[Asterisk-Users] 'System' application exit with error even if it performs the job as expected - partially solved

Dan dtoma at fx.ro
Thu Jul 31 11:35:47 MST 2003


Hi Martin,

I have modified the 'app_system.c' file like that and then recompile
asterisk:

        /* Do our thing here */
        res = system((char *)data);
//      if (res < 0) {
//              ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char
*)data);
//              res = -1;
//      } else if (res == 127) {
//              ast_log(LOG_WARNING, "Unable to execute '%s'\n", (char
*)data);
//              res = -1;
//      } else {
//              if (res && ast_exists_extension(chan, chan->context,
chan->exten, chan->priority + 101, chan->callerid))
//                      chan->priority+=100;
//              res = 0;
//      }
        res = 0;
        LOCAL_USER_REMOVE(u);
        return res;


Now everything work as expected.
It seems to be a problem with the value returned by the 'system((char
*)data)' function which is -1 even if the command is executed successfully.

There is any reason to exit the System() application with -1 if the command
is unable to execute? Maybe a parameter somewhere can prevent this type of
behaviour.

BR,
Dan


----- Original Message ----- 
From: "Martin Pycko" <martinp at digium.com>
To: "Asterisk Users" <asterisk-users at lists.digium.com>
Sent: Thursday, July 31, 2003 7:49 PM
Subject: Re: [Asterisk-Users] 'System' application exit with error even if
it performs the job as expected


> Try to do the same in shell. Does it work ?
>
> Martin
>
> On Thu, 31 Jul 2003, Dan wrote:
>
> > Hi,
> >
> > When I try to run the command wmix to mix two WAV files recorded by the
> > Monitor application I get the following warning in the console and the
macro
> > exit at that point.
> > Running the command from a standard system console it works. More, even
from
> > this macro it works and produce a valid mixed file, but still get that
error
> > and the macro cannot continue.
> >
> > Why?
> > I have tried even with a simple wmix without any parameter and I get the
> > same error.
> >
> > .....
> >     -- Executing System("SIP/103-b7c0", "/usr/local/bin/wmix
> > /var/spool/asterisk/monitor/31072003-19:08:11-103-in.wav
> > /var/spool/asterisk/monitor/31072003-19:08:11-103-out.wav >
> > /var/spool/asterisk/monitor/31072003-19:08:11-103.wav") in new stack
> > WARNING[1200825920]: File app_system.c, Line 57 (skel_exec): Unable to
> > execute '/usr/local/bin/wmix
> > /var/spool/asterisk/monitor/31072003-19:08:11-103-in.wav
> > /var/spool/asterisk/monitor/31072003-19:08:11-103-out.wav >
> > /var/spool/asterisk/monitor/31072003-19:08:11-103.wav'
> >   == Spawn extension (macro-record-cleanup, s, 3) exited non-zero on
> > 'SIP/103-b7c0' in macro 'record-cleanup'
> >   == Spawn extension (fullaccess, h, 1) exited non-zero on
'SIP/103-b7c0'
> >
> >
> > Thanks,
> > Dan
> >
> >
> > _______________________________________________
> > Asterisk-Users mailing list
> > Asterisk-Users at lists.digium.com
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>





More information about the asterisk-users mailing list