Ok so making progress but still a little confused, hopefully this forum can shed some light on this behaviour.
Using the hints provided (thanks all so far) and the latency logging from the cookbook I have managed to isolate the issue down to RTPengine introducing the delay.
INFO: app_python3 [apy_kemi.c:1820]: sr_apy_kemi_exec_func(): alert - action KSR.rtpengine.rtpengine_manage(...) took too long [1003089 ms] (file:(null) func:(null) line:252)
What is confusing is, I don’t believe this block should be being called.
when the BYE is triggered, it routes to ksr_route_withindlg
# handle requests within SIP dialogs
if self.ksr_route_withindlg(msg)==-255 :
return 1
from within the ksr_route_withindlg a check is done to see if any RTPengine work needs doing
# Handle requests within SIP dialogs
def ksr_route_withindlg(self, msg):
if KSR.siputils.has_totag()<0 :
return 1
# RTPEngine handling for UPDATES & reINVITES with sdp
if self.ksr_route_rtpengine(msg) == -255:
return 1
RTPengine is configured in a way to step in whenever there is an SDP present based on
Content-Type: application/sdp
# RTPengine handle anything with SDP
def ksr_route_rtpengine(self, msg):
if KSR.textops.has_body_type("application/sdp"):
KSR.rtpengine.rtpengine_manage(
"RTP/AVP replace-session-connection replace-origin ICE=remove")
return 1
What I can understand is why is this being called and erroring introducing the delay when there is no
Content-Type: application/sdp in a BYE ???
As a quick fix I have put this in which stops the problem (I am sure there is better ways to handle this but for now this works in a DEV environment)
def ksr_route_rtpengine(self, msg):
if KSR.is_BYE():
return 1
if KSR.textops.has_body_type("application/sdp"):
KSR.rtpengine.rtpengine_manage(
"RTP/AVP replace-session-connection replace-origin ICE=remove")
return 1
Can anyone see why this would occur? Why is
sr_apy_kemi_exec_func(): alert - action KSR.rtpengine.rtpengine_manage(...) even being called for this BYE ? when there is no
Content-Type: application/sdp
Lewis