<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Gomtesh,<br>
    <br>
    Theoretically it is possible, but it is not trivial or simple. <br>
    <br>
    I'm still recommending you to do it from script by using the
    remove_branch() function and keeping in localcache the index of the
    last removed contact.<br>
    <br>
    Regards,<br>
    <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>
    <br>
    On 01/31/2013 10:14 AM, Gomtesh Jain wrote:
    <blockquote
cite="mid:CAFMhgaaUyKREW5kJWm4rycdGOFDibrBzW2c=UzTvTtLU1a2EpA@mail.gmail.com"
      type="cite">Hi Duane/Bogdan ,
      <div>&nbsp;&nbsp;</div>
      <div>&nbsp; &nbsp; Yes I want to do Round Robin distribution of calls .&nbsp;</div>
      <div><br>
      </div>
      <div>&nbsp; &nbsp; &nbsp;To remove branch , I will have to know which branch got
        the last call . For that I need to keep contact in cache .&nbsp;</div>
      <div><br>
      </div>
      <div>In lookup.c &nbsp;after getting records and setting RURI , what if
        I do ul.update_ucontact() for first contact in the list .&nbsp;</div>
      <div>Something like this ..</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div>&nbsp;res = ul.get_urecord((udomain_t*)_t, &amp;aor, &amp;r);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; if (res &gt; 0) {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("'%.*s' Not found in usrloc\n",
          aor.len, ZSW(aor.s));</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ul.unlock_udomain((udomain_t*)_t,
          &amp;aor);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
      </div>
      <div><br>
      </div>
      <div>.</div>
      <div>.</div>
      <div>.</div>
      <div><br>
      </div>
      <div>
        <div>&nbsp;if (ptr) {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_DBG("setting as ruri
          &lt;%.*s&gt;\n",ptr-&gt;c.len,ptr-&gt;c.s);</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (set_ruri(_m, &amp;ptr-&gt;c) &lt; 0) {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("unable to rewrite
          Request-URI\n");</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = -3;</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; goto done;</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
      </div>
      <div>.</div>
      <div>.</div>
      <div>.</div>
      <div>.</div>
      <div>set_ruri_q(ptr-&gt;q);</div>
      <div>.</div>
      <div>.</div>
      <div>.</div>
      <div>.</div>
      <div>ul.update_contact (); &nbsp;to update q value of contact&nbsp;</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Will that work ? ...Any side effect ?</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Thanx,</div>
      <div>Gomtesh<br>
        <br>
        <div class="gmail_quote">On Thu, Jan 31, 2013 at 12:05 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: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div bgcolor="#ffffff" text="#000000"> <tt>Hi, <br>
                <br>
                I agree with Duane - what you are trying to do is
                exceeding the purpose of registration - you want to do a
                Round Robin between the 2 registered contacts.<br>
                <br>
                What you could try is to let lookup() to bring both of
                them and to drop one of the contacts from script (wither
                simply removing the branch via $branch var, either via
                branch route).<br>
                <br>
                Regards,<br>
              </tt>
              <div class="im">
                <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>
                <br>
              </div>
              <div>
                <div class="h5"> On 01/30/2013 12:18 PM, Gomtesh Jain
                  wrote:
                  <blockquote type="cite"><br>
                    <div class="gmail_quote">
                      <blockquote class="gmail_quote" style="margin: 0pt
                        0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                        204, 204); padding-left: 1ex;">Thanx Duane &nbsp;for
                        replying &nbsp;the mail ..
                        <div><br>
                        </div>
                        <div>Let me explain you my scenario ...</div>
                        <div><br>
                        </div>
                        <div>&nbsp; I have 2 &nbsp;registered contact&nbsp;</div>
                        <div>&nbsp; &nbsp; &nbsp;1 . 1234 (q value .9)</div>
                        <div>&nbsp; &nbsp; &nbsp;2 &nbsp; &nbsp;5678 (q value .8)</div>
                        <div><br>
                        </div>
                        <div>On IIVITE after lookup() 1234 will be on
                          top of list . So after lookup I just want to
                          update contact 1234 with q value .7 in
                          memory/data base .</div>
                        <div>So that for next call 5678 should come on
                          top of the list for 2nd INVITE .</div>
                        <div><br>
                        </div>
                        <div>So I want make changes in memory/database
                          so that 5678 should be picked up as first
                          contact by very next INVITE .</div>
                        <div><br>
                        </div>
                        <div>Thanx,</div>
                        <div>Gomtesh</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div> <br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                        <div><br>
                          <br>
                          <div class="gmail_quote">On Wed, Jan 30, 2013
                            at 1:50 AM, <span dir="ltr">&lt;<a
                                moz-do-not-send="true"
                                href="mailto:users-request@lists.opensips.org"
                                target="_blank">users-request@lists.opensips.org</a>&gt;</span>
                            wrote:<br>
                            <blockquote class="gmail_quote"
                              style="margin: 0pt 0pt 0pt 0.8ex;
                              border-left: 1px solid rgb(204, 204, 204);
                              padding-left: 1ex;">Send Users mailing
                              list submissions to<br>
                              &nbsp; &nbsp; &nbsp; &nbsp; <a moz-do-not-send="true"
                                href="mailto:users@lists.opensips.org"
                                target="_blank">users@lists.opensips.org</a><br>
                              <br>
                              To subscribe or unsubscribe via the World
                              Wide Web, visit<br>
                              &nbsp; &nbsp; &nbsp; &nbsp; <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><br>
                              or, via email, send a message with subject
                              or body 'help' to<br>
                              &nbsp; &nbsp; &nbsp; &nbsp; <a moz-do-not-send="true"
                                href="mailto:users-request@lists.opensips.org"
                                target="_blank">users-request@lists.opensips.org</a><br>
                              <br>
                              You can reach the person managing the list
                              at<br>
                              &nbsp; &nbsp; &nbsp; &nbsp; <a moz-do-not-send="true"
                                href="mailto:users-owner@lists.opensips.org"
                                target="_blank">users-owner@lists.opensips.org</a><br>
                              <br>
                              When replying, please edit your Subject
                              line so it is more specific<br>
                              than "Re: Contents of Users digest..."<br>
                              <br>
                              <br>
                              Today's Topics:<br>
                              <br>
                              &nbsp; &nbsp;1. Re: Failover and dialog termination
                              (microx)<br>
                              &nbsp; &nbsp;2. Re: Decrease the priority of contact
                              (Duane Larson)<br>
                              &nbsp; &nbsp;3. Re: Carrierroute failure route
                              enhancement (Samuel Muller)<br>
                              &nbsp; &nbsp;4. [RELEASE] OpenSIPS 1.9.0 - a new
                              major release is out<br>
                              &nbsp; &nbsp; &nbsp; (Bogdan-Andrei Iancu)<br>
                              &nbsp; &nbsp;5. [RELEASES] Support and management of
                              OpenSIPS &nbsp; &nbsp; release -<br>
                              &nbsp; &nbsp; &nbsp; IMPORTANT (Bogdan-Andrei Iancu)<br>
                              &nbsp; &nbsp;6. Re: [RELEASE] OpenSIPS 1.9.0 - a new
                              major release is out (Bakko)<br>
                              &nbsp; &nbsp;7. Re: [OpenSIPS-Devel] [RELEASE]
                              OpenSIPS 1.9.0 - a new major<br>
                              &nbsp; &nbsp; &nbsp; release is out (Sa?l Ibarra
                              Corretg?)<br>
                              <br>
                              <br>
----------------------------------------------------------------------<br>
                              <br>
                              Message: 1<br>
                              Date: Tue, 29 Jan 2013 06:12:46 -0800
                              (PST)<br>
                              From: microx &lt;<a moz-do-not-send="true"
                                href="mailto:acmicrox@gmail.com"
                                target="_blank">acmicrox@gmail.com</a>&gt;<br>
                              Subject: Re: [OpenSIPS-Users] Failover and
                              dialog termination<br>
                              To: <a moz-do-not-send="true"
                                href="mailto:users@lists.opensips.org"
                                target="_blank">users@lists.opensips.org</a><br>
                              Message-ID: &lt;<a moz-do-not-send="true"
href="mailto:1359468766526-7584255.post@n2.nabble.com" target="_blank">1359468766526-7584255.post@n2.nabble.com</a>&gt;<br>
                              Content-Type: text/plain; charset=us-ascii<br>
                              <br>
                              Hi Schneur,<br>
                              <br>
                              Yes, the two proxy servers PA and PB are
                              using the same database. And the<br>
                              db_mode regarding dialog<br>
                              is set to 1 to make each dialog be written
                              into memory as well as the<br>
                              database.<br>
                              <br>
                              What do you mean master/master
                              replication? Can you specify your method?<br>
                              Thanks so much.<br>
                              <br>
                              Best wishes,<br>
                              Chen-Che<br>
                              <br>
                              <br>
                              <br>
                              --<br>
                              View this message in context: <a
                                moz-do-not-send="true"
href="http://opensips-open-sip-server.1449251.n2.nabble.com/Failover-and-dialog-termination-tp7584192p7584255.html"
                                target="_blank">http://opensips-open-sip-server.1449251.n2.nabble.com/Failover-and-dialog-termination-tp7584192p7584255.html</a><br>
                              Sent from the OpenSIPS - Users mailing
                              list archive at Nabble.com.<br>
                              <br>
                              <br>
                              <br>
                              ------------------------------<br>
                              <br>
                              Message: 2<br>
                              Date: Tue, 29 Jan 2013 10:39:22 -0600<br>
                              From: Duane Larson &lt;<a
                                moz-do-not-send="true"
                                href="mailto:duane.larson@gmail.com"
                                target="_blank">duane.larson@gmail.com</a>&gt;<br>
                              Subject: Re: [OpenSIPS-Users] Decrease the
                              priority of contact<br>
                              To: OpenSIPS users mailling list &lt;<a
                                moz-do-not-send="true"
                                href="mailto:users@lists.opensips.org"
                                target="_blank">users@lists.opensips.org</a>&gt;<br>
                              Message-ID:<br>
                              &nbsp; &nbsp; &nbsp; &nbsp; &lt;<a moz-do-not-send="true"
href="mailto:CAFcM1EqZxr_FhVkJswpBNPK5wueE-9PvJPJFCof0nr4GHAtpDg@mail.gmail.com"
                                target="_blank">CAFcM1EqZxr_FhVkJswpBNPK5wueE-9PvJPJFCof0nr4GHAtpDg@mail.gmail.com</a>&gt;<br>
                              Content-Type: text/plain;
                              charset="iso-8859-1"<br>
                              <br>
                              I'm not 100% sure what you are trying to
                              do. &nbsp;I needed to do some serial<br>
                              calling and here is what I did<br>
                              <br>
                              <a moz-do-not-send="true"
href="http://opensips-open-sip-server.1449251.n2.nabble.com/opensips-Bugs-3349030-Need-access-to-SIP-URI-Q-Value-td6554597.html"
                                target="_blank">http://opensips-open-sip-server.1449251.n2.nabble.com/opensips-Bugs-3349030-Need-access-to-SIP-URI-Q-Value-td6554597.html</a><br>
                              <br>
                              <a moz-do-not-send="true"
                                href="http://www.opensips.org/Resources/DocsCoreVar19#toc75"
                                target="_blank">http://www.opensips.org/Resources/DocsCoreVar19#toc75</a>
                              <div>
                                <div><br>
                                  <br>
                                  <br>
                                  <br>
                                  On Tue, Jan 29, 2013 at 2:02 AM,
                                  Gomtesh Jain &lt;<a
                                    moz-do-not-send="true"
                                    href="mailto:gomtesh@gmail.com"
                                    target="_blank">gomtesh@gmail.com</a>&gt;

                                  wrote:<br>
                                  <br>
                                  &gt; Hi ,<br>
                                  &gt; &nbsp; &nbsp;I want to decrease the
                                  priority (q value) of contact (in
                                  memory &amp;<br>
                                  &gt; database)as soon as it comes on
                                  top of the list after lookup. So that
                                  next<br>
                                  &gt; call should not pick this contact
                                  (if other contacts are registered). As<br>
                                  &gt; soon as call finishes client will
                                  refresh its registration with original
                                  q<br>
                                  &gt; value.<br>
                                  &gt; How can I do this either in
                                  script after lookup() or in code in
                                  around<br>
                                  &gt; lookup.c ?<br>
                                  &gt;<br>
                                  &gt; Can someone help me on this ?<br>
                                  &gt;<br>
                                  &gt; Thanx,<br>
                                  &gt; Gomtesh<br>
                                  &gt;<br>
                                  &gt;<br>
                                  &gt;<br>
                                </div>
                              </div>
                              &gt;
                              _______________________________________________<br>
                              &gt; Users mailing list<br>
                              &gt; <a moz-do-not-send="true"
                                href="mailto:Users@lists.opensips.org"
                                target="_blank">Users@lists.opensips.org</a><br>
                              &gt; <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><br>
                              &gt;<br>
                              &gt;<br>
                              <br>
                              <br>
                              --<br>
                              --<br>
                              *--*--*--*--*--*<br>
                              Duane<br>
                              *--*--*--*--*--*<br>
                              --<br>
                              -------------- next part --------------<br>
                              An HTML attachment was scrubbed...<br>
                              URL: &lt;<a moz-do-not-send="true"
href="http://lists.opensips.org/pipermail/users/attachments/20130129/d66ee50b/attachment-0001.htm"
                                target="_blank">http://lists.opensips.org/pipermail/users/attachments/20130129/d66ee50b/attachment-0001.htm</a>&gt;<br>
                            </blockquote>
                          </div>
                        </div>
                      </blockquote>
                    </div>
                    <pre><fieldset></fieldset>
_______________________________________________
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>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
  </body>
</html>