[asterisk-commits] mmichelson: branch mmichelson/issue13538 r161850 - /team/mmichelson/issue1353...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 8 15:02:21 CST 2008


Author: mmichelson
Date: Mon Dec  8 15:02:20 2008
New Revision: 161850

URL: http://svn.digium.com/view/asterisk?view=rev&rev=161850
Log:
Swap the order of the parameter and value for the function.
Change the name of the function from INHERIT to AUDIOHOOK_INHERIT
Add some basic XML documentation


Modified:
    team/mmichelson/issue13538/funcs/func_audiohookinherit.c

Modified: team/mmichelson/issue13538/funcs/func_audiohookinherit.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/issue13538/funcs/func_audiohookinherit.c?view=diff&rev=161850&r1=161849&r2=161850
==============================================================================
--- team/mmichelson/issue13538/funcs/func_audiohookinherit.c (original)
+++ team/mmichelson/issue13538/funcs/func_audiohookinherit.c Mon Dec  8 15:02:20 2008
@@ -36,6 +36,30 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 
+/*** DOCUMENTATION
+ 	<function name = "AUDIOHOOK_INHERIT" language="en_US">
+		<synopsis>
+			Set whether an audiohook may be inherited to/from another channel
+		</snopsis>
+		<syntax>
+			<parameter name="source" required="true">
+				<para>The built-in sources in Asterisk are</para>
+				<enumlist>
+					<enum name="MixMonitor" />
+					<enum name="Chanspy" />
+					<enum name="Volume" />
+				</enumlist>
+			</parameter>
+		</syntax>
+		<description>
+			<para>By enabling audiohook inheritance on the channel, you are giving
+			permission for an audiohook to be inherited by a descendent channel. By
+			disabling audiohook inheritance on the channel, you are denying permission
+			for an audiohook to be inherited from a parent channel.</para>
+		</description>
+	</function>
+ ***/
+
 struct inheritable_audiohook {
 	AST_LIST_ENTRY(inheritable_audiohook) list;
 	char source[1];
@@ -153,7 +177,7 @@
 		return -1;
 	}
 
-	allow = !strcasecmp(data, "allow");
+	allow = ast_true(value);
 
 	/* Step 2: retrieve or set up datastore */
 	if (!(datastore = ast_channel_datastore_find(chan, &audiohook_inheritance_info, NULL))) {
@@ -161,7 +185,7 @@
 			ast_log(LOG_NOTICE, "Unable to set up audiohook inheritance datastore on channel %s\n", chan->name);
 			return -1;
 		}
-		return setup_inheritable_audiohook(inheritance_datastore, allow, value);
+		return setup_inheritable_audiohook(inheritance_datastore, allow, data);
 	} else {
 		inheritance_datastore = datastore->data;
 	}
@@ -170,13 +194,13 @@
 
 	if (allow) {
 		AST_LIST_TRAVERSE(&inheritance_datastore->allowed_list, inheritable_audiohook, list) {
-			if (!strcasecmp(inheritable_audiohook->source, value)) {
+			if (!strcasecmp(inheritable_audiohook->source, data)) {
 				return 0;
 			}
 		}
 	} else {
 		AST_LIST_TRAVERSE(&inheritance_datastore->unallowed_list, inheritable_audiohook, list) {
-			if (!strcasecmp(inheritable_audiohook->source, value)) {
+			if (!strcasecmp(inheritable_audiohook->source, data)) {
 				return 0;
 			}
 		}
@@ -186,11 +210,11 @@
 
 	/* Step 5: This means we need to create a new inheritable_audiohook and add it to the correct list */
 
-	return setup_inheritable_audiohook(inheritance_datastore, allow, value);
+	return setup_inheritable_audiohook(inheritance_datastore, allow, data);
 }
 
 static struct ast_custom_function inheritance_function = {
-	.name = "INHERIT",
+	.name = "AUDIOHOOK_INHERIT",
 	.write = func_inheritance_write,
 };
 




More information about the asterisk-commits mailing list