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
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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
On Monday 27 October 2003 18:55, Jiri Kuthan wrote:
Send us the message in question too.
Ok...a crude ngrep of a Grandstream Registering. If you want an Ethereal trace just let me know. What we want is to be able to output the User-Agent to a flat file. User-Agent: Grandstream SIP UA 1.0.4.17
Thanks.
U 200.116.3.131:5060 -> 68.153.171.242:5060 REGISTER sip:maui.telesip.net:5060 SIP/2.0..Record-Route: <sip:200.116 .3.131;ftag=9fd6bdb1-5993-b714-0e08-a372549452ba;lr=on>..Via: SIP/2.0/ UDP 200.116.3.131;branch=z9hG4bK954c.b40b1f8.0..Via: SIP/2.0/UDP 200.1 06.180.147:1045..From: sip:1612@maui.telesip.net:5060;tag=9fd6bdb1-5 993-b714-0e08-a372549452ba..To: sip:1612@maui.telesip.net:5060..Cont act: sip:1612@200.106.180.147:1045..Authorization: DIGEST username=" 1612", realm="telesip.net", algorithm=MD5, uri="sip:maui.telesip.net:5 060", nonce="3f9ddef27a4d2396aef1d7bfef96fcda4ce439ca", response="7ad3 46a12134883740c0a4109001ea0a"..Call-ID: 98976488-6347-17b9-738d-8ad092 2711c6@192.168.0.15..CSeq: 1251 REGISTER..Expires: 600..User-Agent: Gr andstream SIP UA 1.0.4.17..Warning: 396 192.168.0.15:5060 "detected fi rewall/NAT type is full cone"..Max-Forwards: 69..Allow: INVITE, ACK, C ANCEL, BYE, NOTIFY, REFER, OPTIONS, INFO, SUBSCRIBE..Content-Length: 0 .... #
-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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
At 04:13 AM 10/28/2003, Andres wrote:
On Monday 27 October 2003 18:55, Jiri Kuthan wrote:
Send us the message in question too.
Ok...a crude ngrep of a Grandstream Registering. If you want an Ethereal trace just let me know. What we want is to be able to output the User-Agent to a flat file. User-Agent: Grandstream SIP UA 1.0.4.17
exec module translates symbols in header field names to underscore -> user-agent -> user_agent
probably worth fixing for dash.
thanks,
-jiri
On Tuesday 28 October 2003 03:32, Jiri Kuthan wrote:
At 04:13 AM 10/28/2003, Andres wrote:
On Monday 27 October 2003 18:55, Jiri Kuthan wrote:
Send us the message in question too.
Ok...a crude ngrep of a Grandstream Registering. If you want an Ethereal trace just let me know. What we want is to be able to output the User-Agent to a flat file. User-Agent: Grandstream SIP UA 1.0.4.17
exec module translates symbols in header field names to underscore -> user-agent -> user_agent
Works great now. Thanks Jiri!
Regards, Andres http://www.telesip.net
probably worth fixing for dash.
thanks,
-jiri
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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
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@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/ _______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
-- Jiri Kuthan http://iptel.org/~jiri/