[Serusers] exec module question
Greg Fausak
lgfausak at august.net
Tue Oct 28 05:07:06 CET 2003
Jiri,
I've got a bit more basic a question.
In the exec_s3.cfg file in examples, the statement:
if (!exec_msg('blah blah'))
{
...dothis...
};
I was going to play around and see what return values get through,
but I thought first I'd look at the source code:
exec.c in modules/exec will return:
-1 if execution / pipe error
-1 if the execution works but returns a non-zero value
1 if the execution worked and returned a 0
My yacc is a bit rusty.
My question is this. I would expect exec_msg() to return a 0
or a non-zero, but my examination of the exec.c file indicates
it can't return a zero. That doesn't seem right, am I reading it wrong?
It seems to me that the expression !exec_msg() can never evaluate
to true, because exec_msg() can't return a 0.
---greg
Jiri Kuthan wrote:
> Send us the message in question too.
>
> -jiri
>
> At 09:24 PM 10/27/2003, Andres wrote:
>
>>Hi,
>>
>>I am testing the exec module by outputting some variables to a flat file
>>using: SIP_HF_<hf_name>
>>
>>So for example I put something like
>>
>>exec_msg("echo `date` - From: $SIP_HF_FROM To: $SIP_HF_TO Contact:
>>$SIP_HF_CONTACT Src_IP: $SIP_SRCIP User-Agent: $SIP_HF_USER-AGENT >>
>>/var/log/ser/ser_register.log");
>>
>>but the User-Agent header field does not get passed even though a sniffer
>>trace shows it in the SIP REGISTER request.
>>
>>Can somebody tell me why not?
>>
>>Thanks,
>>Andres
>>
>>_______________________________________________
>>Serusers mailing list
>>serusers at lists.iptel.org
>>http://lists.iptel.org/mailman/listinfo/serusers
>
>
> --
> Jiri Kuthan http://iptel.org/~jiri/
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>
More information about the sr-users
mailing list