[OpenSIPS-Users] Absorbing retransmissions

Alex Massover alex at jajah.com
Sat Oct 11 11:05:58 CEST 2008


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?

t_newtran();
t_reply("100","Trying");
....
if(!perl_exec("very_heavy")) {t_reply("403","Forbidden");}
....
t_relay("0x01");

--
Best Regards,
Alex Massover

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro]
Sent: Friday, October 10, 2008 2:22 PM
To: Alex Massover
Cc: users at lists.opensips.org
Subject: Re: [OpenSIPS-Users] Absorbing retransmissions

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
>




******************************************************************************

 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.

******************************************************************************





******************************************************************************

 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.

******************************************************************************





More information about the Users mailing list