**********snip***********<br>So, I see here 2 issues (bugs):<br>
<br>
1) why the A device places in RURI maddr  its own IP ???? RURI points to<br>
destination, so no info about source should be there. Typically maddr is<br>
used in building Contact hdrs.<br>
<br>
2) opensips should automatically remove the maddr param when the script<br>
function do change the domain part of the RURI -&gt; logically speaking, if<br>
you want to change the destination, all fields with destination info<br>
should be affected.<br>************ snip *******<br><br>Indeed. <br>For now the quick fix was to remove maddr just before relaying the call. I could have update $du as a work around, but that would have caused the issue with next hope using opensip. <br>
Either one of these 2 can do that trick<br>if($(ru{uri.maddr}) != &quot;&quot;) {<br>$du = &quot;sip:&quot; + $rU + &quot;@&quot; + $rd + &quot;:&quot; + $rp ;<br>OR <br>$ru = &quot;sip:&quot; + $rU + &quot;@&quot; + $rd + &quot;:&quot; + $rp +&quot;;user=phone;transport=UDP&quot;;  // I prefered this one. <br>
<br>But ultimately would be nice to see the fix in module itself. Just pushed this to production, so far things looks good. Hope I will have good night sleep and happy morning :) <br><br>Best, <br><br>-Jai <br><br><br><br>
<br><br><div class="gmail_quote">On Mon, Dec 14, 2009 at 2:04 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jai,<br>
<div class="im"><br>
Jai Rangi wrote:<br>
&gt; I found another discussion on this,<br>
&gt; <a href="http://www.openser.org/pipermail/users/2007-July/012258.html" target="_blank">http://www.openser.org/pipermail/users/2007-July/012258.html</a><br>
</div>Correct :)<br>
<div class="im">&gt;<br>
&gt; Again specially in this case it does not make sense at all to send<br>
&gt; call to maddr in place of host in the domain.<br>
</div>yes, I agree -&gt; I suggest you remove the maddr param from the RURI.<br>
<div class="im">&gt;<br>
&gt; Say this is the desired scenario<br>
&gt;<br>
&gt; A -&gt; B(Opensips1.6) -&gt; C<br>
&gt;<br>
&gt; - If A send call to B with maddr the call works perfect and goes to C.<br>
</div>This works because lookup(location) replace the entire RURI  (including<br>
the maddr), so the maddr is simply discarded.<br>
<div class="im"><br>
&gt; - But if A send call to B with maddres B send invite back to A (Does<br>
&gt; not make any sense)<br>
</div>If you just change the domain part (as drouting does) of the RURI, the<br>
maddr param is preserved and will break the outbound routing of the call.<br>
<br>
So, I see here 2 issues (bugs):<br>
<br>
1) why the A device places in RURI maddr  its own IP ???? RURI points to<br>
destination, so no info about source should be there. Typically maddr is<br>
used in building Contact hdrs.<br>
<br>
2) opensips should automatically remove the maddr param when the script<br>
function do change the domain part of the RURI -&gt; logically speaking, if<br>
you want to change the destination, all fields with destination info<br>
should be affected.<br>
<br>
Regards,<br>
Bogdan<br>
<div class="im"><br>
<br>
<br>
<br>
&gt;<br>
&gt; Also in another case<br>
&gt;<br>
&gt; A Send call to B&#39;is IP on some domain (Domain is in the table)<br>
&gt; B is not updating the maddr in the SIP header but update domain part<br>
&gt; of uri and sending call back to itself because of maddr and resulting<br>
&gt; in 403 Forbidden here.<br>
&gt;<br>
</div>&gt; U <a href="http://192.168.2.11:5060" target="_blank">192.168.2.11:5060</a> &lt;<a href="http://192.168.2.11:5060" target="_blank">http://192.168.2.11:5060</a>&gt; -&gt; <a href="http://192.168.2.21:5060" target="_blank">192.168.2.21:5060</a><br>

