[asterisk-commits] kmoore: branch kmoore/pjsip_commands r395150 - /team/kmoore/pjsip_commands/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 23 10:23:12 CDT 2013


Author: kmoore
Date: Tue Jul 23 10:23:09 2013
New Revision: 395150

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395150
Log:
Rename Gulp NOTIFY AMI and CLI commands and add documentation

Modified:
    team/kmoore/pjsip_commands/res/res_sip_notify.c

Modified: team/kmoore/pjsip_commands/res/res_sip_notify.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_commands/res/res_sip_notify.c?view=diff&rev=395150&r1=395149&r2=395150
==============================================================================
--- team/kmoore/pjsip_commands/res/res_sip_notify.c (original)
+++ team/kmoore/pjsip_commands/res/res_sip_notify.c Tue Jul 23 10:23:09 2013
@@ -34,6 +34,24 @@
 #include "asterisk/res_sip.h"
 #include "asterisk/sorcery.h"
 
+/*** DOCUMENTATION
+	<manager name="PJSIPNotify" language="en_US">
+		<synopsis>
+			Send a NOTIFY to an endpoint.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Endpoint" required="true">
+				<para>The endpoint to which to send the NOTIFY.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Send a NOTIFY to an endpoint.</para>
+			<para>Message types are defined in sip_notify.conf</para>
+		</description>
+	</manager>
+ ***/
+
 #define CONTENT_TYPE_SIZE 64
 #define CONTENT_SIZE 512
 
@@ -584,9 +602,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "gulp notify";
+		e->command = "pjsip notify";
 		e->usage =
-			"Usage: gulp notify <type> <peer> [<peer>...]\n"
+			"Usage: pjsip notify <type> <peer> [<peer>...]\n"
 			"       Send a NOTIFY request to an endpoint\n"
 			"       Message types are defined in sip_notify.conf\n";
 		return NULL;
@@ -641,11 +659,11 @@
  */
 static int manager_notify(struct mansession *s, const struct message *m)
 {
-	const char *endpoint_name = astman_get_header(m, "Channel");
+	const char *endpoint_name = astman_get_header(m, "Endpoint");
 	struct ast_variable *vars = astman_get_variables(m);
 
 	if (ast_strlen_zero(endpoint_name)) {
-		astman_send_error(s, m, "GulpNotify requires a channel name");
+		astman_send_error(s, m, "PJSIPNotify requires a channel name");
 		return 0;
 	}
 
@@ -668,7 +686,7 @@
 		break;
 	}
 
-	astman_send_ack(s, m, "Notify Sent");
+	astman_send_ack(s, m, "NOTIFY Sent");
 	return 0;
 }
 
@@ -687,7 +705,7 @@
 	}
 
 	ast_cli_register_multiple(cli_options, ARRAY_LEN(cli_options));
-	ast_manager_register_xml("GulpNotify", EVENT_FLAG_SYSTEM, manager_notify);
+	ast_manager_register_xml("PJSIPNotify", EVENT_FLAG_SYSTEM, manager_notify);
 
 	return AST_MODULE_LOAD_SUCCESS;
 }
@@ -700,7 +718,7 @@
 
 static int unload_module(void)
 {
-	ast_manager_unregister("GulpNotify");
+	ast_manager_unregister("PJSIPNotify");
 	aco_info_destroy(&notify_cfg);
 
 	return 0;




More information about the asterisk-commits mailing list