[asterisk-commits] tilghman: trunk r285374 - in /trunk: ./ funcs/func_channel.c

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


Author: tilghman
Date: Tue Sep  7 16:14:54 2010
New Revision: 285374

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

Modified:
    trunk/   (props changed)
    trunk/funcs/func_channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/funcs/func_channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_channel.c?view=diff&rev=285374&r1=285373&r2=285374
==============================================================================
--- trunk/funcs/func_channel.c (original)
+++ trunk/funcs/func_channel.c Tue Sep  7 16:14:54 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