<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hello Jeff,<br>
        <br>
        Perfect - I will take care on my side to improve the docs for
        append_branch() and maybe upload a short tutorial on how to do a
        3xx redirect.<br>
        <br>
        Best regards,<br>
      </tt>
      <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
      On 21.02.2014 17:58, Jeff Pyle wrote:<br>
    </div>
    <blockquote
cite="mid:CACYJG3KJ-GOs+g+4G7jiQrMOqw+nC2ywdTtYReVOO_sTG3cVOg@mail.gmail.com"
      type="cite">
      <div dir="ltr">It works quite well. &nbsp;Here is my config chunk:
        <div><br>
        </div>
        <blockquote style="margin:0 0 0 40px;border:none;padding:0px">
          <div>
            <div><font face="courier new, monospace" size="1">route[3] {<span
                  class="" style="white-space:pre"> </span># 302
                Redirect for inbound traffic</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>if
                (!is_gflag("1")) {<span class="" style="white-space:pre">
                </span># Secondary server</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>$var(rU) =
                $rU;</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>$ru = "sip:"
                + $var(rU) + "@<a moz-do-not-send="true"
                  href="http://10.9.8.2:5060">10.9.8.2:5060</a>";</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>$ru_q = 400;</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>setflag(1);</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>}</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><br>
              </font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>if
                (!is_gflag("0")) {<span class="" style="white-space:pre">
                </span># Primary server</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>if
                (isflagset(1)) append_branch();</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>$ru = "sip:"
                + $var(rU) + "@<a moz-do-not-send="true"
                  href="http://10.9.8.1:5060">10.9.8.1:5060</a>";</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>$ru_q = 500;</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>setflag(1);</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>}</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><br>
              </font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>if
                (isflagset(1)) {<span class="" style="white-space:pre">
                </span># Send 302 if at least one set</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>sl_send_reply("302",
                "Inbound Redirect");</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>} else {<span
                  class="" style="white-space:pre"> </span># or 503 if
                none set</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>sl_send_reply("503",
                "Service Unavailable");</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>}</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><br>
              </font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1"><span
                  class="" style="white-space:pre"> </span>exit;</font></div>
          </div>
          <div>
            <div><font face="courier new, monospace" size="1">}</font></div>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>In the future this will become more sophisticated with
          db/cache lookups, etc. &nbsp;For now gflags provides enough control
          to toggle out a proxy from the 302 reply if necessary.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>- Jeff</div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, Feb 20, 2014 at 10:25 AM,
            Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                moz-do-not-send="true" href="mailto:bogdan@opensips.org"
                target="_blank">bogdan@opensips.org</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <div><tt>Yes, it should be 1.8 compatible. Just let me
                    know if it does the trick, I'm really curious :).<br>
                    <br>
                    Regards,<br>
                  </tt>
                  <div class="">
                    <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                  </div>
                  <div>
                    <div class="h5"> On 20.02.2014 17:07, Jeff Pyle
                      wrote:<br>
                    </div>
                  </div>
                </div>
                <div>
                  <div class="h5">
                    <blockquote type="cite">Perfect, I'll try this soon.
                      &nbsp;Do you expect&nbsp;<span></span>this to work as far
                      back as 1.8?
                      <div><br>
                        <br>
                        On Thursday, February 20, 2014, Bogdan-Andrei
                        Iancu &lt;<a moz-do-not-send="true"
                          href="mailto:bogdan@opensips.org"
                          target="_blank">bogdan@opensips.org</a>&gt;
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div text="#000000" bgcolor="#FFFFFF">
                            <div><tt>Hi Jeff,<br>
                                <br>
                                Try :<br>
                                <br>
                                &nbsp;&nbsp;&nbsp; # first contact<br>
                                &nbsp;&nbsp;&nbsp; $ru = <a moz-do-not-send="true">"sip:firstcontact@foo.com"</a>;<br>
                                &nbsp;&nbsp;&nbsp; $ru_q = 500; # q for the first
                                contact<br>
                                &nbsp;&nbsp;&nbsp; # second contact<br>
                                &nbsp;&nbsp;&nbsp; append_branch(<a
                                  moz-do-not-send="true">"sip:secondcontact@foo.com"</a>,1000);<br>
                                &nbsp;&nbsp;&nbsp; ....<br>
                                &nbsp;&nbsp;&nbsp; t_reply("302","Redirected");<br>
                                <br>
                                Let me know if it works - revisiting the
                                links, I see the docs must be improved.<br>
                                <br>
                                Regards,<br>
                              </tt>
                              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                              On 20.02.2014 15:20, Jeff Pyle wrote:<br>
                            </div>
                            <blockquote type="cite">
                              <div dir="ltr">
                                <div>
                                  <div>
                                    <div dir="ltr">
                                      <div>Hi Bogdan,</div>
                                      <div><br>
                                      </div>
                                      <div>I'm not looking to process a
                                        received 302, but rather
                                        generate one of my own. &nbsp;I want
                                        to set the q values so that the
                                        other side will serially fork.
                                        &nbsp;Ovidiu's example [1] from
                                        earlier in the thread doesn't
                                        address this. &nbsp;Looking at the
                                        docs for append_branch() [2] or
                                        rewriteuri() [3] I don't see any
                                        mention either.</div>
                                      <div><br>
                                      </div>
                                      <div>&nbsp; [1]&nbsp;<a
                                          moz-do-not-send="true"
href="https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg"
                                          target="_blank">https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg</a></div>
                                      <div>&nbsp; [2]&nbsp;<a
                                          moz-do-not-send="true"
                                          href="http://www.opensips.org/Documentation/Script-CoreFunctions#toc2"
                                          target="_blank">http://www.opensips.org/Documentation/Script-CoreFunctions#toc2</a></div>
                                      <div>&nbsp; [3]&nbsp;<a
                                          moz-do-not-send="true"
                                          href="http://www.opensips.org/Documentation/Script-CoreFunctions#toc40"
                                          target="_blank">http://www.opensips.org/Documentation/Script-CoreFunctions#toc40</a><br>
                                        <br>
                                      </div>
                                    </div>
                                  </div>
                                  <div><br>
                                  </div>
                                  - Jeff</div>
                                <div><br>
                                  <br>
                                  <div>On Wed, Feb 19, 2014 at 1:05 PM,
                                    Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                                        moz-do-not-send="true">bogdan@opensips.org</a>&gt;</span>
                                    wrote:<br>
                                    <blockquote style="margin:0px 0px
                                      0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                                      <div text="#000000"
                                        bgcolor="#FFFFFF">
                                        <div><tt>Jeff,<br>
                                            <br>
                                            In OpenSIPS, the
                                            get_redirects() (<a
                                              moz-do-not-send="true"
href="http://www.opensips.org/html/docs/modules/1.10.x/uac_redirect.html#id250266"
                                              target="_blank">http://www.opensips.org/html/docs/modules/1.10.x/uac_redirect.html#id250266</a>)
                                            and the serialize_branches()
                                            (<a moz-do-not-send="true"
href="http://www.opensips.org/Documentation/Script-CoreFunctions-1-10#toc44"
                                              target="_blank">http://www.opensips.org/Documentation/Script-CoreFunctions-1-10#toc44</a>)
                                            do follow the q values in
                                            the handled contacts.<br>
                                            <br>
                                            Regards,<br>
                                          </tt>
                                          <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                                          <div>
                                            <div> On 19.02.2014 18:08,
                                              Jeff Pyle wrote:<br>
                                            </div>
                                          </div>
                                        </div>
                                        <div>
                                          <div>
                                            <blockquote type="cite">
                                              <div dir="ltr">
                                                <div>
                                                  <div>
                                                    <div dir="ltr">
                                                      <div>How does one
                                                        manage q values
                                                        for the various
                                                        branches? &nbsp;I'd
                                                        like the
                                                        endpoint
                                                        receiving the
                                                        302 to serially
                                                        fork through the
                                                        various URIs
                                                        (branches) I
                                                        include.</div>
                                                      <div><br>
                                                      </div>
                                                      <div><br>
                                                      </div>
                                                      <div>- Jeff</div>
                                                      <div><br>
                                                      </div>
                                                    </div>
                                                  </div>
                                                  <br>
                                                  <br>
                                                  <div>On Thu, Sep 19,
                                                    2013 at 11:26 AM,
                                                    Ovidiu Sas <span
                                                      dir="ltr">&lt;<a
                                                        moz-do-not-send="true">osas@voipembedded.com</a>&gt;</span>
                                                    wrote:<br>
                                                    <blockquote
                                                      style="margin:0px
                                                      0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                                                      Take a look at the
                                                      redirect example
                                                      in the source
                                                      tree:<br>
                                                      <a
                                                        moz-do-not-send="true"
href="https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg"
                                                        target="_blank">https://github.com/OpenSIPS/opensips/blob/master/examples/redirect.cfg</a><br>
                                                      <br>
                                                      Regards,<br>
                                                      Ovidiu Sas<br>
                                                      <div> </div>
                                                    </blockquote>
                                                  </div>
                                                </div>
                                              </div>
                                            </blockquote>
                                          </div>
                                        </div>
                                      </div>
                                    </blockquote>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                      <br>
                      -- <br>
                      <br>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>