summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2013-05-01 20:01:43 +0000
committerRichard Mudgett <rmudgett@digium.com>2013-05-01 20:01:43 +0000
commit5fec9b8d1f107311ac13f67e742001c46f84c945 (patch)
tree9294900ac553d06c317b2fe24098ccfb79d350b9 /channels
parent213834ffd404f6d8343ce36ea4d581ea8ae1e06a (diff)
Remove some unnecessary calls to ast_bridged_channel() in chan_unistim.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_unistim.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c
index c26ac73a9..dea796364 100644
--- a/channels/chan_unistim.c
+++ b/channels/chan_unistim.c
@@ -2962,15 +2962,10 @@ static void transfer_call_step1(struct unistimsession *pte)
if (sub->moh) {
ast_log(LOG_WARNING, "Transfer with peer already listening music on hold\n");
} else {
- if (ast_bridged_channel(sub->owner)) {
- ast_moh_start(ast_bridged_channel(sub->owner),
- sub->parent->musicclass, NULL);
- sub->moh = 1;
- sub->subtype = SUB_THREEWAY;
- } else {
- ast_log(LOG_WARNING, "Unable to find peer subchannel for music on hold\n");
- return;
- }
+ ast_queue_control_data(sub->owner, AST_CONTROL_HOLD,
+ sub->parent->musicclass, strlen(sub->parent->musicclass) + 1);
+ sub->moh = 1;
+ sub->subtype = SUB_THREEWAY;
}
sub_start_silence(pte, sub);
handle_dial_page(pte);
@@ -2994,7 +2989,7 @@ static void transfer_cancel_step2(struct unistimsession *pte)
}
if (sub->owner) {
swap_subs(sub, sub_trans);
- ast_moh_stop(ast_bridged_channel(sub_trans->owner));
+ ast_queue_control(sub_trans->owner, AST_CONTROL_UNHOLD);
sub_trans->moh = 0;
sub_trans->subtype = SUB_REAL;
sub->subtype = SUB_THREEWAY;
@@ -3502,13 +3497,9 @@ static void key_dial_page(struct unistimsession *pte, char keycode)
break;
case KEY_HANGUP:
if (sub && sub->owner) {
- struct ast_channel *bridgepeer = NULL;
-
sub_stop_silence(pte, sub);
send_tone(pte, 0, 0);
- if ((bridgepeer = ast_bridged_channel(sub->owner))) {
- ast_moh_stop(bridgepeer);
- }
+ ast_queue_control(sub->owner, AST_CONTROL_UNHOLD);
sub->moh = 0;
sub->subtype = SUB_REAL;
pte->state = STATE_CALL;
@@ -3519,7 +3510,7 @@ static void key_dial_page(struct unistimsession *pte, char keycode)
send_led_update(pte, 0x08);
send_led_update(pte, 0x10);
show_main_page(pte);
- }
+ }
break;
case KEY_FAV0:
case KEY_FAV1:
@@ -4799,9 +4790,7 @@ static int unistim_hangup(struct ast_channel *ast)
if (unistimdebug) {
ast_verb(0, "Threeway call disconnected, switching to real call\n");
}
- if (ast_bridged_channel(sub_trans->owner)) {
- ast_moh_stop(ast_bridged_channel(sub_trans->owner));
- }
+ ast_queue_control(sub_trans->owner, AST_CONTROL_UNHOLD);
sub_trans->moh = 0;
sub_trans->subtype = SUB_REAL;
swap_subs(sub_trans, sub);