From 245fbece26ad9bbdcacc23900e2df85fbb0931d3 Mon Sep 17 00:00:00 2001 From: russell Date: Wed, 2 Jan 2008 23:22:25 +0000 Subject: 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. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96079 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_console.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'channels/chan_console.c') diff --git a/channels/chan_console.c b/channels/chan_console.c index 3e9efcb39..1bdd836ea 100644 --- a/channels/chan_console.c +++ b/channels/chan_console.c @@ -42,7 +42,6 @@ * - transfer CLI command * - boost CLI command and .conf option * - console_video support - * - Add ringing sound on incoming calls */ /*** MODULEINFO @@ -466,19 +465,20 @@ static int console_call(struct ast_channel *c, char *dest, int timeout) console_pvt_lock(pvt); if (pvt->autoanswer) { - ast_verb(1, V_BEGIN "Auto-answered" V_END); pvt->hookstate = 1; + console_pvt_unlock(pvt); + ast_verb(1, V_BEGIN "Auto-answered" V_END); 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; + ast_indicate(c, AST_CONTROL_RINGING); } - console_pvt_unlock(pvt); - ast_queue_frame(c, &f); return start_stream(pvt); @@ -502,12 +502,12 @@ static int console_indicate(struct ast_channel *chan, int cond, const void *data 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 @@ static char *cli_console_answer(struct ast_cli_entry *e, int cmd, struct ast_cli } pvt->hookstate = 1; + + ast_indicate(pvt->owner, -1); + ast_queue_frame(pvt->owner, &f); return CLI_SUCCESS; -- cgit v1.2.3