[asterisk-commits] mmichelson: branch mmichelson/sip_attended_transfer r387774 - /team/mmichelso...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 6 13:58:47 CDT 2013


Author: mmichelson
Date: Mon May  6 13:58:44 2013
New Revision: 387774

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387774
Log:
Fix channel refcount issue in handling INVITE with Replaces.

Incoming INVITE with replaces is properly handled for both
bridged and unbridged calls now.


Modified:
    team/mmichelson/sip_attended_transfer/channels/chan_sip.c

Modified: team/mmichelson/sip_attended_transfer/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_attended_transfer/channels/chan_sip.c?view=diff&rev=387774&r1=387773&r2=387774
==============================================================================
--- team/mmichelson/sip_attended_transfer/channels/chan_sip.c (original)
+++ team/mmichelson/sip_attended_transfer/channels/chan_sip.c Mon May  6 13:58:44 2013
@@ -24787,13 +24787,13 @@
 		struct ast_channel *replaces_chan)
 {
 	RAII_VAR(struct ast_bridge *, bridge, NULL, ao2_cleanup);
-	RAII_VAR(struct ast_channel *, c, p->owner, ao2_cleanup);
+	RAII_VAR(struct ast_channel *, c, NULL, ao2_cleanup);
 
 	if (req->ignore) {
 		return 0;
 	}
 
-	if (!c) {
+	if (!p->owner) {
 		/* What to do if no channel ??? */
 		ast_log(LOG_ERROR, "Unable to create new channel.  Invite/replace failed.\n");
 		transmit_response_reliable(p, "503 Service Unavailable", req);
@@ -24802,6 +24802,8 @@
 		return 1;
 	}
 	append_history(p, "Xfer", "INVITE/Replace received");
+
+	c = ast_channel_ref(p->owner);
 
 	/* Fake call progress */
 	transmit_response(p, "100 Trying", req);




More information about the asterisk-commits mailing list