<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Hi Tito,<br>
      <br>
      See the link I already gave you on the $ru_q variable:<br>
         
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-CoreVar-1-11#toc77">http://www.opensips.org/Documentation/Script-CoreVar-1-11#toc77</a><br>
      <br>
      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>
    <div class="moz-cite-prefix">On 28.10.2015 19:20, Tito Cumpen wrote:<br>
    </div>
    <blockquote
cite="mid:CANZPVB5qPwiOuLcdV1_0HOCCpGPUfjQG5-50E=gSQhs7fYCr6w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <table class="" style="font-size:12.8px" cellpadding="0">
          <tbody>
            <tr class="">
              <td class="" style="width:675px">Bogdan,<br>
                <br>
                Is there way to modify the q value of the RURI? say the
                first contact is of sip transport and I need to
                rearrange the order so that the this branch(first
                contact that happens to be a sip branch ) is called
                after all ws branches? I reiterate the only reason for
                this that rtpengine will replace media params if sip and
                ws are handled back to back.<br>
                <a moz-do-not-send="true"
                  href="https://github.com/sipwise/rtpengine/issues/118">https://github.com/sipwise/rtpengine/issues/118</a><br>
                Therefore I in the ideal scenario I will make offers to
                all ws records at once then all sip clients thereafter.<br>
                <br>
                <br>
                Thanks,<br>
                Tito</td>
              <td class=""><br>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Oct 26, 2015 at 4:31 PM,
          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"> <tt>Hi Tito,<br>
                <br>
                yes, the first contact is pushed into RURI and not into
                contacts. So additionally you need to check that too.
                See:<br>
                    <a moz-do-not-send="true"
                  href="http://www.opensips.org/Documentation/Script-CoreVar-1-11#toc77"
                  target="_blank">http://www.opensips.org/Documentation/Script-CoreVar-1-11#toc77</a><br>
                <br>
                After 1) did lookup(location) and 2) set the new q
                values , do serialize_branches() -&gt; this will
                re-arrange them according to the q value. See :<br>
                    <a moz-do-not-send="true"
