[svn-commits] mmichelson: branch mmichelson/bridged_channel r395723 - /team/mmichelson/brid...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 29 18:08:34 CDT 2013


Author: mmichelson
Date: Mon Jul 29 18:08:33 2013
New Revision: 395723

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395723
Log:
Remove ast_bridged_channel from chan_mgcp


Modified:
    team/mmichelson/bridged_channel/channels/chan_mgcp.c

Modified: team/mmichelson/bridged_channel/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/bridged_channel/channels/chan_mgcp.c?view=diff&rev=395723&r1=395722&r2=395723
==============================================================================
--- team/mmichelson/bridged_channel/channels/chan_mgcp.c (original)
+++ team/mmichelson/bridged_channel/channels/chan_mgcp.c Mon Jul 29 18:08:33 2013
@@ -920,7 +920,6 @@
 {
 	struct mgcp_subchannel *sub = ast_channel_tech_pvt(ast);
 	struct mgcp_endpoint *p = sub->parent;
-	struct ast_channel *bridged;
 
 	ast_debug(1, "mgcp_hangup(%s)\n", ast_channel_name(ast));
 	if (!ast_channel_tech_pvt(ast)) {
@@ -967,10 +966,11 @@
 	}
 	sub->cxident[0] = '\0';
 	if ((sub == p->sub) && sub->next->owner) {
+		RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(sub->next->owner), ast_channel_cleanup);
+
 		if (p->hookstate == MGCP_OFFHOOK) {
-			if (sub->next->owner && ast_bridged_channel(sub->next->owner)) {
+			if (sub->next->owner && bridged) {
 				/* ncs fix! */
-				bridged = ast_bridged_channel(sub->next->owner);
 				transmit_notify_request_with_callerid(p->sub, (p->ncs ? "L/wt1" : "L/wt"),
 					S_COR(ast_channel_caller(bridged)->id.number.valid, ast_channel_caller(bridged)->id.number.str, ""),
 					S_COR(ast_channel_caller(bridged)->id.name.valid, ast_channel_caller(bridged)->id.name.str, ""));
@@ -980,8 +980,7 @@
 			p->sub = sub->next;
 			p->sub->cxmode = MGCP_CX_RECVONLY;
 			transmit_modify_request(p->sub);
-			if (sub->next->owner && ast_bridged_channel(sub->next->owner)) {
-				bridged = ast_bridged_channel(sub->next->owner);
+			if (sub->next->owner && bridged) {
 				transmit_notify_request_with_callerid(p->sub, "L/rg",
 					S_COR(ast_channel_caller(bridged)->id.number.valid, ast_channel_caller(bridged)->id.number.str, ""),
 					S_COR(ast_channel_caller(bridged)->id.name.valid, ast_channel_caller(bridged)->id.name.str, ""));
@@ -3149,11 +3148,16 @@
 			memset(p->dtmf_buf, 0, sizeof(p->dtmf_buf));
 			len = 0;
 		} else if (ast_parking_ext_valid(p->dtmf_buf, chan, ast_channel_context(chan)) &&
-			sub->next->owner && ast_bridged_channel(sub->next->owner)) {
+			sub->next->owner && ast_channel_is_bridged(sub->next->owner)) {
+			RAII_VAR(struct ast_channel *, bridged, ast_channel_bridge_peer(sub->next->owner), ast_channel_cleanup);
+
+			if (!bridged) {
+				break;
+			}
+
 			/* This is a three way call, the main call being a real channel,
 			   and we're parking the first call. */
-			ast_masq_park_call_exten(ast_bridged_channel(sub->next->owner), chan,
-				p->dtmf_buf, ast_channel_context(chan), 0, NULL);
+			ast_masq_park_call_exten(bridged, chan, p->dtmf_buf, ast_channel_context(chan), 0, NULL);
 			ast_verb(3, "Parking call to '%s'\n", ast_channel_name(chan));
 			break;
 		} else if (!ast_strlen_zero(p->lastcallerid) && !strcmp(p->dtmf_buf, "*60")) {




More information about the svn-commits mailing list