<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Hi Bogdan<br><br>Just to complicate things a bit, 4.4.4.4 is the public ip of the nated device... I made a mistake in my trace where I changed the contact address in the initial 200 (from 4.4.4.4), it should have been the nated ip, 5.5.5.5 for example... So you will see then that 2 is in fact fixing the contact, but 1 is then fixing it again...<br><br>For now we have managed to create a workaround whereby we perform a "lookup location" on any acks, cancels or byes received from 1.1.1.1, this function fixes the ruri to the correct one from the location table, and sends it out correctly. This seems to be working fine so far...<br><br>Thank you for your help,<br><br>Regards,<br>Bruce<br><div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div
style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bogdan-Andrei Iancu <bogdan@voice-system.ro><br><b><span style="font-weight: bold;">To:</span></b> OpenSIPS users mailling list <users@lists.opensips.org><br><b><span style="font-weight: bold;">Sent:</span></b> Fri, 21 May, 2010 12:57:37<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [OpenSIPS-Users] In dialog requests misrouted<br></font><br>Hi Bruce,<br><br>It is a logical problem. The chain is: 3 -> 1 -> 2 -> 4, and when the <br>reply goes back, the NAT traversal must be done by the border entity <br>(first in the public net). So, if 4 is behind nat, then 2 must do it and <br>not 1 (like in your case)<br><br>Because 1 (and not 2) is "fixing" the contact , the routing info gets <br>lost (the 4 hop is lost). So, guilty is 2 for not fixing
the contact in <br>200 OK from 4.<br><br>Regards,<br>Bogdan<br><br>Bruce Borrett wrote:<br>> Hi Bogdan<br>><br>> Thank you for your reply, that is exactly how I understood it.<br>><br>> Here is another fuller trace for a better understanding of the <br>> problem, which I believe to be uac_nat_test. On both servers , when a <br>> 200 is received, uac_nat_test is returning true because it is finding <br>> the top via (next hop for reply) to be different to the source ip <br>> (previous hop of reply):<br>><br>> Internet Protocol, Src: 1.1.1.1 (1.1.1.1), Dst: 2.2.2.2 (2.2.2.2)<br>><br>> User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>><br>> INVITE sip:1111111111@2.2.2.2 SIP/2.0<br>> Record-Route: <sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bK5be8.eeb63911.0<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK55985828;rport=5060<br>> From:
"22222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2><br>> Contact: <sip:2222222222@3.3.3.3><br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 102 INVITE<br>> User-Agent: Asterisk PBX<br>> Max-Forwards: 69<br>> Date: Tue, 18 May 2010 06:29:00 GMT<br>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>> Supported: replaces<br>> X-CRE-ID: "sbc-tp-04-1274164140.30823.0<br>> X-DIALSTRING: SIP/ico-bry-001/1111111111<br>> Content-Type: application/sdp<br>> Content-Length: 259<br>><br>> v=0<br>> o=root 4296 4296 IN IP4 3.3.3.3<br>> s=session<br>> c=IN IP4 3.3.3.3<br>> t=0 0<br>> m=audio 10060 RTP/AVP 18 101<br>> a=rtpmap:18 G729/8000<br>> a=fmtp:18 annexb=no<br>> a=rtpmap:101 telephone-event/8000<br>> a=fmtp:101 0-16<br>> a=silenceSupp:off - - - -<br>> a=ptime:60<br>>
a=sendrecv<br>><br>><br>><br>><br>><br>><br>><br>><br>> Internet Protocol, Src: 2.2.2.2 (2.2.2.2), Dst: 4.4.4.4 (4.4.4.4)<br>><br>> User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>><br>> INVITE sip:1111111111@4.4.4.4 SIP/2.0<br>> Record-Route: <sip:2.2.2.2;lr=on;ftag=as1a75bb38><br>> Record-Route: <sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK5be8.91dcf496.0<br>> Via: SIP/2.0/UDP <br>> 1.1.1.1;rport=5060;received=1.1.1.1;branch=z9hG4bK5be8.eeb63911.0<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK55985828;rport=5060<br>> From: "2222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2><br>> Contact: <sip:2222222222@3.3.3.3><br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 102 INVITE<br>> User-Agent: Asterisk PBX<br>> Max-Forwards: 68<br>> Date:
Tue, 18 May 2010 06:29:00 GMT<br>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>> Supported: replaces<br>> X-CRE-ID: "sbc-tp-04-1274164140.30823.0<br>> X-DIALSTRING: SIP/ico-bry-001/1111111111<br>> Content-Type: application/sdp<br>> Content-Length: 259<br>><br>> v=0<br>> o=root 4296 4296 IN IP4 3.3.3.3<br>> s=session<br>> c=IN IP4 3.3.3.3<br>> t=0 0<br>> m=audio 10060 RTP/AVP 18 101<br>> a=rtpmap:18 G729/8000<br>> a=fmtp:18 annexb=no<br>> a=rtpmap:101 telephone-event/8000<br>> a=fmtp:101 0-16<br>> a=silenceSupp:off - - - -<br>> a=ptime:60<br>> a=sendrecv<br>><br>><br>><br>><br>><br>> Internet Protocol, Src: 4.4.4.4 (4.4.4.4), Dst: 2.2.2.2 (2.2.2.2)<br>><br>> User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>><br>> SIP/2.0 200 OK<br>> Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bK5be8.91dcf496.0;received=2.2.2.2<br>> Via:
SIP/2.0/UDP <br>> 1.1.1.1;rport=5060;received=1.1.1.1;branch=z9hG4bK5be8.eeb63911.0<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK55985828;rport=5060<br>> Record-Route: <sip:2.2.2.2;lr=on;ftag=as1a75bb38><br>> Record-Route: <sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> From: "2222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2>;tag=as5bd164c9<br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 102 INVITE<br>> User-Agent: Asterisk PBX 1.6.0.9<br>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>> Supported: replaces, timer<br>> Contact: <sip:1111111111@4.4.4.4><br>> Content-Type: application/sdp<br>> Content-Length: 290<br>><br>> v=0<br>> o=root 2115801714 2115801714 IN IP4 4.4.4.4<br>> s=Asterisk PBX 1.6.0.9<br>> c=IN IP4 4.4.4.4<br>> t=0 0<br>> m=audio 12004 RTP/AVP 18 101<br>> a=rtpmap:18
G729/8000<br>> a=fmtp:18 annexb=no<br>> a=rtpmap:101 telephone-event/8000<br>> a=fmtp:101 0-16<br>> a=silenceSupp:off - - - -<br>> a=ptime:60<br>> a=sendrecv<br>><br>><br>><br>><br>><br>><br>> Internet Protocol, Src: 2.2.2.2 (2.2.2.2), Dst: 1.1.1.1 (1.1.1.1)<br>><br>> User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>><br>> SIP/2.0 200 OK<br>> Via: SIP/2.0/UDP <br>> 1.1.1.1;rport=5060;received=1.1.1.1;branch=z9hG4bK5be8.eeb63911.0<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK55985828;rport=5060<br>> Record-Route: <sip:2.2.2.2;lr=on;ftag=as1a75bb38><br>> Record-Route: <sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> From: "2222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2>;tag=as5bd164c9<br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 102 INVITE<br>> User-Agent: Asterisk PBX
1.6.0.9<br>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>> Supported: replaces, timer<br>> Contact: <sip:1111111111@4.4.4.4><br>> Content-Type: application/sdp<br>> Content-Length: 290<br>><br>> v=0<br>> o=root 2115801714 2115801714 IN IP4 4.4.4.4<br>> s=Asterisk PBX 1.6.0.9<br>> c=IN IP4 4.4.4.4<br>> t=0 0<br>> m=audio 12004 RTP/AVP 18 101<br>> a=rtpmap:18 G729/8000<br>> a=fmtp:18 annexb=no<br>> a=rtpmap:101 telephone-event/8000<br>> a=fmtp:101 0-16<br>> a=silenceSupp:off - - - -<br>> a=ptime:60<br>> a=sendrecv<br>><br>><br>><br>><br>> ACK is sent with 2.2.2.2 in ruri, instead of 4.4.4.4:<br>><br>> Internet Protocol, Src: 1.1.1.1 (1.1.1.1), Dst: 2.2.2.2 (2.2.2.2)<br>><br>> User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)<br>><br>> ACK sip:1111111111@2.2.2.2:5060 SIP/2.0<br>> Record-Route:
<sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bK5be8.eeb63911.2<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK07b01eaf;rport=5060<br>> Route: <sip:2.2.2.2;lr=on;ftag=as1a75bb38><br>> From: "2222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2>;tag=as5bd164c9<br>> Contact: <sip:2222222222@3.3.3.3><br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 102 ACK<br>> User-Agent: Asterisk PBX<br>> Max-Forwards: 69<br>> Content-Length: 0<br>><br>><br>><br>><br>> The ACK is not relayed on to 4.4.4.4, and so 4.4.4.4 just keeps <br>> retransmitting 200 replies. Later the BYE from 1.1.1.1 also has an <br>> incorrect ruri and so it is also not sent on to 4.4.4.4 as follows:<br>><br>> Internet Protocol, Src: 1.1.1.1 (1.1.1.1), Dst: 2.2.2.2 (2.2.2.2)<br>><br>> User Datagram Protocol, Src Port:
sip (5060), Dst Port: sip (5060)<br>><br>> BYE sip:1111111111@2.2.2.2:5060 SIP/2.0<br>> Record-Route: <sip:1.1.1.1;lr=on;ftag=as1a75bb38><br>> Via: SIP/2.0/UDP 1.1.1.1;branch=z9hG4bK6be8.2fa52b26.0<br>> Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK02874f97;rport=5060<br>> Route: <sip:2.2.2.2;lr=on;ftag=as1a75bb38><br>> From: "2222222222" <sip:2222222222@3.3.3.3>;tag=as1a75bb38<br>> To: <sip:1111111111@2.2.2.2>;tag=as5bd164c9<br>> Call-ID: 7a98e4540899dde2053dc8a11cee1a04@3.3.3.3<br>> CSeq: 103 BYE<br>> User-Agent: Asterisk PBX<br>> Max-Forwards: 69<br>> Reason: Q.850 ;cause=16; text="Normal Clearing"<br>> X-Asterisk-HangupCauseCode: 16<br>> Content-Length: 0<br>><br>> I believe we would have been able to fix this issue by using the <br>> dialoq module on both servers, but I do not know much about the dialog <br>> module yet, and unfortunately we have no control over one of
the <br>> opensips servers. i also thought of trying to use the b2bua modules on <br>> just our server, but once again i will first need to learn more about <br>> those, but for now, we have managed to create a workaround whereby we <br>> rewrite the ruri for all acks, byes and cancels with the ip retrieved <br>> from the location table (using avp_db_query), which seems to be <br>> working, for now. I hope to find a more reliable fix.<br>><br>> Thanks for the help.<br>> Bruce<br>><br>><br>> ------------------------------------------------------------------------<br>> *From:* Bogdan-Andrei Iancu <<a ymailto="mailto:bogdan@voice-system.ro" href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>><br>> *To:* OpenSIPS users mailling list <<a ymailto="mailto:users@lists.opensips.org" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>><br>> *Sent:* Tue, 18 May, 2010
17:54:01<br>> *Subject:* Re: [OpenSIPS-Users] In dialog requests misrouted<br>><br>> Hi Bruce,<br>><br>> The ACK for a 200OK is routed based on the route set - this the RR set +<br>> the contact of the other party. So, the ACK will have in RURI the<br>> contact of the other party (from 200 OK) and the RR set as Route hdrs.<br>><br>> Regards,<br>> Bogdan<br>><br>> Bruce Borrett wrote:<br>> > Hi<br>> ><br>> > We are trying to migrate from an SBC to Opensips 1.6. When we are<br>> > sending calls to another provider who are using Openser, they are not<br>> > taking the contact address from our 200 replies, instead they are<br>> > putting our Openser address in the RURI of all Acks, Byes and Cancels.<br>> > Am I right in saying that this is incorrect? Im not sure where they<br>> > are getting this address either, maybe from the To: field, or from the<br>> >
record route header?<br>> ><br>> > Is there a way to match the message received to a transaction and<br>> > route the message to the contact in the original invite stored by TM?<br>> > Or perhaps some better way of solving this?<br>> ><br>> > Here are the messages:<br>> ><br>> > SIP/2.0 200 OK<br>> > Via: SIP/2.0/UDP<br>> > <br>> xx.xxx.0.33;rport=5060;received=41.221.0.33;branch=z9hG4bKb9fc.f1cf4e03.0<br>> > Via: SIP/2.0/UDP xx.xxx.0.42:5060;branch=z9hG4bK3d3a5800;rport=5060<br>> > Record-Route: <sip:xx.xxx.1.13;lr=on;ftag=as5e3b3ce0><br>> > Record-Route: <sip:xx.xxx.0.33;lr=on;ftag=as5e3b3ce0><br>> > From: "xxxxxxx7239" <sip:<a ymailto="mailto:xxxxxxx7239@xx.xxx" href="mailto:xxxxxxx7239@xx.xxx">xxxxxxx7239@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:xxxxxxx7239@xx.xxx"
href="mailto:xxxxxxx7239@xx.xxx">xxxxxxx7239@xx.xxx</a>>.0.42>;tag=as5e3b3ce0<br>> > To: <sip:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a>>.1.13>;tag=as33b0f85f<br>> > Call-ID: <a ymailto="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx" href="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx">4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx" href="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx">4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx</a>>.0.42<br>> > CSeq: 102 INVITE<br>> > User-Agent: Asterisk PBX 1.6.0.9<br>> > Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>> > Supported: replaces, timer<br>> > Contact: <sip:<a
ymailto="mailto:xxxxxxx0114@xx.xxx" href="mailto:xxxxxxx0114@xx.xxx">xxxxxxx0114@xx.xxx</a> <mailto:<a ymailto="mailto:xxxxxxx0114@xx.xxx" href="mailto:xxxxxxx0114@xx.xxx">xxxxxxx0114@xx.xxx</a>>.236.105><br>> > Content-Type: application/sdp<br>> > Content-Length: 290<br>> ><br>> ><br>> > ACK sip:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a> <mailto:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a>>.1.13:5060 SIP/2.0<br>> > Record-Route: <sip:xx.xxx.0.33;lr=on;ftag=as5e3b3ce0><br>> > Via: SIP/2.0/UDP xx.xxx.0.33;branch=z9hG4bKb9fc.f1cf4e03.2<br>> > Via: SIP/2.0/UDP xx.xxx.0.42:5060;branch=z9hG4bK5e0350ba;rport=5060<br>> > Route: <sip:xx.xxx.1.13;lr=on;ftag=as5e3b3ce0><br>> > From: "xxxxxxx7239" <sip:<a ymailto="mailto:xxxxxxx7239@xx.xxx"
href="mailto:xxxxxxx7239@xx.xxx">xxxxxxx7239@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:xxxxxxx7239@xx.xxx" href="mailto:xxxxxxx7239@xx.xxx">xxxxxxx7239@xx.xxx</a>>.0.42>;tag=as5e3b3ce0<br>> > To: <sip:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:xxxxxx0114@xx.xxx" href="mailto:xxxxxx0114@xx.xxx">xxxxxx0114@xx.xxx</a>>.1.13>;tag=as33b0f85f<br>> > Contact: <sip:<a ymailto="mailto:xxxxxx7239@xx.xxx" href="mailto:xxxxxx7239@xx.xxx">xxxxxx7239@xx.xxx</a> <mailto:<a ymailto="mailto:xxxxxx7239@xx.xxx" href="mailto:xxxxxx7239@xx.xxx">xxxxxx7239@xx.xxx</a>>.0.42><br>> > Call-ID: <a ymailto="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx" href="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx">4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx</a> <br>> <mailto:<a ymailto="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx"
href="mailto:4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx">4b3419c86b29e5ce5a387a1b74f7effc@xx.xxx</a>>.0.42<br>> > CSeq: 102 ACK<br>> > User-Agent: Asterisk PBX<br>> > Max-Forwards: 69<br>> > Content-Length: 0<br>> ><br>> > Thank you very much in advance..<br>> > Bruce<br>> ><br>> ><br>> > ------------------------------------------------------------------------<br>> ><br>> > _______________________________________________<br>> > Users mailing list<br>> > <a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>> > <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>> >
<br>><br>><br>> -- <br>> Bogdan-Andrei Iancu<br>> www.voice-system.ro<br>><br>><br>> _______________________________________________<br>> Users mailing list<br>> <a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a> <mailto:<a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>><br>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________<br>> Users mailing list<br>> <a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>> <br><br><br>-- <br>Bogdan-Andrei Iancu<br>www.voice-system.ro<br><br><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></div></div>
</div><br>
</body></html>