[asterisk-commits] rmudgett: trunk r422870 - /trunk/funcs/func_channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 9 11:14:14 CDT 2014


Author: rmudgett
Date: Tue Sep  9 11:14:02 2014
New Revision: 422870

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422870
Log:
func_channel: Add CHANNEL(onhold) item to get the current hold status of the channel.

It would be useful to get the current hold status of a channel.

Added CHANNEL(onhold) item that returns 1 (onhold) and 0 (not-onhold) for
the hold status of a channel.

ASTERISK-24038
Reported by: Matt Jordan

AFS-113 #close
Reported by: Mark Michelson

Review: https://reviewboard.asterisk.org/r/3983/

Modified:
    trunk/funcs/func_channel.c

Modified: trunk/funcs/func_channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_channel.c?view=diff&rev=422870&r1=422869&r2=422870
==============================================================================
--- trunk/funcs/func_channel.c (original)
+++ trunk/funcs/func_channel.c Tue Sep  9 11:14:02 2014
@@ -156,6 +156,9 @@
 						and exten are supplied by the channel pushing the handler
 						before it is pushed.</para>
 					</enum>
+					<enum name="onhold">
+						<para>R/O Whether or not the channel is onhold. (1/0)</para>
+					</enum>
 					<enum name="language">
 						<para>R/W language for sounds played.</para>
 					</enum>
@@ -475,7 +478,10 @@
 		locked_copy_string(chan, buf, ast_channel_parkinglot(chan), len);
 	else if (!strcasecmp(data, "state"))
 		locked_copy_string(chan, buf, ast_state2str(ast_channel_state(chan)), len);
-	else if (!strcasecmp(data, "channeltype"))
+	else if (!strcasecmp(data, "onhold")) {
+		locked_copy_string(chan, buf,
+			ast_channel_hold_state(chan) == AST_CONTROL_HOLD ? "1" : "0", len);
+	} else if (!strcasecmp(data, "channeltype"))
 		locked_copy_string(chan, buf, ast_channel_tech(chan)->type, len);
 	else if (!strcasecmp(data, "accountcode"))
 		locked_copy_string(chan, buf, ast_channel_accountcode(chan), len);




More information about the asterisk-commits mailing list