<HTML>
<HEAD>
<TITLE>Re: [SR-Users] LCR next_gw() - certain GW, source from other IP address</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Ah &#8211; I didn&#8217;t have the same routine in branch_route &#8211; I think that&#8217;s the key. &nbsp;Seems to be working now.<BR>
I see now that I am sourcing out the IP addy that I need to be.<BR>
<BR>
Thanks for that extra hint Stagg.<BR>
<BR>
-graham<BR>
<BR>
On 1/29/11 11:45 AM, &quot;Stagg Shelton&quot; &lt;<a href="stagg@vocalcloud.com">stagg@vocalcloud.com</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> &nbsp;&nbsp;I have the force send socket in the branch route too. &nbsp;So assume the first attempt fails and the call makes it to the failure route that I setup. &nbsp;Once it gets to the branch route then it executes the following where you can perform your logic again.<BR>
&nbsp;<BR>
&nbsp;branch_route[2] {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog(&quot;new branch at $ru\n&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($rd==&quot;aaa.aaa.aaa.aaa&quot;)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog (&quot;L_INFO&quot;, &quot;This is a request for A Plan&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(udp:xxx.xxx.xxx.xxx:5060);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog (&quot;L_INFO&quot;, &quot;This is a request for another plan&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(udp:yyy.yyy.yyy.yyy:5060);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<BR>
&nbsp;}<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;Stagg<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;On 1/29/11 12:32 PM, Graham Wooden wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> Re: [SR-Users] LCR next_gw() - certain GW, source from other IP address Well, ran into another wall .... I can&#8217;t seem to do the force_send_socket at the point of when next_gw() is called in the failure &nbsp;route. &nbsp;<BR>
&nbsp;<BR>
&nbsp;Is there anyway to clear and/or re-assign the data that is making it where I can&#8217;t re-write the transaction to come from another IP addy?<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;On 1/29/11 11:01 AM, &quot;Graham Wooden&quot; &lt;<a href="graham@g-rock.net">graham@g-rock.net</a>&gt; wrote:<BR>
&nbsp;<BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Stagg, <BR>
&nbsp;<BR>
&nbsp;While the Ips are the same, the suggestion to use &#8220;rd&#8221; along with an entry in the &#8220;hostname&#8221; column appears to be what I want. &nbsp;<BR>
&nbsp;<BR>
&nbsp;I assigned in my DNS some testing hostnames to the single IP in question. &nbsp;When debugging, I see that rd contains the hostname, not the IP. &nbsp;I believe with that, I can differentiate between the two... And when I see hostname of blah.blah.tld, then go ahead and do the force_send_socket.<BR>
&nbsp;<BR>
&nbsp;This definitely solves the issue for the time being. However, I am wondering if/when call volume increases if the call-setup time be delayed because of these look ups. &nbsp;Everything that I have read so far is that the gw_name is just information, the module doesn&#8217;t actually have access to it. Boo.<BR>
&nbsp;<BR>
&nbsp;-graham<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;On 1/29/11 8:36 AM, &quot;GP Wooden&quot; &lt;<a href="graham@g-rock.net">graham@g-rock.net</a>&gt; wrote:<BR>
&nbsp;<BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Same destination IP for both rate decks, so I need to go by something else, like the gw_name. <BR>
&nbsp;<BR>
&nbsp;----- Reply message -----<BR>
&nbsp;From: &quot;Stagg Shelton&quot; &lt;<a href="stagg@vocalcloud.com">stagg@vocalcloud.com</a>&gt;<BR>
&nbsp;Date: Sat, Jan 29, 2011 8:27 am<BR>
&nbsp;Subject: [SR-Users] LCR next_gw() - certain GW, source from other IP address<BR>
&nbsp;To: &lt;<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<BR>
&nbsp;<BR>
&nbsp;Do the provider gateways have the same IP address for the different rate <BR>
&nbsp;plans? &nbsp;If the gateways are different then the following may be relevant.<BR>
&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (next_gw()) {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# prepare for lcr failover<BR>
&nbsp;&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bsp;{<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog (&quot;L_INFO&quot;, &quot;This is a request for another rate <BR>
&nbsp;plan&quot;);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(udp:yyy.yyy.yyy.yyy:5060);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;route(2);<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog(&quot;No gateways found!&quot;);<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;Stagg<BR>
&nbsp;<BR>
&nbsp;On 1/29/11 9:10 AM, Graham Wooden wrote:<BR>
&nbsp;&gt; Hi there,<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; I have a requirement now that for one of my GW&sup1;s in my LCR, needs to be<BR>
&nbsp;&gt; sourced from another IP address (two different rate-decks with the carrier).<BR>
&nbsp;&gt; This ratedeck will always be at least 2nd inline ...<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; I was thinking something along the sorts ... Some pseudo code:<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; failure_route [2] {<BR>
&nbsp;&gt; .<BR>
&nbsp;&gt; .<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (next_gw()) {<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( name = 'gw_name') {<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(udp:ip.address.of.certain.ip:5060);<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# just dummy, as we will send out our default IP for everyone<BR>
&nbsp;&gt; else.<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_on_failure(&quot;2&quot;);<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;route(19);<BR>
&nbsp;&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&nbsp;&gt; .<BR>
&nbsp;&gt; .<BR>
&nbsp;&gt; .<BR>
&nbsp;&gt; }<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; What variable will have the value that's in the gw_name column? I can't go<BR>
&nbsp;&gt; by the IP address in $ru because the destination IP is the same between the<BR>
&nbsp;&gt; two ratedecks.<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; Overall, Is that the best way to handle this requirement?<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; Thanks all,<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; -graham<BR>
&nbsp;&gt;<BR>
&nbsp;&gt;<BR>
&nbsp;&gt;<BR>
&nbsp;&gt; _______________________________________________<BR>
&nbsp;&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
&nbsp;&gt; <a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
&nbsp;&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><BR>
&nbsp;<BR>
&nbsp;_______________________________________________<BR>
&nbsp;SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
&nbsp;<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
&nbsp;<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
&nbsp;SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
&nbsp;<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
&nbsp;<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><BR>
&nbsp;<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>