[OpenSIPS-Users] Issue with multiple Route header
Bogdan-Andrei Iancu
bogdan at opensips.org
Fri Aug 17 00:08:39 CEST 2012
ah...so you have preloaded Route - try to take a look at the opensips
default script to see how the loose_route() function is used in normal
sequential routing (when you have a TO tag) and in a preloaded initial
request.
Also I recommend you these short webinars:
http://www.opensips.org/Resources/Webinars#toc12
http://www.opensips.org/Resources/Webinars#toc9
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 08/16/2012 08:58 PM, Gomtesh Jain wrote:
> Hi Bogdan,
> I put some more log messages...and found that if there are 2
> routes in INVITE It execute
>
> if (loose_route()) {
> # mark routing logic in request
> xlog("L_NOTICE", "HERE OPENSIP CONF Loose Route method
> ($rm) \n");
> route(1);
> exit;
> };
> piece of script and exit.
>
> while In case of 1 route this piece of script does not execute.
>
> Here I give you part of script ....
>
>
> route{
> # max_forwards==0, or excessively long requests
> xlog("L_NOTICE", "HERE OPENSIP CONF STARTS method ($rm) \n");
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> exit;
> };
>
> if (msg:len >= 2048 ) {
> sl_send_reply("513", "Message too big");
> exit;
> };
>
> if (nat_uac_test("1")) {
> fix_nated_contact();
> };
> # subsequent messages withing a dialog should take the
> # path determined by record-routing
> if (loose_route()) {
> # mark routing logic in request
> xlog("L_NOTICE", "HERE OPENSIP CONF Loose Route method
> ($rm) \n");
> route(1);
> exit;
> };
>
> if (!((to_uri=~"@208.109.191.123
> <http://208.109.191.123>")||(to_uri=~"@.+3clogic.com
> <http://3clogic.com>")||(src_ip==50.16.212.126)))
> {
> sl_send_reply("403", "Relaying not allowed");
> exit;
>
> }
> # we record-route all messages -- to make sure that
> # subsequent messages will go through our proxy; that's
> # particularly good if upstream and downstream entities
> # use different transport protocol
>
> if (!method=="REGISTER")
> {
> xlog("L_NOTICE", "Before Add Record Route TCP OPENSIPS \n");
> record_route();
> xlog("L_NOTICE", "Add Record Route TCP OPENSIPS \n");
> }
>
>
> Thanx,
> Gomtesh
>
> On Thu, Aug 16, 2012 at 7:37 PM, Bogdan-Andrei Iancu
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
> Well, that means your script execution does not get there....try
> to place more xlogs in the beginning of the script to see what's
> the exec path in there.
>
> Regards,
> Bogdan
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
>
> On 08/16/2012 01:58 PM, Gomtesh Jain wrote:
>> Hi Bogdan,
>> I put 2 log messages before and after record_route to make
>> sure it gets executed.
>> But I dont's see those messages in log 1st scenario (2 route
>> headers) while I can see both the message in log in 2nd scenario
>> (1 route header).
>>
>> Here I give INVITE messages in 1st scenario...
>>
>>
>> INVITE sip:aa1 at management.3clogic.com:5506
>> <http://sip:aa1@management.3clogic.com:5506> SIP/2.0
>> Via: SIP/2.0/TCP
>> 192.168.3.134:1323;rport;branch=z9hG4bKPj564512b7c47d4f1c91bf69b2616eea18
>> Max-Forwards: 70
>> From:
>> sip:aa1 at management.3clogic.com:5506;tag=9fa0b4f78ee640dba4c6e0522c9c63a8
>> To: sip:aa1 at management.3clogic.com:5506
>> <http://sip:aa1@management.3clogic.com:5506>
>> Contact: <sip:aa1 at 192.168.3.134:1321;transport=TCP;ob>
>> Call-ID: 8ba1014b656e4cdc968bcf4a9c92ae66
>> CSeq: 3514 INVITE
>> *Route: <sip:23.20.79.160:7060;transport=TCP;lr>
>> Route: <sip:208.109.191.105:8060;lr>*
>> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE,
>> NOTIFY, REFER, MESSAGE, OPTIONS
>> Supported: replaces, 100rel, timer, norefersub
>> Session-Expires: 300
>> Min-SE: 90
>> User-Agent: WebAstra
>> X-Info: normal;;P=;L=;S=Out;A=aa1;CI=;CS=1;PI=1;CP=1
>> Content-Type: application/sdp
>> Content-Length: 259
>>
>> TCP Proxy fwds ...
>>
>> INVITE sip:aa1 at management.3clogic.com:5506
>> <http://sip:aa1@management.3clogic.com:5506> SIP/2.0
>> Via: SIP/2.0/UDP 23.20.79.160:7060;branch=z9hG4bK9618.b76ba1d3.0;i=fe
>> Via: SIP/2.0/TCP
>> 192.168.3.134:1323;received=115.252.66.182;rport=1323;branch=z9hG4bKPj564512b7c47d4f1c91bf69b2616eea18
>> Max-Forwards: 69
>> From:
>> sip:aa1 at management.3clogic.com:5506;tag=9fa0b4f78ee640dba4c6e0522c9c63a8
>> To: sip:aa1 at management.3clogic.com:5506
>> <http://sip:aa1@management.3clogic.com:5506>
>> Contact: <sip:aa1 at 115.252.66.182:1323;transport=TCP;ob>
>> Call-ID: 8ba1014b656e4cdc968bcf4a9c92ae66
>> CSeq: 3514 INVITE
>> Route: <sip:208.109.191.105:8060;lr>
>> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE,
>> NOTIFY, REFER, MESSAGE, OPTIONS
>> Supported: replaces, 100rel, timer, norefersub
>> Session-Expires: 300
>> Min-SE: 90
>> User-Agent: WebAstra
>> X-Info: normal;;P=;L=;S=Out;A=aa1;CI=;CS=1;PI=1;CP=1
>> Content-Type: application/sdp
>> Content-Length: 25
>>
>>
>> Thanx,
>> Gomtesh
>>
>>
>> On Thu, Aug 16, 2012 at 4:05 PM, Bogdan-Andrei Iancu
>> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>>
>> You say you do record_route(), but no RR header is added to
>> the request ? this is a bit hard to believe ....are you sure
>> your script ends to the RR function ?
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and Developer
>> http://www.opensips-solutions.com
>>
>>
>> On 08/16/2012 01:23 PM, Gomtesh Jain wrote:
>>> Hi Bogdan,
>>> I am doing ...
>>>
>>> if (!method=="REGISTER")
>>> {
>>> xlog("L_NOTICE", "Before Add Record Route TCP
>>> OPENSIPS \n");
>>> record_route();
>>> xlog("L_NOTICE", "Add Record Route TCP OPENSIPS
>>> \n");
>>> }
>>>
>>> in my config .
>>>
>>>
>>> But in 1st scenario it does not add record route .So UA1
>>> tries to send ACK directly to "Other proxy". Which is wrong.
>>>
>>>
>>> While it adds record route in 2nd scenario and all
>>> signalling works fine.
>>>
>>>
>>> Thanx,
>>> Gomtesh
>>>
>>>
>>>
>>>
>>> On Thu, Aug 16, 2012 at 3:43 PM, Bogdan-Andrei Iancu
>>> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>>>
>>> Hi Gomtesh,
>>>
>>>
>>> On 08/14/2012 04:10 PM, Gomtesh Jain wrote:
>>>
>>> Hi,
>>>
>>> I am running opensips 1.6 as TCP proxy. I am
>>> facing problem when I use multiple proxy in my N/w.
>>>
>>> UA1------> TCP proxy(opensips 1.6)------->Other
>>> Proxy--------> UA2
>>>
>>> UA1 adds 2 Route headers in INVITE.
>>> In this scenario TCP proxy does not add Record Route
>>> in INVITE.
>>>
>>> How comes ?? don;t you do record_route() on the opensips ??
>>>
>>>
>>>
>>>
>>>
>>> UA1------> TCP proxy(opensips 1.6)------------> UA2
>>>
>>> UA1 add only 1 Route header.
>>> In this scenario It works fine with the same conf.
>>>
>>> What "fine" means ? It means opensips adds on route ? or ?
>>>
>>> Regards,
>>> Bogdan
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120817/59347c22/attachment-0001.htm>
More information about the Users
mailing list