summaryrefslogtreecommitdiff
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-07-23 21:32:33 +0000
committerJonathan Rose <jrose@digium.com>2013-07-23 21:32:33 +0000
commitf3fcf0aa2ebde966c1cb3094b8d2a1c9fd365416 (patch)
tree9d15312cf2d5d9129689128e17053f696705feb4 /funcs/func_channel.c
parentc780fd5498c12a32026d441de40278fd5ba718e2 (diff)
func_channel: dtmf_features setting
Allows reading andsetting dtmf features via a channel function CHANNEL(dtmf_features) (closes issue ASTERISK-21876) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/2648/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 006c0cb99..4d098c347 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/indications.h"
#include "asterisk/stringfields.h"
#include "asterisk/global_datastores.h"
+#include "asterisk/bridging_basic.h"
/*** DOCUMENTATION
<function name="CHANNELS" language="en_US">
@@ -101,6 +102,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<enum name="audiowriteformat">
<para>R/O format currently being written.</para>
</enum>
+ <enum name="dtmf_features">
+ <para>R/W The channel's DTMF bridge features.
+ May include one or more of 'T' 'K' 'H' 'W' and 'X' in a similar manner to options
+ in the <literal>Dial</literal> application. When setting it, the features string
+ must be all upper case.</para>
+ </enum>
<enum name="callgroup">
<para>R/W numeric call pickup groups that this channel is a member.</para>
</enum>
@@ -436,9 +443,13 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
ast_copy_string(buf, ast_channel_trace_is_enabled(chan) ? "1" : "0", len);
ast_channel_unlock(chan);
#endif
- } else if (!strcasecmp(data, "tonezone") && ast_channel_zone(chan))
+ } else if (!strcasecmp(data, "tonezone") && ast_channel_zone(chan)) {
locked_copy_string(chan, buf, ast_channel_zone(chan)->country, len);
- else if (!strcasecmp(data, "language"))
+ } else if (!strcasecmp(data, "dtmf_features")) {
+ if (ast_bridge_features_ds_get_string(chan, buf, len)) {
+ buf[0] = '\0';
+ }
+ } else if (!strcasecmp(data, "language"))
locked_copy_string(chan, buf, ast_channel_language(chan), len);
else if (!strcasecmp(data, "musicclass"))
locked_copy_string(chan, buf, ast_channel_musicclass(chan), len);
@@ -615,6 +626,8 @@ static int func_channel_write_real(struct ast_channel *chan, const char *functio
ast_channel_unlock(chan);
new_zone = ast_tone_zone_unref(new_zone);
}
+ } else if (!strcasecmp(data, "dtmf_features")) {
+ ret = ast_bridge_features_ds_set_string(chan, value);
} else if (!strcasecmp(data, "callgroup")) {
ast_channel_lock(chan);
ast_channel_callgroup_set(chan, ast_get_group(value));