[SR-Users] Can following scenario be implemented using Kamilio

Daniel Tryba d.tryba at pocos.nl
Tue Mar 3 18:21:30 CET 2015


On Tuesday 03 March 2015 17:56:45 Jayanth Acharya wrote:
> Would like to know if Kamilio (in it's sip-proxy role) could be configured
> to somehow take note of the 'Contact:' header of a 302 response from
> B-party, to forward the INVITE to C-party (specified by the updated Contact
> URI) ?

No problem, if you take a look at the "default" config it will have a 
failure_route[MANAGE_FAILURE] and a WITH_BLOCK3XX define commented.
The failure route will normally block 302:

        # block call redirect based on 3xx replies.
        if (t_check_status("3[0-9][0-9]")) {
                send_reply("404","Not found BLOCK3XX");
                exit;
        }


If you replace (or insert before) above code something like:

        if (t_check_status("302")
        {
                $var(contact) = $T_rpl($ct);
                $var(contact) = $(var(contact){re.subst,/^<(sip:\+?
[0-9]+ at .*)>$/\1/});

                $du=$null;
                $ru=$var(contact);

                route(RELAY);
                exit;
        }

You have your case solved.

BTW you might want to do additonal checks when billing is concerned.

-- 

Telefoon: 088 0100 700
Sales: sales at pocos.nl | Service: servicedesk at pocos.nl
http://www.pocos.nl/ | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel 
17097024



More information about the sr-users mailing list