Fix underscreen buttons warnings apeared while transfer process

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@375016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Igor Goncharovskiy
2012-10-15 08:11:45 +00:00
parent cabdb471fb
commit 5b1a89e1b1

View File

@@ -3297,7 +3297,7 @@ static void handle_key_fav(struct unistimsession *pte, char keycode)
static void key_call(struct unistimsession *pte, char keycode) static void key_call(struct unistimsession *pte, char keycode)
{ {
struct unistim_subchannel *sub = NULL; struct unistim_subchannel *sub = get_sub(pte->device, SUB_REAL);
if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) { if ((keycode >= KEY_0) && (keycode <= KEY_SHARP)) {
if (keycode == KEY_SHARP) { if (keycode == KEY_SHARP) {
keycode = '#'; keycode = '#';
@@ -3311,16 +3311,20 @@ static void key_call(struct unistimsession *pte, char keycode)
} }
switch (keycode) { switch (keycode) {
case KEY_FUNC1: case KEY_FUNC1:
if (ast_channel_state(sub->owner) == AST_STATE_UP) {
if (get_sub(pte->device, SUB_THREEWAY)) { if (get_sub(pte->device, SUB_THREEWAY)) {
close_call(pte); close_call(pte);
} }
}
break; break;
case KEY_FUNC2: case KEY_FUNC2:
if (ast_channel_state(sub->owner) == AST_STATE_UP) {
if (get_sub(pte->device, SUB_THREEWAY)) { if (get_sub(pte->device, SUB_THREEWAY)) {
transfer_cancel_step2(pte); transfer_cancel_step2(pte);
} else { } else {
transfer_call_step1(pte); transfer_call_step1(pte);
} }
}
break; break;
case KEY_HANGUP: case KEY_HANGUP:
case KEY_FUNC4: case KEY_FUNC4:
@@ -3351,7 +3355,6 @@ static void key_call(struct unistimsession *pte, char keycode)
MUTE_OFF); MUTE_OFF);
break; break;
case KEY_MUTE: case KEY_MUTE:
sub = get_sub(pte->device, SUB_REAL);
if (!sub || !sub->owner) { if (!sub || !sub->owner) {
ast_log(LOG_WARNING, "Unable to find subchannel for music on hold\n"); ast_log(LOG_WARNING, "Unable to find subchannel for music on hold\n");
return; return;
@@ -3366,7 +3369,6 @@ static void key_call(struct unistimsession *pte, char keycode)
} }
break; break;
case KEY_ONHOLD: case KEY_ONHOLD:
sub = get_sub(pte->device, SUB_REAL);
if (!sub) { if (!sub) {
if(pte->device->ssub[pte->device->selected]) { if(pte->device->ssub[pte->device->selected]) {
sub_hold(pte, pte->device->ssub[pte->device->selected]); sub_hold(pte, pte->device->ssub[pte->device->selected]);