1
votes

I am using Kamailio version 5.3.3 and rtpengine version 8.4.0. Both Kamailio and Rtp-Engine are running on the same ubuntu machine. The "timeout" value in rtpengine config file is set to 60 seconds.

I establish a call between two SIP clients registered to Kamailio and media is relayed via rtp-engine - this works fine

To test the rtp media timeout, I blocked the UDP traffic from the SIP clients to rtpengine, and after the specified period, I see the following log from rtpengine which seems to indicate that it has detected the timeout

rtpengine[2127]: INFO: [R-RVm58r4SUY7Cz6GW-D5w..]: Closing call due to timeout

However, even after this the call does the terminated. So my question is:

How do I get Kamailio to terminate the call when rtp-engine detects a media timeout. What changes (if any) in the kamailio cfg is required for this?

UPDATE

Have attached the current kamailio.cfg and rtpengine.conf file after masking the IP addresses

Basically my requirement is that if one (or both) of the SIP clients in a call either get killed or lose network or stop sending media - there must be a way to identify this in Kamailio and terminate the call.

Kamailio config: https://pastebin.com/s4akZSfa Rtpengine config: https://pastebin.com/7xzejiYW

I debugged on this further and there are two separate issues which I am facing:

First Issue:

The issue which I mentioned earlier - when I block RTP traffic from both SIP client to RTPEngine, the RTP Engine detects timeouts as seen from the log mentioned above but the call does not end. On debugging further, as per my understanding, rtpengine needs to make an RPC call to Kamailio to tell it to end the dialog - I tried using the "b2b-url" and "xmlrpc-format" config options in rtpengine for this, but here I am not clear of the following:

a. What should the port set in the "b2b-url" config in rtpengine? I tried with 80 and 5060, but keep getting connection refused when rtpengine tries to make a curl request on media timeout

b. Which Kamailio module needs to be loaded for this - there is an XMLRPC module, XHTTP RPC module and JSONRPCS module - which one is needed for this?

Second Issue: The second issue is that if instead of RTP traffic being blocked from both devices, it is blocked from only one of the devices - then it looks like rtpengine is not even able to detect the media timeout, meaning I don't see the log Closing call due to timeout in syslog which I saw when traffic from both devices was blocked. I am assuming there must be a way to detect this - to handle the case when one device lets say looses network or stops sending media - how can I detect and take action based on this?

1
Can you please share your current Kamailio config file?Nick
@Nick have updated kamailio.cfg, rtpengine.conf and also added some more information and queriesArchit Sinha

1 Answers

0
votes

Ok so I have most likely figured out the First issue - When both sides RTP traffic is diasbled and rtpengine is able to detect timeout but call does not end.

There were 2 issues with my config:

  1. From rtpengine I was sending RPC request on 127.0.0.1:5060, but in kamailio.cfg, it was listening on the local IP (10.x.x.x) - when I changed it to 0.0.0.0 in kamailio.cfg , rtpengine was able to establish connection

  2. From rtpengine, the value of xmlrpc-format needs to be 2 instead of 1 it seems (not very sure about this) - 1 means the teardown command whereas 2 means dlg.terminate_dlg command . Also the dialog module was not loaded in kamailio.cfg. After loading the dialog module in kamailio and setting the value to xmlrpc-format to 2 in rtpengine.conf - now when both sides RTP traffic is blocked, Kamailio cleanly terminates the call.

However I still not been able to figure out the Second Issue mentioned above - why rtpengine is not able to detect media timeout if only one side RTP traffic is stopped