<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'>Stagg, <BR>
<BR>
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>
<BR>
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>
<BR>
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>
<BR>
-graham<BR>
<BR>
<BR>
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>
<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>
<BR>
----- Reply message -----<BR>
From: &quot;Stagg Shelton&quot; &lt;<a href="stagg@vocalcloud.com">stagg@vocalcloud.com</a>&gt;<BR>
Date: Sat, Jan 29, 2011 8:27 am<BR>
Subject: [SR-Users] LCR next_gw() - certain GW, source from other IP address<BR>
To: &lt;<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<BR>
<BR>
Do the provider gateways have the same IP address for the different rate <BR>
plans? &nbsp;If the gateways are different then the following may be relevant.<BR>
<BR>
&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;&nbs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bsp;&nbsp;&nbsp;&nbsp;{<BR>
&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>
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;};<BR>
&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;} else {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xlog(&quot;No gateways found!&quot;);<BR>
<BR>
<BR>
Stagg<BR>
<BR>
On 1/29/11 9:10 AM, Graham Wooden wrote:<BR>
&gt; Hi there,<BR>
&gt;<BR>
&gt; I have a requirement now that for one of my GW&sup1;s in my LCR, needs to be<BR>
&gt; sourced from another IP address (two different rate-decks with the carrier).<BR>
&gt; This ratedeck will always be at least 2nd inline ...<BR>
&gt;<BR>
&gt; I was thinking something along the sorts ... Some pseudo code:<BR>
&gt;<BR>
&gt; failure_route [2] {<BR>
&gt; .<BR>
&gt; .<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (next_gw()) {<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( name = 'gw_name') {<BR>
&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>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<BR>
&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>
&gt; else.<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_on_failure(&quot;2&quot;);<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;route(19);<BR>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>
&gt; .<BR>
&gt; .<BR>
&gt; .<BR>
&gt; }<BR>
&gt;<BR>
&gt; What variable will have the value that's in the gw_name column? I can't go<BR>
&gt; by the IP address in $ru because the destination IP is the same between the<BR>
&gt; two ratedecks.<BR>
&gt;<BR>
&gt; Overall, Is that the best way to handle this requirement?<BR>
&gt;<BR>
&gt; Thanks all,<BR>
&gt;<BR>
&gt; -graham<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; _______________________________________________<BR>
&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
&gt; <a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
&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>
<BR>
_______________________________________________<BR>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
<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>
<BR>
<BR>
<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>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<BR>
<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><BR>
<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>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>