[Devel] append_branch - in failure route

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Feb 7 12:14:26 CET 2007


Klaus Darilion wrote:
> On Wed, February 7, 2007 11:10, Bogdan-Andrei Iancu said:
>   
>> Klaus Darilion wrote:
>>     
>>> Hi!
>>>
>>> As we have clarified the normal append_branch behaviour maybe we can
>>> clarify the meaning in failure_route too:
>>>
>>> failure_route[1] {
>>>   # send to voicebox
>>>   rewriteuri("sip:vm at server.com");
>>>   append_branch();
>>>   t_relay();
>>> }
>>>
>>> I suspect that the new URI will be written into RURI (branches[0]). Then
>>> append_branch() copies the URI from branches[0] into branches[1]. Then
>>> t_relay sees 2 branches: branches[0] and branches[1]. But as branches[0]
>>> is already "dead", only branches[1] will be releayed.
>>>
>>> Is this correct?
>>>
>>>       
>> yes this is correct - there is no special handling of append_branch() in
>> failure route. What is important to know is that the branch[0] in
>> failure route is the winning branch of the transaction and and inherits
>> all its attributes. So, if you had force_socket(sock1) for branch x
>> (before relay) and this is the winning branch in failure route, the
>> branch[0] will have the forced_socket "sock1" which will be again
>> inherit by the new branch after append_branch().
>>     
>
> Thus - in failure_route - I always have to
>  1. change URI to new destination
>  2. append_branch().
>
> If I would do it the other way round (1. append_branch, 2. change URI)
> then I would again call the same URI.
>
> Correct???
>
>   
yes :)

regards,
bogdan



More information about the Devel mailing list