[Asterisk-Users] 'System' application exit with error evenifitperforms the job as expected
Dan
dtoma at fx.ro
Sun Aug 3 02:55:39 MST 2003
Hi,
I have done the changes in app_system.c, recompile everything and now....
VERY STRANGE... the system command is executed successfully and no return
code is displayed.
This is the result in Asterisk Console:
-- Executing System("SIP/103-f297", "wmix
/var/spool/asterisk/monitor/03082003-123929-101-in.wav
/var/spool/asterisk/monitor/03082003-123929-101-out.wav >
/var/spool/asterisk/monitor/03082003-123929-101.wav") in new stack
-- Executing System("SIP/103-f297", "sox
/var/spool/asterisk/monitor/03082003-123929-101.wav
/var/spool/asterisk/monitor/03082003-123929-101.gsm") in new stack
I don't know how this is possible, but it seems that now everything is ok...
Thanks a lot,
Dan
---- Original Message -----
From: "Armand A. Verstappen" <armand at nl.envida.net>
To: <asterisk-users at lists.digium.com>
Sent: Saturday, August 02, 2003 11:05 PM
Subject: Re: [Asterisk-Users] 'System' application exit with error
evenifitperforms the job as expected
On Fri, 2003-08-01 at 16:45, Dan wrote:
> > #include <stdlib.h>
> > #include <stdio.h>
> >
> > int main() {
> >
> > int ret;
> >
> > ret = system("/bin/ls > /dev/null");
> >
> > printf("system(\"/bin/ls > /dev/null\") returned %d\n", ret);
> >
> > return(ret);
> > }
> >
> > gcc mysystem.c -o mysystem
> > ./mysystem
> >
> > what is the output?
>
> On Fri, 2003-08-01 at 10:40, Dan wrote:
> > This is the result:
> >
> > [root at danpbx temp]# ./mysystem
> > system("/bin/ls > /dev/null") returned 0
> > [root at danpbx temp]#
>
> Okay, that at least rules out the suggestion earlier in this thread that
> your systems' system call is broken.
(line below moved down from top back into context)
> Then?
> What can it be?
Don't know really. I'd change app_system.c, to tell me what the exact
return code we got:
...
/* Do our thing here */
res = system((char *)data);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to execute '%s' (result %d)\n",
(char *)data, res);
res = -1;
} else if (res == 127) {
ast_log(LOG_WARNING, "Unable to execute '%s' (result %d)\n",
(char *)data);
res = -1;
}
...
and recompile and install app_system.so. It would help you to know what
the return code was that is causing you problems. I'm not sure how that
would help you, but it is the one thing I can think of that would get
you more information.
wkr,
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in email?
More information about the asterisk-users
mailing list