[Kamailio-Devel] [ openser-Feature Requests-2159383 ] 'reply' function involving 'sl_reply' and 't_reply'

SourceForge.net noreply at sourceforge.net
Sun Oct 12 02:34:53 CEST 2008


Feature Requests item #2159383, was opened at 2008-10-11 15:47
Message generated for change (Comment added) made by ibc_sf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2159383&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iaki Baz (ibc_sf)
Assigned to: Nobody/Anonymous (nobody)
Summary: 'reply' function involving 'sl_reply' and 't_reply'

Initial Comment:
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?

----------------------------------------------------------------------

>Comment By: Iaki Baz (ibc_sf)
Date: 2008-10-12 02:34

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

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2008-10-11 19:57

Message:
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:

https://sourceforge.net/tracker/index.php?func=detail&aid=2105813&group_id=139143&atid=743020

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

----------------------------------------------------------------------

Comment By: Iaki Baz (ibc_sf)
Date: 2008-10-11 16:10

Message:
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?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2008-10-11 16:01

Message:
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


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743023&aid=2159383&group_id=139143



More information about the Devel mailing list