[svn-commits] russell: branch russell/sla_rewrite r51456 - in /team/russell/sla_rewrite: ap...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Jan 22 13:30:28 MST 2007


Author: russell
Date: Mon Jan 22 14:30:28 2007
New Revision: 51456

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51456
Log:
Register the apps and device state handler

Modified:
    team/russell/sla_rewrite/apps/app_meetme.c
    team/russell/sla_rewrite/include/asterisk/utils.h

Modified: team/russell/sla_rewrite/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_rewrite/apps/app_meetme.c?view=diff&rev=51456&r1=51455&r2=51456
==============================================================================
--- team/russell/sla_rewrite/apps/app_meetme.c (original)
+++ team/russell/sla_rewrite/apps/app_meetme.c Mon Jan 22 14:30:28 2007
@@ -187,10 +187,14 @@
 static const char *app = "MeetMe";
 static const char *app2 = "MeetMeCount";
 static const char *app3 = "MeetMeAdmin";
+static const char *slastation_app = "SLAStation";
+static const char *slatrunk_app = "SLATrunk";
 
 static const char *synopsis = "MeetMe conference bridge";
 static const char *synopsis2 = "MeetMe participant count";
 static const char *synopsis3 = "MeetMe conference Administration";
+static const char *slastation_synopsis = "Shared Line Appearance Station";
+static const char *slatrunk_synopsis = "Shared Line Appearance Trunk";
 
 static const char *descrip =
 "  MeetMe([confno][,[options][,pin]]): Enters the user into a specified MeetMe\n"
@@ -268,6 +272,12 @@
 "      'v' -- Lower entire conference listening volume\n"
 "      'V' -- Raise entire conference listening volume\n"
 "";
+
+static const char *slastation_desc =
+"  SLAStation():\n";
+
+static const char *slatrunk_desc =
+"  SLATrunk():\n";
 
 /*! \brief The MeetMe Conference object */
 struct ast_conference {
@@ -2659,6 +2669,21 @@
 	return AST_DEVICE_INUSE;
 }
 
+static int slastation_exec(struct ast_channel *chan, void *data)
+{
+	return 0;
+}
+
+static int slatrunk_exec(struct ast_channel *chan, void *data)
+{
+	return 0;
+}
+
+static int sla_state(const char *data)
+{
+	return AST_DEVICE_INUSE;
+}
+
 static void load_config_meetme(void)
 {
 	struct ast_config *cfg;
@@ -2831,16 +2856,20 @@
 {
 	int res = 0;
 	
-	ast_cli_unregister_multiple(cli_meetme, sizeof(cli_meetme) / sizeof(struct ast_cli_entry));
+	ast_cli_unregister_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
 	res = ast_manager_unregister("MeetmeMute");
 	res |= ast_manager_unregister("MeetmeUnmute");
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
 	res |= ast_unregister_application(app);
+	res |= ast_unregister_application(slastation_app);
+	res |= ast_unregister_application(slatrunk_app);
+
+	ast_devstate_prov_del("Meetme");
+	ast_devstate_prov_del("SLA");
 
 	ast_module_user_hangup_all();
-	ast_devstate_prov_del("Meetme");
-
+	
 	destroy_sla();
 
 	return res;
@@ -2850,14 +2879,22 @@
 {
 	int res;
 
-	ast_cli_register_multiple(cli_meetme, sizeof(cli_meetme) / sizeof(struct ast_cli_entry));
-	res = ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute, "Mute a Meetme user");
-	res |= ast_manager_register("MeetmeUnmute", EVENT_FLAG_CALL, action_meetmeunmute, "Unmute a Meetme user");
+	ast_cli_register_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
+	res = ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, 
+		action_meetmemute, "Mute a Meetme user");
+	res |= ast_manager_register("MeetmeUnmute", EVENT_FLAG_CALL, 
+		action_meetmeunmute, "Unmute a Meetme user");
 	res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
 	res |= ast_register_application(app2, count_exec, synopsis2, descrip2);
 	res |= ast_register_application(app, conf_exec, synopsis, descrip);
+	res |= ast_register_application(slastation_app, slastation_exec,
+		slastation_synopsis, slastation_desc);
+	res |= ast_register_application(slatrunk_app, slatrunk_exec,
+		slatrunk_synopsis, slatrunk_desc);
 
 	res |= ast_devstate_prov_add("Meetme", meetmestate);
+	res |= ast_devstate_prov_add("SLA", sla_state);
+
 	load_config();
 	return res;
 }

Modified: team/russell/sla_rewrite/include/asterisk/utils.h
URL: http://svn.digium.com/view/asterisk/team/russell/sla_rewrite/include/asterisk/utils.h?view=diff&rev=51456&r1=51455&r2=51456
==============================================================================
--- team/russell/sla_rewrite/include/asterisk/utils.h (original)
+++ team/russell/sla_rewrite/include/asterisk/utils.h Mon Jan 22 14:30:28 2007
@@ -553,4 +553,6 @@
  */
 void ast_enable_packet_fragmentation(int sock);
 
+#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
+
 #endif /* _ASTERISK_UTILS_H */



More information about the svn-commits mailing list