aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-06 19:48:06 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2011-05-06 19:48:06 +0000
commitd95833ef8ab1f606e0a26e505edb7c7f70926c66 (patch)
treef3641e9f054ffe0670eecb67d524ef5f36940493 /channels
parent9dea52016cd3d69d79867c66a3cc0d17aedf23eb (diff)
Merged revisions 317865 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317865 | russell | 2011-05-06 14:46:49 -0500 (Fri, 06 May 2011) | 11 lines chan_sip: fix a deadlock in check_rtp_timeout. Don't block doing silly deadlock avoidance. Just return and try again later. The funciton gets called often enough that it's fine. Also, this change was already made in trunk. (closes issue #18791) Reported by: irroot Patches: chan_sip.rtptimeout.patch uploaded by irroot (license 52) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@317866 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 0712e8c5d..eeff8905a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -24933,10 +24933,11 @@ static void check_rtp_timeout(struct sip_pvt *dialog, time_t t)
if (!ast_test_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD) || (ast_rtp_instance_get_hold_timeout(dialog->rtp) && (t > dialog->lastrtprx + ast_rtp_instance_get_hold_timeout(dialog->rtp)))) {
/* Needs a hangup */
if (ast_rtp_instance_get_timeout(dialog->rtp)) {
- if(ast_channel_trylock(dialog->owner)) {
- /* Dont do a infinite deadlock avoidance loop.
- * Lets try this on next round (1 ms to 1000 ms later)
- * call is allready dead */
+ if (!dialog->owner || ast_channel_trylock(dialog->owner)) {
+ /*
+ * Don't block, just try again later.
+ * If there was no owner, the call is dead already.
+ */
return;
}
ast_log(LOG_NOTICE, "Disconnecting call '%s' for lack of RTP activity in %ld seconds\n",