[OpenSIPS-Users] Absorbing retransmissions
    Iñaki Baz Castillo 
    ibc at aliax.net
       
    Sat Oct 11 15:38:49 CEST 2008
    
    
  
El Sábado, 11 de Octubre de 2008, Alex Massover escribió:
> Hi!
>
> Thanks! It really looks better. You wrote: " if retransmission, the
> function will send the last reply sent automatically and break the script."
>
> If I understand correctly in order for this to work I need to move all my
> other sl_send_reply("4xx") to t_reply("4xx") also? So it will be able to
> send not only 100, but all negative replies also?
That's true, if you have already created the transaction you must send replies  
statefully, this is, using "t_reply".
But note here that this is a matter of efficience:
If you create a transaction and finally you reply 4XX you are wasting system 
resources, this is the reason RFC 3261 suggest to never create a transaction 
after authentication has been checked.
But in your case, if the authentication process is slow it could be a need to 
create the transaction before performing the authentication, but maybe you 
could do it more efficience by doing:
route[0] {
	# If there is no Proxy-Authorization header terminate the request statessly:
	if ! $hdr(Proxy-Authorization)
        	{ sl_reply(“407, "Proxy Authentication Required”); }		
	
	...
	t_newtran();
	t_reply("100","Trying");
	....
	 if(!perl_exec(“very_heavy_auth”))
        	{ t_reply(“403”); }
                 …
	....
	t_relay("0x01");
}
-- 
Iñaki Baz Castillo
    
    
More information about the Users
mailing list