[Serusers] exec module question

Jiri Kuthan jiri at iptel.org
Tue Oct 28 09:07:46 CET 2003


Greg,

that's related to SER's return value convention. Actions
returning zero are rather exceptional and lead to immediate 
leaving the script. (Good for example on receipt of an unnecessary
retransmission).


Otherwise:
>0 ... true
<0 false


-jiri

At 05:07 AM 10/28/2003, Greg Fausak wrote:
>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
>

--
Jiri Kuthan            http://iptel.org/~jiri/ 




More information about the sr-users mailing list