<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I am not very familiar with the code of the lcr module to see if you
    get access to the destination addresses via some variables, but
    probably you can try to do a loop on next_gw():<br>
    <br>
    while(next_gw()) {<br>
    &nbsp;&nbsp;&nbsp; km_append_branch();<br>
    }<br>
    sl_send_reply("302","Moved Temporary&#8221;);<br>
    exit;<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 9/12/12 2:57 PM, Fatima
      Chahrour~Vanrise Support wrote:<br>
    </div>
    <blockquote cite="mid:02e401cd90e6$2beb6f60$83c24e20$@com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Any help?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Cheers,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">F Chahrour<o:p></o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
                <a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
                [<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>] <b>On
                  Behalf Of </b>Fatima Chahrour~Vanrise Support<br>
                <b>Sent:</b> Tuesday, September 11, 2012 11:37 AM<br>
                <b>To:</b> 'SIP Router - Kamailio (OpenSER) and SIP
                Express Router (SER) - Users Mailing List';
                <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
                <b>Subject:</b> Re: [SR-Users] Kamailio-Redirect based
                LCR routing<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal"><span style="color:#1F497D">Hi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Sorry!!! You
            already mentioned to me that I should use
            km_append_branch(&#8220;uri&#8221;) in order to send multiple contacts.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">I tried it now
            as follow:<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Km_append_branch($ru) or Km_append_branch()
          <o:p></o:p></p>
        <p class="MsoNormal"><span style="color:#1F497D">&nbsp;</span>sl_send_reply("302","Moved
          Temporary&#8221;)<span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Am getting in
            the contacts the first lcr_gw twice;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Contact: <a
              moz-do-not-send="true"
              href="sip:961377888@192.168.111.195">sip:961377888@192.168.111.195</a>,
            <a moz-do-not-send="true"
              href="sip:961377888@192.168.111.195">sip:961377888@192.168.111.195</a>.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">What variable
            should I use to list all contacts of lcr_gw?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Kind regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">F Chahrour<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
                <a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
                [<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>] <b>On
                  Behalf Of </b>Fatima Chahrour~Vanrise Support<br>
                <b>Sent:</b> Monday, September 10, 2012 11:50 PM<br>
                <b>To:</b> 'SIP Router - Kamailio (OpenSER) and SIP
                Express Router (SER) - Users Mailing List';
                <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
                <b>Subject:</b> [SR-Users] Kamailio-Redirect based LCR
                routing<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Dear Daniel\List,<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Following up to a previous post where I was
          able in my testing lab to redirect call with 1<sup>st</sup>
          destination of lcr_gw table to another Kamailio(acting as any
          SBC) with Daniels assist, I need a hand in redirecting the
          call with multiple contacts , basically based on the lcr
          routing rule configured in kamailio LCR module for the
          rerouted call. <o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Is this possible using code 300 with
          multiple choices message? Or you advise me with another
          method?<o:p></o:p></p>
        <p class="MsoNormal">If 300 redirect message works, what should
          be the variable set as $ru to get all lcr_gw destinations?<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Example for clarification: <o:p></o:p></p>
        <p class="MsoNormal">My current redirect script used after lcr
          functions is :<o:p></o:p></p>
        <p class="MsoNormal">&#8230;.<o:p></o:p></p>
        <p class="MsoNormal">$ru= $ru;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></p>
        <p class="MsoNormal">sl_send_reply("302","Moved
          Temporary");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <o:p></o:p></p>
        <p class="MsoNormal">&#8230;.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">This script is successfully sending the 302
          message with Contact: <a moz-do-not-send="true"
            href="sip:1119613454646@192.168.111.195">sip:1119613454646@192.168.111.195</a>.
          (1119613454646 is the dialed number with prefix,
          192.168.111.195 is first lcr_gw ip). Now if the call to
          192.168.111.195 is failed and I need to redirect the second
          destination, second lcr_gw ip, how can I achieve this?<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Thank you for your usual response.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal">Kind Regards,<o:p></o:p></p>
        <p class="MsoNormal">F Chahrour<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a></pre>
  </body>
</html>