[asterisk-commits] russell: trunk r96079 - /trunk/channels/chan_console.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 2 17:22:26 CST 2008


Author: russell
Date: Wed Jan  2 17:22:25 2008
New Revision: 96079

URL: http://svn.digium.com/view/asterisk?view=rev&rev=96079
Log:
Add support for generating a ringing sound on an incoming call.  This is a bit
of a hack.  It just asks the core to generate the same tone that it would when
you hear ringback when making an outbound call.  But hey, it works, and you get
the localized ring tone for the appropriate language set on the channel.

Modified:
    trunk/channels/chan_console.c

Modified: trunk/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_console.c?view=diff&rev=96079&r1=96078&r2=96079
==============================================================================
--- trunk/channels/chan_console.c (original)
+++ trunk/channels/chan_console.c Wed Jan  2 17:22:25 2008
@@ -42,7 +42,6 @@
  * - transfer CLI command
  * - boost CLI command and .conf option
  * - console_video support
- * - Add ringing sound on incoming calls
  */
 
 /*** MODULEINFO
@@ -466,18 +465,19 @@
 	console_pvt_lock(pvt);
 
 	if (pvt->autoanswer) {
+		pvt->hookstate = 1;
+		console_pvt_unlock(pvt);
 		ast_verb(1, V_BEGIN "Auto-answered" V_END);
-		pvt->hookstate = 1;
 		f.frametype = AST_FRAME_CONTROL;
 		f.subclass = AST_CONTROL_ANSWER;
 	} else {
+		console_pvt_unlock(pvt);
 		ast_verb(1, V_BEGIN "Type 'console answer' to answer, or use the 'autoanswer' option "
 				"for future calls" V_END);
 		f.frametype = AST_FRAME_CONTROL;
 		f.subclass = AST_CONTROL_RINGING;
-	}
-
-	console_pvt_unlock(pvt);
+		ast_indicate(c, AST_CONTROL_RINGING);
+	}
 
 	ast_queue_frame(c, &f);
 
@@ -502,12 +502,12 @@
 	case AST_CONTROL_BUSY:
 	case AST_CONTROL_CONGESTION:
 	case AST_CONTROL_RINGING:
+	case -1:
 		res = -1;  /* Ask for inband indications */
 		break;
 	case AST_CONTROL_PROGRESS:
 	case AST_CONTROL_PROCEEDING:
 	case AST_CONTROL_VIDUPDATE:
-	case -1:
 		break;
 	case AST_CONTROL_HOLD:
 		ast_verb(1, V_BEGIN "Console Has Been Placed on Hold" V_END);
@@ -835,6 +835,9 @@
 	}
 
 	pvt->hookstate = 1;
+
+	ast_indicate(pvt->owner, -1);
+
 	ast_queue_frame(pvt->owner, &f);
 
 	return CLI_SUCCESS;




More information about the asterisk-commits mailing list