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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 8 09:50:43 CDT 2013


Author: mmichelson
Date: Wed May  8 09:50:40 2013
New Revision: 387959

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387959
Log:
Fix bridge logic in SIP's handle_invite_replaces()

In my tests, bridged scenarios were working, but as Josh
pointed out, it turns out that the reason for this is because
the bridged scenario could not actually evaluate true. This
meant that in all cases, I ended up performing an ast_channel_move()
instead of an ast_bridge_impart().


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=387959&r1=387958&r2=387959
==============================================================================
--- team/mmichelson/sip_attended_transfer/channels/chan_sip.c (original)
+++ team/mmichelson/sip_attended_transfer/channels/chan_sip.c Wed May  8 09:50:40 2013
@@ -24821,19 +24821,22 @@
 
 	ast_debug(4, "Invite/Replaces: preparing to masquerade %s into %s\n", ast_channel_name(c), ast_channel_name(replaces_chan));
 
-	bridge = ast_channel_get_bridge(c);
 	*nounlock = 1;
 	ast_channel_unlock(c);
 	sip_pvt_unlock(p);
 
 	ast_raw_answer(c, 1);
 
+	ast_channel_lock(replaces_chan);
+	bridge = ast_channel_get_bridge(replaces_chan);
+	ast_channel_unlock(replaces_chan);
+
 	if (bridge) {
-		ast_bridge_impart(bridge, replaces_chan, c, NULL, 1);
+		ast_bridge_impart(bridge, c, replaces_chan, NULL, 1);
 	} else {
 		ast_channel_move(replaces_chan, c);
-	}
-	ast_hangup(c);
+		ast_hangup(c);
+	}
 	sip_pvt_lock(p);
 	return 0;
 }




More information about the asterisk-commits mailing list