mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-18 18:58:22 +00:00
Remove some unnecessary calls to ast_bridged_channel() in chan_mgcp.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3226,11 +3226,10 @@ static int attempt_transfer(struct mgcp_endpoint *p)
|
||||
together (but then, why would we want to?) */
|
||||
if (ast_bridged_channel(p->sub->owner)) {
|
||||
/* The three-way person we're about to transfer to could still be in MOH, so
|
||||
stop if now if appropriate */
|
||||
if (ast_bridged_channel(p->sub->next->owner))
|
||||
stop it now */
|
||||
ast_queue_control(p->sub->next->owner, AST_CONTROL_UNHOLD);
|
||||
if (ast_channel_state(p->sub->owner) == AST_STATE_RINGING) {
|
||||
ast_indicate(ast_bridged_channel(p->sub->next->owner), AST_CONTROL_RINGING);
|
||||
ast_queue_control(p->sub->next->owner, AST_CONTROL_RINGING);
|
||||
}
|
||||
if (ast_channel_masquerade(p->sub->next->owner, ast_bridged_channel(p->sub->owner))) {
|
||||
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
|
||||
@@ -3241,7 +3240,7 @@ static int attempt_transfer(struct mgcp_endpoint *p)
|
||||
unalloc_sub(p->sub->next);
|
||||
} else if (ast_bridged_channel(p->sub->next->owner)) {
|
||||
if (ast_channel_state(p->sub->owner) == AST_STATE_RINGING) {
|
||||
ast_indicate(ast_bridged_channel(p->sub->next->owner), AST_CONTROL_RINGING);
|
||||
ast_queue_control(p->sub->next->owner, AST_CONTROL_RINGING);
|
||||
}
|
||||
ast_queue_control(p->sub->next->owner, AST_CONTROL_UNHOLD);
|
||||
if (ast_channel_masquerade(p->sub->owner, ast_bridged_channel(p->sub->next->owner))) {
|
||||
@@ -3277,7 +3276,6 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
|
||||
if (sub->outgoing) {
|
||||
/* Answered */
|
||||
if (sub->owner) {
|
||||
if (ast_bridged_channel(sub->owner))
|
||||
ast_queue_control(sub->owner, AST_CONTROL_UNHOLD);
|
||||
sub->cxmode = MGCP_CX_SENDRECV;
|
||||
if (!sub->rtp) {
|
||||
@@ -3334,7 +3332,6 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
|
||||
ast_log(LOG_WARNING, "On hook, but already have owner on %s@%s\n", p->name, p->parent->name);
|
||||
ast_log(LOG_WARNING, "If we're onhook why are we here trying to handle a hd or hf?\n");
|
||||
}
|
||||
if (ast_bridged_channel(sub->owner))
|
||||
ast_queue_control(sub->owner, AST_CONTROL_UNHOLD);
|
||||
sub->cxmode = MGCP_CX_SENDRECV;
|
||||
if (!sub->rtp) {
|
||||
@@ -3452,19 +3449,18 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
|
||||
sub->cxmode = MGCP_CX_MUTE;
|
||||
ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
|
||||
transmit_modify_request(sub);
|
||||
if (sub->owner && ast_bridged_channel(sub->owner))
|
||||
if (sub->owner)
|
||||
ast_queue_control(sub->owner, AST_CONTROL_HOLD);
|
||||
sub->next->cxmode = MGCP_CX_RECVONLY;
|
||||
handle_hd_hf(sub->next, ev);
|
||||
} else if (sub->owner && sub->next->owner) {
|
||||
/* We've got two active calls lets decide whether or not to conference or just flip flop */
|
||||
if ((!sub->outgoing) && (!sub->next->outgoing)) {
|
||||
/* We made both calls lets conferenct */
|
||||
/* We made both calls lets conference */
|
||||
ast_verb(3, "MGCP Conferencing %d and %d on %s@%s\n",
|
||||
sub->id, sub->next->id, p->name, p->parent->name);
|
||||
sub->cxmode = MGCP_CX_CONF;
|
||||
sub->next->cxmode = MGCP_CX_CONF;
|
||||
if (ast_bridged_channel(sub->next->owner))
|
||||
ast_queue_control(sub->next->owner, AST_CONTROL_UNHOLD);
|
||||
transmit_modify_request(sub);
|
||||
transmit_modify_request(sub->next);
|
||||
@@ -3477,10 +3473,8 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
|
||||
sub->cxmode = MGCP_CX_MUTE;
|
||||
ast_verb(3, "MGCP Muting %d on %s@%s\n", sub->id, p->name, p->parent->name);
|
||||
transmit_modify_request(sub);
|
||||
if (ast_bridged_channel(sub->owner))
|
||||
ast_queue_control(sub->owner, AST_CONTROL_HOLD);
|
||||
|
||||
if (ast_bridged_channel(sub->next->owner))
|
||||
ast_queue_control(sub->owner, AST_CONTROL_HOLD);
|
||||
ast_queue_control(sub->next->owner, AST_CONTROL_HOLD);
|
||||
|
||||
handle_hd_hf(sub->next, ev);
|
||||
@@ -3496,7 +3490,6 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
|
||||
/* XXX - What do we do now? */
|
||||
return -1;
|
||||
}
|
||||
if (ast_bridged_channel(p->sub->owner))
|
||||
ast_queue_control(p->sub->owner, AST_CONTROL_UNHOLD);
|
||||
p->sub->cxmode = MGCP_CX_SENDRECV;
|
||||
transmit_modify_request(p->sub);
|
||||
|
Reference in New Issue
Block a user