diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-03-24 12:29:10 -0400 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-03-24 10:31:39 -0600 |
commit | d08c69a9e28d98d386971bd8527dec3926f0502b (patch) | |
tree | a3ecea4da7caf54b972fbb61cfda15cf502df311 /res/res_pjsip_sdp_rtp.c | |
parent | 6666deb9078ef5db13c5e4ea8923e412e30b3db5 (diff) |
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
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index a82475774..b66c1aeb8 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -163,6 +163,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); |