aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-04 11:47:51 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-04 11:47:51 +0000
commit3e24132b576496686b4099af0fa08135c0a3f260 (patch)
treeb2c267040c8a460b3140ce5e261b25ab9f70a834 /funcs/func_channel.c
parentd83ea735dc1addcbd6ee876f649cfecbcdb196e6 (diff)
Make tonezone writeable in CHANNEL() (from my old func_tonezone.c)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32018 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 66ea0d465..dd51bb0a6 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -108,7 +108,14 @@ static int func_channel_write(struct ast_channel *chan, char *function,
locked_string_field_set(chan, language, value);
else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value);
- else if (!strcasecmp(data, "callgroup"))
+ else if (!strcasecmp(data, "tonezone")) {
+ struct tone_zone *new_zone;
+ if (!(new_zone = ast_get_indication_zone(data))) {
+ ast_log(LOG_ERROR, "Unknown country code for tonezone. Check indications.conf for available country codes.\n");
+ ret = -1;
+ } else
+ chan->zone = new_zone;
+ } else if (!strcasecmp(data, "callgroup"))
chan->callgroup = ast_get_group(data);
else if (!strcasecmp(data, "txgain")) {
sscanf(value, "%hhd", &gainset);
@@ -149,7 +156,7 @@ static struct ast_custom_function channel_function = {
"R/W musicclass class (from musiconhold.conf) for hold music\n"
"R/W rxgain set rxgain level on channel drivers that support it\n"
"R/O state state for channel\n"
- "R/O tonezone zone for indications played\n"
+ "R/W tonezone zone for indications played\n"
"R/W txgain set txgain level on channel drivers that support it\n"
"R/O videonativeformat format used natively for video\n"
"\n"