[Kamailio-Users] t_newtran/t_reply vs. sl_send_reply

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 31 07:52:38 CEST 2008


Hello,

On 07/30/08 17:53, mayamatakeshi wrote:
> Hello,
> sorry if this is a stupid question,
> but in the openser.cfg that comes with the source, I see the following:
>
> if (!lookup("location")) {
>         switch ($retcode) {
>                 case -1:
>                 case -3:
>                         t_newtran();
>                         t_reply("404", "Not Found");
>                         exit;
>                 case -2:
>                         sl_send_reply("405", "Method Not Allowed");
>                         exit;
>         }
> }
>
> Could you tell me why we use t_newtran/t_reply for cases -1,-3 and 
> sl_send_reply for case -2.
> I read docs for modules sl and tm but I still don't get it why we 
> shoud created a transaction in one situation and not in the other.
t_newtran() creates a transaction which helps in detecting and avoid 
processing retransmissions with t_check_trans(). Once a transaction is 
created, you have to use t_reply() to send the replies. Practically, it 
is script writer decision when to create the transaction. It is good to 
know that transaction creation takes some resources so you have to 
balance between shifting to stateful processing or doing it stateless.

Cheers,
Daniel

>
> Regards,
> takeshi
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>   

-- 
Daniel-Constantin Mierla
http://www.asipto.com





More information about the Users mailing list