dect
/
asterisk
Archived
13
0
Fork 0

Fix up formatting and a few typos/poor grammar in pbx.c (bug #3924)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5347 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
kpfleming 2005-04-01 19:56:35 +00:00
parent ec83551020
commit fc1ef7ac89
1 changed files with 59 additions and 50 deletions

53
pbx.c
View File

@ -336,9 +336,9 @@ static struct pbx_builtin {
"Resets the Call Data Record",
" ResetCDR([options]): Causes the Call Data Record to be reset, optionally\n"
"storing the current CDR before zeroing it out\b"
"(if 'w' option is specifed) record will be stored.\n"
"(if 'a' option is specifed) any stacked records will be stored.\n"
"(if 'v' option is specifed) any variables will be saved.\n"
" - if 'w' option is specified record will be stored.\n"
" - if 'a' option is specified any stacked records will be stored.\n"
" - if 'v' option is specified any variables will be saved.\n"
"Always returns 0.\n"
},
@ -398,27 +398,30 @@ static struct pbx_builtin {
},
{ "SetLanguage", pbx_builtin_setlanguage,
"Sets user language",
"Sets channel language",
" SetLanguage(language): Set the channel language to 'language'. This\n"
"information is used for the syntax in generation of numbers, and to choose\n"
"a natural language file when available.\n"
" For example, if language is set to 'fr' and the file 'demo-congrats' is \n"
"requested to be played, if the file 'fr/demo-congrats' exists, then\n"
"it will play that file, and if not will play the normal 'demo-congrats'.\n"
"For some language codes, SetLanguage also changes the syntax of some\n"
"Asterisk functions, like SayNumber.\n"
"Always returns 0.\n"
},
{ "SetVar", pbx_builtin_setvar,
"Set variable to value",
" SetVar(#n1=value|#n2=value|..[|options]) Set a variables to a CDR.\n"
"Set channel variable to value",
" SetVar(#n1=value|#n2=value|..[|options]) \n"
"You can specify an endless list of name / value pairs to be set as channel variables.\n"
" #n=value: Sets variable n to value. If prefixed with _, single\n"
"inheritance assumed. If prefixed with __, infinite inheritance is assumed.\n"
"The last arg (if it doesn't contain an '=' ) is intrepreted as a string of\n"
"options. Valid Options:\n"
" - c - CDR, if set set the var as a CDR variable also.\n"
" - r - Recursive CDR, if there are any stacked CDRs, also apply to all as a cdr var.\n"
" - g - Set a global variable not a channel variable.\n"
" #n=value: Sets variable n to value. If prefixed with _, single\n"
"inheritance assumed. If prefixed with __, infinite inheritance is assumed.\n" },
},
{ "ImportVar", pbx_builtin_importvar,
"Set variable to value",
@ -1779,12 +1782,10 @@ int ast_device_state_changed(const char *fmt, ...)
*rest = 0;
}
if (option_debug > 2)
ast_log(LOG_DEBUG, "Changing state for %s\n", device);
state = ast_device_state(device);
if (option_debug > 2)
ast_log(LOG_DEBUG, "Changing state for %s - state %d\n", device, state);
ast_mutex_lock(&hintlock);
@ -3390,7 +3391,8 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
memset(&counters, 0, sizeof(counters));
if (argc != 2 && argc != 3) return RESULT_SHOWUSAGE;
if (argc != 2 && argc != 3)
return RESULT_SHOWUSAGE;
/* we obtain [exten@]context? if yes, split them ... */
if (argc == 3) {
@ -3402,16 +3404,20 @@ static int handle_show_dialplan(int fd, int argc, char *argv[])
context = splitter;
/* check for length and change to NULL if ast_strlen_zero() */
if (ast_strlen_zero(exten)) exten = NULL;
if (ast_strlen_zero(context)) context = NULL;
if (ast_strlen_zero(exten))
exten = NULL;
if (ast_strlen_zero(context))
context = NULL;
show_dialplan_helper(fd, context, exten, &counters, NULL);
} else {
/* no '@' char, only context given */
context = argv[2];
if (ast_strlen_zero(context)) context = NULL;
if (ast_strlen_zero(context))
context = NULL;
show_dialplan_helper(fd, context, exten, &counters, NULL);
}
} else {
/* Show complete dial plan */
show_dialplan_helper(fd, NULL, NULL, &counters, NULL);
}
@ -3460,7 +3466,7 @@ static struct ast_custom_function_obj isnull_function = {
static struct ast_custom_function_obj exists_function = {
.name = "exists",
.desc = "Existance Test: Returns 1 if exists, 0 otherwise",
.desc = "Existence Test: Returns 1 if exists, 0 otherwise",
.syntax = "exists(<data>)",
.read = builtin_function_exists,
.write = NULL,
@ -3504,17 +3510,17 @@ static struct ast_custom_function_obj cdr_function = {
*/
static struct ast_cli_entry show_applications_cli =
{ { "show", "applications", NULL },
handle_show_applications, "Shows registered applications",
handle_show_applications, "Shows registered dialplan applications",
show_applications_help, complete_show_applications };
static struct ast_cli_entry show_functions_cli =
{ { "show", "functions", NULL },
handle_show_functions, "Shows registered functions",
handle_show_functions, "Shows registered dialplan functions",
show_functions_help};
static struct ast_cli_entry show_application_cli =
{ { "show", "application", NULL },
handle_show_application, "Describe a specific application",
handle_show_application, "Describe a specific dialplan application",
show_application_help, complete_show_application };
static struct ast_cli_entry show_dialplan_cli =
@ -3699,7 +3705,8 @@ static void get_timerange(struct ast_timing *i, char *times)
}
*e = '\0';
e++;
while(*e && !isdigit(*e)) e++;
while(*e && !isdigit(*e))
e++;
if (!*e) {
ast_log(LOG_WARNING, "Invalid time range. Assuming no restrictions based on time.\n");
return;
@ -3768,6 +3775,7 @@ static char *days[] =
"sat",
};
/*--- get_dow: Get day of week */
static unsigned int get_dow(char *dow)
{
char *c;
@ -4031,7 +4039,8 @@ int ast_context_add_include2(struct ast_context *con, const char *value,
strcpy(new_include->rname, value);
c = new_include->rname;
/* Strip off timing info */
while(*c && (*c != '|')) c++;
while(*c && (*c != '|'))
c++;
/* Process if it's there */
if (*c) {
new_include->hastime = ast_build_timing(&(new_include->timing), c+1);