[SR-Users] Serial forking

igor.potjevlesch at gmail.com igor.potjevlesch at gmail.com
Tue May 29 14:48:10 CEST 2018


Thank you. I'm running 4.2.7 but I think both options are available too.

I'm not sure to understand the first thing about t_set_fr. Currently, when I do lookup(aliases), the default behaviour is to send both calls simultaneously if there is 2 entries in aliases table. So, first, I'm wondering how can I change this behaviour to do serial forking instead.

-----Message d'origine-----
De : sr-users <sr-users-bounces at lists.kamailio.org> De la part de Daniel Tryba
Envoyé : lundi 28 mai 2018 17:13
À : Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Objet : Re: [SR-Users] Serial forking

On Mon, May 28, 2018 at 04:55:30PM +0200, igor.potjevlesch at gmail.com wrote:
> I know that the default behaviour of two aliases in kamailio.aliases 
> result in parallel forking.
> 
> I'm wondering if its possible to do serial forking instead? For 
> example, in case that the first INVITE has no 180/183, or neither 100 
> Trying, then send the INVITE to the second entry?

Offcourse, fiddle with t_set_fr on a per call basis or the
fr_inv_timer/fr_timer:
http://www.kamailio.org/docs/modules/5.2.x/modules/tm.html#tm.f.t_set_fr

SERIALRELAY is used in stead of the normal RELAY route, it loads available endpoints with t_load_contacts:
http://www.kamailio.org/docs/modules/5.2.x/modules/tm.html#tm.f.t_load_contacts
and fetches the first one with t_next_contacts.
In the failure route keep calling t_next_contacts till there are no more.

route[SERIALRELAY] {
        if (is_method("INVITE|SUBSCRIBE")) {
                t_on_branch("MANAGE_BRANCH");
                t_on_reply("MANAGE_REPLY");
        }
        if (is_method("INVITE")) {
                t_load_contacts();
                t_next_contacts();

                t_on_failure("SERIAL_FAILURE");
        }

        if (!t_relay()) {
                sl_reply_error();
        }

        break;
}

failure_route[SERIAL_FAILURE] {
        if (!t_next_contacts())
        {
                send_reply("408","Timeout or nobody available");

                exit;
        }

        t_on_branch("MANAGE_BRANCH");
        t_on_reply("MANAGE_REPLY");
        t_on_failure("SERIAL_FAILURE");

        t_relay();
}


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users at lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users




More information about the sr-users mailing list