[asterisk-commits] mattf: branch mattf/asterisk-ss7 r43233 - in /team/mattf/asterisk-ss7: ./ agi...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Sep 18 14:56:07 MST 2006


Author: mattf
Date: Mon Sep 18 16:56:06 2006
New Revision: 43233

URL: http://svn.digium.com/view/asterisk?rev=43233&view=rev
Log:
Merged revisions 42982,43008,43024,43039,43052,43075,43099,43111,43123,43135,43147,43161-43162,43164-43166,43185,43199,43205,43207-43208,43212-43216,43221,43230 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r42982 | qwell | 2006-09-15 12:16:00 -0500 (Fri, 15 Sep 2006) | 3 lines

Many Solaris fixes - this moves some of the stuff from utils.c to strcompat.c
Every OS uses strcompat now - this was done on purpose.

................
r43008 | tilghman | 2006-09-16 00:43:54 -0500 (Sat, 16 Sep 2006) | 10 lines

Merged revisions 43003 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43003 | tilghman | 2006-09-15 23:44:02 -0500 (Fri, 15 Sep 2006) | 2 lines

When the marked user enters the conference, we should no longer timeout

........

................
r43024 | tilghman | 2006-09-16 03:10:55 -0500 (Sat, 16 Sep 2006) | 10 lines

Merged revisions 43019 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43019 | tilghman | 2006-09-16 02:57:04 -0500 (Sat, 16 Sep 2006) | 2 lines

When a realtime peer expires, reset the ipaddress in the realtime database back to 0 (Issue 6656)

........

................
r43039 | markster | 2006-09-16 16:45:35 -0500 (Sat, 16 Sep 2006) | 2 lines

Fix the dtmf dialtone thing

................
r43052 | kpfleming | 2006-09-16 18:53:58 -0500 (Sat, 16 Sep 2006) | 2 lines

merge markster's usersconf branch with some slight changes

................
r43075 | tilghman | 2006-09-17 09:00:39 -0500 (Sun, 17 Sep 2006) | 11 lines

Merged revisions 43072 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43072 | tilghman | 2006-09-17 08:54:34 -0500 (Sun, 17 Sep 2006) | 3 lines

