summaryrefslogtreecommitdiff
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2009-03-17 21:28:04 +0000
committerRussell Bryant <russell@russellbryant.com>2009-03-17 21:28:04 +0000
commit16fc1993ef4612fc610eb72e2c769a7ef6b05144 (patch)
treeced71772c0fb3525fb9208e47647cc5a8241f967 /funcs/func_channel.c
parent9dc40485f212e6adc3ff87f9bdbe1c68cddfde64 (diff)
Add support for the "name" option in the CHANNEL() function.
Review: http://reviewboard.digium.com/r/199/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index ff8eeb2e5..5cf262154 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -83,6 +83,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<enum name="musicclass">
<para>R/W class (from musiconhold.conf) for hold music.</para>
</enum>
+ <enum name="name">
+ <para>The name of the channel</para>
+ </enum>
<enum name="parkinglot">
<para>R/W parkinglot for parking.</para>
</enum>
@@ -249,7 +252,9 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
locked_copy_string(chan, buf, chan->language, len);
else if (!strcasecmp(data, "musicclass"))
locked_copy_string(chan, buf, chan->musicclass, len);
- else if (!strcasecmp(data, "parkinglot"))
+ else if (!strcasecmp(data, "name")) {
+ locked_copy_string(chan, buf, chan->name, len);
+ } else if (!strcasecmp(data, "parkinglot"))
locked_copy_string(chan, buf, chan->parkinglot, len);
else if (!strcasecmp(data, "state"))
locked_copy_string(chan, buf, ast_state2str(chan->_state), len);