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
This commit is contained in:
Matthew Fredrickson
2006-09-19 21:07:49 +00:00
parent fc60c151d3
commit 33ddb53663
7 changed files with 34 additions and 11 deletions

View File

@@ -238,14 +238,14 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
case AST_PBX_KEEPALIVE: case AST_PBX_KEEPALIVE:
if (option_debug) 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); 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); 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; goto out;
break; break;
default: default:
if (option_debug) 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); 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); 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; dead = 1;
goto out; goto out;

View File

@@ -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) static int close_mailbox(struct vm_state *vms, struct ast_vm_user *vmu)
{ {
int x = 0; int x = 0;
#ifndef IMAP_STORAGE
int res = 0, nummsg;
#endif
if (vms->lastmsg <= -1) if (vms->lastmsg <= -1)
goto done; goto done;
vms->curmsg = -1; vms->curmsg = -1;
#ifndef IMAP_STORAGE #ifndef IMAP_STORAGE
int res = 0, nummsg;
/* Get the deleted messages fixed */ /* Get the deleted messages fixed */
if (vm_lock_path(vms->curdir)) if (vm_lock_path(vms->curdir))
return ERROR_LOCK_PATH; return ERROR_LOCK_PATH;

View File

@@ -2070,6 +2070,8 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
int prilocaldialplan; int prilocaldialplan;
int ldp_strip; int ldp_strip;
int exclusive; int exclusive;
const char *rr_str;
int redirect_reason;
c = strchr(dest, '/'); c = strchr(dest, '/');
if (c) 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, 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)); 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 #ifdef SUPPORT_USERUSER
/* User-user info */ /* User-user info */

View File

@@ -59,7 +59,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
ast_copy_string(buf, num, len); ast_copy_string(buf, num, len);
} else { } else {
ast_log(LOG_ERROR, "Unknown callerid data type.\n"); ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
} }
} else { } else {
if (!strncasecmp("all", data, 3)) { 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); ast_copy_string(buf, chan->cid.cid_rdnis, len);
} }
} else { } 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); free(chan->cid.cid_rdnis);
chan->cid.cid_rdnis = ast_strdup(value); chan->cid.cid_rdnis = ast_strdup(value);
} else { } else {
ast_log(LOG_ERROR, "Unknown callerid data type.\n"); ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
} }
return 0; return 0;

View File

@@ -1056,6 +1056,7 @@ static void check_label(pval *item)
The method: well, for each label, find the first label in the context 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. */ with the same name. If it's not the current label, then throw an error. */
struct pval *curr; struct pval *curr;
struct pval *x;
/* printf("==== check_label: ====\n"); */ /* printf("==== check_label: ====\n"); */
if( !current_extension ) if( !current_extension )
@@ -1063,7 +1064,7 @@ static void check_label(pval *item)
else else
curr = current_extension; 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); */ /* 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 ) if( x && x != item )
{ {

View File

@@ -495,7 +495,7 @@ static int load_module(void *mod)
} else { } else {
if (option_debug) if (option_debug)
ast_log(LOG_DEBUG, "Unable to start GTK console monitor -- ignoring\n"); 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"); ast_verbose( VERBOSE_PREFIX_2 "GTK is not available -- skipping monitor\n");
} }
return 0; return 0;

View File

@@ -525,7 +525,7 @@ static void *monmp3thread(void *data)
close(class->srcfd); close(class->srcfd);
class->srcfd = -1; class->srcfd = -1;
pthread_testcancel(); pthread_testcancel();
if (class->pid) { if (class->pid > 1) {
kill(class->pid, SIGHUP); kill(class->pid, SIGHUP);
usleep(100000); usleep(100000);
kill(class->pid, SIGTERM); kill(class->pid, SIGTERM);
@@ -778,6 +778,10 @@ static int moh_scan_files(struct mohclass *class) {
if ((strlen(files_dirent->d_name) < 4)) if ((strlen(files_dirent->d_name) < 4))
continue; 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); snprintf(filepath, sizeof(filepath), "%s/%s", class->dir, files_dirent->d_name);
if (stat(filepath, &statbuf)) if (stat(filepath, &statbuf))
@@ -1095,7 +1099,7 @@ static void ast_moh_destroy(void)
AST_LIST_LOCK(&mohclasses); AST_LIST_LOCK(&mohclasses);
while ((moh = AST_LIST_REMOVE_HEAD(&mohclasses, list))) { while ((moh = AST_LIST_REMOVE_HEAD(&mohclasses, list))) {
if (moh->pid) { if (moh->pid > 1) {
ast_log(LOG_DEBUG, "killing %d!\n", moh->pid); ast_log(LOG_DEBUG, "killing %d!\n", moh->pid);
stime = time(NULL) + 2; stime = time(NULL) + 2;
pid = moh->pid; pid = moh->pid;