&gt; &lt;<a href="http://192.168.2.21:5060" target="_blank">http://192.168.2.21:5060</a>&gt;<br>
<div class="im">&gt; INVITE<br>
&gt; sip:19498859944@somedomain.com:5060;user=phone;transport=UDP;maddr=192.168.2.21<br>
&gt; SIP/2.0.<br>
&gt;<br>
&gt; Call processed through routing module found the rule that<br>
&gt; 19498859944 should be forwarded to 192.168.2.30<br>
&gt;<br>
&gt; After loading the dr_load<br>
&gt; $ru is<br>
&gt; <a href="mailto:sip%3A19498859944@192.168.2.30">sip:19498859944@192.168.2.30</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253A19498859944@192.168.2.30">sip%3A19498859944@192.168.2.30</a>&gt;;user=phone;transport=UDP;maddr=192.168.2.21<br>
<div class="im">&gt;<br>
&gt; t_relay send call to 192.168.2.21 and call fails in the (is_uri_local)<br>
&gt; cause it does not find 192.168.2.30 in the domain table. If you add<br>
&gt; 192.168.2.30 in the domain table that will create a loop cause maddr<br>
&gt; is never going to get update. :(<br>
&gt;<br>
&gt; Now I think this is bug here in drouting module, which is not updating<br>
&gt; the maddr. I believe the new $ru should be<br>
&gt; <a href="mailto:sip%3A19498859944@192.168.2.30">sip:19498859944@192.168.2.30</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253A19498859944@192.168.2.30">sip%3A19498859944@192.168.2.30</a>&gt;;user=phone;transport=UDP;maddr=192.168.2.30<br>
<div class="im">&gt;<br>
&gt;<br>
&gt; Hope I gave good example, any thoughts?<br>
&gt; So either t_relay should not send call to maddr.<br>
&gt; Or maddr should be updated in the drouting module as well as LCR and<br>
&gt; carrier route modules.<br>
&gt;<br>
&gt; I believe this can be fixed in the script itself. Looking for better<br>
&gt; suggestions.<br>
&gt;<br>
&gt;<br>
&gt; -Jai<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Sun, Dec 13, 2009 at 12:12 PM, Jai Rangi &lt;<a href="mailto:jprangi@didforsale.com">jprangi@didforsale.com</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:jprangi@didforsale.com">jprangi@didforsale.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I am having issue with call routing in certain situation. I am<br>
&gt;     using drouting module and permission module for authentications.<br>
&gt;<br>
&gt;     Here is the trace<br>
&gt;<br>
&gt;     * # Call comes from 192.168.1.11 to 192.168.1.11*<br>
&gt;<br>
</div>&gt;     U <a href="http://192.168.1.11:5060" target="_blank">192.168.1.11:5060</a> &lt;<a href="http://192.168.1.11:5060" target="_blank">http://192.168.1.11:5060</a>&gt; -&gt;<br>
&gt;     <a href="http://192.168.1.13:5060" target="_blank">192.168.1.13:5060</a> &lt;<a href="http://192.168.1.13:5060" target="_blank">http://192.168.1.13:5060</a>&gt;<br>
<div class="im">&gt;<br>
&gt;     INVITE<br>
&gt;     sip:19498858961@192.168.1.13:5060;user=phone;transport=UDP;maddr=192.168.1.11<br>
&gt;     SIP/2.0.<br>
&gt;<br>
&gt;     Record-Route:<br>
&gt;     &lt;sip:192.168.1.11;ftag=dc7-13c4-5db56e-28caa21e-5db56e;lr=on&gt;.<br>
&gt;<br>
&gt;     Via: SIP/2.0/UDP 192.168.1.11;branch=z9hG4bK2c7a.d24c40b5.0.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     65.243.172.245:5060;branch=z9hG4bK31c0ba996f394d817b1f3364936c1b88.4a620e1.<br>
&gt;<br>
&gt;     Record-Route: &lt;sip:65.243.172.245:5060;lr&gt;.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     63.110.102.239:5060;branch=z9hG4bK4be83d023d1c5e705dbce69dc257428e.61c8be4a;received=63.110.102.239.<br>
&gt;<br>
&gt;     record-route: &lt;sip:63.110.102.239;lr&gt;.<br>
&gt;<br>
&gt;     Remote-Party-ID: &lt;<a href="mailto:sip%3A%2B19496794816@63.110.102.239">sip:+19496794816@63.110.102.239</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253A%252B19496794816@63.110.102.239">sip%3A%2B19496794816@63.110.102.239</a>&gt;&gt;;screen=yes;party=calling;privacy=off.<br>
<div><div></div><div class="h5">&gt;<br>
&gt;     f:<br>
&gt;     &lt;sip:+19496794816@199.173.94.144:5060;user=phone&gt;;tag=dc7-13c4-5db56e-28caa21e-5db56e.<br>
&gt;<br>
&gt;     t: &lt;sip:+19498858961@63.110.102.239:5060;user=phone&gt;.<br>
&gt;<br>
&gt;     i: a1d74c18905eadc713c45db56e6e0cb7e4a9d9a091cba8848-0096-6871.<br>
&gt;<br>
&gt;     CSeq: 1 INVITE.<br>
&gt;<br>
&gt;     Max-Forwards: 16.<br>
&gt;<br>
&gt;     k: 100rel, replaces.<br>
&gt;<br>
&gt;     allow:<br>
&gt;     ACK,BYE,CANCEL,INVITE,OPTIONS,INFO,SUBSCRIBE,REFER,NOTIFY,PRACK.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     SCR9:5060;maddr=199.173.94.144;branch=z9hG4bK-5db56e-6e0cb7e4-3dc36a18;received=199.173.94.144.<br>
&gt;<br>
&gt;     m: &lt;sip:199.173.94.144:5060;transport=UDP&gt;.<br>
&gt;<br>
&gt;     c: application/SDP.<br>
&gt;<br>
&gt;     l: 233.<br>
&gt;<br>
&gt;     .<br>
&gt;<br>
&gt;     v=0.<br>
&gt;<br>
&gt;     o=PVG 1260705241820 1260705241820 IN IP4 199.173.77.34.<br>
&gt;<br>
&gt;     s=-.<br>
&gt;<br>
&gt;     p=+1 6135555555.<br>
&gt;<br>
&gt;     c=IN IP4 199.173.77.34.<br>
&gt;<br>
&gt;     t=0 0.<br>
&gt;<br>
&gt;     m=audio 55632 RTP/AVP 18 0 8 101.<br>
&gt;<br>
&gt;     a=rtpmap:101 telephone-event/8000.<br>
&gt;<br>
&gt;     a=fmtp:101 0-15.<br>
&gt;<br>
&gt;     a=ptime:20.<br>
&gt;<br>
&gt;     a=fmtp:18 annexb=no.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     #<br>
&gt;<br>
</div></div>&gt;     U <a href="http://192.168.1.13:5060" target="_blank">192.168.1.13:5060</a> &lt;<a href="http://192.168.1.13:5060" target="_blank">http://192.168.1.13:5060</a>&gt; -&gt;<br>
&gt;     <a href="http://192.168.1.11:5060" target="_blank">192.168.1.11:5060</a> &lt;<a href="http://192.168.1.11:5060" target="_blank">http://192.168.1.11:5060</a>&gt;<br>
<div class="im">&gt;<br>
&gt;     SIP/2.0 100 Giving a try.<br>
&gt;<br>
&gt;     Via: SIP/2.0/UDP 192.168.1.11;branch=z9hG4bK2c7a.d24c40b5.0.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     65.243.172.245:5060;branch=z9hG4bK31c0ba996f394d817b1f3364936c1b88.4a620e1.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     63.110.102.239:5060;branch=z9hG4bK4be83d023d1c5e705dbce69dc257428e.61c8be4a;received=63.110.102.239.<br>
&gt;<br>
&gt;     f:<br>
&gt;     &lt;sip:+19496794816@199.173.94.144:5060;user=phone&gt;;tag=dc7-13c4-5db56e-28caa21e-5db56e.<br>
&gt;<br>
&gt;     t: &lt;sip:+19498858961@63.110.102.239:5060;user=phone&gt;.<br>
&gt;<br>
&gt;     i: a1d74c18905eadc713c45db56e6e0cb7e4a9d9a091cba8848-0096-6871.<br>
&gt;<br>
&gt;     CSeq: 1 INVITE.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     SCR9:5060;maddr=199.173.94.144;branch=z9hG4bK-5db56e-6e0cb7e4-3dc36a18;received=199.173.94.144.<br>
&gt;<br>
&gt;     Server: OpenSIPS (1.6.0-notls (x86_64/linux)).<br>
&gt;<br>
&gt;     Content-Length: 0.<br>
&gt;<br>
&gt;     .<br>
&gt;     *<br>
&gt;      According to drouting rules, call should be going to 192.168.1.3,<br>
&gt;     but somehow opensips is updating the maddress to the origination<br>
&gt;     IP (192.168.1.11 in this case) and is sending calls to *the IP in<br>
&gt;     maddr. in place to destination IP.<br>
&gt;<br>
&gt;     # Sending invite to originating IP.<br>
&gt;<br>
</div>&gt;     *U <a href="http://192.168.1.13:5060" target="_blank">192.168.1.13:5060</a> &lt;<a href="http://192.168.1.13:5060" target="_blank">http://192.168.1.13:5060</a>&gt; -&gt;<br>
&gt;     <a href="http://192.168.1.11:5060" target="_blank">192.168.1.11:5060</a> &lt;<a href="http://192.168.1.11:5060" target="_blank">http://192.168.1.11:5060</a>&gt;<br>
<div class="im">&gt;     *<br>
&gt;     *INVITE <a href="mailto:sip%3A19498858961@192.168.1.3">sip:19498858961@192.168.1.3</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253A19498858961@192.168.1.3">sip%3A19498858961@192.168.1.3</a>&gt;;user=phone;transport=UDP;maddr=192.168.1.11<br>
<div class="im">&gt;     SIP/2.0.*<br>
&gt;<br>
&gt;     Record-Route:<br>
&gt;     &lt;sip:192.168.1.13;lr=on;ftag=dc7-13c4-5db56e-28caa21e-5db56e&gt;.<br>
&gt;<br>
&gt;     Record-Route:<br>
&gt;     &lt;sip:192.168.1.11;ftag=dc7-13c4-5db56e-28caa21e-5db56e;lr=on&gt;.<br>
&gt;<br>
&gt;     Via: SIP/2.0/UDP 192.168.1.13;branch=z9hG4bK2c7a.cb3da61.0.<br>
&gt;<br>
&gt;     Via: SIP/2.0/UDP 192.168.1.11;branch=z9hG4bK2c7a.d24c40b5.0.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     65.243.172.245:5060;branch=z9hG4bK31c0ba996f394d817b1f3364936c1b88.4a620e1.<br>
&gt;<br>
&gt;     Record-Route: &lt;sip:65.243.172.245:5060;lr&gt;.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     63.110.102.239:5060;branch=z9hG4bK4be83d023d1c5e705dbce69dc257428e.61c8be4a;received=63.110.102.239.<br>
&gt;<br>
&gt;     record-route: &lt;sip:63.110.102.239;lr&gt;.<br>
&gt;<br>
&gt;     Remote-Party-ID: &lt;<a href="mailto:sip%3A%2B19496794816@63.110.102.239">sip:+19496794816@63.110.102.239</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:sip%253A%252B19496794816@63.110.102.239">sip%3A%2B19496794816@63.110.102.239</a>&gt;&gt;;screen=yes;party=calling;privacy=off.<br>
<div><div></div><div class="h5">&gt;<br>
&gt;     f:<br>
&gt;     &lt;sip:+19496794816@199.173.94.144:5060;user=phone&gt;;tag=dc7-13c4-5db56e-28caa21e-5db56e.<br>
&gt;<br>
&gt;     t: &lt;sip:+19498858961@63.110.102.239:5060;user=phone&gt;.<br>
&gt;<br>
&gt;     i: a1d74c18905eadc713c45db56e6e0cb7e4a9d9a091cba8848-0096-6871.<br>
&gt;<br>
&gt;     CSeq: 1 INVITE.<br>
&gt;<br>
&gt;     Max-Forwards: 15.<br>
&gt;<br>
&gt;     k: 100rel, replaces.<br>
&gt;<br>
&gt;     allow:<br>
&gt;     ACK,BYE,CANCEL,INVITE,OPTIONS,INFO,SUBSCRIBE,REFER,NOTIFY,PRACK.<br>
&gt;<br>
&gt;     v: SIP/2.0/UDP<br>
&gt;     SCR9:5060;maddr=199.173.94.144;branch=z9hG4bK-5db56e-6e0cb7e4-3dc36a18;received=199.173.94.144.<br>
&gt;<br>
&gt;     m: &lt;sip:199.173.94.144:5060;transport=UDP&gt;.<br>
&gt;<br>
&gt;     c: application/SDP.<br>
&gt;<br>
&gt;     l: 233.<br>
&gt;<br>
&gt;     .<br>
&gt;<br>
&gt;     v=0.<br>
&gt;<br>
&gt;     o=PVG 1260705241820 1260705241820 IN IP4 199.173.77.34.<br>
&gt;<br>
&gt;     s=-.<br>
&gt;<br>
&gt;     p=+1 6135555555.<br>
&gt;<br>
&gt;     c=IN IP4 199.173.77.34.<br>
&gt;<br>
&gt;     t=0 0.<br>
&gt;<br>
&gt;     m=audio 55632 RTP/AVP 18 0 8 101.<br>
&gt;<br>
&gt;     a=rtpmap:101 telephone-event/8000.<br>
&gt;<br>
&gt;     a=fmtp:101 0-15.<br>
&gt;<br>
&gt;     a=p<br>
&gt;<br>
&gt;     #<br>
&gt;<br>
&gt;     My Routing logic is quite simple.<br>
&gt;<br>
&gt;     if (is_uri_host_local()) {<br>
&gt;                        # -- outbound to inbound<br>
&gt;                             route(12);<br>
&gt;                     }<br>
&gt;<br>
&gt;<br>
&gt;     route[4] {<br>
&gt;             #Routing to Public Network<br>
&gt;<br>
&gt;             if (!do_routing(&quot;10&quot;,&quot;1&quot;)) {<br>
&gt;                     xlog(&quot;-- do_routing failed  \n&quot;);<br>
&gt;                     sl_send_reply(&quot;503&quot;, &quot;Unable to load gateways&quot;);<br>
&gt;                     exit ;<br>
&gt;             } else {<br>
&gt;             t_on_failure(&quot;1&quot;);  #&lt;--- This will be where you load the<br>
&gt;     nextgateway<br>
&gt;             route(1);<br>
&gt;             exit;<br>
&gt;            };<br>
&gt;     } # End Route 4<br>
&gt;<br>
&gt;     route[12] {<br>
&gt;             # From an External Domain -&gt; inbound<br>
&gt;<br>
&gt;             lookup(&quot;aliases&quot;);<br>
&gt;             if (!lookup(&quot;location&quot;)) {<br>
&gt;                     route(4);<br>
&gt;                     exit ;<br>
&gt;             }<br>
&gt;             route(1);<br>
&gt;     }<br>
&gt;     route[1] {<br>
&gt;<br>
&gt;             if (!t_relay()) {<br>
&gt;                           sl_reply_error();<br>
&gt;             };<br>
&gt;             exit;<br>
&gt;     }<br>
&gt;<br>
&gt;     I am confused why opensip is seding call to maddr IP in place of<br>
&gt;     IP in destination URI. Any help of link will be appreciated.<br>
&gt;<br>
&gt;     Best,<br>
&gt;     -Jai<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a 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></blockquote></div><br>