aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-15 00:15:14 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-07-15 00:15:14 +0000
commit398df2d16be973d90ef26885a7d85dfb632a10ca (patch)
tree74f0c959524051c9e344293ffbfc08dfb081e7ce /pbx
parent723dd748ca185863ce4b52bc09762f5d8776d00e (diff)
fix some indentation
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6130 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/pbx_spool.c166
1 files changed, 83 insertions, 83 deletions
diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index b4cc38142..5276e1842 100755
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -100,94 +100,94 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
int lineno = 0;
while(fgets(buf, sizeof(buf), f)) {
lineno++;
- /* Trim comments */
- c = buf;
- while ((c = strchr(c, '#'))) {
- if ((c == buf) || (*(c-1) == ' ') || (*(c-1) == '\t'))
- *c = '\0';
- else
- c++;
- }
- c = strchr(buf, ';');
- if (c)
- *c = '\0';
+ /* Trim comments */
+ c = buf;
+ while ((c = strchr(c, '#'))) {
+ if ((c == buf) || (*(c-1) == ' ') || (*(c-1) == '\t'))
+ *c = '\0';
+ else
+ c++;
+ }
+ c = strchr(buf, ';');
+ if (c)
+ *c = '\0';
- /* Trim trailing white space */
- while(!ast_strlen_zero(buf) && buf[strlen(buf) - 1] < 33)
- buf[strlen(buf) - 1] = '\0';
- if (!ast_strlen_zero(buf)) {
- c = strchr(buf, ':');
- if (c) {
- *c = '\0';
+ /* Trim trailing white space */
+ while(!ast_strlen_zero(buf) && buf[strlen(buf) - 1] < 33)
+ buf[strlen(buf) - 1] = '\0';
+ if (!ast_strlen_zero(buf)) {
+ c = strchr(buf, ':');
+ if (c) {
+ *c = '\0';
+ c++;
+ while ((*c) && (*c < 33))
c++;
- while ((*c) && (*c < 33))
- c++;
#if 0
- printf("'%s' is '%s' at line %d\n", buf, c, lineno);
-#endif
- if (!strcasecmp(buf, "channel")) {
- strncpy(o->tech, c, sizeof(o->tech) - 1);
- if ((c2 = strchr(o->tech, '/'))) {
- *c2 = '\0';
- c2++;
- strncpy(o->dest, c2, sizeof(o->dest) - 1);
- } else {
- ast_log(LOG_NOTICE, "Channel should be in form Tech/Dest at line %d of %s\n", lineno, fn);
- o->tech[0] = '\0';
- }
- } else if (!strcasecmp(buf, "callerid")) {
- ast_callerid_split(c, o->cid_name, sizeof(o->cid_name), o->cid_num, sizeof(o->cid_num));
- } else if (!strcasecmp(buf, "application")) {
- strncpy(o->app, c, sizeof(o->app) - 1);
- } else if (!strcasecmp(buf, "data")) {
- strncpy(o->data, c, sizeof(o->data) - 1);
- } else if (!strcasecmp(buf, "maxretries")) {
- if (sscanf(c, "%d", &o->maxretries) != 1) {
- ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn);
- o->maxretries = 0;
- }
- } else if (!strcasecmp(buf, "context")) {
- strncpy(o->context, c, sizeof(o->context) - 1);
- } else if (!strcasecmp(buf, "extension")) {
- strncpy(o->exten, c, sizeof(o->exten) - 1);
- } else if (!strcasecmp(buf, "priority")) {
- if ((sscanf(c, "%d", &o->priority) != 1) || (o->priority < 1)) {
- ast_log(LOG_WARNING, "Invalid priority at line %d of %s\n", lineno, fn);
- o->priority = 1;
- }
- } else if (!strcasecmp(buf, "retrytime")) {
- if ((sscanf(c, "%d", &o->retrytime) != 1) || (o->retrytime < 1)) {
- ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn);
- o->retrytime = 300;
- }
- } else if (!strcasecmp(buf, "waittime")) {
- if ((sscanf(c, "%d", &o->waittime) != 1) || (o->waittime < 1)) {
- ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn);
- o->waittime = 45;
- }
- } else if (!strcasecmp(buf, "retry")) {
- o->retries++;
- } else if (!strcasecmp(buf, "startretry")) {
- if (sscanf(c, "%d", &o->callingpid) != 1) {
- ast_log(LOG_WARNING, "Unable to retrieve calling PID!\n");
- o->callingpid = 0;
- }
- } else if (!strcasecmp(buf, "endretry") || !strcasecmp(buf, "abortretry")) {
- o->callingpid = 0;
- o->retries++;
- } else if (!strcasecmp(buf, "delayedretry")) {
- } else if (!strcasecmp(buf, "setvar")) { /* JDG variable support */
- strncat(o->variable, c, sizeof(o->variable) - strlen(o->variable) - 1);
- strncat(o->variable, "|", sizeof(o->variable) - strlen(o->variable) - 1);
-
- } else if (!strcasecmp(buf, "account")) {
- strncpy(o->account, c, sizeof(o->account) - 1);
+ printf("'%s' is '%s' at line %d\n", buf, c, lineno);
+#endif
+ if (!strcasecmp(buf, "channel")) {
+ strncpy(o->tech, c, sizeof(o->tech) - 1);
+ if ((c2 = strchr(o->tech, '/'))) {
+ *c2 = '\0';
+ c2++;
+ strncpy(o->dest, c2, sizeof(o->dest) - 1);
} else {
- ast_log(LOG_WARNING, "Unknown keyword '%s' at line %d of %s\n", buf, lineno, fn);
+ ast_log(LOG_NOTICE, "Channel should be in form Tech/Dest at line %d of %s\n", lineno, fn);
+ o->tech[0] = '\0';
}
- } else
- ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
- }
+ } else if (!strcasecmp(buf, "callerid")) {
+ ast_callerid_split(c, o->cid_name, sizeof(o->cid_name), o->cid_num, sizeof(o->cid_num));
+ } else if (!strcasecmp(buf, "application")) {
+ strncpy(o->app, c, sizeof(o->app) - 1);
+ } else if (!strcasecmp(buf, "data")) {
+ strncpy(o->data, c, sizeof(o->data) - 1);
+ } else if (!strcasecmp(buf, "maxretries")) {
+ if (sscanf(c, "%d", &o->maxretries) != 1) {
+ ast_log(LOG_WARNING, "Invalid max retries at line %d of %s\n", lineno, fn);
+ o->maxretries = 0;
+ }
+ } else if (!strcasecmp(buf, "context")) {
+ strncpy(o->context, c, sizeof(o->context) - 1);
+ } else if (!strcasecmp(buf, "extension")) {
+ strncpy(o->exten, c, sizeof(o->exten) - 1);
+ } else if (!strcasecmp(buf, "priority")) {
+ if ((sscanf(c, "%d", &o->priority) != 1) || (o->priority < 1)) {
+ ast_log(LOG_WARNING, "Invalid priority at line %d of %s\n", lineno, fn);
+ o->priority = 1;
+ }
+ } else if (!strcasecmp(buf, "retrytime")) {
+ if ((sscanf(c, "%d", &o->retrytime) != 1) || (o->retrytime < 1)) {
+ ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn);
+ o->retrytime = 300;
+ }
+ } else if (!strcasecmp(buf, "waittime")) {
+ if ((sscanf(c, "%d", &o->waittime) != 1) || (o->waittime < 1)) {
+ ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn);
+ o->waittime = 45;
+ }
+ } else if (!strcasecmp(buf, "retry")) {
+ o->retries++;
+ } else if (!strcasecmp(buf, "startretry")) {
+ if (sscanf(c, "%d", &o->callingpid) != 1) {
+ ast_log(LOG_WARNING, "Unable to retrieve calling PID!\n");
+ o->callingpid = 0;
+ }
+ } else if (!strcasecmp(buf, "endretry") || !strcasecmp(buf, "abortretry")) {
+ o->callingpid = 0;
+ o->retries++;
+ } else if (!strcasecmp(buf, "delayedretry")) {
+ } else if (!strcasecmp(buf, "setvar")) { /* JDG variable support */
+ strncat(o->variable, c, sizeof(o->variable) - strlen(o->variable) - 1);
+ strncat(o->variable, "|", sizeof(o->variable) - strlen(o->variable) - 1);
+
+ } else if (!strcasecmp(buf, "account")) {
+ strncpy(o->account, c, sizeof(o->account) - 1);
+ } else {
+ ast_log(LOG_WARNING, "Unknown keyword '%s' at line %d of %s\n", buf, lineno, fn);
+ }
+ } else
+ ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
+ }
}
strncpy(o->fn, fn, sizeof(o->fn) - 1);
if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {