[Home]

Summary:ASTERISK-13228: class with only application is unuseable
Reporter:caspy (caspy)Labels:
Date Opened:2008-12-16 03:18:35.000-0600Date Closed:2008-12-16 08:28:07.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:when you define class with mode=custom and only application (no directory):

[some_class]
mode=custom
application=/path/streamer

it is do not start due to chdir() attempt to "nodir" directory at spawn_mp3() in res_musiconhold.c

****** ADDITIONAL INFORMATION ******

these strings in forked part of function spawn_mp3():

if (chdir(class->dir) < 0) {
ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno));
_exit(1);
}


should be wrapped in additional if(), like:

if (strcasecmp(class->dir, "nodir")) {
.....



and also, calls to ast_log() seem to be unworkable, because of closed file descriptors few line above.
Comments:By: Digium Subversion (svnbot) 2008-12-16 08:28:06.000-0600

Repository: asterisk
Revision: 164605

U   branches/1.4/res/res_musiconhold.c

------------------------------------------------------------------------
r164605 | russell | 2008-12-16 08:28:06 -0600 (Tue, 16 Dec 2008) | 5 lines

Don't try to change working directory if a directory was not configured.

(closes issue ASTERISK-13228)
Reported by: caspy

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=164605