Hi Gomtesh,

Theoretically it is possible, but it is not trivial or simple.

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.

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 01/31/2013 10:14 AM, Gomtesh Jain wrote:
Hi Duane/Bogdan ,
    Yes I want to do Round Robin distribution of calls .

To remove branch , I will have to know which branch got the last call . For that I need to keep contact in cache .

In lookup.c after getting records and setting RURI , what if I do ul.update_ucontact() for first contact in the list .
Something like this ..


 res = ul.get_urecord((udomain_t*)_t, &aor, &r);
        if (res > 0) {
LM_DBG("'%.*s' Not found in usrloc\n", aor.len, ZSW(aor.s));
                ul.unlock_udomain((udomain_t*)_t, &aor);
                return -1;
        }

.
.
.

 if (ptr) {
                LM_DBG("setting as ruri <%.*s>\n",ptr->c.len,ptr->c.s);
                if (set_ruri(_m, &ptr->c) < 0) {
                        LM_ERR("unable to rewrite Request-URI\n");
                        ret = -3;
                        goto done;
                }
.
.
.
.
set_ruri_q(ptr->q);
.
.
.
.
ul.update_contact ();  to update q value of contact



Will that work ? ...Any side effect ?


Thanx,
Gomtesh

On Thu, Jan 31, 2013 at 12:05 AM, Bogdan-Andrei Iancu <[email protected] <mailto:[email protected]>> wrote:

    Hi,

    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.

    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).

    Regards,

    Bogdan-Andrei Iancu
    OpenSIPS Founder and Developer
    http://www.opensips-solutions.com


    On 01/30/2013 12:18 PM, Gomtesh Jain wrote:

        Thanx Duane  for replying  the mail ..

        Let me explain you my scenario ...

          I have 2  registered contact
             1 . 1234 (q value .9)
             2    5678 (q value .8)

        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 .
        So that for next call 5678 should come on top of the list for
        2nd INVITE .

        So I want make changes in memory/database so that 5678 should
        be picked up as first contact by very next INVITE .

        Thanx,
        Gomtesh







        On Wed, Jan 30, 2013 at 1:50 AM,
        <[email protected]
        <mailto:[email protected]>> wrote:

            Send Users mailing list submissions to
            [email protected] <mailto:[email protected]>

            To subscribe or unsubscribe via the World Wide Web, visit
            http://lists.opensips.org/cgi-bin/mailman/listinfo/users
            or, via email, send a message with subject or body 'help' to
            [email protected]
            <mailto:[email protected]>

            You can reach the person managing the list at
            [email protected]
            <mailto:[email protected]>

            When replying, please edit your Subject line so it is
            more specific
            than "Re: Contents of Users digest..."


            Today's Topics:

               1. Re: Failover and dialog termination (microx)
               2. Re: Decrease the priority of contact (Duane Larson)
               3. Re: Carrierroute failure route enhancement (Samuel
            Muller)
               4. [RELEASE] OpenSIPS 1.9.0 - a new major release is out
                  (Bogdan-Andrei Iancu)
5. [RELEASES] Support and management of OpenSIPS release -
                  IMPORTANT (Bogdan-Andrei Iancu)
               6. Re: [RELEASE] OpenSIPS 1.9.0 - a new major release
            is out (Bakko)
               7. Re: [OpenSIPS-Devel] [RELEASE] OpenSIPS 1.9.0 - a
            new major
                  release is out (Sa?l Ibarra Corretg?)


            
----------------------------------------------------------------------

            Message: 1
            Date: Tue, 29 Jan 2013 06:12:46 -0800 (PST)
            From: microx <[email protected] <mailto:[email protected]>>
            Subject: Re: [OpenSIPS-Users] Failover and dialog termination
            To: [email protected]
            <mailto:[email protected]>
            Message-ID: <[email protected]
            <mailto:[email protected]>>
            Content-Type: text/plain; charset=us-ascii

            Hi Schneur,

            Yes, the two proxy servers PA and PB are using the same
            database. And the
            db_mode regarding dialog
            is set to 1 to make each dialog be written into memory as
            well as the
            database.

            What do you mean master/master replication? Can you
            specify your method?
            Thanks so much.

            Best wishes,
            Chen-Che



            --
            View this message in context:
            
http://opensips-open-sip-server.1449251.n2.nabble.com/Failover-and-dialog-termination-tp7584192p7584255.html
            Sent from the OpenSIPS - Users mailing list archive at
            Nabble.com.



            ------------------------------

            Message: 2
            Date: Tue, 29 Jan 2013 10:39:22 -0600
            From: Duane Larson <[email protected]
            <mailto:[email protected]>>
            Subject: Re: [OpenSIPS-Users] Decrease the priority of
            contact
            To: OpenSIPS users mailling list
            <[email protected] <mailto:[email protected]>>
            Message-ID:
            <cafcm1eqzxr_fhvkjswpbnpk5wuee-9pvjpjfcof0nr4ghat...@mail.gmail.com
            
<mailto:cafcm1eqzxr_fhvkjswpbnpk5wuee-9pvjpjfcof0nr4ghat...@mail.gmail.com>>
            Content-Type: text/plain; charset="iso-8859-1"

            I'm not 100% sure what you are trying to do.  I needed to
            do some serial
            calling and here is what I did

            
http://opensips-open-sip-server.1449251.n2.nabble.com/opensips-Bugs-3349030-Need-access-to-SIP-URI-Q-Value-td6554597.html

            http://www.opensips.org/Resources/DocsCoreVar19#toc75




            On Tue, Jan 29, 2013 at 2:02 AM, Gomtesh Jain
            <[email protected] <mailto:[email protected]>> wrote:

            > Hi ,
            >    I want to decrease the priority (q value) of contact
            (in memory &
            > database)as soon as it comes on top of the list after
            lookup. So that next
            > call should not pick this contact (if other contacts
            are registered). As
            > soon as call finishes client will refresh its
            registration with original q
            > value.
            > How can I do this either in script after lookup() or in
            code in around
            > lookup.c ?
            >
            > Can someone help me on this ?
            >
            > Thanx,
            > Gomtesh
            >
            >
            >
            > _______________________________________________
            > Users mailing list
            > [email protected] <mailto:[email protected]>
            > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
            >
            >


            --
            --
            *--*--*--*--*--*
            Duane
            *--*--*--*--*--*
            --
            -------------- next part --------------
            An HTML attachment was scrubbed...
            URL:
            
<http://lists.opensips.org/pipermail/users/attachments/20130129/d66ee50b/attachment-0001.htm>


    _______________________________________________
    Users mailing list
    [email protected]  <mailto:[email protected]>
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to