Hello,

 

Im having a hard time figuring out how to handle a 302 reidrect,  the uac_redirect modules shows a simple configuration. However for me,  what it is not doing is changing the 302 back to invite.  It is sending the 302 as is on.

 

       if(!t_check_status("3[0-9][0-9]")) {

              exit;

       }

       get_redirects("3:1");

       t_relay();

 

This code just relays the 302 for me.  I should add I am using this with the DISPATCHER module so perhaps that has something to do with my issue.

 

Setup is this,  kamailio is sitting between to sip servers,  so the flow goes like this,   sip_server_a -> kamailio -> sip_server_b.    sip_server_b only responds with 302 redirects,  sip_server_a does not handle 302’s at all.  Kamailio will only get invites from sip_server_a,  and the redirects from sip_server_b will only have one contact.  How can I get kamailio to reply to sip_server_a’s invite with the updated INVITE?

 

My config is a mesh of the dispatcher example and uac_redirect example with this specific section handling the redirect:

 

# Sample failure route

failure_route[RTF_DISPATCH] {

        xlog("L_NOTICE", "RTF_DISPATCH: ");

        if (t_is_canceled()) {

                exit;

        }

        # next DST - only for 500 or local timeout

        if (t_check_status("500")

                        or (t_branch_timeout() and !t_branch_replied()))

        {

                if(ds_next_dst())

                {

                        t_on_failure("RTF_DISPATCH");

                        route(RELAY);

                        exit;

                }

        }

        if (t_check_status("302")) {

          xlog("L_NOTICE", "RTF_DISPATCH: 302 ");

          if (!get_redirects("1:1")) {

            xlog("L_NOTICE", "RTF_DISPATCH: failed to get_redirects ");

            t_reply("480", "Temporarily Unavailable");

            exit;

          }

          xlog("L_NOTICE", "RTF_DISPATCH: got redirects ");

          t_relay(“sip_server_a”,”5060”);

        }

}

 

Any ideas what I am doing wrong is this supported?  Im expecting once I relay this message that it should be an INVITE not a 302 redirect.  I cant find any examples of anyone else really doing this.