[SR-Users] Retransmission handling

Daniel-Constantin Mierla miconda at gmail.com
Thu Oct 19 19:22:50 CEST 2017



On 19.10.17 17:41, Alex Balashov wrote:
> On Thu, Oct 19, 2017 at 11:06:21AM +0300, Volkan Oransoy wrote:
>
>> I wonder purpose of this block in default script. What I didn’t understand is the purpose of "t_check_trans()”. Accoording to documentation, this method returns a boolean. So why do we use it even we don’t check output?
>>
>> 	# handle retransmissions
>> 	if (!is_method("ACK")) {
>> 		if(t_precheck_trans()) {
>> 			t_check_trans();
>> 			exit;
>> 		}
>> 		t_check_trans();
>> 	}
> Because t_check_trans() has certain behaviours simply in virtue of being
> called:
>
> https://kamailio.org/docs/modules/5.0.x/modules/tm.html#tm.f.t_check_trans
>
> For example:
>
>    "For ACKs to negative replies or for ACKs to local transactions it will
>     terminate the script if the ACK belongs to a transaction"
>
>
>
Just to highlight, the other section in the docs is also relevant,
respectively stopping the config execution if it was a retransmission
after sending back the last response.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training, Nov 13-15, 2017, in Berlin - www.asipto.com
Kamailio World Conference - www.kamailioworld.com




More information about the sr-users mailing list