I pushed a patch to master branch that allows to use t_replicate()
without any parameters.
Apparently the same behaviour can be achieved using:
t_replicate("")
so the parameter is an empty string. Can you try it and see if works?
Also, feedback on testing the patch for no parameter would be appreciated.
Cheers,
Daniel
On 25/07/14 09:31, Daniel-Constantin Mierla wrote:
On 24/07/14 19:34, Asgaroth wrote:
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.
If it is in the same network, it should be ok, udp forwarding is
unlikely to be lost. Or you can use tcp for forwarding.
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 :)
Going to look at the code and add it if not something very complex.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users