[SR-Users] append_branch and t_replicate issue

Asgaroth 00asgaroth00 at gmail.com
Thu Jul 24 19:34:33 CEST 2014


On 24/07/2014 17:26, Daniel-Constantin Mierla wrote:
> checking docs, it seems like that. I will have to look at the code and 
> eventually make an option without parameter. Otherwise, like it is 
> not, the parameter forces an outbound proxy to be used for forwarding.

I guess that makes sense for setting $ds to replicate the message and 
explains the behaviour I was seeing both branches going to $ds which was 
set in t_replicate uri param.

>
> You sent me the sip trace and you can see there that two register 
> requests are sent out, both to the address in the parameter of the 
> t_replicate(), but one has the address from append_branch() in r-uri. 
> So the forking was done.
>
> Maybe you can try with a look via kamailio itself:
>
> $ru = uri1;
> append_branch("uri2");
> t_replicate("sip:kamailioip:kamailioport");
>
> Then you see that is coming with src_ip==myself and simply do 
> t_relay() and the r-uri should point to where it needs to be forwarded. 

Can you forsee any issues with using 2 forward requests instead of 
t_replicate. the only difference i can see in the message is that the 
second forward adds a duplicate (expected behaviour) via address (i 
presume because the message already had a via added in the previous 
forward. So what I was thinking was, something like this:

on registrar 1:

     save("location")
     forward(BACKUP_REGISTRAR_2);
     forward(BACKUP_REGISTRAR_3);

then on the 2nd registrar something like this:

     if ( src_ip == BACKUP_REGISTRAR_1 || src_ip == BACKUP_REGISTRAR_3 ) {
             save("location","0x02");
             exit;
     };

I use 0x02 flag so that save does not send reply because forward above 
is stateless.

A 'kamctl ul show <contact>' seems to look the same accross the 3 
registrars when testing.

The only thing I can think of is if kamailio is really busy and does not 
get to process the message, because forward is stateless, it wont 
re-transmit a couple times to relay the message.

I guess, it would be nice if t_replicate accepted a couple of uri to 
replicate to then for each uri set $ds to uri an send message, however, 
I'm not sure if that is even feasable :)

Thanks
Bruce



More information about the sr-users mailing list