[sr-dev] appending a new branch in route block

Andrei Pelinescu-Onciul andrei at iptel.org
Fri May 21 13:35:49 CEST 2010


On May 17, 2010 at 18:47, Juha Heinanen <jh at tutpro.com> wrote:
> Juha Heinanen writes:
> 
> > any pointer on how to do the same from lcr module?  i guess i need to
> > load tm api and call some tm function?
> 
> i think i was able to figure this out.  the corresponding tm api
> function is t_gett().
> 
> so i went and changed next_gw() implementation so that if no transaction
> exists, it rewrites request uri and if it exists, it clears possible old
> branches and appends a new one.

Note that if you call next_gw() after t_relay() and no transaction
exists, it means that no transaction could be created (out of mem, parse
error, bad via) and it makes no sense to re-try with a different uri or
branch.

The easiest way to check for this is to look at T (t_gett() ) after
t_relay(). If is T_UNDEFINED or 0 => no transaction could be created.


More information about the sr-dev mailing list