href="http://www.opensips.org/Documentation/Script-CoreFunctions-1-11#toc44"
                  target="_blank">http://www.opensips.org/Documentation/Script-CoreFunctions-1-11#toc44</a><br>
                <br>
                Regards,<br>
              </tt><span 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>
              </span>
              <div>
                <div class="h5">
                  <div>On 21.10.2015 03:48, Tito Cumpen wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Bogdan,
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>I tried this </div>
                      <div>
                        <p><span>$var(i) = 0;</span></p>
                        <p><span>while ($(branch(uri)[$var(i)]) != null
                            &amp;&amp; $var(i) &lt; 5) {</span></p>
                        <p><span>  
                            xlog("$$(branch(uri)[$var(i)])=[$(branch(uri)[$var(i)])]\n");</span></p>
                        <p><span>   if
                            ($(branch(uri)[$var(i)]{uri.transport}) ==
                            "ws") {</span></p>
                        <p><span>       xlog(" ws branch found number
                            $var(i) with
                            URI=[$(branch(uri)[$var(i)])]\n");</span></p>
                        <p><span>       #remove_branch($var(i));</span></p>
                        <p><span>       $(branch(q)[$var(i)]) = 380;</span></p>
                        <p><span>        xlog("$(branch(q)[$var(i)])
                            confirming q value for branch
                            $(branch(uri)[$var(i)])\n");</span></p>
                        <p><span></span><br>
                        </p>
                        <p><span>   } else {</span></p>
                        <p><span>       $var(i) = $var(i) + 1;</span></p>
                        <p><span>   }</span></p>
                        <p><span>        xlog("$(branch(duri)[*])
                            finished looping through all branches\n");</span></p>
                        <p><span>}</span></p>
                        <p><span><br>
                          </span></p>
                        <p><span><br>
                          </span></p>
                        <p><span>but it appears that lookup will only
                            provide the every other branch that isn't
                            the first. I can't control which AOR is
                            added first or second which I must do to
                            prioritize ws . Is there anyway to access
                            all of those contacts and put them in an
                            array? I am hitting a max while loop error
                            here when there is more than one aor. by
                            default all records get a q value of 1. So I
                            am attempting to go under the value for all
                            ws aor contacts and serial fork. Hopefully
                            I'll be able to call all ws contacts in
                            parallel then all standard sip clients in
                            parallel as they all should posses a q value
                            of 1.</span></p>
                        <p><span><br>
                          </span></p>
                        <p><span>Thanks,</span></p>
                        <p><span>Tito</span></p>
                        <p><span><br>
                          </span></p>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Tue, Jul 7, 2015 at
                        7:01 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"> <tt>Hi
                              Tito,<br>
                              <br>
                              Try $(branch(uri)[x]{uri.transport}) to
                              get the transport param from the URI.<br>
                              <br>
                              Or, look into the </tt><tt>$(branch(socket)[x]{s.select,0,:})

                              - the proto of the sending socket.<br>
                              <br>
                              Regards,<br>
                            </tt><span>
                              <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>
                            </span>
                            <div>
                              <div>
                                <div>On 07.07.2015 12:14, Tito Cumpen
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">Bogdan,
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>Thanks for your reply. These
                                      variables seem like a step in the
                                      right direction although it raises
                                      another question as to how to
                                      access the branches and check the
                                      destination proto. How does one
                                      access the array of branches?
                                      Would they have to be casted and
                                      lopped and checked against a
                                      regex? <strong>dP seems to provide
                                        the proto but what would be
                                        provided in the case of various
                                        destination protos as in the
                                        case of sip and ws?</strong></div>
                                    <div><strong><br>
                                      </strong></div>
                                    <div><strong><br>
                                      </strong></div>
                                    <div><strong>Thanks,</strong></div>
                                    <div><font color="#666666"
                                        face="Trebuchet MS, sans-serif,
                                        Verdana, Arial"><span
                                          style="font-size:13.0080003738403px;line-height:21.5932807922363px"><b>Tito</b></span></font></div>
                                  </div>
                                  <div class="gmail_extra"><br>
                                    <div class="gmail_quote">On Thu, Jul
                                      2, 2015 at 9:31 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"> <tt>Hi
                                            Tito,<br>
                                            <br>
                                            The registrar module
                                            (responsible for extracting
                                            the contacts from SIP msg
                                            and storing into USRLOC)
                                            takes the q value from the
                                            Contact header (as SIP RFC
                                            requires). <br>
                                            Currently there is no way to
                                            change the q value (from
                                            script level) before saving
                                            into USRLOC.<br>
                                            <br>
                                            But what you can do is to
                                            change the q values after
                                            the lookup (when loaded into
                                            msg from USRLOC).<br>
                                            <br>
                                            Take a look at branch
                                            variable $branch(q) :<br>
                                                <a
                                              moz-do-not-send="true"
                                              href="http://www.opensips.org/Documentation/Script-CoreVar-2-1#toc22"
                                              target="_blank">http://www.opensips.org/Documentation/Script-CoreVar-2-1#toc22</a><br>
                                            and $ru_q (q value for RURI)
                                            :<br>
                                                <a
                                              moz-do-not-send="true"
                                              href="http://www.opensips.org/Documentation/Script-CoreVar-2-1#toc77"
                                              target="_blank">http://www.opensips.org/Documentation/Script-CoreVar-2-1#toc77</a><br>
                                            <br>
                                            and you may change the q
                                            values and do a
                                            serialize_branches() after
                                            that.<br>
                                            <br>
                                            Best 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>
                                          <span>
                                            <div>On 01.07.2015 19:57,
                                              Tito Cumpen wrote:<br>
                                            </div>
                                          </span>
                                          <blockquote type="cite"><span>
                                              <div dir="ltr">Group,
                                                <div>
                                                  <div
                                                    style="outline:none;font-size:medium">
                                                    <div
style="margin-bottom:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-radius:0px;width:1104.23608398438px;float:none!important">
                                                      <div
style="padding-top:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-bottom-color:rgb(216,216,216);border-top-color:rgb(216,216,216);border-radius:0px;margin-bottom:0px;margin-left:0px;margin-right:0px">
                                                        <div>
                                                          <div
                                                          style="padding-bottom:20px;padding-left:8px">
                                                          <div
                                                          style="margin-left:44px">
                                                          <div
style="font-size:12.8000001907349px;margin-bottom:0px;margin-left:0px;padding-bottom:5px">
                                                          <div
                                                          style="overflow:hidden">
                                                          <div dir="ltr"><br>
                                                          <br>
                                                          </div>
                                                          <div dir="ltr">Is
                                                          it possible to
                                                          set the q
                                                          value upon
                                                          registration?
                                                          I need to set
                                                          ws
                                                          destinations
                                                          to a lower q
                                                          value as
                                                          rtpengine has
                                                          a limitation
                                                          on sending
                                                          different
                                                          media params
                                                          on a per
                                                          branch basis
                                                          in parallel.
                                                          Or should I
                                                          loop into the
                                                          branches with
                                                          a certain
                                                          attribute and
                                                          order them
                                                          before
                                                          serializing
                                                          them? </div>
                                                          <div><span
                                                          style="font-size:12.8000001907349px"><br>
                                                          </span></div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </div>
                                                  </div>
                                                </div>
                                              </div>
                                              <br>
                                              <fieldset></fieldset>
                                              <br>
                                            </span>
                                            <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                                          </blockquote>
                                          <br>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>