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?