[OpenSER-Users] Issue with Openser Serial Forking

Aadilkhan Maniyar amaniyar at velankani.com
Sat Mar 29 08:38:41 CET 2008


Hi,

I am trying to implement Serial forking using the lcr module. Here is
how my cfg file looks like:

modparam("lcr|usrloc|auth_db|avpops|domain", "db_url",
        "mysql://xxxxxx:xxxxxx@localhost/xxxxx")
modparam("lcr","lcr_table","lcr")
modparam("lcr", "contact_avp", "$avp(i:711)")

### Try for Serial Forking
                if (load_contacts())
                {
                        xlog("L_INFO","In load_contacts()\n");
                        xlog("L_INFO","load_contacts() - avp(i:711) =
$avp(i:711) - ds =  $ds\n");
                }
                if (!next_contacts())
                {
                        sl_send_reply("500", "Server Internal Error");
                        exit;
                }
                else
                {
                        xlog("L_INFO","next_contacts() - avp(i:711) =
$avp(i:711) - ds =  $ds\n");
                        t_on_failure("5");
                        t_relay();
                        #exit;
                };

failure_route[5]
{
        xlog("L_INFO","Entered failure route for Serial Forking\n");
        t_on_failure("5");
        if (next_contacts())
        {
                xlog("L_INFO","Failure Route, Next contacts\n");
                append_branch();
                t_relay();
        }
        exit;
}

 ### End Try for Serial Forking

I am unable to simulate serial forking using the above configuration.
Here is what the logs say:

9(6228) load_contacts(): DEBUG: Nothing to do - no branches!
 9(6228) In load_contacts()::VSPL
 9(6228) load_contacts() - avp(i:711) = <null> - ds =  <null>
 9(6228) next_contacts(): DEBUG: No AVPs -- we are done!
 9(6228) next_contacts() - avp(i:711) = <null> - ds =  <null>


When I check the location (mysql) db, it displays the entries and the q
parameters...

What I am doing wrong?

Thanks,
Aadil 
-----Original Message-----
From: users-bounces at lists.openser.org
[mailto:users-bounces at lists.openser.org] On Behalf Of Aadilkhan Maniyar
Sent: Friday, March 28, 2008 7:02 PM
To: 'Juha Heinanen'
Cc: 'Vinod Kumar Singh'; users at lists.openser.org; 'Amit Nagpal'
Subject: Re: [OpenSER-Users] Issue with Openser Serial Forking

Thanks again Juha... Will try this out..

-----Original Message-----
From: Juha Heinanen [mailto:jh at tutpro.com] 
Sent: Friday, March 28, 2008 7:02 PM
To: Aadilkhan Maniyar
Cc: users at lists.openser.org; 'Vinod Kumar Singh'; 'Amit Nagpal'
Subject: RE: [OpenSER-Users] Issue with Openser Serial Forking

Aadilkhan Maniyar writes:

 > Can you please give me a code snippet of how can I implement serial
 > forking using the modules/functions mentioned below.

i don't know about core functions (in fact i was not able to find them
in core cook book, but i'm pretty sure they must be there somewhere),
but if you use lcr, you call load_contacts() in your route block, then
set a failure route, then call next_contacts() and t_relay.  in your
failure route, you then just keep on setting failure route again and
call next_contacts()/t_relay again as long as next_contacts() returns 1,
i.e., there are still contacts left.  see lcr README.

-- juha



_______________________________________________
Users mailing list
Users at lists.openser.org
http://lists.openser.org/cgi-bin/mailman/listinfo/users






More information about the Users mailing list