summaryrefslogtreecommitdiff
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-08-02 14:05:07 +0000
committerMark Michelson <mmichelson@digium.com>2013-08-02 14:05:07 +0000
commitf8622e7c5cbdda91a5efad230a9e3af593378c7c (patch)
treeac2c4b5f2256fb55c84fb8915d82298d23c0e188 /channels/chan_mgcp.c
parent57a8148ccd704f02f33c65d902b199f4205e5480 (diff)
Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.
This commit is smaller than the initial review placed on review board. This is because a change to allow for channel drivers to access parking functionality externally was committed and invalidated quite a few of the changes initially made. (closes issue ASTERISK-22039) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2717 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index b99064646..07d8434cb 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -922,7 +922,6 @@ static int mgcp_hangup(struct ast_channel *ast)
{
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)) {
@@ -969,10 +968,11 @@ static int mgcp_hangup(struct ast_channel *ast)
}
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, ""));
@@ -982,8 +982,7 @@ static int mgcp_hangup(struct ast_channel *ast)
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, ""));