[asterisk-commits] igorg: branch 11 r375016 - /branches/11/channels/chan_unistim.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 15 03:11:48 CDT 2012


Author: igorg
Date: Mon Oct 15 03:11:45 2012
New Revision: 375016

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375016
Log:

Fix underscreen buttons warnings apeared while transfer process


Modified:
    branches/11/channels/chan_unistim.c

Modified: branches/11/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_unistim.c?view=diff&rev=375016&r1=375015&r2=375016
==============================================================================
--- branches/11/channels/chan_unistim.c (original)
+++ branches/11/channels/chan_unistim.c Mon Oct 15 03:11:45 2012
@@ -3297,7 +3297,7 @@
 
 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_SHARP) {
 			keycode = '#';
@@ -3311,15 +3311,19 @@
 	}
 	switch (keycode) {
 	case KEY_FUNC1:
-		if (get_sub(pte->device, SUB_THREEWAY)) {
-			close_call(pte);
+		if (ast_channel_state(sub->owner) == AST_STATE_UP) {
+			if (get_sub(pte->device, SUB_THREEWAY)) {
+				close_call(pte);
+			}
 		}
 		break;
 	case KEY_FUNC2:
-		if (get_sub(pte->device, SUB_THREEWAY)) {
-			transfer_cancel_step2(pte);
-		} else {
-			transfer_call_step1(pte);
+		if (ast_channel_state(sub->owner) == AST_STATE_UP) {
+			if (get_sub(pte->device, SUB_THREEWAY)) {
+				transfer_cancel_step2(pte);
+			} else {
+				transfer_call_step1(pte);
+			}
 		}
 		break;
 	case KEY_HANGUP:
@@ -3351,7 +3355,6 @@
 							 MUTE_OFF);
 		break;
 	case KEY_MUTE:
-		sub = get_sub(pte->device, SUB_REAL);
 		if (!sub || !sub->owner) {
 			ast_log(LOG_WARNING, "Unable to find subchannel for music on hold\n");
 			return;
@@ -3366,7 +3369,6 @@
 		}
 		break;
 	case KEY_ONHOLD:
-		sub = get_sub(pte->device, SUB_REAL);
 		if (!sub) {
 			if(pte->device->ssub[pte->device->selected]) {
 				sub_hold(pte, pte->device->ssub[pte->device->selected]);




More information about the asterisk-commits mailing list