<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=EUC-KR" http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    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>
    <br>
    branch_route[2] {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("new branch at $ru\n");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($rd=="aaa.aaa.aaa.aaa")<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog ("L_INFO", "This is a request for A Plan");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; force_send_socket(<a class="moz-txt-link-freetext" href="udp:xxx.xxx.xxx.xxx:5060">udp:xxx.xxx.xxx.xxx:5060</a>);<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog ("L_INFO", "This is a request for another plan");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; force_send_socket(<a class="moz-txt-link-freetext" href="udp:yyy.yyy.yyy.yyy:5060">udp:yyy.yyy.yyy.yyy:5060</a>);<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
    }<br>
    <br>
    <br>
    Stagg<br>
    <br>
    <br>
    On 1/29/11 12:32 PM, Graham Wooden wrote:
    <blockquote cite="mid:C969AB55.2B2C4%25graham@g-rock.net"
      type="cite">
      <title>Re: [SR-Users] LCR next_gw() - certain GW, source from
        other IP address</title>
      <font face="Calibri, Verdana, Helvetica, Arial"><span
          style="font-size: 11pt;">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 &nbsp;route. &nbsp;<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" &lt;<a
            moz-do-not-send="true" 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;">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. &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¡¯t actually have access to
            it. Boo.<br>
            <br>
            -graham<br>
            <br>
            <br>
            On 1/29/11 8:36 AM, "GP Wooden" &lt;<a
              moz-do-not-send="true" 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: "Stagg Shelton" &lt;<a moz-do-not-send="true"
                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 moz-do-not-send="true"
                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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# prepare for lcr failover<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_on_failure("2");<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($rd=="aaa.aaa.aaa.aaa")<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;&nbsp;&nbsp;xlog ("L_INFO", "This is a request for
              Some Rate Plan");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(<a class="moz-txt-link-freetext" href="udp:xxx.xxx.xxx.xxx:5060">udp:xxx.xxx.xxx.xxx:5060</a>);<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;else<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;&nbsp;&nbsp;xlog ("L_INFO", "This is a request for
              another rate <br>
              plan");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;force_send_socket(<a class="moz-txt-link-freetext" href="udp:yyy.yyy.yyy.yyy:5060">udp:yyy.yyy.yyy.yyy:5060</a>);<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("No gateways found!");<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©ö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(<a class="moz-txt-link-freetext" href="udp:ip.address.of.certain.ip:5060">udp:ip.address.of.certain.ip:5060</a>);<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("2");<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 moz-do-not-send="true"
                href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
              &gt; <a moz-do-not-send="true"
                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 moz-do-not-send="true"
                href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
              <a moz-do-not-send="true"
                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 moz-do-not-send="true"
                  href="sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
                <a moz-do-not-send="true"
                  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>
        <font face="Calibri, Verdana, Helvetica, Arial"><span
            style="font-size: 11pt;"><br>
          </span></font></blockquote>
    </blockquote>
  </body>
</html>