Directory used the wrong context for delivery of 0- and *- keypresses
(according to Directory's own documentation) - Issue 7965

........

................
r43099 | qwell | 2006-09-17 16:58:04 -0500 (Sun, 17 Sep 2006) | 2 lines

Get rid of all the useless (and confusing) typedefs

................
r43111 | qwell | 2006-09-17 17:24:27 -0500 (Sun, 17 Sep 2006) | 5 lines

Skinny hold support.

Original patch by wedhorn, with modifications by me.
Issue #7588

................
r43123 | qwell | 2006-09-17 18:04:48 -0500 (Sun, 17 Sep 2006) | 2 lines

remove a bit of redundant code

................
r43135 | markster | 2006-09-18 00:40:17 -0500 (Mon, 18 Sep 2006) | 2 lines

Improve documentation of users.conf items.

................
r43147 | tilghman | 2006-09-18 09:53:54 -0500 (Mon, 18 Sep 2006) | 2 lines

Remove the suggestion of realtime hints, since that functionality will not be available until post-1.4

................
r43161 | file | 2006-09-18 10:07:59 -0500 (Mon, 18 Sep 2006) | 10 lines

Merged revisions 43159 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43159 | file | 2006-09-18 11:05:39 -0400 (Mon, 18 Sep 2006) | 2 lines

Add number unobtainable tone for New Zealand (issue #7969 reported by nic_bellamy)

........

................
r43162 | file | 2006-09-18 10:15:33 -0500 (Mon, 18 Sep 2006) | 2 lines

Use a better check to ensure database connection is up (pointer to connection must exist, and connection must report status being ok) (issue #7955 reported by sorg)

................
r43164 | file | 2006-09-18 10:32:08 -0500 (Mon, 18 Sep 2006) | 9 lines

Blocked revisions 43163 via svnmerge

........
r43163 | file | 2006-09-18 11:30:26 -0400 (Mon, 18 Sep 2006) | 2 lines

Add deprecation notice about app_math (issue #7957 reported by k-egg)

........

................
r43165 | murf | 2006-09-18 10:44:18 -0500 (Mon, 18 Sep 2006) | 3 lines

Clarified the meaning of the callwaiting variable in the zapata.conf file.


................
r43166 | kpfleming | 2006-09-18 10:54:57 -0500 (Mon, 18 Sep 2006) | 2 lines

minor performance improvement for platforms where -fPIC and -fpic are actually different (has no effect on x86/x86-64)

................
r43185 | mogorman | 2006-09-18 11:36:14 -0500 (Mon, 18 Sep 2006) | 5 lines

seperate jingle and gtalk so it will be easier to track
changes in both of the moving specs.  Currently chan_gtalk is 
compatible with the latest gtalk/libjingle version, and chan_jingle
needs a lot of work.

................
r43199 | file | 2006-09-18 12:37:44 -0500 (Mon, 18 Sep 2006) | 2 lines

Reference will be kept in the application component only right now. In the future this should be expanded to the channel driver (just like all the other channel drivers) (issue #7975 reported by andrewt)

................
r43205 | qwell | 2006-09-18 14:08:40 -0500 (Mon, 18 Sep 2006) | 2 lines

escape some quotes

................
r43207 | kpfleming | 2006-09-18 14:20:24 -0500 (Mon, 18 Sep 2006) | 2 lines

it appears that current Mac OS/X does not need the poll compatibility module at all, and platforms that do need it also need -DPOLLCOMPAT (or they wouldn't have compiled at all)

................
r43208 | kpfleming | 2006-09-18 14:30:10 -0500 (Mon, 18 Sep 2006) | 2 lines

handle config.guess name for FreeBSD properly

................
r43212 | kpfleming | 2006-09-18 14:54:18 -0500 (Mon, 18 Sep 2006) | 2 lines

merge qwell's CLI verbification work

................
r43213 | kpfleming | 2006-09-18 14:54:46 -0500 (Mon, 18 Sep 2006) | 2 lines

revert this since, since some unnamed platforms are silly about it :-)

................
r43214 | oej | 2006-09-18 14:56:44 -0500 (Mon, 18 Sep 2006) | 2 lines

Issue #7351 - sending CANCEL when the call at some point has been in UP state is wrong.

................
r43215 | qwell | 2006-09-18 14:57:09 -0500 (Mon, 18 Sep 2006) | 4 lines

We have autoconf...let's actually use it.

(note, M4 wasn't used, so...bye)

................
r43216 | kpfleming | 2006-09-18 14:58:27 -0500 (Mon, 18 Sep 2006) | 2 lines

always use fork() when available

................
r43221 | oej | 2006-09-18 15:13:14 -0500 (Mon, 18 Sep 2006) | 2 lines

Merging patch from 1.2 - Issue #7682

................
r43230 | qwell | 2006-09-18 16:24:50 -0500 (Mon, 18 Sep 2006) | 4 lines

Only use alloca.h on OSes that have it.

Reported by jontow on IRC in #asterisk-dev

................

Added:
    team/mattf/asterisk-ss7/channels/chan_gtalk.c   (props changed)
      - copied unchanged from r43230, trunk/channels/chan_gtalk.c
    team/mattf/asterisk-ss7/configs/gtalk.conf.sample   (props changed)
      - copied unchanged from r43230, trunk/configs/gtalk.conf.sample
    team/mattf/asterisk-ss7/configs/users.conf.sample   (props changed)
      - copied unchanged from r43230, trunk/configs/users.conf.sample
Modified:
    team/mattf/asterisk-ss7/   (props changed)
    team/mattf/asterisk-ss7/Makefile
    team/mattf/asterisk-ss7/agi/Makefile
    team/mattf/asterisk-ss7/apps/app_directory.c
    team/mattf/asterisk-ss7/apps/app_meetme.c
    team/mattf/asterisk-ss7/apps/app_mixmonitor.c
    team/mattf/asterisk-ss7/apps/app_osplookup.c
    team/mattf/asterisk-ss7/apps/app_playback.c
    team/mattf/asterisk-ss7/apps/app_queue.c
    team/mattf/asterisk-ss7/apps/app_realtime.c
    team/mattf/asterisk-ss7/apps/app_rpt.c
    team/mattf/asterisk-ss7/apps/app_voicemail.c
    team/mattf/asterisk-ss7/build_tools/prep_moduledeps
    team/mattf/asterisk-ss7/channels/chan_agent.c
    team/mattf/asterisk-ss7/channels/chan_alsa.c
    team/mattf/asterisk-ss7/channels/chan_features.c
    team/mattf/asterisk-ss7/channels/chan_h323.c
    team/mattf/asterisk-ss7/channels/chan_iax2.c
    team/mattf/asterisk-ss7/channels/chan_jingle.c
    team/mattf/asterisk-ss7/channels/chan_local.c
    team/mattf/asterisk-ss7/channels/chan_mgcp.c
    team/mattf/asterisk-ss7/channels/chan_misdn.c
    team/mattf/asterisk-ss7/channels/chan_oss.c
    team/mattf/asterisk-ss7/channels/chan_sip.c
    team/mattf/asterisk-ss7/channels/chan_skinny.c
    team/mattf/asterisk-ss7/channels/chan_zap.c
    team/mattf/asterisk-ss7/channels/iax2-provision.c
    team/mattf/asterisk-ss7/configs/extensions.conf.sample
    team/mattf/asterisk-ss7/configs/func_odbc.conf.sample
    team/mattf/asterisk-ss7/configs/indications.conf.sample
    team/mattf/asterisk-ss7/configs/skinny.conf.sample
    team/mattf/asterisk-ss7/configs/voicemail.conf.sample
    team/mattf/asterisk-ss7/configs/zapata.conf.sample
    team/mattf/asterisk-ss7/configure
    team/mattf/asterisk-ss7/configure.ac
    team/mattf/asterisk-ss7/doc/jingle.txt
    team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in
    team/mattf/asterisk-ss7/include/asterisk/cli.h
    team/mattf/asterisk-ss7/include/asterisk/compat.h
    team/mattf/asterisk-ss7/include/asterisk/config.h
    team/mattf/asterisk-ss7/include/asterisk/pbx.h
    team/mattf/asterisk-ss7/include/asterisk/strings.h
    team/mattf/asterisk-ss7/include/asterisk/utils.h
    team/mattf/asterisk-ss7/main/Makefile
    team/mattf/asterisk-ss7/main/asterisk.c
    team/mattf/asterisk-ss7/main/astmm.c
    team/mattf/asterisk-ss7/main/cdr.c
    team/mattf/asterisk-ss7/main/channel.c
    team/mattf/asterisk-ss7/main/cli.c
    team/mattf/asterisk-ss7/main/config.c
    team/mattf/asterisk-ss7/main/db.c
    team/mattf/asterisk-ss7/main/dnsmgr.c
    team/mattf/asterisk-ss7/main/file.c
    team/mattf/asterisk-ss7/main/frame.c
    team/mattf/asterisk-ss7/main/http.c
    team/mattf/asterisk-ss7/main/image.c
    team/mattf/asterisk-ss7/main/logger.c
    team/mattf/asterisk-ss7/main/manager.c
    team/mattf/asterisk-ss7/main/pbx.c
    team/mattf/asterisk-ss7/main/rtp.c
    team/mattf/asterisk-ss7/main/strcompat.c
    team/mattf/asterisk-ss7/main/translate.c
    team/mattf/asterisk-ss7/main/udptl.c
    team/mattf/asterisk-ss7/main/utils.c
    team/mattf/asterisk-ss7/makeopts.in
    team/mattf/asterisk-ss7/pbx/pbx_ael.c
    team/mattf/asterisk-ss7/pbx/pbx_config.c
    team/mattf/asterisk-ss7/pbx/pbx_dundi.c
    team/mattf/asterisk-ss7/res/res_agi.c
    team/mattf/asterisk-ss7/res/res_clioriginate.c
    team/mattf/asterisk-ss7/res/res_config_pgsql.c
    team/mattf/asterisk-ss7/res/res_convert.c
    team/mattf/asterisk-ss7/res/res_crypto.c
    team/mattf/asterisk-ss7/res/res_features.c
    team/mattf/asterisk-ss7/res/res_indications.c
    team/mattf/asterisk-ss7/res/res_jabber.c
    team/mattf/asterisk-ss7/res/res_musiconhold.c
    team/mattf/asterisk-ss7/res/res_odbc.c
    team/mattf/asterisk-ss7/utils/Makefile

Propchange: team/mattf/asterisk-ss7/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Propchange: team/mattf/asterisk-ss7/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/mattf/asterisk-ss7/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Sep 18 16:56:06 2006
@@ -1,1 +1,1 @@
-/trunk:1-42968
+/trunk:1-43232

Modified: team/mattf/asterisk-ss7/Makefile
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/Makefile?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/Makefile (original)
+++ team/mattf/asterisk-ss7/Makefile Mon Sep 18 16:56:06 2006
@@ -140,13 +140,6 @@
       endif
     endif
   endif
-endif
-
-ID=id
-
-ifeq ($(OSARCH),SunOS)
-  M4=/usr/local/bin/m4
-  ID=/usr/xpg4/bin/id
 endif
 
 ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)

Modified: team/mattf/asterisk-ss7/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/agi/Makefile?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/agi/Makefile (original)
+++ team/mattf/asterisk-ss7/agi/Makefile Mon Sep 18 16:56:06 2006
@@ -16,16 +16,18 @@
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
 ifeq ($(OSARCH),SunOS)
-  LIBS+=-lsocket -lnsl ../main/strcompat.o
+  LIBS+=-lsocket -lnsl
 endif
 
 include $(ASTTOPDIR)/Makefile.rules
 
 all: $(AGIS)
 
-eagi-test: eagi-test.o
+eagi-test: eagi-test.o strcompat.o
 
 eagi-sphinx-test: eagi-sphinx-test.o
+
+$(eval $(call ast_make_o_c,strcompat.o,../main/strcompat.c))
 
 install: all
 	mkdir -p $(DESTDIR)$(AGI_DIR)

Modified: team/mattf/asterisk-ss7/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_directory.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_directory.c (original)
+++ team/mattf/asterisk-ss7/apps/app_directory.c Mon Sep 18 16:56:06 2006
@@ -393,10 +393,10 @@
 	return cfg;
 }
 
-static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char *context, char *dialcontext, char digit, int last, int readext, int fromappvm)
+static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct ast_config *ucfg, char *context, char *dialcontext, char digit, int last, int readext, int fromappvm)
 {
 	/* Read in the first three digits..  "digit" is the first digit, already read */
-	char ext[NUMDIGITS + 1];
+	char ext[NUMDIGITS + 1], *cat;
 	char name[80] = "";
 	struct ast_variable *v;
 	int res;
@@ -411,7 +411,7 @@
 		return -1;
 	}
 	if (digit == '0') {
-		if (!ast_goto_if_exists(chan, chan->context, "o", 1) ||
+		if (!ast_goto_if_exists(chan, dialcontext, "o", 1) ||
 		    (!ast_strlen_zero(chan->macrocontext) &&
 		     !ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
 			return 0;
@@ -422,7 +422,7 @@
 		}
 	}	
 	if (digit == '*') {
-		if (!ast_goto_if_exists(chan, chan->context, "a", 1) ||
+		if (!ast_goto_if_exists(chan, dialcontext, "a", 1) ||
 		    (!ast_strlen_zero(chan->macrocontext) &&
 		     !ast_goto_if_exists(chan, chan->macrocontext, "a", 1))) {
 			return 0;
@@ -499,6 +499,58 @@
 			}
 		}
 
+		if (!res && ucfg) {
+			/* Search users.conf for all names which start with those digits */
+			for (cat = ast_category_browse(ucfg, NULL); cat && !res ; cat = ast_category_browse(ucfg, cat)) {
+				if (!strcasecmp(cat, "general"))
+					continue;
+				if (!ast_true(ast_config_option(ucfg, cat, "hasdirectory")))
+					continue;
+				
+				/* Find all candidate extensions */
+				if ((pos = ast_variable_retrieve(ucfg, cat, "fullname"))) {
+					ast_copy_string(name, pos, sizeof(name));
+					/* Grab the last name */
+					if (last && strrchr(pos,' '))
+						pos = strrchr(pos, ' ') + 1;
+					conv = convert(pos);
+					if (conv) {
+						if (!strcmp(conv, ext)) {
+							/* Match! */
+							found++;
+							/* We have a match -- play a greeting if they have it */
+							res = play_mailbox_owner(chan, context, dialcontext, cat, name, readext, fromappvm);
+							switch (res) {
+							case -1:
+								/* user pressed '1' but extension does not exist, or
+								 * user hungup
+								 */
+								lastuserchoice = 0;
+								break;
+							case '1':
+								/* user pressed '1' and extensions exists;
+								   play_mailbox_owner will already have done
+								   a goto() on the channel
+								 */
+								lastuserchoice = res;
+								break;
+							case '*':
+								/* user pressed '*' to skip something found */
+								lastuserchoice = res;
+								res = 0;
+								break;
+							default:
+								break;
+							}
+							free(conv);
+							break;
+						}
+						free(conv);
+					}
+				}
+			}
+		}
+			
 		if (lastuserchoice != '1') {
 			res = ast_streamfile(chan, found ? "dir-nomore" : "dir-nomatch", chan->language);
 			if (!res)
@@ -514,7 +566,7 @@
 {
 	int res = 0;
 	struct ast_module_user *u;
-	struct ast_config *cfg;
+	struct ast_config *cfg, *ucfg;
 	int last = 1;
 	int readext = 0;
 	int fromappvm = 0;
@@ -554,6 +606,8 @@
 		ast_module_user_remove(u);
 		return -1;
 	}
+	
+	ucfg = ast_config_load("users.conf");
 
 	dirintro = ast_variable_retrieve(cfg, args.vmcontext, "directoryintro");
 	if (ast_strlen_zero(dirintro))
@@ -571,7 +625,7 @@
 		if (!res)
 			res = ast_waitfordigit(chan, 5000);
 		if (res > 0) {
-			res = do_directory(chan, cfg, args.vmcontext, args.dialcontext, res, last, readext, fromappvm);
+			res = do_directory(chan, cfg, ucfg, args.vmcontext, args.dialcontext, res, last, readext, fromappvm);
 			if (res > 0) {
 				res = ast_waitstream(chan, AST_DIGIT_ANY);
 				ast_stopstream(chan);
@@ -581,6 +635,8 @@
 		}
 		break;
 	}
+	if (ucfg)
+		ast_config_destroy(ucfg);
 	ast_config_destroy(cfg);
 	ast_module_user_remove(u);
 	return res;

Modified: team/mattf/asterisk-ss7/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_meetme.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_meetme.c (original)
+++ team/mattf/asterisk-ss7/apps/app_meetme.c Mon Sep 18 16:56:06 2006
@@ -661,13 +661,6 @@
 	return cnf;
 }
 
-static int confs_show(int fd, int argc, char **argv)
-{
-	ast_cli(fd, "Deprecated! Please use 'meetme' instead.\n");
-
-	return RESULT_SUCCESS;
-}
-
 /*! \brief CLI command for showing SLAs */
 static int sla_show(int fd, int argc, char *argv[]) 
 {
@@ -693,23 +686,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char show_confs_usage[] =
-"Deprecated! Please use 'meetme' instead.\n";
-
-static struct ast_cli_entry cli_show_confs = {
-	{ "show", "conferences", NULL }, confs_show,
-	"Show status of conferences", show_confs_usage, NULL };
-
-
-static char sla_show_usage[] =
-"Usage: sla show\n"
-"       Lists status of all shared line appearances\n";
-
-static struct ast_cli_entry cli_sla_show = {
-	{ "sla", "show", NULL }, sla_show,
-	"Show status of Shared Line Appearances", sla_show_usage, NULL };
-
-static int conf_cmd(int fd, int argc, char **argv) 
+static int meetme_cmd(int fd, int argc, char **argv) 
 {
 	/* Process the command */
 	struct ast_conference *cnf;
@@ -853,7 +830,7 @@
 	return 0;
 }
 
-static char *complete_confcmd(const char *line, const char *word, int pos, int state)
+static char *complete_meetmecmd(const char *line, const char *word, int pos, int state)
 {
 	static char *cmds[] = {"lock", "unlock", "mute", "unmute", "kick", "list", NULL};
 
@@ -915,13 +892,23 @@
 	return NULL;
 }
 	
-static char conf_usage[] =
-"Usage: meetme  (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
+static char meetme_usage[] =
+"Usage: meetme (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
 "       Executes a command for the conference or on a conferee\n";
 
-static struct ast_cli_entry cli_conf = {
-	{"meetme", NULL, NULL }, conf_cmd,
-	"Execute a command on a conference or conferee", conf_usage, complete_confcmd};
+static char sla_show_usage[] =
+"Usage: sla show\n"
+"       Lists status of all shared line appearances\n";
+
+static struct ast_cli_entry cli_meetme[] = {
+	{ { "sla", "show", NULL },
+	sla_show, "Show status of Shared Line Appearances",
+	sla_show_usage, NULL },
+
+	{ { "meetme", NULL, NULL },
+	meetme_cmd, "Execute a command on a conference or conferee",
+	meetme_usage, complete_meetmecmd },
+};
 
 static void conf_flush(int fd, struct ast_channel *chan)
 {
@@ -1432,6 +1419,8 @@
 						}
 					}
 				} else if(currentmarked >= 1 && lastmarked == 0) {
+					/* Marked user entered, so cancel timeout */
+					timeout = 0;
 					if (confflags & CONFFLAG_MONITOR)
 						ztc.confmode = ZT_CONF_CONFMON | ZT_CONF_LISTENER;
 					else if (confflags & CONFFLAG_TALKER)
@@ -3070,10 +3059,8 @@
 {
 	int res = 0;
 	
-	res |= ast_cli_unregister(&cli_show_confs);
-	res |= ast_cli_unregister(&cli_sla_show);
-	res |= ast_cli_unregister(&cli_conf);
-	res |= ast_manager_unregister("MeetmeMute");
+	ast_cli_unregister_multiple(cli_meetme, sizeof(cli_meetme) / sizeof(struct ast_cli_entry));
+	res = ast_manager_unregister("MeetmeMute");
 	res |= ast_manager_unregister("MeetmeUnmute");
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
@@ -3093,10 +3080,8 @@
 	int res;
 
 	ASTOBJ_CONTAINER_INIT(&slas);
-	res = ast_cli_register(&cli_show_confs);
-	res |= ast_cli_register(&cli_sla_show);
-	res |= ast_cli_register(&cli_conf);
-	res |= ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute, "Mute a Meetme user");
+	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");
 	res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
 	res |= ast_register_application(app2, count_exec, synopsis2, descrip2);

Modified: team/mattf/asterisk-ss7/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_mixmonitor.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_mixmonitor.c (original)
+++ team/mattf/asterisk-ss7/apps/app_mixmonitor.c Mon Sep 18 16:56:06 2006
@@ -421,22 +421,21 @@
 	return ast_complete_channels(line, word, pos, state, 2);
 }
 
-static struct ast_cli_entry cli_mixmonitor = {
-	{ "mixmonitor", NULL, NULL },
-	mixmonitor_cli, 
-	"Execute a MixMonitor command.",
+static struct ast_cli_entry cli_mixmonitor[] = {
+	{ { "mixmonitor", NULL, NULL },
+	mixmonitor_cli, "Execute a MixMonitor command.",
 	"mixmonitor <start|stop> <chan_name> [args]\n\n"
 	"The optional arguments are passed to the\n"
 	"MixMonitor application when the 'start' command is used.\n",
-	complete_mixmonitor_cli
+	complete_mixmonitor_cli },
 };
 
 static int unload_module(void)
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_mixmonitor);
-	res |= ast_unregister_application(stop_app);
+	ast_cli_unregister_multiple(cli_mixmonitor, sizeof(cli_mixmonitor) / sizeof(struct ast_cli_entry));
+	res = ast_unregister_application(stop_app);
 	res |= ast_unregister_application(app);
 	
 	ast_module_user_hangup_all();
@@ -448,8 +447,8 @@
 {
 	int res;
 
-	res = ast_cli_register(&cli_mixmonitor);
-	res |= ast_register_application(app, mixmonitor_exec, synopsis, desc);
+	ast_cli_register_multiple(cli_mixmonitor, sizeof(cli_mixmonitor) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(app, mixmonitor_exec, synopsis, desc);
 	res |= ast_register_application(stop_app, stop_mixmonitor_exec, stop_synopsis, stop_desc);
 
 	return res;

Modified: team/mattf/asterisk-ss7/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_osplookup.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_osplookup.c (original)
+++ team/mattf/asterisk-ss7/apps/app_osplookup.c Mon Sep 18 16:56:06 2006
@@ -1596,11 +1596,10 @@
 "Usage: osp show\n"
 "       Displays information on Open Settlement Protocol support\n";
 
-static struct ast_cli_entry osp_cli = {
-	{"osp", "show", NULL}, 
-	osp_show, 
-	"Displays OSP information", 
-	osp_usage 
+static struct ast_cli_entry cli_osp[] = {
+	{ { "osp", "show", NULL},
+	osp_show, "Displays OSP information",
+	osp_usage },
 };
 
 static int load_module(void)
@@ -1610,8 +1609,8 @@
 	if(!osp_load())
 		return AST_MODULE_LOAD_DECLINE;
 
-	res = ast_cli_register(&osp_cli);
-	res |= ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
+	ast_cli_register_multiple(cli_osp, sizeof(cli_osp) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
 	res |= ast_register_application(app2, osplookup_exec, synopsis2, descrip2);
 	res |= ast_register_application(app3, ospnext_exec, synopsis3, descrip3);
 	res |= ast_register_application(app4, ospfinished_exec, synopsis4, descrip4);
@@ -1627,7 +1626,7 @@
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
 	res |= ast_unregister_application(app1);
-	res |= ast_cli_unregister(&osp_cli);
+	ast_cli_unregister_multiple(cli_osp, sizeof(cli_osp) / sizeof(struct ast_cli_entry));
 	osp_unload();
 
 	ast_module_user_hangup_all();

Modified: team/mattf/asterisk-ss7/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_playback.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_playback.c (original)
+++ team/mattf/asterisk-ss7/apps/app_playback.c Mon Sep 18 16:56:06 2006
@@ -371,8 +371,10 @@
 	return RESULT_SUCCESS;
 }
 
-static struct ast_cli_entry myclis[] = {
-        { { "say", "load", NULL }, __say_init, "set/show the say mode", "say load new|old" },
+static struct ast_cli_entry cli_playback[] = {
+        { { "say", "load", NULL },
+	__say_init, "set/show the say mode",
+	"say load new|old" },
 };
 
 static int playback_exec(struct ast_channel *chan, void *data)
@@ -478,7 +480,7 @@
 static int load_module(void)
 {
 	reload();
-        ast_cli_register_multiple(myclis, sizeof(myclis)/sizeof(struct ast_cli_entry));
+        ast_cli_register_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
 	return ast_register_application(app, playback_exec, synopsis, descrip);
 }
 

Modified: team/mattf/asterisk-ss7/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_queue.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_queue.c (original)
+++ team/mattf/asterisk-ss7/apps/app_queue.c Mon Sep 18 16:56:06 2006
@@ -3941,7 +3941,7 @@
 	return RESULT_SUCCESS;
 }
 
-static int queues_show(int fd, int argc, char **argv)
+static int queue_list(int fd, int argc, char **argv)
 {
 	return __queues_show(NULL, 0, fd, argc, argv, 0);
 }
@@ -3975,7 +3975,7 @@
  */
 static int manager_queues_show( struct mansession *s, struct message *m )
 {
-	char *a[] = { "show", "queues" };
+	char *a[] = { "queue", "list" };
 
 	__queues_show(s, 1, -1, 2, a, 0);
 	astman_append(s, "\r\n\r\n");	/* Properly terminate Manager output */
@@ -4175,7 +4175,7 @@
 	return 0;
 }
 
-static int handle_add_queue_member(int fd, int argc, char *argv[])
+static int handle_queue_add_member(int fd, int argc, char *argv[])
 {
 	char *queuename, *interface;
 	int penalty;
@@ -4222,9 +4222,9 @@
 	}
 }
 
-static char *complete_add_queue_member(const char *line, const char *word, int pos, int state)
-{
-	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
+static char *complete_queue_add_member(const char *line, const char *word, int pos, int state)
+{
+	/* 0 - queue; 1 - add; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
 	switch (pos) {
 	case 3:	/* Don't attempt to complete name of member (infinite possibilities) */
 		return NULL;
@@ -4249,7 +4249,7 @@
 	}
 }
 
-static int handle_remove_queue_member(int fd, int argc, char *argv[])
+static int handle_queue_remove_member(int fd, int argc, char *argv[])
 {
 	char *queuename, *interface;
 
@@ -4280,13 +4280,13 @@
 	}
 }
 
-static char *complete_remove_queue_member(const char *line, const char *word, int pos, int state)
+static char *complete_queue_remove_member(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct call_queue *q;
 	struct member *m;
 
-	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
+	/* 0 - queue; 1 - remove; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
 	if (pos > 5 || pos < 3)
 		return NULL;
 	if (pos == 4)	/* only one possible match, 'from' */
@@ -4312,44 +4312,64 @@
 	return NULL;
 }
 
-static char show_queues_usage[] =
-"Usage: show queues\n"
+static char queue_list_usage[] =
+"Usage: queue list\n"
 "       Provides summary information on call queues.\n";
 
-static struct ast_cli_entry cli_show_queues = {
-	{ "show", "queues", NULL }, queues_show,
-	"Show status of queues", show_queues_usage, NULL };
-
-static char show_queue_usage[] =
-"Usage: show queue\n"
+static char queue_show_usage[] =
+"Usage: queue show\n"
 "       Provides summary information on a specified queue.\n";
 
-static struct ast_cli_entry cli_show_queue = {
-	{ "show", "queue", NULL }, queue_show,
-	"Show status of a specified queue", show_queue_usage, complete_queue };
-
-static char aqm_cmd_usage[] =
-"Usage: add queue member <channel> to <queue> [penalty <penalty>]\n";
-
-static struct ast_cli_entry cli_add_queue_member = {
-	{ "add", "queue", "member", NULL }, handle_add_queue_member,
-	"Add a channel to a specified queue", aqm_cmd_usage, complete_add_queue_member };
-
-static char rqm_cmd_usage[] =
-"Usage: remove queue member <channel> from <queue>\n";
-
-static struct ast_cli_entry cli_remove_queue_member = {
-	{ "remove", "queue", "member", NULL }, handle_remove_queue_member,
-	"Removes a channel from a specified queue", rqm_cmd_usage, complete_remove_queue_member };
+static char qam_cmd_usage[] =
+"Usage: queue add member <channel> to <queue> [penalty <penalty>]\n";
+
+static char qrm_cmd_usage[] =
+"Usage: queue remove member <channel> from <queue>\n";
+
+static struct ast_cli_entry cli_show_queues_deprecated = {
+	{ "show", "queues", NULL },
+	queue_list, NULL,
+	NULL, NULL };
+
+static struct ast_cli_entry cli_show_queue_deprecated = {
+	{ "show", "queue", NULL },
+	queue_show, NULL,
+	NULL, complete_queue };
+
+static struct ast_cli_entry cli_add_queue_member_deprecated = {
+	{ "add", "queue", "member", NULL },
+	handle_queue_add_member, NULL,
+	NULL, complete_queue_add_member };
+
+static struct ast_cli_entry cli_remove_queue_member_deprecated = {
+	{ "remove", "queue", "member", NULL },
+	handle_queue_remove_member, NULL,
+	NULL, complete_queue_remove_member };
+
+static struct ast_cli_entry cli_queue[] = {
+	{ { "queue", "list", NULL },
+	queue_list, "Show status of queues",
+	queue_list_usage, NULL, &cli_show_queues_deprecated },
+
+	{ { "queue", "show", NULL },
+	queue_show, "Show status of a specified queue",
+	queue_show_usage, complete_queue, &cli_show_queue_deprecated },
+
+	{ { "queue", "add", "member", NULL },
+	handle_queue_add_member, "Add a channel to a specified queue",
+	qam_cmd_usage, complete_queue_add_member, &cli_add_queue_member_deprecated },
+
+	{ { "queue", "remove", "member", NULL },
+	handle_queue_remove_member, "Removes a channel from a specified queue",
+	qrm_cmd_usage, complete_queue_remove_member, &cli_remove_queue_member_deprecated },
+};
 
 static int unload_module(void)
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_show_queue);
-	res |= ast_cli_unregister(&cli_show_queues);
-	res |= ast_cli_unregister(&cli_add_queue_member);
-	res |= ast_cli_unregister(&cli_remove_queue_member);
+	ast_cli_unregister_multiple(cli_queue, sizeof(cli_queue) / sizeof(struct ast_cli_entry));
+	res = ast_manager_unregister("QueueStatus");
 	res |= ast_manager_unregister("Queues");
 	res |= ast_manager_unregister("QueueStatus");
 	res |= ast_manager_unregister("QueueAdd");
@@ -4360,11 +4380,11 @@
 	res |= ast_unregister_application(app_pqm);
 	res |= ast_unregister_application(app_upqm);
 	res |= ast_unregister_application(app_ql);
+	res |= ast_unregister_application(app);
 	res |= ast_custom_function_unregister(&queueagentcount_function);
 	res |= ast_custom_function_unregister(&queuemembercount_function);
 	res |= ast_custom_function_unregister(&queuememberlist_function);
 	res |= ast_custom_function_unregister(&queuewaitingcount_function);
-	res |= ast_unregister_application(app);
 
 	ast_module_user_hangup_all();
 
@@ -4380,21 +4400,18 @@
 		return AST_MODULE_LOAD_DECLINE;
 	if (queue_persistent_members)
 		reload_queue_members();
+	ast_cli_register_multiple(cli_queue, sizeof(cli_queue) / sizeof(struct ast_cli_entry));
 	res = ast_register_application(app, queue_exec, synopsis, descrip);
-	res |= ast_cli_register(&cli_show_queue);
-	res |= ast_cli_register(&cli_show_queues);
-	res |= ast_cli_register(&cli_add_queue_member);
-	res |= ast_cli_register(&cli_remove_queue_member);
+	res |= ast_register_application(app_aqm, aqm_exec, app_aqm_synopsis, app_aqm_descrip);
+	res |= ast_register_application(app_rqm, rqm_exec, app_rqm_synopsis, app_rqm_descrip);
+	res |= ast_register_application(app_pqm, pqm_exec, app_pqm_synopsis, app_pqm_descrip);
+	res |= ast_register_application(app_upqm, upqm_exec, app_upqm_synopsis, app_upqm_descrip);
+	res |= ast_register_application(app_ql, ql_exec, app_ql_synopsis, app_ql_descrip);
 	res |= ast_manager_register("Queues", 0, manager_queues_show, "Queues");
 	res |= ast_manager_register("QueueStatus", 0, manager_queues_status, "Queue Status");
 	res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
 	res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
 	res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
-	res |= ast_register_application(app_aqm, aqm_exec, app_aqm_synopsis, app_aqm_descrip);
-	res |= ast_register_application(app_rqm, rqm_exec, app_rqm_synopsis, app_rqm_descrip);
-	res |= ast_register_application(app_pqm, pqm_exec, app_pqm_synopsis, app_pqm_descrip);
-	res |= ast_register_application(app_upqm, upqm_exec, app_upqm_synopsis, app_upqm_descrip);
-	res |= ast_register_application(app_ql, ql_exec, app_ql_synopsis, app_ql_descrip);
 	res |= ast_custom_function_register(&queueagentcount_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuememberlist_function);

Modified: team/mattf/asterisk-ss7/apps/app_realtime.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_realtime.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_realtime.c (original)
+++ team/mattf/asterisk-ss7/apps/app_realtime.c Mon Sep 18 16:56:06 2006
@@ -69,7 +69,7 @@
 "updated or -1 if an error occurs.\n";
 
 
-static int cli_load_realtime(int fd, int argc, char **argv) 
+static int cli_realtime_load(int fd, int argc, char **argv) 
 {
 	char *header_format = "%30s  %-30s\n";
 	struct ast_variable *var=NULL;
@@ -94,7 +94,7 @@
 	return RESULT_SUCCESS;
 }
 
-static int cli_update_realtime(int fd, int argc, char **argv) {
+static int cli_realtime_update(int fd, int argc, char **argv) {
 	int res = 0;
 
 	if(argc<7) {
@@ -115,21 +115,23 @@
 	return RESULT_SUCCESS;
 }
 
-static char cli_load_realtime_usage[] =
+static char cli_realtime_load_usage[] =
 "Usage: realtime load <family> <colmatch> <value>\n"
 "       Prints out a list of variables using the RealTime driver.\n";
 
-static struct ast_cli_entry cli_load_realtime_cmd = {
-        { "realtime", "load", NULL, NULL }, cli_load_realtime,
-        "Used to print out RealTime variables.", cli_load_realtime_usage, NULL };
-
-static char cli_update_realtime_usage[] =
+static char cli_realtime_update_usage[] =
 "Usage: realtime update <family> <colmatch> <value>\n"
 "       Update a single variable using the RealTime driver.\n";
 
-static struct ast_cli_entry cli_update_realtime_cmd = {
-        { "realtime", "update", NULL, NULL }, cli_update_realtime,
-        "Used to update RealTime variables.", cli_update_realtime_usage, NULL };
+static struct ast_cli_entry cli_realtime[] = {
+	{ { "realtime", "load", NULL, NULL },
+	cli_realtime_load, "Used to print out RealTime variables.",
+	cli_realtime_load_usage, NULL },
+
+	{ { "realtime", "update", NULL, NULL },
+	cli_realtime_update, "Used to update RealTime variables.",
+	cli_realtime_update_usage, NULL },
+};
 
 static int realtime_update_exec(struct ast_channel *chan, void *data) 
 {
@@ -236,9 +238,8 @@
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_load_realtime_cmd);
-	res |= ast_cli_unregister(&cli_update_realtime_cmd);
-	res |= ast_unregister_application(uapp);
+	ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
+	res = ast_unregister_application(uapp);
 	res |= ast_unregister_application(app);
 
 	ast_module_user_hangup_all();
@@ -250,9 +251,8 @@
 {
 	int res;
 
-	res = ast_cli_register(&cli_load_realtime_cmd);
-	res |= ast_cli_register(&cli_update_realtime_cmd);
-	res |= ast_register_application(uapp, realtime_update_exec, usynopsis, udesc);
+	ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(uapp, realtime_update_exec, usynopsis, udesc);
 	res |= ast_register_application(app, realtime_exec, synopsis, desc);
 
 	return res;

Modified: team/mattf/asterisk-ss7/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_rpt.c?rev=43233&r1=43232&r2=43233&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/apps/app_rpt.c (original)
+++ team/mattf/asterisk-ss7/apps/app_rpt.c Mon Sep 18 16:56:06 2006
@@ -726,29 +726,30 @@
 "Usage: rpt restart\n"
 "       Restarts app_rpt\n";
 
-static struct ast_cli_entry  cli_debug =
-        { { "rpt", "debug", "level" }, rpt_do_debug, 
-		"Enable app_rpt debugging", debug_usage };
-
-static struct ast_cli_entry  cli_dump =
-        { { "rpt", "dump" }, rpt_do_dump,
-		"Dump app_rpt structs for debugging", dump_usage };
-
-static struct ast_cli_entry  cli_stats =
-        { { "rpt", "stats" }, rpt_do_stats,
-		"Dump node statistics", dump_stats };
-
-static struct ast_cli_entry  cli_lstats =
-        { { "rpt", "lstats" }, rpt_do_lstats,
-		"Dump link statistics", dump_lstats };
-
-static struct ast_cli_entry  cli_reload =
-        { { "rpt", "reload" }, rpt_do_reload,
-		"Reload app_rpt config", reload_usage };
-
-static struct ast_cli_entry  cli_restart =
-        { { "rpt", "restart" }, rpt_do_restart,
-		"Restart app_rpt", restart_usage };
+static struct ast_cli_entry cli_rpt[] = {
+	{ { "rpt", "debug", "level" },
+	rpt_do_debug, "Enable app_rpt debugging",
+	debug_usage },
+
+        { { "rpt", "dump" },
+	rpt_do_dump, "Dump app_rpt structs for debugging",
+	dump_usage },
+
+        { { "rpt", "stats" },
+	rpt_do_stats, "Dump node statistics",
+	dump_stats },
+        { { "rpt", "lstats" },
+	rpt_do_lstats, "Dump link statistics",
+	dump_lstats },
+
+        { { "rpt", "reload" },
+	rpt_do_reload, "Reload app_rpt config",
+	reload_usage },
+
+        { { "rpt", "restart" },
+	rpt_do_restart, "Restart app_rpt",
+	restart_usage },
+};
 
 /*
 * Telemetry defaults
@@ -8018,12 +8019,7 @@
 	i = ast_unregister_application(app);
 
 	/* Unregister cli extensions */
-	ast_cli_unregister(&cli_debug);
-	ast_cli_unregister(&cli_dump);
-	ast_cli_unregister(&cli_stats);
-	ast_cli_unregister(&cli_lstats);
-	ast_cli_unregister(&cli_reload);
-	ast_cli_unregister(&cli_restart);
+	ast_cli_unregister_multiple(cli_rpt, sizeof(cli_rpt) / sizeof(struct ast_cli_entry));
 
 	return i;
 }
@@ -8038,12 +8034,7 @@
 	ast_pthread_create(&rpt_master_thread,NULL,rpt_master,cfg);
 
 	/* Register cli extensions */
-	ast_cli_register(&cli_debug);
-	ast_cli_register(&cli_dump);
-	ast_cli_register(&cli_stats);
-	ast_cli_register(&cli_lstats);
-	ast_cli_register(&cli_reload);
-	ast_cli_register(&cli_restart);
+	ast_cli_register_multiple(cli_rpt, sizeof(cli_rpt) / sizeof(struct ast_cli_entry));
 
 	return ast_register_application(app, rpt_exec, synopsis, descrip);
 }

Modified: team/mattf/asterisk-ss7/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/apps/app_voicemail.c?rev=43233&r1=43232&r2=43233&view=diff

[... 11585 lines stripped ...]


More information about the asterisk-commits mailing list