[Users] 302 Redirect behavior

Brandon Price brandon.price at hostrocket.com
Wed Nov 16 21:56:52 CET 2005


I am trying to use the uac_redirect module to duplicate the behavior  
that asterisk performs when it receives a 302-Moved Temporarily from  
a registered user agent. It basically extracts the number to forward  
to from the SIP contact address in the 302 reply. For example if "sip: 
13143212222 at ser1.voipnoc.net" is the sip contact address then  
13143212222 is the number (of coarse). It then executes whatever code  
matches that pattern. This works perfectly for me but ends up making  
2 calls because I get the invite, I send it to the UA, and then I do  
another dial if there is a forward. That of coarse costs me twice as  
much.
I have tried...

if(t_check_status("302")){ # what to do if device tells us to forward  
to another number
                 xlog("A redirect");
                 get_redirects("*","redirect");
                 rewritehost("our.pstn.gw.ip");
                 t_relay();
                 return;
I simply need it to get the number to redirect to from the contact  
portion and forward the invite to that number @ our pstn gateway. Any  
help greatly appreciated.





More information about the Users mailing list