#134 'reply' function involving 'sl_reply' and 't_reply'

ver devel
modules (93)

Hi, IMHO is not very friendly being dealing with 'sl_reply' or 't_reply' depending on if the transaction has been already created.

Sometimes it's not clear which one to use (for example if we are processing on_reply_route and so).

I know that both "t_reply" and "sl_reply" belong to different modules (tm and sl) but it could be nice a new function just called "reply" that would call the appropiate function t_reply or sl_reply depending on the existance of the transaction.

This is:

if xxxxx {
reply("403", "Forbidden");

on_failure_route[1] {
if xxxxx {
reply("500", "Bad gateway");

Is it feasible?


  • Nobody/Anonymous

    i'm not convinced yet that this is needed. in my script i forward all requests statefully so i know that when reply comes, i need to process it statefully. are you saying that you forward some requests stafully and some statelessly? perhaps you can give another example.

    -- juha

  • Iñaki Baz Castillo

    Well, the fact is that "t_reply" can be used just when the transaction has been already created, this is, after calling "t_newtrans()", in "on_failure_route" (so "t_Realy" was called before and created the transaction). And "sl_reply" can be used just when the transaction doesn't exist for the current request.
    In fact you get a logical error if you try to use "sl_reply" when the transsaction already exist or "t_reply" when the transaction doesn't exist.

    So, in conclusion, there is no possibility of choosing wich one to use. If the transaction already exists you must use "t_reply", and if not, you must use "sl_reply". So why not a common function called "reply()" that would call the appropiate function depending on if the transaction exists?

  • Daniel-Constantin Mierla

    This functions is needed -- it is another discussion on tracker related to some presence issues -- if the script writer has the option to identify if the transaction exists or not, there are modules that use sl_send_reply() inside. If the script writer has created a transaction, the module will reply stateless. The retransmission issues appear, see:


    Options are:
    - one function in tm that binds to sl to reply stateless if no transaction is found, or vice-versa:
    - one function is sl that binds to tm to search for transaction and use t_reply() if found

  • Iñaki Baz Castillo

    Won't these new function in tm and sl be the same function in fact?

  • Daniel-Constantin Mierla

    • assigned_to: nobody --> miconda
    • status: open --> closed-fixed
  • Daniel-Constantin Mierla

    send_reply() of sl module is implementing this functionality now -- to be released in 1.5.


Log in to post a comment.