<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 – I didn’t have the same routine in branch_route – I think that’s the key. 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, "Stagg Shelton" <<a href="stagg@vocalcloud.com">stagg@vocalcloud.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> I have the force send socket in the branch route too. So assume the first attempt fails and the call makes it to the failure route that I setup. Once it gets to the branch route then it executes the following where you can perform your logic again.<BR>
<BR>
branch_route[2] {<BR>
xlog("new branch at $ru\n");<BR>
if($rd=="aaa.aaa.aaa.aaa")<BR>
{<BR>
xlog ("L_INFO", "This is a request for A Plan");<BR>
force_send_socket(udp:xxx.xxx.xxx.xxx:5060);<BR>
}<BR>
else<BR>
{<BR>
xlog ("L_INFO", "This is a request for another plan");<BR>
force_send_socket(udp:yyy.yyy.yyy.yyy:5060);<BR>
};<BR>
}<BR>
<BR>
<BR>
Stagg<BR>
<BR>
<BR>
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’t seem to do the force_send_socket at the point of when next_gw() is called in the failure route. <BR>
<BR>
Is there anyway to clear and/or re-assign the data that is making it where I can’t re-write the transaction to come from another IP addy?<BR>
<BR>
<BR>
On 1/29/11 11:01 AM, "Graham Wooden" <<a href="graham@g-rock.net">graham@g-rock.net</a>> wrote:<BR>
<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Stagg, <BR>
<BR>
While the Ips are the same, the suggestion to use “rd” along with an entry in the “hostname” column appears to be what I want. <BR>
<BR>
I assigned in my DNS some testing hostnames to the single IP in question. When debugging, I see that rd contains the hostname, not the IP. 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. Everything that I have read so far is that the gw_name is just information, the module doesn’t actually have access to it. Boo.<BR>
<BR>
-graham<BR>
<BR>
<BR>
On 1/29/11 8:36 AM, "GP Wooden" <<a href="graham@g-rock.net">graham@g-rock.net</a>> wrote:<BR>
<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: "Stagg Shelton" <<a href="stagg@vocalcloud.com">stagg@vocalcloud.com</a>><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: <<a href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><BR>
<BR>
Do the provider gateways have the same IP address for the different rate <BR>
plans? If the gateways are different then the following may be relevant.<BR>
<BR>
if (next_gw()) {<BR>
# prepare for lcr failover<BR>
t_on_failure("2");<BR>
if($rd=="aaa.aaa.aaa.aaa")<BR>
{<BR>
xlog ("L_INFO", "This is a request for Some Rate Plan");<BR>
force_send_socket(udp:xxx.xxx.xxx.xxx:5060);<BR>
}<BR>
else<BR>
{<BR>
xlog ("L_INFO", "This is a request for another rate <BR>
plan");<BR>
force_send_socket(udp:yyy.yyy.yyy.yyy:5060);<BR>
};<BR>
route(2);<BR>
} else {<BR>
xlog("No gateways found!");<BR>
<BR>
<BR>
Stagg<BR>
<BR>
On 1/29/11 9:10 AM, Graham Wooden wrote:<BR>
> Hi there,<BR>
><BR>
> I have a requirement now that for one of my GW¹s in my LCR, needs to be<BR>
> sourced from another IP address (two different rate-decks with the carrier).<BR>
> This ratedeck will always be at least 2nd inline ...<BR>
><BR>
> I was thinking something along the sorts ... Some pseudo code:<BR>
><BR>
> failure_route [2] {<BR>
> .<BR>
> .<BR>
> if (next_gw()) {<BR>
> if ( name = 'gw_name') {<BR>
> force_send_socket(udp:ip.address.of.certain.ip:5060);<BR>
> } else {<BR>
> # just dummy, as we will send out our default IP for everyone<BR>
> else.<BR>
> }<BR>
> t_on_failure("2");<BR>
> route(19);<BR>
> }<BR>
> .<BR>
> .<BR>
> .<BR>
> }<BR>
><BR>
> What variable will have the value that's in the gw_name column? I can't go<BR>
> by the IP address in $ru because the destination IP is the same between the<BR>
> two ratedecks.<BR>
><BR>
> Overall, Is that the best way to handle this requirement?<BR>
><BR>
> Thanks all,<BR>
><BR>
> -graham<BR>
><BR>
><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>
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>
<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>
<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
<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>