From: Sean Bright Date: Fri, 24 Mar 2017 16:29:10 +0000 (-0400) Subject: res_pjsip_sdp_rtp: Set hangup cause for RTP timeouts X-Git-Tag: 14.5.0-rc1~81^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=701a03738b30205601258559aa7bbf98bcd08a5f;p=thirdparty%2Fasterisk.git res_pjsip_sdp_rtp: Set hangup cause for RTP timeouts chan_sip sets the hangup cause code to AST_CAUSE_REQUESTED_CHAN_UNAVAIL (44) when a channel is hung up due to an RTP timeout. So do the same when it happens with PJSIP for parity. Change-Id: I3546ebbde6460c22a27c9da1bf321711b5961ab8 --- diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 3d29212069..1552b362ae 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -164,6 +164,10 @@ static int rtp_check_timeout(const void *data) ast_log(LOG_NOTICE, "Disconnecting channel '%s' for lack of RTP activity in %d seconds\n", ast_channel_name(chan), elapsed); + ast_channel_lock(chan); + ast_channel_hangupcause_set(chan, AST_CAUSE_REQUESTED_CHAN_UNAVAIL); + ast_channel_unlock(chan); + ast_softhangup(chan, AST_SOFTHANGUP_DEV); ast_channel_unref(chan);