[OpenSIPS-Users] Problems with loose_route and ACK

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Sep 27 06:30:56 EDT 2019


Hi Olle,

When doing loose_route(), opensips has to determine if the RURI or the 
top Route URI points to itself. In order to check this "is for myself", 
OpenSIPS checks the host URI against the listening IP and the domains 
from domain table (as the dynamic component).

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 9/27/19 11:58 AM, olle at zaark.com wrote:
>
> Hi think I have located the problem, it seems like due to a wrong 
> ansible configuration the IP the edge proxy have been entered into the 
> domain table of 172.0.251.4.
>
> When I removed it from the domain table it works as expected, in both 
> cases I have set:
>
> modparam("rr", "enable_double_rr", 0)
>
> Below are the logs from a working scenarion (172.25.0.21 is NOT in 
> domain table)
>
> 2019-09-27T08:31:32.777817+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: 
> 0a58c198-5ba4-1238-3aa8-fa163e0144b5|Route0|New request: M=ACK 
> RURI=sip:c22c11d0-7961-48c6-a603-e3d1872a462a at xxx.yyy.zzz.162:57021;transport=TCP;ob 
> F=sip:111 at 172.25.0.25 T=sip:222 at blfkfmne406w.zaark.com D=<null> 
> IP=172.25.0.25:5060 ID=0a58c198-5ba4-1238-3aa8-fa163e0144b5 PROTO=udp
>
> 2019-09-27T08:31:32.778095+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:maxfwd:is_maxfwd_present: value = 70
>
> 2019-09-27T08:31:32.778370+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:comp_scriptvar: str 20 : udp
>
> 2019-09-27T08:31:32.778642+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:comp_scriptvar: str 20 : udp
>
> 2019-09-27T08:31:32.778892+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:uri:has_totag: totag found
>
> 2019-09-27T08:31:32.779162+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:parse_headers: flags=200
>
> 2019-09-27T08:31:32.779408+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:is_preloaded: No
>
> 2019-09-27T08:31:32.779713+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 14==11 &&  [212.116.71.162] == [172.25.0.24]
>
> 2019-09-27T08:31:32.779968+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 57021
>
> 2019-09-27T08:31:32.780211+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 14==12 &&  [212.116.71.162] == [172.25.251.4]
>
> 2019-09-27T08:31:32.780479+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 57021
>
> 2019-09-27T08:31:32.780753+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:check_self: host != me
>
> 2019-09-27T08:31:32.781023+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==11 &&  [172.25.0.21] == [172.25.0.24]
>
> 2019-09-27T08:31:32.781279+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> 2019-09-27T08:31:32.781545+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==9 &&  [172.25.0.21] == [127.0.0.1]
>
> 2019-09-27T08:31:32.781825+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> 2019-09-27T08:31:32.782074+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==12 &&  [172.25.0.21] == [172.25.251.4]
>
> 2019-09-27T08:31:32.782311+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> *2019-09-27T08:31:32.782550+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:check_self: host != me*
>
> *2019-09-27T08:31:32.782810+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: Topmost URI is NOT myself*
>
> 2019-09-27T08:31:32.783073+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: URI to be processed: 
> 'sip:172.25.0.21:5070;lr;r2=on;ftag=4DNFgFa4mN6pg;dlg=4ee.34140ca2'
>
> 2019-09-27T08:31:32.783331+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: Next URI is a loose router
>
> Below is one that fails (172.25.0.21 is in domain table)
>
> 2019-09-27T08:26:01.321708+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: 
> 3842d729-5ba3-1238-3aa8-fa163e0144b5|Route0|New request: M=ACK 
> RURI=sip:c22c11d0-7961-48c6-a603-e3d1872a462a at xxx.yyy.zzz.162:57008;transport=TCP;ob 
> F=sip:111 at 172.25.0.25 T=sip:222 at blfkfmne406w.zaark.com D=<null> 
> IP=172.25.0.25:5060 ID=3842d729-5ba3-1238-3aa8-fa163e0144b5 PROTO=udp
>
> 2019-09-27T08:26:01.322012+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:maxfwd:is_maxfwd_present: value = 70
>
> 2019-09-27T08:26:01.322260+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:comp_scriptvar: str 20 : udp
>
> 2019-09-27T08:26:01.322510+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:comp_scriptvar: str 20 : udp
>
> 2019-09-27T08:26:01.322779+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:uri:has_totag: totag found
>
> 2019-09-27T08:26:01.323017+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:parse_headers: flags=200
>
> 2019-09-27T08:26:01.323267+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:is_preloaded: No
>
> 2019-09-27T08:26:01.323514+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 14==11 &&  [212.116.71.162] == [172.25.0.24]
>
> 2019-09-27T08:26:01.323807+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 57008
>
> 2019-09-27T08:26:01.324071+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 14==12 &&  [212.116.71.162] == [172.25.251.4]
>
> 2019-09-27T08:26:01.324314+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 57008
>
> 2019-09-27T08:26:01.324551+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:check_self: host != me
>
> 2019-09-27T08:26:01.324809+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==11 &&  [172.25.0.21] == [172.25.0.24]
>
> 2019-09-27T08:26:01.325061+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> 2019-09-27T08:26:01.325310+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==9 &&  [172.25.0.21] == [127.0.0.1]
>
> 2019-09-27T08:26:01.325548+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> 2019-09-27T08:26:01.325833+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if 
> host==us: 11==12 &&  [172.25.0.21] == [172.25.251.4]
>
> 2019-09-27T08:26:01.326109+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:core:grep_sock_info: checking if port 
> 5060 matches port 5070
>
> *2019-09-27T08:26:01.326346+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: Topmost route URI: 
> 'sip:172.25.0.21:5070;lr;r2=on;ftag=2U2XcS8vt3SHS;dlg=f49.90a38793' is me*
>
> 2019-09-27T08:26:01.326578+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: URI to be processed: 
> 'sip:aaa.bbb.ccc.77:5002;transport=tcp;lr;r2=on;ftag=2U2XcS8vt3SHS;dlg=f49.90a38793'
>
> 2019-09-27T08:26:01.326828+00:00 sip-stage-1 
> /usr/sbin/opensips[11548]: DBG:rr:after_loose: Next URI is a loose router
>
> But I don’t understand why entries in the domain modules affect the rr 
> module.
>
> BR/Olle
>
> *Från:*Bogdan-Andrei Iancu <bogdan at opensips.org>
> *Skickat:* den 27 september 2019 10:13
> *Till:* Olle Frimanson <olle at zaark.com>; users at lists.opensips.org
> *Ämne:* Re: SV: SV: [OpenSIPS-Users] Problems with loose_route and ACK
>
> Enable log_level 4 (debug level) and post the logs generated by 
> OpenSIPS (172.25.251.4) when handling the ACK.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
>    https://www.opensips-solutions.com
> OpenSIPS Summit 2019
>    https://www.opensips.org/events/Summit-2019Amsterdam/
>
> On 9/26/19 9:31 PM, Olle Frimanson wrote:
>
>     Hi yes I tried that as well and then the ACK was not routed at all.
>
>     BR/Olle
>
>     *Från:*Bogdan-Andrei Iancu <bogdan at opensips.org>
>     <mailto:bogdan at opensips.org>
>     *Skickat:* den 26 september 2019 19:59
>     *Till:* Olle Frimanson <olle at zaark.com> <mailto:olle at zaark.com>;
>     users at lists.opensips.org <mailto:users at lists.opensips.org>
>     *Ämne:* Re: SV: [OpenSIPS-Users] Problems with loose_route and ACK
>
>     Hi,
>
>     You should have it on the OpenSIPS with the 172.25.251.4 IP.
>
>     Regards,
>
>
>     Bogdan-Andrei Iancu
>
>       
>
>     OpenSIPS Founder and Developer
>
>        https://www.opensips-solutions.com
>
>     OpenSIPS Summit 2019
>
>        https://www.opensips.org/events/Summit-2019Amsterdam/
>
>     On 9/26/19 6:45 PM, Olle Frimanson wrote:
>
>         Hi again I might add it’s enabled on our edge proxy since it
>         converts TCP/TLS to UDP
>
>         Br/Olle
>
>         *Från:*Bogdan-Andrei Iancu <bogdan at opensips.org>
>         <mailto:bogdan at opensips.org>
>         *Skickat:* den 26 september 2019 16:51
>         *Till:* OpenSIPS users mailling list
>         <users at lists.opensips.org> <mailto:users at lists.opensips.org>;
>         olle at zaark.com <mailto:olle at zaark.com>
>         *Ämne:* Re: [OpenSIPS-Users] Problems with loose_route and ACK
>
>         Hi Olle,
>
>         It is like the double-RR indication is ignored (the r2 param)
>         from the top Route hdr. Are you sure that the
>         "enable_double_rr" modparam is still on ?
>
>         Regards,
>
>
>
>         Bogdan-Andrei Iancu
>
>           
>
>         OpenSIPS Founder and Developer
>
>            https://www.opensips-solutions.com
>
>         OpenSIPS Summit 2019
>
>            https://www.opensips.org/events/Summit-2019Amsterdam/
>
>         On 9/26/19 4:30 PM, olle at zaark.com <mailto:olle at zaark.com> wrote:
>
>             Hi ,
>
>             I have stumbled on a issue with ACK on 200 OK from
>             Freeswitch. We are running 2.4.4 but I have also upgraded
>             to 2.4.6 and testad with the same result.
>
>             I get an ACK from our Freeswitch (172.25.0.25), trace from
>             ngrep (some address and numbers have been anonymized).
>
>             U 2019/09/26 13:00:22.614545 172.25.0.25:5060 ->
>             172.25.251.4:5060 #31
>
>             ACK
>             sip:c22c11d0-7961-48c6-a603-e3d1872a462a at 95.195.215.15:56188;transport=TCP;ob
>             SIP/2.0.
>
>             Via: SIP/2.0/UDP
>             172.25.0.25;rport;branch=z9hG4bK26XN3DN58vg6e.
>
>             Route:
>             <sip:172.25.0.21:5070;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>
>             <sip:172.25.0.21:5070;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>.
>
>             Route:
>             <sip:aaa.bbb.ccc.77:5002;transport=tcp;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>
>             <sip:aaa.bbb.ccc.77:5002;transport=tcp;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>.
>
>             Max-Forwards: 70.
>
>             From: "0123456789" <sip:0123456789 at 172.25.0.25>
>             <sip:0123456789 at 172.25.0.25>;tag=v3rpgKD64K2me.
>
>             To: <sip:9876543210 at blfkfmne406w.zaark.com>
>             <sip:9876543210 at blfkfmne406w.zaark.com>;tag=3Gwq-SQeo2nkmHWzeMGXPMJbWjv1UqxR.
>
>             Call-ID: 6d8b0c06-5b00-1238-3aa8-fa163e0144b5.
>
>             CSeq: 10197616 ACK.
>
>             Contact:
>             <sip:gw+device at 172.25.0.25:5060;transport=udp;gw=device>
>             <sip:gw+device at 172.25.0.25:5060;transport=udp;gw=device>.
>
>             Content-Length: 0.
>
>             .
>
>             Our script in this case basically only have 3 steps
>             has_to(), loose_route() and t_relay()
>
>             AFAIK this packed should be routed to our edge proxy on
>             172.25.0.21 which has the public IP aaa.bbb.ccc,  but what
>             happens is that it routes to the 2nd Route header and
>             drops the first:
>
>             U 2019/09/26 13:00:22.614870 172.25.251.4:5060 ->
>             aaa.bbb.ccc.77:5002 #32
>
>             ACK
>             sip:c22c11d0-7961-48c6-a603-e3d1872a462a at 95.195.215.15:56188;transport=TCP;ob
>             SIP/2.0.
>
>             Via: SIP/2.0/UDP
>             172.25.251.4:5060;branch=z9hG4bK1d62.29103862.3.
>
>             Via: SIP/2.0/UDP
>             172.25.0.25;received=172.25.0.25;rport=5060;branch=z9hG4bK26XN3DN58vg6e.
>
>             Route:
>             <sip:aaa.bbb.ccc.77:5002;transport=tcp;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>
>             <sip:aaa.bbb.ccc.77:5002;transport=tcp;lr;r2=on;ftag=v3rpgKD64K2me;dlg=1b3.4591f441>.
>
>             Max-Forwards: 69.
>
>             From: "0123456789" <sip:0123456789 at 172.25.0.25>
>             <sip:0123456789 at 172.25.0.25>;tag=v3rpgKD64K2me.
>
>             To: <sip:9876543210 at blfkfmne406w.zaark.com>
>             <sip:9876543210 at blfkfmne406w.zaark.com>;tag=3Gwq-SQeo2nkmHWzeMGXPMJbWjv1UqxR.
>
>             Call-ID: 6d8b0c06-5b00-1238-3aa8-fa163e0144b5.
>
>             CSeq: 10197616 ACK.
>
>             Contact:
>             <sip:gw+device at 172.25.0.25:5060;transport=udp;gw=device>
>             <sip:gw+device at 172.25.0.25:5060;transport=udp;gw=device>.
>
>             Content-Length: 0.
>
>             This used to work in an older setup with Opensips running
>             2.1, so not sure if I’m doing something wrong here.
>
>             Any hints are appreciated
>
>             Thanks in advance / Olle
>
>
>
>
>
>             _______________________________________________
>
>             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/20190927/bd79a2c1/attachment-0001.html>


More information about the Users mailing list