<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Henning,<div><br></div><div>My inbound carrier has done some digging and discovered that the reason is they choose the *first* address from the *last* Record-Route header.</div><div><br></div><div>Most gateways apparently add multiple Record-Route headers, whereas when we get a OK to our INVITE from the carrier, the various Record-Route headers have been compiled into a single Record-Route header like:</div><div><br></div><div><pre style="-webkit-user-select: text; position: absolute; top: -99px; z-index: auto; ">Record-Route: <<a href="sip:85.13.242.57;lr=on">sip:85.13.242.57;lr=on</a>>
Record-Route: <<a href="sip:85.13.242.55;lr=on">sip:85.13.242.55;lr=on</a>></pre><div><div></div></div></div><div><div><div><b>--> INVITE</b></div></div></div><blockquote type="cite"><div><div><div><font face="Courier New">Record-Route: <<a href="sip:8.13.22.57;lr=on">sip:8.13.22.57;lr=on</a>></font></div><div><font face="Courier New">Record-Route: <<a href="sip:8.13.22.55;lr=on">sip:8.13.22.55;lr=on</a>></font></div></div></div></blockquote><br><div><b><-- OK</b></div><blockquote type="cite"><div><font face="Courier New">Record-Route: <<a href="sip:53.116.5.147;lr=on">sip:53.116.5.147;lr=on</a>>,<<a href="sip:8.13.22.57;lr=on">sip:8.13.22.57;lr=on</a>>,<<a href="sip:8.13.22.55;lr=on">sip:8.13.22.55;lr=on</a>></font></div></blockquote><div><br></div><div>Is this normal behaviour of SIP, and either way is there any way to ask Kamailio to mangle the 200 OK to split the Record-Route header into the separate entries that is possibly more "standard"…?</div><div><br></div><div>Cheers,</div><div>Leo</div><div><br><div><div>On 6 May 2013, at 12:20, Henning Westerholt <<a href="mailto:hw@kamailio.org">hw@kamailio.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Am Freitag, 3. Mai 2013, 16:54:29 schrieb Leo Brown:<br><blockquote type="cite">I added record_route() and now I see an extra record-route and Via: header:<br><br>.9........INVITE <a href="sip:44800800150@pstn-out.netfuse.net">sip:44800800150@pstn-out.netfuse.net</a> SIP/2.0<br>Record-Route: <<a href="sip:85.13.242.55;lr=on">sip:85.13.242.55;lr=on</a>><br>Via: SIP/2.0/UDP 85.13.242.55;branch=z9hG4bK388f.04bc8632.1<br>Via: SIP/2.0/UDP 81.88.163.210:5060;rport=5060;branch=z9hG4bK82ae6ced<br>    INVITE <a href="sip:44800800150@our-pstn-switch">sip:44800800150@our-pstn-switch</a> SIP/2.0<br>    Record-Route: <<a href="sip:mvno-edge;lr=on">sip:mvno-edge;lr=on</a>><br>    Via: SIP/2.0/UDP mvno-edge;branch=z9hG4bK388f.04bc8632.1<br>    Via: SIP/2.0/UDP mvno-carrier:5060;rport=5060;branch=z9hG4bK82ae6ced<br>    Contact: <<a href="sip:441234567890@mvno-carrier:5060">sip:441234567890@mvno-carrier:5060</a>><br><br>I have replaced the relevant IP addresses in the example with mvno-edge,<br>mvno-carrier, and outbound-carrier. So the route got "recorded" but the<br>Contact: still referenced my mvno-carrier when inviting my<br>outbound-carrier.<br><br>Accordingly, I do not get the BYE message from my originating mvno-carrier,<br>after I send them 200 OK they try to talk to my outbound-carrier.<br><br>Note this is how I am routing the call to my gateway:<br><br>        # Change destination URI to our carrier<br>        $ru = "sip:" + $rU + "@" +<br>$sel(cfg_get.gateways.outbound_carrier_1);<br><br>Any other ideas on how the Contact header should be modified?<br></blockquote><br>Hi Leo,<br><br>maybe the originating gateway user agent is not configured correctly. Normally <br>one does not need to modify the Contact header for this functionality.<br><br>The originating user agent needs to "learn" the route set that he should <br>follow and specify then this the respective Route headers.<br><br>Take a look to this example on how it works in detail:<br><br><a href="http://www.in2eps.com/fo-sip/tk-fo-sip-dialog.html">http://www.in2eps.com/fo-sip/tk-fo-sip-dialog.html</a><br><br>BTW, if your proxy on the path also needs to honour Route sets you need to use <br>also the loose_route function in rr module.<br><br>Henning Westerholt<br></blockquote></div><br></div></body></html>