[asterisk-commits] russell: branch russell/events r85635 - in /team/russell/events: ./ apps/ cha...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 15 13:20:18 CDT 2007
Author: russell
Date: Mon Oct 15 13:20:17 2007
New Revision: 85635
URL: http://svn.digium.com/view/asterisk?view=rev&rev=85635
Log:
resolve, reset
Added:
team/russell/events/doc/tex/backtrace.tex
- copied unchanged from r85633, trunk/doc/tex/backtrace.tex
Modified:
team/russell/events/ (props changed)
team/russell/events/LICENSE
team/russell/events/apps/app_dial.c
team/russell/events/apps/app_mixmonitor.c
team/russell/events/apps/app_osplookup.c
team/russell/events/apps/app_queue.c
team/russell/events/apps/app_rpt.c
team/russell/events/apps/app_zapateller.c
team/russell/events/channels/chan_gtalk.c
team/russell/events/channels/chan_jingle.c
team/russell/events/channels/chan_mgcp.c
team/russell/events/channels/chan_oss.c
team/russell/events/channels/chan_sip.c
team/russell/events/channels/chan_skinny.c
team/russell/events/channels/chan_zap.c
team/russell/events/channels/iax2-provision.c
team/russell/events/configs/features.conf.sample
team/russell/events/configs/queues.conf.sample
team/russell/events/configure.ac
team/russell/events/doc/PEERING
team/russell/events/doc/asterisk-mib.txt
team/russell/events/doc/tex/ael.tex
team/russell/events/doc/tex/ajam.tex
team/russell/events/doc/tex/app-sms.tex
team/russell/events/doc/tex/asterisk.tex
team/russell/events/doc/tex/billing.tex
team/russell/events/doc/tex/cdrdriver.tex
team/russell/events/doc/tex/channelvariables.tex
team/russell/events/doc/tex/cliprompt.tex
team/russell/events/doc/tex/configuration.tex
team/russell/events/doc/tex/dundi.tex
team/russell/events/doc/tex/enum.tex
team/russell/events/doc/tex/extensions.tex
team/russell/events/doc/tex/ices.tex
team/russell/events/doc/tex/imapstorage.tex
team/russell/events/doc/tex/jitterbuffer.tex
team/russell/events/doc/tex/localchannel.tex
team/russell/events/doc/tex/manager.tex
team/russell/events/doc/tex/misdn.tex
team/russell/events/doc/tex/odbcstorage.tex
team/russell/events/doc/tex/privacy.tex
team/russell/events/doc/tex/queuelog.tex
team/russell/events/doc/tex/queues-with-callback-members.tex
team/russell/events/doc/tex/realtime.tex
team/russell/events/doc/tex/security.tex
team/russell/events/doc/tex/sla.tex
team/russell/events/funcs/func_callerid.c
team/russell/events/funcs/func_strings.c
team/russell/events/include/asterisk/logger.h
team/russell/events/include/asterisk/strings.h
team/russell/events/main/asterisk.c
team/russell/events/main/astobj2.c
team/russell/events/main/cdr.c
team/russell/events/main/channel.c
team/russell/events/main/cli.c
team/russell/events/main/db.c
team/russell/events/main/file.c
team/russell/events/main/frame.c
team/russell/events/main/image.c
team/russell/events/main/rtp.c
team/russell/events/main/threadstorage.c
team/russell/events/main/translate.c
team/russell/events/main/udptl.c
team/russell/events/main/utils.c
team/russell/events/pbx/dundi-parser.c
team/russell/events/pbx/pbx_ael.c
team/russell/events/pbx/pbx_config.c
team/russell/events/pbx/pbx_dundi.c
team/russell/events/pbx/pbx_realtime.c
team/russell/events/res/res_clioriginate.c
team/russell/events/res/res_convert.c
team/russell/events/res/res_crypto.c
team/russell/events/res/res_jabber.c
team/russell/events/res/res_limit.c
team/russell/events/res/res_smdi.c
Propchange: team/russell/events/
------------------------------------------------------------------------------
automerge = *
Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/russell/events/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/russell/events/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct 15 13:20:17 2007
@@ -1,1 +1,1 @@
-/trunk:1-85455
+/trunk:1-85634
Modified: team/russell/events/LICENSE
URL: http://svn.digium.com/view/asterisk/team/russell/events/LICENSE?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/LICENSE (original)
+++ team/russell/events/LICENSE Mon Oct 15 13:20:17 2007
@@ -57,14 +57,13 @@
If you have any questions regarding our licensing policy, please
contact us:
-+1.877.546.8963 (via telephone in the USA)
++1.877.344.4861 (via telephone in the USA)
+1.256.428.6000 (via telephone outside the USA)
+1.256.864.0464 (via FAX inside or outside the USA)
IAX2/misery.digium.com/6000 (via IAX2)
licensing at digium.com (via email)
Digium, Inc.
-150 West Park Loop
-Suite 100
+445 Jan Davis Drive
Huntsville, AL 35806
USA
Modified: team/russell/events/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_dial.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_dial.c (original)
+++ team/russell/events/apps/app_dial.c Mon Oct 15 13:20:17 2007
@@ -1405,6 +1405,7 @@
tc->cid.cid_pres = chan->cid.cid_pres;
tc->cid.cid_ton = chan->cid.cid_ton;
tc->cid.cid_tns = chan->cid.cid_tns;
+ tc->cid.cid_ani2 = chan->cid.cid_ani2;
tc->adsicpe = chan->adsicpe;
tc->transfercapability = chan->transfercapability;
Modified: team/russell/events/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_mixmonitor.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_mixmonitor.c (original)
+++ team/russell/events/apps/app_mixmonitor.c Mon Oct 15 13:20:17 2007
@@ -362,46 +362,44 @@
return 0;
}
-static int mixmonitor_cli(int fd, int argc, char **argv)
+static char *handle_cli_mixmonitor(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct ast_channel *chan;
- if (argc < 3)
- return RESULT_SHOWUSAGE;
-
- if (!(chan = ast_get_channel_by_name_prefix_locked(argv[2], strlen(argv[2])))) {
- ast_cli(fd, "No channel matching '%s' found.\n", argv[2]);
- return RESULT_SUCCESS;
- }
-
- if (!strcasecmp(argv[1], "start")) {
- mixmonitor_exec(chan, argv[3]);
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "mixmonitor [start|stop]";
+ e->usage =
+ "Usage: mixmonitor <start|stop> <chan_name> [args]\n"
+ " The optional arguments are passed to the MixMonitor\n"
+ " application when the 'start' command is used.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
+ }
+
+ if (a->argc < 3)
+ return CLI_SHOWUSAGE;
+
+ if (!(chan = ast_get_channel_by_name_prefix_locked(a->argv[2], strlen(a->argv[2])))) {
+ ast_cli(a->fd, "No channel matching '%s' found.\n", a->argv[2]);
+ /* Technically this is a failure, but we don't want 2 errors printing out */
+ return CLI_SUCCESS;
+ }
+
+ if (!strcasecmp(a->argv[1], "start")) {
+ mixmonitor_exec(chan, a->argv[3]);
ast_channel_unlock(chan);
} else {
ast_channel_unlock(chan);
ast_audiohook_detach_source(chan, mixmonitor_spy_type);
}
- return RESULT_SUCCESS;
-}
-
-static char *complete_mixmonitor_cli(const char *line, const char *word, int pos, int state)
-{
- char *options[] = {"start", "stop", NULL};
-
- if (pos == 1)
- return ast_cli_complete (word, options, state);
-
- return ast_complete_channels(line, word, pos, state, 2);
+ return CLI_SUCCESS;
}
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 },
+ NEW_CLI(handle_cli_mixmonitor, "Execute a MixMonitor command")
};
static int unload_module(void)
Modified: team/russell/events/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_osplookup.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_osplookup.c (original)
+++ team/russell/events/apps/app_osplookup.c Mon Oct 15 13:20:17 2007
@@ -1861,10 +1861,7 @@
return 0;
}
-static int osp_show(
- int fd,
- int argc,
- char* argv[])
+static char *handle_cli_osp_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i;
int found = 0;
@@ -1872,12 +1869,21 @@
const char* provider = NULL;
const char* tokenalgo;
- if ((argc < 2) || (argc > 3)) {
- return RESULT_SHOWUSAGE;
- }
- if (argc > 2) {
- provider = argv[2];
- }
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "osp show";
+ e->usage =
+ "Usage: osp show\n"
+ " Displays information on Open Settlement Protocol support\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if ((a->argc < 2) || (a->argc > 3))
+ return CLI_SHOWUSAGE;
+ if (a->argc > 2)
+ provider = a->argv[2];
if (!provider) {
switch (osp_tokenformat) {
case TOKEN_ALGO_BOTH:
@@ -1891,7 +1897,7 @@
tokenalgo = "Signed";
break;
}
- ast_cli(fd, "OSP: %s %s %s\n",
+ ast_cli(a->fd, "OSP: %s %s %s\n",
osp_initialized ? "Initialized" : "Uninitialized", osp_hardware ? "Accelerated" : "Normal", tokenalgo);
}
@@ -1900,25 +1906,25 @@
while(p) {
if (!provider || !strcasecmp(p->name, provider)) {
if (found) {
- ast_cli(fd, "\n");
- }
- ast_cli(fd, " == OSP Provider '%s' == \n", p->name);
- ast_cli(fd, "Local Private Key: %s\n", p->privatekey);
- ast_cli(fd, "Local Certificate: %s\n", p->localcert);
+ ast_cli(a->fd, "\n");
+ }
+ ast_cli(a->fd, " == OSP Provider '%s' == \n", p->name);
+ ast_cli(a->fd, "Local Private Key: %s\n", p->privatekey);
+ ast_cli(a->fd, "Local Certificate: %s\n", p->localcert);
for (i = 0; i < p->cacount; i++) {
- ast_cli(fd, "CA Certificate %d: %s\n", i + 1, p->cacerts[i]);
+ ast_cli(a->fd, "CA Certificate %d: %s\n", i + 1, p->cacerts[i]);
}
for (i = 0; i < p->spcount; i++) {
- ast_cli(fd, "Service Point %d: %s\n", i + 1, p->srvpoints[i]);
- }
- ast_cli(fd, "Max Connections: %d\n", p->maxconnections);
- ast_cli(fd, "Retry Delay: %d seconds\n", p->retrydelay);
- ast_cli(fd, "Retry Limit: %d\n", p->retrylimit);
- ast_cli(fd, "Timeout: %d milliseconds\n", p->timeout);
- ast_cli(fd, "Source: %s\n", strlen(p->source) ? p->source : "<unspecified>");
- ast_cli(fd, "Auth Policy %d\n", p->authpolicy);
- ast_cli(fd, "Default protocol %s\n", p->defaultprotocol);
- ast_cli(fd, "OSP Handle: %d\n", p->handle);
+ ast_cli(a->fd, "Service Point %d: %s\n", i + 1, p->srvpoints[i]);
+ }
+ ast_cli(a->fd, "Max Connections: %d\n", p->maxconnections);
+ ast_cli(a->fd, "Retry Delay: %d seconds\n", p->retrydelay);
+ ast_cli(a->fd, "Retry Limit: %d\n", p->retrylimit);
+ ast_cli(a->fd, "Timeout: %d milliseconds\n", p->timeout);
+ ast_cli(a->fd, "Source: %s\n", strlen(p->source) ? p->source : "<unspecified>");
+ ast_cli(a->fd, "Auth Policy %d\n", p->authpolicy);
+ ast_cli(a->fd, "Default protocol %s\n", p->defaultprotocol);
+ ast_cli(a->fd, "OSP Handle: %d\n", p->handle);
found++;
}
p = p->next;
@@ -1927,12 +1933,12 @@
if (!found) {
if (provider) {
- ast_cli(fd, "Unable to find OSP provider '%s'\n", provider);
+ ast_cli(a->fd, "Unable to find OSP provider '%s'\n", provider);
} else {
- ast_cli(fd, "No OSP providers configured\n");
- }
- }
- return RESULT_SUCCESS;
+ ast_cli(a->fd, "No OSP providers configured\n");
+ }
+ }
+ return CLI_SUCCESS;
}
static const char* app1= "OSPAuth";
@@ -1993,14 +1999,8 @@
" OSPFINISHSTATUS The status of the OSP Finish attempt as a text string, one of\n"
" SUCCESS | FAILED | ERROR \n";
-static const char osp_usage[] =
-"Usage: osp show\n"
-" Displays information on Open Settlement Protocol support\n";
-
static struct ast_cli_entry cli_osp[] = {
- { {"osp", "show", NULL},
- osp_show, "Displays OSP information",
- osp_usage },
+ NEW_CLI(handle_cli_osp_show, "Displays OSF information")
};
static int load_module(void)
Modified: team/russell/events/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_queue.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_queue.c (original)
+++ team/russell/events/apps/app_queue.c Mon Oct 15 13:20:17 2007
@@ -372,6 +372,7 @@
unsigned int wrapped:1;
unsigned int timeoutrestart:1;
unsigned int announceholdtime:2;
+ unsigned int announceposition:1;
unsigned int strategy:3;
unsigned int maskmemberstatus:1;
unsigned int realtime:1;
@@ -803,6 +804,7 @@
q->announcefrequency = 0;
q->minannouncefrequency = DEFAULT_MIN_ANNOUNCE_FREQUENCY;
q->announceholdtime = 0;
+ q->announceholdtime = 1;
q->roundingseconds = 0; /* Default - don't announce seconds */
q->servicelevel = 0;
q->ringinuse = 1;
@@ -1013,6 +1015,8 @@
q->announceholdtime = ANNOUNCEHOLDTIME_ALWAYS;
else
q->announceholdtime = 0;
+ } else if (!strcasecmp(param, "announce-position")) {
+ q->announceposition = ast_true(val);
} else if (!strcasecmp(param, "periodic-announce")) {
if (strchr(val, ',')) {
char *s, *buf = ast_strdupa(val);
@@ -1532,23 +1536,25 @@
} else {
ast_moh_stop(qe->chan);
}
- /* Say we're next, if we are */
- if (qe->pos == 1) {
- res = play_file(qe->chan, qe->parent->sound_next);
- if (res)
- goto playout;
- else
- goto posout;
- } else {
- res = play_file(qe->chan, qe->parent->sound_thereare);
- if (res)
- goto playout;
- res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */
- if (res)
- goto playout;
- res = play_file(qe->chan, qe->parent->sound_calls);
- if (res)
- goto playout;
+ if (qe->parent->announceposition) {
+ /* Say we're next, if we are */
+ if (qe->pos == 1) {
+ res = play_file(qe->chan, qe->parent->sound_next);
+ if (res)
+ goto playout;
+ else
+ goto posout;
+ } else {
+ res = play_file(qe->chan, qe->parent->sound_thereare);
+ if (res)
+ goto playout;
+ res = ast_say_number(qe->chan, qe->pos, AST_DIGIT_ANY, qe->chan->language, (char *) NULL); /* Needs gender */
+ if (res)
+ goto playout;
+ res = play_file(qe->chan, qe->parent->sound_calls);
+ if (res)
+ goto playout;
+ }
}
/* Round hold time to nearest minute */
avgholdmins = abs(((qe->parent->holdtime + 30) - (now - qe->start)) / 60);
@@ -1603,8 +1609,10 @@
}
posout:
- ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
+ if (qe->parent->announceposition) {
+ ast_verb(3, "Told %s in %s their queue position (which was %d)\n",
qe->chan->name, qe->parent->name, qe->pos);
+ }
res = play_file(qe->chan, qe->parent->sound_thanks);
playout:
Modified: team/russell/events/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_rpt.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_rpt.c (original)
+++ team/russell/events/apps/app_rpt.c Mon Oct 15 13:20:17 2007
@@ -299,7 +299,6 @@
#ifdef OLD_ASTERISK
STANDARD_LOCAL_USER;
#endif
-
#define MSWAIT 200
#define HANGTIME 5000
@@ -699,60 +698,20 @@
*/
/* Debug mode */
-static int rpt_do_debug(int fd, int argc, char *argv[]);
-static int rpt_do_dump(int fd, int argc, char *argv[]);
-static int rpt_do_stats(int fd, int argc, char *argv[]);
-static int rpt_do_lstats(int fd, int argc, char *argv[]);
-static int rpt_do_reload(int fd, int argc, char *argv[]);
-static int rpt_do_restart(int fd, int argc, char *argv[]);
-
-static char debug_usage[] =
-"Usage: rpt debug level {0-7}\n"
-" Enables debug messages in app_rpt\n";
-
-static char dump_usage[] =
-"Usage: rpt dump <nodename>\n"
-" Dumps struct debug info to log\n";
-
-static char dump_stats[] =
-"Usage: rpt stats <nodename>\n"
-" Dumps node statistics to console\n";
-
-static char dump_lstats[] =
-"Usage: rpt lstats <nodename>\n"
-" Dumps link statistics to console\n";
-
-static char reload_usage[] =
-"Usage: rpt reload\n"
-" Reloads app_rpt running config parameters\n";
-
-static char restart_usage[] =
-"Usage: rpt restart\n"
-" Restarts app_rpt\n";
+static char *handle_cli_rpt_debug_level(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *handle_cli_rpt_dump(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *handle_cli_rpt_stats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *handle_cli_rpt_lstats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *handle_cli_rpt_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *handle_cli_rpt_restart(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
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 },
+ NEW_CLI(handle_cli_rpt_debug_level, "Enable app_rpt debuggin"),
+ NEW_CLI(handle_cli_rpt_dump, "Dump app_rpt structs for debugging"),
+ NEW_CLI(handle_cli_rpt_stats, "Dump node statistics"),
+ NEW_CLI(handle_cli_rpt_lstats, "Dump link statistics"),
+ NEW_CLI(handle_cli_rpt_reload, "Reload app_rpt config"),
+ NEW_CLI(handle_cli_rpt_restart, "Restart app_rpt")
};
/*
@@ -1130,48 +1089,70 @@
/*
* Enable or disable debug output at a given level at the console
*/
-static int rpt_do_debug(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_debug_level(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int newlevel;
- if (argc != 4)
- return RESULT_SHOWUSAGE;
- newlevel = myatoi(argv[3]);
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt debug level";
+ e->usage =
+ "Usage: rpt debug level {0-7}\n"
+ " Enables debug messages in app_rpt\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+ if (a->argc != 4)
+ return CLI_SHOWUSAGE;
+ newlevel = myatoi(a->argv[3]);
if ((newlevel < 0) || (newlevel > 7))
- return RESULT_SHOWUSAGE;
+ return CLI_SHOWUSAGE;
if (newlevel)
- ast_cli(fd, "app_rpt Debugging enabled, previous level: %d, new level: %d\n", debug, newlevel);
+ ast_cli(a->fd, "app_rpt Debugging enabled, previous level: %d, new level: %d\n", debug, newlevel);
else
- ast_cli(fd, "app_rpt Debugging disabled\n");
-
- debug = newlevel;
- return RESULT_SUCCESS;
+ ast_cli(a->fd, "app_rpt Debugging disabled\n");
+
+ debug = newlevel;
+
+ return CLI_SUCCESS;
}
/*
* Dump rpt struct debugging onto console
*/
-static int rpt_do_dump(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_dump(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i;
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt dump";
+ e->usage =
+ "Usage: rpt dump <nodename>\n"
+ " Dumps struct debug info to log\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
for (i = 0; i < nrpts; i++) {
- if (!strcmp(argv[2], rpt_vars[i].name)) {
+ if (!strcmp(a->argv[2], rpt_vars[i].name)) {
rpt_vars[i].disgorgetime = time(NULL) + 10; /* Do it 10 seconds later */
- ast_cli(fd, "app_rpt struct dump requested for node %s\n", argv[2]);
- return RESULT_SUCCESS;
- }
- }
- return RESULT_FAILURE;
+ ast_cli(a->fd, "app_rpt struct dump requested for node %s\n", a->argv[2]);
+ return CLI_SUCCESS;
+ }
+ }
+ return CLI_FAILURE;
}
/*
* Dump statistics onto console
*/
-static int rpt_do_stats(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_stats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i, j;
int dailytxtime, dailykerchunks;
@@ -1187,8 +1168,19 @@
static char *not_applicable = "N/A";
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt stats";
+ e->usage =
+ "Usage: rpt stats <nodename>\n"
+ " Dumps node statistics to console\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
for (i = 0 ; i <= MAX_STAT_LINKS; i++)
listoflinks[i] = NULL;
@@ -1199,7 +1191,7 @@
lastdtmfcommand = not_applicable;
for (i = 0; i < nrpts; i++) {
- if (!strcmp(argv[2], rpt_vars[i].name)) {
+ if (!strcmp(a->argv[2], rpt_vars[i].name)) {
/* Make a copy of all stat variables while locked */
myrpt = &rpt_vars[i];
rpt_mutex_lock(&myrpt->lock); /* LOCK */
@@ -1283,19 +1275,19 @@
rpt_mutex_unlock(&myrpt->lock); /* UNLOCK */
- ast_cli(fd, "************************ NODE %s STATISTICS *************************\n\n", myrpt->name);
- ast_cli(fd, "Signal on input..................................: %s\n", input_signal);
- ast_cli(fd, "Transmitter enabled..............................: %s\n", enable_state);
- ast_cli(fd, "Time out timer state.............................: %s\n", tot_state);
- ast_cli(fd, "Time outs since system initialization............: %d\n", timeouts);
- ast_cli(fd, "Identifier state.................................: %s\n", ider_state);
- ast_cli(fd, "Kerchunks today..................................: %d\n", dailykerchunks);
- ast_cli(fd, "Kerchunks since system initialization............: %d\n", totalkerchunks);
- ast_cli(fd, "Keyups today.....................................: %d\n", dailykeyups);
- ast_cli(fd, "Keyups since system initialization...............: %d\n", totalkeyups);
- ast_cli(fd, "DTMF commands today..............................: %d\n", dailyexecdcommands);
- ast_cli(fd, "DTMF commands since system initialization........: %d\n", totalexecdcommands);
- ast_cli(fd, "Last DTMF command executed.......................: %s\n", lastdtmfcommand);
+ ast_cli(a->fd, "************************ NODE %s STATISTICS *************************\n\n", myrpt->name);
+ ast_cli(a->fd, "Signal on input..................................: %s\n", input_signal);
+ ast_cli(a->fd, "Transmitter enabled..............................: %s\n", enable_state);
+ ast_cli(a->fd, "Time out timer state.............................: %s\n", tot_state);
+ ast_cli(a->fd, "Time outs since system initialization............: %d\n", timeouts);
+ ast_cli(a->fd, "Identifier state.................................: %s\n", ider_state);
+ ast_cli(a->fd, "Kerchunks today..................................: %d\n", dailykerchunks);
+ ast_cli(a->fd, "Kerchunks since system initialization............: %d\n", totalkerchunks);
+ ast_cli(a->fd, "Keyups today.....................................: %d\n", dailykeyups);
+ ast_cli(a->fd, "Keyups since system initialization...............: %d\n", totalkeyups);
+ ast_cli(a->fd, "DTMF commands today..............................: %d\n", dailyexecdcommands);
+ ast_cli(a->fd, "DTMF commands since system initialization........: %d\n", totalexecdcommands);
+ ast_cli(a->fd, "Last DTMF command executed.......................: %s\n", lastdtmfcommand);
hours = dailytxtime / 3600000;
dailytxtime %= 3600000;
@@ -1304,7 +1296,7 @@
seconds = dailytxtime / 1000;
dailytxtime %= 1000;
- ast_cli(fd, "TX time today ...................................: %02d:%02d:%02d.%d\n",
+ ast_cli(a->fd, "TX time today ...................................: %02d:%02d:%02d.%d\n",
hours, minutes, seconds, dailytxtime);
hours = (int) totaltxtime / 3600000;
@@ -1314,57 +1306,69 @@
seconds = (int) totaltxtime / 1000;
totaltxtime %= 1000;
- ast_cli(fd, "TX time since system initialization..............: %02d:%02d:%02d.%d\n",
+ ast_cli(a->fd, "TX time since system initialization..............: %02d:%02d:%02d.%d\n",
hours, minutes, seconds, (int) totaltxtime);
- ast_cli(fd, "Nodes currently connected to us..................: ");
+ ast_cli(a->fd, "Nodes currently connected to us..................: ");
for (j = 0;; j++) {
if (!listoflinks[j]) {
if (!j) {
- ast_cli(fd, "<NONE>");
+ ast_cli(a->fd, "<NONE>");
}
break;
}
- ast_cli(fd, "%s", listoflinks[j]);
+ ast_cli(a->fd, "%s", listoflinks[j]);
if (j % 4 == 3) {
- ast_cli(fd, "\n");
- ast_cli(fd, " : ");
+ ast_cli(a->fd, "\n");
+ ast_cli(a->fd, " : ");
} else {
if (listoflinks[j + 1])
- ast_cli(fd, ", ");
+ ast_cli(a->fd, ", ");
}
}
- ast_cli(fd, "\n");
-
- ast_cli(fd, "Last node which transmitted to us................: %s\n", lastnodewhichkeyedusup);
- ast_cli(fd, "Autopatch state..................................: %s\n", patch_state);
- ast_cli(fd, "Autopatch called number..........................: %s\n", called_number);
- ast_cli(fd, "Reverse patch/IAXRPT connected...................: %s\n\n", reverse_patch_state);
-
- return RESULT_SUCCESS;
- }
- }
- return RESULT_FAILURE;
+ ast_cli(a->fd, "\n");
+
+ ast_cli(a->fd, "Last node which transmitted to us................: %s\n", lastnodewhichkeyedusup);
+ ast_cli(a->fd, "Autopatch state..................................: %s\n", patch_state);
+ ast_cli(a->fd, "Autopatch called number..........................: %s\n", called_number);
+ ast_cli(a->fd, "Reverse patch/IAXRPT connected...................: %s\n\n", reverse_patch_state);
+
+ return CLI_SUCCESS;
+ }
+ }
+ return CLI_FAILURE;
}
/*
* Link stats function
*/
-static int rpt_do_lstats(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_lstats(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i, j;
struct rpt *myrpt;
struct rpt_link *l;
struct rpt_lstat *s, *t;
struct rpt_lstat s_head;
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt lstats";
+ e->usage =
+ "Usage: rpt lstats <nodename>\n"
+ " Dumps link statistics to console\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
s = NULL;
s_head.next = &s_head;
s_head.prev = &s_head;
for (i = 0; i < nrpts; i++) {
- if (!strcmp(argv[2], rpt_vars[i].name)) {
+ if (!strcmp(a->argv[2], rpt_vars[i].name)) {
/* Make a copy of all stat variables while locked */
myrpt = &rpt_vars[i];
rpt_mutex_lock(&myrpt->lock); /* LOCK */
@@ -1379,7 +1383,7 @@
if ((s = ast_calloc(1, sizeof(*s))) == NULL) {
ast_log(LOG_ERROR, "Malloc failed in rpt_do_lstats\n");
rpt_mutex_unlock(&myrpt->lock); /* UNLOCK */
- return RESULT_FAILURE;
+ return CLI_FAILURE;
}
ast_copy_string(s->name, l->name, MAXREMSTR);
pbx_substitute_variables_helper(l->chan, "${IAXPEER(CURRENTCHANNEL)}", s->peer, MAXPEERSTR - 1);
@@ -1391,8 +1395,8 @@
l = l->next;
}
rpt_mutex_unlock(&myrpt->lock); /* UNLOCK */
- ast_cli(fd, "NODE PEER RECONNECTS DIRECTION CONNECT TIME\n");
- ast_cli(fd, "---- ---- ---------- --------- ------------\n");
+ ast_cli(a->fd, "NODE PEER RECONNECTS DIRECTION CONNECT TIME\n");
+ ast_cli(a->fd, "---- ---- ---------- --------- ------------\n");
for (s = s_head.next; s != &s_head; s = s->next) {
int hours, minutes, seconds;
@@ -1406,7 +1410,7 @@
connecttime %= 1000;
snprintf(conntime, sizeof(conntime), "%02d:%02d:%02d.%d",
hours, minutes, seconds, (int) connecttime);
- ast_cli(fd, "%-10s%-20s%-12d%-11s%-30s\n",
+ ast_cli(a->fd, "%-10s%-20s%-12d%-11s%-30s\n",
s->name, s->peer, s->reconnects, (s->outbound)? "OUT":"IN", conntime);
}
/* destroy our local link queue */
@@ -1417,42 +1421,65 @@
remque((struct qelem *)t);
ast_free(t);
}
- return RESULT_SUCCESS;
- }
- }
- return RESULT_FAILURE;
+ return CLI_SUCCESS;
+ }
+ }
+
+ return CLI_FAILURE;
}
/*
* reload vars
*/
-static int rpt_do_reload(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int n;
- if (argc > 2)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt reload";
+ e->usage =
+ "Usage: rpt reload\n"
+ " Reloads app_rpt running config parameters\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc > 2)
+ return CLI_SHOWUSAGE;
for (n = 0; n < nrpts; n++)
rpt_vars[n].reload = 1;
- return RESULT_FAILURE;
+ return CLI_SUCCESS;
}
/*
* restart app_rpt
*/
-static int rpt_do_restart(int fd, int argc, char *argv[])
+static char *handle_cli_rpt_restart(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
int i;
- if (argc > 2)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "rpt restart";
+ e->usage =
+ "Usage: rpt restart\n"
+ " Restarts app_rpt\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc > 2)
+ return CLI_SHOWUSAGE;
for (i = 0; i < nrpts; i++) {
if (rpt_vars[i].rxchannel)
ast_softhangup(rpt_vars[i].rxchannel, AST_SOFTHANGUP_DEV);
}
- return RESULT_FAILURE;
+ return CLI_SUCCESS;
}
static int play_tone_pair(struct ast_channel *chan, int f1, int f2, int duration, int amplitude)
@@ -4627,7 +4654,7 @@
char multimode = 0;
char oc;
char tmp[20], freq[20] = "", savestr[20] = "";
- int mhz, decimals;
+ int mhz = 0, decimals = 0;
struct ast_channel *mychannel;
AST_DECLARE_APP_ARGS(args1,
AST_APP_ARG(freq);
@@ -6800,7 +6827,7 @@
{
int res = -1, i, rem_totx, n, phone_mode = 0;
char *tmp, keyed = 0;
- char *options, *tele, c;
+ char *options = NULL, *tele, c;
struct rpt *myrpt;
struct ast_frame *f;
struct ast_channel *who;
Modified: team/russell/events/apps/app_zapateller.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_zapateller.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/apps/app_zapateller.c (original)
+++ team/russell/events/apps/app_zapateller.c Mon Oct 15 13:20:17 2007
@@ -53,7 +53,7 @@
" 'answer' - causes the line to be answered before playing the tone,\n"
" 'nocallerid' - causes Zapateller to only play the tone if there is no\n"
" callerid information available. Options should be\n"
-" separated by | characters\n\n"
+" separated by , characters\n\n"
" This application will set the following channel variable upon completion:\n"
" ZAPATELLERSTATUS - This will contain the last action accomplished by the\n"
" Zapateller application. Possible values include:\n"
Modified: team/russell/events/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_gtalk.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/channels/chan_gtalk.c (original)
+++ team/russell/events/channels/chan_gtalk.c Mon Oct 15 13:20:17 2007
@@ -191,8 +191,8 @@
static int gtalk_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int gtalk_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const char *them, const char *sid);
-static int gtalk_do_reload(int fd, int argc, char **argv);
-static int gtalk_show_channels(int fd, int argc, char **argv);
+static char *gtalk_do_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
+static char *gtalk_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
/*----- RTP interface functions */
static int gtalk_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp,
struct ast_rtp *vrtp, struct ast_rtp *trtp, int codecs, int nat_active);
@@ -226,7 +226,6 @@
static struct io_context *io; /*!< The IO context */
static struct in_addr __ourip;
-
/*! \brief RTP driver interface */
static struct ast_rtp_protocol gtalk_rtp = {
type: "Gtalk",
@@ -235,21 +234,10 @@
get_codec: gtalk_get_codec,
};
-static const char debug_usage[] =
-"Usage: gtalk show channels\n"
-" Shows current state of the Gtalk channels.\n";
-
-static const char reload_usage[] =
-"Usage: gtalk reload\n"
-" Reload gtalk channel driver.\n";
-
-
static struct ast_cli_entry gtalk_cli[] = {
- {{ "gtalk", "reload", NULL}, gtalk_do_reload, "Enable Jabber debugging", reload_usage },
- {{ "gtalk", "show", "channels", NULL}, gtalk_show_channels, "Show GoogleTalk Channels", debug_usage },
- };
-
-
+ NEW_CLI(gtalk_do_reload, "Enable Jabber debugging"),
+ NEW_CLI(gtalk_show_channels, "Show GoogleTalk Channels"),
+};
static char externip[16];
@@ -265,7 +253,7 @@
struct gtalk *gtalk = NULL;
char *domain = NULL , *s = NULL;
- if(strchr(connection, '@')) {
+ if (strchr(connection, '@')) {
s = ast_strdupa(connection);
domain = strsep(&s, "@");
ast_verbose("OOOOH domain = %s\n", domain);
@@ -1581,7 +1569,7 @@
}
/*! \brief CLI command "gtalk show channels" */
-static int gtalk_show_channels(int fd, int argc, char **argv)
+static char *gtalk_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT "%-30.30s %-30.30s %-15.15s %-5.5s %-5.5s \n"
struct gtalk_pvt *p;
@@ -1591,11 +1579,22 @@
char *jid = NULL;
char *resource = NULL;
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "gtalk show channels";
+ e->usage =
+ "Usage: gtalk show channels\n"
+ " Shows current state of the Gtalk channels.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
ast_mutex_lock(>alklock);
- ast_cli(fd, FORMAT, "Channel", "Jabber ID", "Resource", "Read", "Write");
+ ast_cli(a->fd, FORMAT, "Channel", "Jabber ID", "Resource", "Read", "Write");
ASTOBJ_CONTAINER_TRAVERSE(>alk_list, 1, {
ASTOBJ_WRLOCK(iterator);
p = iterator->p;
@@ -1611,7 +1610,7 @@
resource ++;
}
if (chan)
- ast_cli(fd, FORMAT,
+ ast_cli(a->fd, FORMAT,
chan->name,
jid,
resource,
@@ -1628,16 +1627,27 @@
ast_mutex_unlock(>alklock);
- ast_cli(fd, "%d active gtalk channel%s\n", numchans, (numchans != 1) ? "s" : "");
- return RESULT_SUCCESS;
+ ast_cli(a->fd, "%d active gtalk channel%s\n", numchans, (numchans != 1) ? "s" : "");
+ return CLI_SUCCESS;
#undef FORMAT
}
-/*! \brief CLI command "gtalk show channels" */
-static int gtalk_do_reload(int fd, int argc, char **argv)
-{
+/*! \brief CLI command "gtalk reload" */
+static char *gtalk_do_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "gtalk reload";
+ e->usage =
+ "Usage: gtalk reload\n"
+ " Reload gtalk channel driver.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
ast_verbose("IT DOES WORK!\n");
- return RESULT_SUCCESS;
+ return CLI_SUCCESS;
}
static int gtalk_parser(void *data, ikspak *pak)
Modified: team/russell/events/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_jingle.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/channels/chan_jingle.c (original)
+++ team/russell/events/channels/chan_jingle.c Mon Oct 15 13:20:17 2007
@@ -199,7 +199,7 @@
/*! \brief PBX interface structure for channel registration */
static const struct ast_channel_tech jingle_tech = {
- .type = type,
+ .type = "Jingle",
.description = "Jingle Channel Driver",
.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
.requester = jingle_request,
@@ -227,7 +227,7 @@
/*! \brief RTP driver interface */
static struct ast_rtp_protocol jingle_rtp = {
- type: "jingle",
+ type: "Jingle",
get_rtp_info: jingle_get_rtp_peer,
set_rtp_peer: jingle_set_rtp_peer,
get_codec: jingle_get_codec,
Modified: team/russell/events/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/channels/chan_mgcp.c?view=diff&rev=85635&r1=85634&r2=85635
==============================================================================
--- team/russell/events/channels/chan_mgcp.c (original)
+++ team/russell/events/channels/chan_mgcp.c Mon Oct 15 13:20:17 2007
@@ -422,7 +422,7 @@
static void handle_response(struct mgcp_endpoint *p, struct mgcp_subchannel *sub,
int result, unsigned int ident, struct mgcp_request *resp);
static void dump_cmd_queues(struct mgcp_endpoint *p, struct mgcp_subchannel *sub);
-static int mgcp_reload(int fd, int argc, char *argv[]);
+static char *mgcp_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static int reload_config(int reload);
static struct ast_channel *mgcp_request(const char *type, int format, void *data, int *cause);
@@ -1041,71 +1041,72 @@
return 0;
}
-static int mgcp_show_endpoints(int fd, int argc, char *argv[])
-{
- struct mgcp_gateway *g;
- struct mgcp_endpoint *e;
+static char *handle_mgcp_show_endpoints(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ struct mgcp_gateway *mg;
+ struct mgcp_endpoint *me;
int hasendpoints = 0;
- if (argc != 3)
- return RESULT_SHOWUSAGE;
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "mgcp show endpoints";
+ e->usage =
+ "Usage: mgcp show endpoints\n"
+ " Lists all endpoints known to the MGCP (Media Gateway Control Protocol) subsystem.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+
+ if (a->argc != 3)
+ return CLI_SHOWUSAGE;
ast_mutex_lock(&gatelock);
- g = gateways;
- while(g) {
- e = g->endpoints;
- ast_cli(fd, "Gateway '%s' at %s (%s)\n", g->name, g->addr.sin_addr.s_addr ? ast_inet_ntoa(g->addr.sin_addr) : ast_inet_ntoa(g->defaddr.sin_addr), g->dynamic ? "Dynamic" : "Static");
- while(e) {
+ mg = gateways;
+ while(mg) {
+ me = mg->endpoints;
+ ast_cli(a->fd, "Gateway '%s' at %s (%s)\n", mg->name, mg->addr.sin_addr.s_addr ? ast_inet_ntoa(mg->addr.sin_addr) : ast_inet_ntoa(mg->defaddr.sin_addr), mg->dynamic ? "Dynamic" : "Static");
+ while(me) {
/* Don't show wilcard endpoint */
- if (strcmp(e->name, g->wcardep) !=0)
- ast_cli(fd, " -- '%s@%s in '%s' is %s\n", e->name, g->name, e->context, e->sub->owner ? "active" : "idle");
+ if (strcmp(me->name, mg->wcardep) != 0)
+ ast_cli(a->fd, " -- '%s@%s in '%s' is %s\n", me->name, mg->name, me->context, me->sub->owner ? "active" : "idle");
hasendpoints = 1;
- e = e->next;
+ me = me->next;
}
if (!hasendpoints) {
- ast_cli(fd, " << No Endpoints Defined >> ");
- }
- g = g->next;
[... 12428 lines stripped ...]
More information about the asterisk-commits
mailing list