[Home]

Summary:ASTERISK-11003: [patch] Chash after Monitor w/o options
Reporter:Mike Anikienko (mike anikienko)Labels:
Date Opened:2007-12-10 13:00:44.000-0600Date Closed:2007-12-11 14:03:51.000-0600
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Resources/res_monitor
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bt.log
( 1) dialplan.conf
( 2) monitor.diff
Description:For example, call from SIP to SIP with recording. But Monitor without options. exten => s,n,Monitor(alaw,${CALLFILENAME})

   -- Executing [s@macro-record_call:4] Monitor("SIP/712-082a6768", "alaw,20071210-213317-712-612") in new stack
(core dumped)


In backtrace I see:
#1  0xb7fbd5ae in start_monitor_exec (chan=0x833c218, data=0xb6a18d58) at res_monitor.c:447

In res_monitor.c I see:
       char *arg = NULL;
       char *options = NULL;
       int stream_action = X_REC_IN | X_REC_OUT;
...

       AST_DECLARE_APP_ARGS(args,
               AST_APP_ARG(format);
               AST_APP_ARG(fname_base);
               AST_APP_ARG(options);
       );

       /* Parse arguments. */
       if (ast_strlen_zero((char*)data)) {
               ast_log(LOG_ERROR, "Monitor requires an argument\n");
               return 0;
       }

       parse = ast_strdupa((char*)data);
       AST_STANDARD_APP_ARGS(args, parse);

       if (strchr(args.options, 'm'))
               stream_action |= X_JOIN;
...

Where initialization and parsing args.options? args.options is NULL !!!

I have studied app_dial and have made this small patch.
Comments:By: Digium Subversion (svnbot) 2007-12-11 14:03:48.000-0600

Repository: asterisk
Revision: 92365

U   trunk/res/res_monitor.c

------------------------------------------------------------------------
r92365 | file | 2007-12-11 14:03:46 -0600 (Tue, 11 Dec 2007) | 4 lines

Only look to see if options are set if some have been provided.
(closes issue ASTERISK-11003)
Reported by: Mike Anikienko

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

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