summaryrefslogtreecommitdiff
path: root/funcs/func_channel.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-09-07 21:14:54 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-09-07 21:14:54 +0000
commit2302618bb78a987a2cffa7cef663c25f7730fbb2 (patch)
tree48678d6ed3be29a1537d3b691faf097d4fe90797 /funcs/func_channel.c
parent4e0612340ecf0174bbe0583527b7d290e4ed8b80 (diff)
Merged revisions 285373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r285373 | tilghman | 2010-09-07 16:14:03 -0500 (Tue, 07 Sep 2010) | 7 lines Add CHANNEL(checkhangup) to check whether a channel is in the process of being hanged up. (closes issue #17652) Reported by: kobaz Patches: func_channel.patch uploaded by kobaz (license 834) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_channel.c')
-rw-r--r--funcs/func_channel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/funcs/func_channel.c b/funcs/func_channel.c
index 729bdf45b..1416efc39 100644
--- a/funcs/func_channel.c
+++ b/funcs/func_channel.c
@@ -88,6 +88,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<enum name="channeltype">
<para>R/O technology used for channel.</para>
</enum>
+ <enum name="checkhangup">
+ <para>1/0 whether the channel is hanging up</para>
+ </enum>
<enum name="language">
<para>R/W language for sounds played.</para>
</enum>
@@ -298,7 +301,11 @@ static int func_channel_read(struct ast_channel *chan, const char *function,
locked_copy_string(chan, buf, chan->tech->type, len);
else if (!strcasecmp(data, "accountcode"))
locked_copy_string(chan, buf, chan->accountcode, len);
- else if (!strcasecmp(data, "peeraccount"))
+ else if (!strcasecmp(data, "checkhangup")) {
+ ast_channel_lock(chan);
+ ast_copy_string(buf, ast_check_hangup(chan) ? "1" : "0", len);
+ ast_channel_unlock(chan);
+ } else if (!strcasecmp(data, "peeraccount"))
locked_copy_string(chan, buf, chan->peeraccount, len);
else if (!strcasecmp(data, "hangupsource"))
locked_copy_string(chan, buf, chan->hangupsource, len);