[asterisk-commits] tilghman: branch 1.8 r285373 - /branches/1.8/funcs/func_channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 7 16:14:08 CDT 2010


Author: tilghman
Date: Tue Sep  7 16:14:03 2010
New Revision: 285373

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=285373
Log:
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)

Modified:
    branches/1.8/funcs/func_channel.c

Modified: branches/1.8/funcs/func_channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/funcs/func_channel.c?view=diff&rev=285373&r1=285372&r2=285373
==============================================================================
--- branches/1.8/funcs/func_channel.c (original)
+++ branches/1.8/funcs/func_channel.c Tue Sep  7 16:14:03 2010
@@ -87,6 +87,9 @@
 					</enum>
 					<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>
@@ -298,7 +301,11 @@
 		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);




More information about the asterisk-commits mailing list