[asterisk-commits] file: branch file/gulp_transfer r387691 - /team/file/gulp_transfer/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 6 10:59:30 CDT 2013


Author: file
Date: Mon May  6 10:59:28 2013
New Revision: 387691

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387691
Log:
Fix a bug where a subscription may be left in an unterminated state if the progress monitoring frame hook is prematurely destroyed.

Modified:
    team/file/gulp_transfer/res/res_sip_refer.c

Modified: team/file/gulp_transfer/res/res_sip_refer.c
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_transfer/res/res_sip_refer.c?view=diff&rev=387691&r1=387690&r2=387691
==============================================================================
--- team/file/gulp_transfer/res/res_sip_refer.c (original)
+++ team/file/gulp_transfer/res/res_sip_refer.c Mon May  6 10:59:28 2013
@@ -165,23 +165,33 @@
 
 	/* If a notification is due to be sent push it to the thread pool */
 	if (notification) {
+		if (ast_sip_push_task(progress->serializer, refer_progress_notify, notification)) {
+			ao2_cleanup(notification);
+		}
+
 		/* If the subscription is being terminated we don't need the frame hook any longer */
 		if (notification->state == PJSIP_EVSUB_STATE_TERMINATED) {
 			ast_framehook_detach(chan, progress->framehook);
 		}
 
+	}
+
+	return f;
+}
+
+/*! \brief Destroy callback for monitoring framehook */
+static void refer_progress_framehook_destroy(void *data)
+{
+	struct refer_progress *progress = data;
+	struct refer_progress_notification *notification = refer_progress_notification_alloc(progress, 503, PJSIP_EVSUB_STATE_TERMINATED);
+
+	if (notification) {
 		if (ast_sip_push_task(progress->serializer, refer_progress_notify, notification)) {
 			ao2_cleanup(notification);
 		}
 	}
 
-	return f;
-}
-
-/*! \brief Destroy callback for monitoring framehook */
-static void refer_progress_framehook_destroy(void *data)
-{
-	ao2_cleanup(data);
+	ao2_cleanup(progress);
 }
 
 /*! \brief Serialized callback for subscription termination */




More information about the asterisk-commits mailing list