From: Tilghman Lesher Date: Tue, 7 Sep 2010 21:14:54 +0000 (+0000) Subject: Merged revisions 285373 via svnmerge from X-Git-Tag: 11.0.0-beta1~2364 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2302618bb78a987a2cffa7cef663c25f7730fbb2;p=thirdparty%2Fasterisk.git 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 --- diff --git a/funcs/func_channel.c b/funcs/func_channel.c index 729bdf45b2..1416efc399 100644 --- a/funcs/func_channel.c +++ b/funcs/func_channel.c @@ -88,6 +88,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") R/O technology used for channel. + + 1/0 whether the channel is hanging up + R/W language for sounds played. @@ -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);