[OpenSIPS-Users] Absorbing retransmissions

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Oct 10 14:21:52 CEST 2008


Hi Alex,

The simplest code will be like:

...
t_newtran();
t_reply("100","Trying");
....
Do_stuff
....
t_relay("0x01");


t_newtran() - will create the transaction; if retransmission, the 
function will send the last reply sent automatically and break the script.
t_reply() will be hit only for initial request and you will send the 100 
to stop any further retransmission -(so t_newtran() will re-send the 100 
for retransmissions).

t_relay("0x01") - do relay without sending any 100 back as we already 
did it.

REgards,
Bogdan

Alex Massover wrote:
>
> Hi!
>
> I want to explicitly absorb retransmissions of INVITE, before it reach 
> t_relay(). I need this because I have I run a very heavy custom 
> authentication on INVITE before it goes to t_relay().
>
> if(method==”INVITE”)
>
> {
>
> if(!perl_exec(“very_heavy_auth”))
>
> { sl_reply(“403”); }
>
>>
>>
>>
> t_relay();
>
> }
>
> I want to absorb retransmission before my perl_exec, 1) in order not 
> to run it multiple times, it’s very heavy, 2) if “very_heavy_auth” 
> misbehaves it can break the call logic, I can answer to the callee 
> with 403 for one retransmission, but to successfully forward another 
> retransmission further.
>
> Here’s my idea:
>
> if(method==”INVITE”)
>
> {
>
> if (!t_check_trans())
>
> { t_new_trans(); }
>
> else
>
> { drop(); }
>
> if(!perl_exec(“very_heavy_auth”))
>
> { sl_reply(“403”); }
>
>>
>>
>>
> t_relay();
>
> }
>
> Is it a good idea to absorb retransmissions with t_check_trans() and 
> t_new_trans()?
>
> --
>
> Best Regards,
>
> Alex Massover
>
>
>
> ****************************************************************************** 
>
> This footnote confirms that this email message has been scanned by 
> Jajah Inc. Mail system for the presence of malicious code, vandals & 
> computer viruses.
> ******************************************************************************
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   




More information about the Users mailing list