0

I'm using a Kamailio proxy version 4.0.4. I have two UAC (Bob1, Bob2) registered with the same URI. Then a third UAC (Alice) sends a INVITE to the proxy. Both UACs receive this Invite and both accept the call. Kamailio now cancels the second (Bob2) and forwards the 200 Ok of the first (Bob1) to Alice.

However, I need to get both 200 Ok reponses from Bob1 and Bob2 to Alice. Alice then wants to talk to them concurrently.

Is this possible with kamailio? How can I prevent the second 200 Ok from being canceled?

1 Answers1

3

When routing in stateful mode (via tm module), Kamailio is canceling all the other active branches when a 200ok is received. Even you would think two 200ok are generated at the same time, very likely they are processed one after the other, so one branch gets cancelled.

You should be able to achieve what you want by doing stateless routing. Instead of using functions from tm module to send out the request, use forward() function. The logic should be like:

  • set r-uri ($ru) to first destination
  • forward()
  • set r-uri ($ru) to second destination
  • forward()

If destination are set by a lookup("location"), the first one gets into r-uri and you can do a forward(). For the second, you have to get its details via $branch(...) variable and set the r-uri and then other attributes relevant for next hop.

miconda
  • 1,754
  • 11
  • 14
  • Thanks for your answer. Could you please make a small example how I can use that? I'm not really into kamailio syntax. That would be great! – Lukas Bernhard Sep 16 '15 at 08:14
  • Thanks @miconda, I used this method, but it seems each forward add new Via header to the forwarded message, and both Via headers are identical, here is the sample Via headers for the second forward(): Via: SIP/2.0/UDP 192.168.1.21;branch=z9hG4bKbe8c.953ed42f0bcc438c6991121d3483010b.0 Via: SIP/2.0/UDP 192.168.1.21;branch=z9hG4bKbe8c.953ed42f0bcc438c6991121d3483010b.0 Via: SIP/2.0/UDP 10.189.219.4:5060;rport=5060;rport=5060;branch=z9hG4bK-4177-1-2 – Ali Shirvani Jun 15 '19 at 13:28