[asterisk-commits] file: branch 13 r428761 - in /branches/13: ./ res/res_pjsip_refer.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 2 06:21:01 CST 2014


Author: file
Date: Tue Dec  2 06:20:58 2014
New Revision: 428761

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=428761
Log:
res_pjsip_refer: Fix issue where native bridge may not occur upon completion of a transfer.

There are two methods within res_pjsip_refer for keeping track of the state of a transfer.
The first is a framehook which looks at frames passing by to determine the state. The second
subscribes to know when the channel joins a bridge. In the case when the channel joins the
bridge the framehook is *NOT* removed and this prevents the native RTP bridging technology
from getting used.

This change gets the channel and if it still exists remove the framehook.

Review: https://reviewboard.asterisk.org/r/4218/
........

Merged revisions 428760 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    branches/13/   (props changed)
    branches/13/res/res_pjsip_refer.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/res/res_pjsip_refer.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_refer.c?view=diff&rev=428761&r1=428760&r2=428761
==============================================================================
--- branches/13/res/res_pjsip_refer.c (original)
+++ branches/13/res/res_pjsip_refer.c Tue Dec  2 06:20:58 2014
@@ -149,6 +149,7 @@
 	struct refer_progress *progress = data;
 	struct ast_bridge_blob *enter_blob;
 	struct refer_progress_notification *notification;
+	struct ast_channel *chan;
 
 	if (stasis_subscription_final_message(sub, message)) {
 		ao2_ref(progress, -1);
@@ -180,6 +181,20 @@
 		}
 		progress->bridge_sub = stasis_unsubscribe(progress->bridge_sub);
 	}
+
+	chan = ast_channel_get_by_name(progress->transferee);
+	if (!chan) {
+		/* The channel is already gone */
+		return;
+	}
+
+	ast_channel_lock(chan);
+	ast_debug(3, "Detaching REFER progress monitoring hook from '%s' as it has joined a bridge\n",
+		ast_channel_name(chan));
+	ast_framehook_detach(chan, progress->framehook);
+	ast_channel_unlock(chan);
+
+	ast_channel_unref(chan);
 }
 
 /*! \brief Progress monitoring frame hook - examines frames to determine state of transfer */




More information about the asterisk-commits mailing list