[OpenSIPS-Users] is_method("MESSAGE") not work
Bogdan-Andrei Iancu
bogdan at opensips.org
Tue Dec 18 14:58:03 CET 2012
Hi Dragomir,
Just tried your piece of script with 1.8.2 and trunk (latest SVN) and it
works....
Maybe you are not using the proper script ?
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 12/18/2012 05:27 PM, Dragomir Haralambiev wrote:
> Hi Bogdan,
> Here is script and debug 6:
> route{
> xlog("L_ERR", "+++++++++++++++++++++++++++++++++++++++++++$rm $fU
> from $si:$sp\n");
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> exit;
> };
> if (msg:len >= 2048 ) {
> xlog("L_ERR", "Message too big from $si:$sp\n");
> sl_send_reply("513", "Message too big");
> exit;
> };
> if (!sipmsg_validate("sh")) {
> send_reply("400", "Bad Request/Body");
> exit;
> };
> ##################################### MESSAGE
> ##########################################
> if (is_method('MESSAGE')) {
> xlog("L_ERR", "MESSAGE from $si:$sp \n");
> sl_send_reply("200", "ok");
> exit;
> };
> if ( $rm == "MESSAGE" ) {
> xlog("L_ERR", "$rm from $si:$sp \n");
> sl_send_reply("200", "ok");
> exit;
> };
> if(has_body("")) { xlog("L_ERR", "BODY yes"); }
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> +++++++++++++++++++++++++++++++++++++++++++MESSAGE 344447741656 from
> 88.87.3.168:23729 <http://88.87.3.168:23729>
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:maxfwd:is_maxfwd_present: value = 70
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:parse_headers: flags=ffffffffffffffff
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:parse_to: end of header reached, state=10
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:parse_to: display={}, ruri={sip:5555 at 82.87.10.164
> <mailto:sip%3A5555 at 82.87.10.164>}
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:get_hdr_field: <To> [24]; uri=[sip:5555 at 82.87.10.164
> <mailto:sip%3A5555 at 82.87.10.164>]
> ] 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:get_hdr_field: to body [<sip:5555 at 82.87.10.164
> <mailto:sip%3A5555 at 82.87.10.164>>
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:get_hdr_field: cseq <CSeq>: <11163> <MESSAGE>
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:get_hdr_field: content_length=4
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:get_hdr_field: found end of header
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:decode_mime_type: Decoding MIME type for:[text/plain]
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:decode_mime_type: Decoding MIME type for:[text/plain,
> application/im-iscomposing+xml]
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:decode_mime_type: Decoding MIME type for:[
> application/im-iscomposing+xml]
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:parse_headers: flags=ffffffffffffffff
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]:
> DBG:core:parse_headers: flags=ffffffffffffffff
> Dec 18 15:24:09 sbc /usr/local/sbin/opensips[18250]: BODY yes
>
> 2012/12/18 Bogdan-Andrei Iancu <bogdan at opensips.org
> <mailto:bogdan at opensips.org>>
>
> Hi,
>
> Are you 100% sure your script execution gets to that "if" ? place
> an xlog before the "if" to double check it.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
>
> On 12/18/2012 04:45 PM, Dragomir Haralambiev wrote:
>> Hello,
>> I try receive SIP MESSAGE in opensips 1.8.2(revision 9536).
>> The follow do not wotk:
>> if (is_method("MESSAGE")) {
>> xlog("L_ERR", "MESSAGE from $si:$sp \n");
>> exit;
>> };
>> Here is debug 6:
>> DBG:core:parse_headers: flags=ffffffffffffffff
>> DBG:core:parse_to: end of header reached, state=10
>> DBG:core:parse_to: display={}, ruri={sip:5555555 at 82.87.10.164
>> <mailto:sip%3A5555555 at 82.87.10.164>}
>> DBG:core:get_hdr_field: <To> [27]; uri=[sip:5555555 at 82.87.10.164
>> <mailto:sip%3A5555555 at 82.87.10.164>]
>> DBG:core:get_hdr_field: to body [<sip:5555555 at 82.87.10.164
>> <mailto:sip%3A5555555 at 82.87.10.164>>
>> DBG:core:get_hdr_field: cseq <CSeq>: <49480> <MESSAGE>
>> DDBG:core:get_hdr_field: content_length=6
>> DBG:core:get_hdr_field: found end of header
>> DBG:core:decode_mime_type: Decoding MIME type for:[text/plain]
>> DBG:core:decode_mime_type: Decoding MIME type for:[text/plain,
>> application/im-iscomposing+xml]
>> DBG:core:decode_mime_type: Decoding MIME type for:[
>> application/im-iscomposing+xml]
>> DBG:core:parse_headers: flags=ffffffffffffffff
>> Where is problem?
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121218/e0cb0d42/attachment-0001.htm>
More information about the Users
mailing list