<div dir="ltr">Bogdan,<div><br></div><div><br></div><div>I tried this </div><div>







<p class=""><span class="">$var(i) = 0;</span></p>
<p class=""><span class="">while ($(branch(uri)[$var(i)]) != null &amp;&amp; $var(i) &lt; 5) {</span></p>
<p class=""><span class="">   xlog(&quot;$$(branch(uri)[$var(i)])=[$(branch(uri)[$var(i)])]\n&quot;);</span></p>
<p class=""><span class="">   if ($(branch(uri)[$var(i)]{uri.transport}) == &quot;ws&quot;) {</span></p>
<p class=""><span class="">       xlog(&quot; ws branch found number $var(i) with URI=[$(branch(uri)[$var(i)])]\n&quot;);</span></p>
<p class=""><span class="">       #remove_branch($var(i));</span></p>
<p class=""><span class="">       $(branch(q)[$var(i)]) = 380;</span></p>
<p class=""><span class="">        xlog(&quot;$(branch(q)[$var(i)]) confirming q value for branch $(branch(uri)[$var(i)])\n&quot;);</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">   } else {</span></p>
<p class=""><span class="">       $var(i) = $var(i) + 1;</span></p>
<p class=""><span class="">   }</span></p>
<p class=""><span class="">        xlog(&quot;$(branch(duri)[*]) finished looping through all branches\n&quot;);</span></p>
<p class=""><span class="">}</span></p><p class=""><span class=""><br></span></p><p class=""><span class=""><br></span></p><p class=""><span class="">but it appears that lookup will only provide the every other branch that isn&#39;t the first. I can&#39;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&#39;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 class=""><span class=""><br></span></p><p class=""><span class="">Thanks,</span></p><p class=""><span class="">Tito</span></p><p class=""><span class=""><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 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 class="">
    <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
    </span><div><div class="h5"><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 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 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 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 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 href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a 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>