[asterisk-commits] russell: branch russell/chan_console r49049 - in
/team/russell/chan_console: ...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Dec 28 17:54:59 MST 2006
Author: russell
Date: Thu Dec 28 18:54:59 2006
New Revision: 49049
URL: http://svn.digium.com/view/asterisk?view=rev&rev=49049
Log:
add support for the "mohinterpret" option
Modified:
team/russell/chan_console/channels/chan_console.c
team/russell/chan_console/configs/console.conf.sample
Modified: team/russell/chan_console/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/channels/chan_console.c?view=diff&rev=49049&r1=49048&r2=49049
==============================================================================
--- team/russell/chan_console/channels/chan_console.c (original)
+++ team/russell/chan_console/channels/chan_console.c Thu Dec 28 18:54:59 2006
@@ -61,6 +61,7 @@
struct ast_channel *owner;
PaStream *stream;
const char *name;
+ char mohinterpret[MAX_MUSICCLASS];
struct ast_frame fr;
char read_buf[NUM_SAMPLES * 2 + AST_FRIENDLY_OFFSET];
char write_buf[NUM_SAMPLES * 2];
@@ -286,7 +287,7 @@
break;
case AST_CONTROL_HOLD:
ast_verbose(" << Console Has Been Placed on Hold >> \n");
- ast_moh_start(chan, data, NULL);
+ ast_moh_start(chan, data, pvt.mohinterpret);
break;
case AST_CONTROL_UNHOLD:
ast_verbose(" << Console Has Been Retrieved from Hold >> \n");
@@ -582,7 +583,9 @@
struct ast_config *cfg;
struct ast_variable *v;
+ /* default values */
memcpy(&global_jbconf, &default_jbconf, sizeof(global_jbconf));
+ strcpy(pvt.mohinterpret, "default");
if (!(cfg = ast_config_load(CONFIG_FILE))) {
ast_log(LOG_NOTICE, "Unable to open configuration file %s!\n", CONFIG_FILE);
@@ -591,10 +594,13 @@
v = ast_variable_browse(cfg, "general");
for (; v; v = v->next) {
if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
- continue;
-
- ast_log(LOG_WARNING, "Unknown option '%s' on line '%d' of '%s'!\n",
- v->name, v->lineno, CONFIG_FILE);
+ continue;
+ else if (!strcasecmp(v->name, "mohinterpret"))
+ ast_copy_string(pvt.mohinterpret, v->value, sizeof(pvt.mohinterpret));
+ else {
+ ast_log(LOG_WARNING, "Unknown option '%s' on line '%d' of '%s'!\n",
+ v->name, v->lineno, CONFIG_FILE);
+ }
}
ast_config_destroy(cfg);
Modified: team/russell/chan_console/configs/console.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/chan_console/configs/console.conf.sample?view=diff&rev=49049&r1=49048&r2=49049
==============================================================================
--- team/russell/chan_console/configs/console.conf.sample (original)
+++ team/russell/chan_console/configs/console.conf.sample Thu Dec 28 18:54:59 2006
@@ -3,6 +3,13 @@
;
[general]
+
+; Default Music on Hold class to use when this channel is placed on hold in
+; the case that the music class is not set on the channel with
+; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel
+; putting this one on hold did not suggest a class to use.
+;
+; mohinterpret=default
;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an
More information about the asterisk-commits
mailing list