[SR-Users] t_check_trans() exits route execution if transaction is found
Daniel-Constantin Mierla
miconda at gmail.com
Thu Jul 7 10:23:39 CEST 2016
Hello,
this behaviour is intended to absorb the retransmissions -- if the
transaction is found, the request was already processed (could be by
another application process) and makes no sense to process it again . If
you don't use t_check_trans(), it will be anyhow discarded later when
t_relay() or t_newtran() is executed, because the transaction is already
in memory -- but usually that means you consumed some extra cpu/memory
to get there.
Cheers,
Daniel
On 07/07/16 09:59, Sebastian Damm wrote:
> Hi,
>
> on one of our systems we are checking a few times whether a
> transaction already exists. We noticed that route execution stops if
> the transaction is found. And after looking into the code, we found
> that it seems to be intended like this.
>
> From tm.c:
> int t_check_trans(struct sip_msg* msg)
> {
> if (msg->first_line.type==SIP_REPLY) {
> [..]
> } else {
> switch(t_check_msg(msg, 0)){
> [..]
> case 1: /* found */
> [..]
> return 0; /* exit from the script */
> }
> }
> }
>
> Can anybody explain, why script execution should stop when a running
> transaction is found? I would expect that then the function returns 1
> so I can use it in my if statement and continue with my routing
> script.
>
> Thanks already for an explanation,
> Sebastian
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
More information about the sr-users
mailing list