summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2006-09-19 21:07:49 +0000
committerMatthew Fredrickson <creslin@digium.com>2006-09-19 21:07:49 +0000
commit33ddb536631cb9b46dc63923dbf79ead8db89186 (patch)
treecf83670bfa579bddec4a254d9f6fc45e2a8a7829
parentfc60c151d3c49897088c148ea01304701b40c2a2 (diff)
Various updates from PCadach's chan_h323-live branch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_macro.c4
-rw-r--r--apps/app_voicemail.c5
-rw-r--r--channels/chan_zap.c17
-rw-r--r--funcs/func_callerid.c6
-rw-r--r--pbx/pbx_ael.c3
-rw-r--r--pbx/pbx_gtkconsole.c2
-rw-r--r--res/res_musiconhold.c8
7 files changed, 34 insertions, 11 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 42b32dd83..21c2b7c62 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -238,14 +238,14 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
case AST_PBX_KEEPALIVE:
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited KEEPALIVE in macro %s on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
- if (option_verbose > 1)
+ else if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
goto out;
break;
default:
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
- if (option_verbose > 1)
+ else if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
dead = 1;
goto out;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 4e605e917..99e51f23b 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4607,12 +4607,15 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
{
int x = 0;
+#ifndef IMAP_STORAGE
+ int res = 0, nummsg;
+#endif
+
if (vms->lastmsg <= -1)
goto done;
vms->curmsg = -1;
#ifndef IMAP_STORAGE
- int res = 0, nummsg;
/* Get the deleted messages fixed */
if (vm_lock_path(vms->curdir))
return ERROR_LOCK_PATH;
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index b10cd6bcc..303b52015 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -2070,6 +2070,8 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
int prilocaldialplan;
int ldp_strip;
int exclusive;
+ const char *rr_str;
+ int redirect_reason;
c = strchr(dest, '/');
if (c)
@@ -2176,7 +2178,20 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
}
pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
p->use_callingpres ? ast->cid.cid_pres : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
- pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
+ if ((rr_str = pbx_builtin_getvar_helper(ast, "PRIREDIRECTREASON"))) {
+ if (!strcasecmp(rr_str, "UNKNOWN"))
+ redirect_reason = 0;
+ else if (!strcasecmp(rr_str, "BUSY"))
+ redirect_reason = 1;
+ else if (!strcasecmp(rr_str, "NO_REPLY"))
+ redirect_reason = 2;
+ else if (!strcasecmp(rr_str, "UNCONDITIONAL"))
+ redirect_reason = 15;
+ else
+ redirect_reason = PRI_REDIR_UNCONDITIONAL;
+ } else
+ redirect_reason = PRI_REDIR_UNCONDITIONAL;
+ pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, redirect_reason);
#ifdef SUPPORT_USERUSER
/* User-user info */
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c
index 21f13ceaa..6068739d4 100644
--- a/funcs/func_callerid.c
+++ b/funcs/func_callerid.c
@@ -59,7 +59,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
ast_copy_string(buf, num, len);
} else {
- ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+ ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
}
} else {
if (!strncasecmp("all", data, 3)) {
@@ -88,7 +88,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
ast_copy_string(buf, chan->cid.cid_rdnis, len);
}
} else {
- ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+ ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
}
}
@@ -125,7 +125,7 @@ static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
free(chan->cid.cid_rdnis);
chan->cid.cid_rdnis = ast_strdup(value);
} else {
- ast_log(LOG_ERROR, "Unknown callerid data type.\n");
+ ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
}
return 0;
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index cbef91f6a..791a58c3c 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -1056,6 +1056,7 @@ static void check_label(pval *item)
The method: well, for each label, find the first label in the context
with the same name. If it's not the current label, then throw an error. */
struct pval *curr;
+ struct pval *x;
/* printf("==== check_label: ====\n"); */
if( !current_extension )
@@ -1063,7 +1064,7 @@ static void check_label(pval *item)
else
curr = current_extension;
- struct pval *x = find_first_label_in_current_context((char *)item->u1.str, curr);
+ x = find_first_label_in_current_context((char *)item->u1.str, curr);
/* printf("Hey, check_label found with item = %x, and x is %x, and currcont is %x, label name is %s\n", item,x, current_context, (char *)item->u1.str); */
if( x && x != item )
{
diff --git a/pbx/pbx_gtkconsole.c b/pbx/pbx_gtkconsole.c
index 4dce4d28a..9f9a1899e 100644
--- a/pbx/pbx_gtkconsole.c
+++ b/pbx/pbx_gtkconsole.c
@@ -495,7 +495,7 @@ static int load_module(void *mod)
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n");
- if (option_verbose > 1)
+ else if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
}
return 0;
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index e553a994d..408201706 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -525,7 +525,7 @@ static void *monmp3thread(void *data)
close(class->srcfd);
class->srcfd = -1;
pthread_testcancel();
- if (class->pid) {
+ if (class->pid > 1) {
kill(class->pid, SIGHUP);
usleep(100000);
kill(class->pid, SIGTERM);
@@ -778,6 +778,10 @@ static int moh_scan_files(struct mohclass *class) {
if ((strlen(files_dirent->d_name) < 4))
continue;
+ /* Skip standard license file - it is not audio */
+ if (!strcmp(files_dirent->d_name, "LICENSE"))
+ continue;
+
snprintf(filepath, sizeof(filepath), "%s/%s", class->dir, files_dirent->d_name);
if (stat(filepath, &statbuf))
@@ -1095,7 +1099,7 @@ static void ast_moh_destroy(void)
AST_LIST_LOCK(&mohclasses);
while ((moh = AST_LIST_REMOVE_HEAD(&mohclasses, list))) {
- if (moh->pid) {
+ if (moh->pid > 1) {
ast_log(LOG_DEBUG, "killing %d!\n", moh->pid);
stime = time(NULL) + 2;
pid = moh->pid;