Hello all,

I've questions 'bout the redirect/forward with 30x requests.

Actually, it does not work, it seems the uac redirect module doesn' t use the new contact for the new invite.

simple schema : pstn gw -> kamailio -> linksys -> call forward unconditionnal to another pstn number -> kamailio -> gw pstn

the 302 as seen with ngrep tool :

#SIP/2.0 302 Moved Temporarily.
#To: <sip:B@sip_proxy;user=phone>;tag=91515579fff6b8d1i0.
#From: <sip:A@pstn_gw1;user=phone>;tag=16627-UI-00020cf3-54eea92c4.
#Call-ID: 16627-RO-00020cf2-4186e9762@pstn_gw1.
#CSeq: 81990 INVITE.
#Via: SIP/2.0/UDP sip_proxy;branch=z9hG4bK0f0c.22989b87.1.
#Via: SIP/2.0/UDP pstn_gw1:5060;rport=5060;received=ip_pstn_gw1;branch=z9hG4bK-25EA-243F3.
#Record-Route: <sip:sip_proxy;lr=on;ftag=16627-UI-00020cf3-54eea92c4;did=f65.bcc44f06>.
#Contact: <sip:C@sip_proxy>.
#Diversion: "B" <sip:B@sip_proxy>;reason=unconditional.
#Server: Linksys/SPA942-6.1.3(a).

DBG:uac_redirect:shmcontact2dset: adding contact <sip:C@sip_proxy>
dest set : Contact: sip:B@ip_B, <sip:C@sip_proxy>;q=0.01
contact $ct: <sip:pstn_gw1:5060>

the second pstn gateway received a request to B, and not C (so it creates a loop through pstn ...).

in my config :

loadmodule "uac.so"
modparam("uac", "rr_store_param", "vsf")
modparam("uac", "from_restore_mode", "auto")

loadmodule "uac_redirect.so"
modparam("uac_redirect", "default_filter", "accept")
modparam("uac_redirect","bflags", 1)

loadmodule "diversion.so"

failure_route[2]
{
        setdebug(4);

        if (t_check_status("301|302"))
        {
                route(26)     # acc fwd
                $avp(s:acc_status) = "cfu";

                if (!get_redirects("2:1"))
                {
                        xlog("L_NOTICE", "failed to extract contact info from 30x header");
                        route(10);      # stop rtp
                        t_reply("480", "Temporarily Unavailable");
                        exit;
                }

                # flag 3xx status, open a new branch and back to find the new callee
                setflag(28);
                append_branch();
                t_on_branch("1");
                route(3);     # search the new callee
                setdebug();
                exit;
        }

        t_on_branch("1");
        setdebug();
        route(3);       # find callee
        route(12);      # local outbound
        route(10);      # stop rtp
}

I'm using lcr module to route calls, kamailio v. 1.5.3.

I've another question, is the 30x always considered as a failure_route ?

Any help and/or explanations about the tricks would be really appreciated ... thanks,

--
Samuel MULLER
sml@l33.fr