diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_amd.c | 3 | ||||
-rw-r--r-- | apps/app_festival.c | 8 | ||||
-rw-r--r-- | apps/app_followme.c | 2 | ||||
-rw-r--r-- | apps/app_ices.c | 3 | ||||
-rw-r--r-- | apps/app_minivm.c | 24 | ||||
-rw-r--r-- | apps/app_originate.c | 5 | ||||
-rw-r--r-- | apps/app_queue.c | 5 | ||||
-rw-r--r-- | apps/app_voicemail.c | 2 |
8 files changed, 18 insertions, 34 deletions
diff --git a/apps/app_amd.c b/apps/app_amd.c index 60c13fd95..7c4e2a47a 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -157,7 +157,6 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) int iTotalTime = 0; int iWordsCount = 0; int currentState = STATE_IN_WORD; - int previousState = STATE_IN_SILENCE; int consecutiveVoiceDuration = 0; char amdCause[256] = "", amdStatus[256] = ""; char *parse = ast_strdupa(data); @@ -303,7 +302,6 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (silenceDuration >= betweenWordsSilence) { if (currentState != STATE_IN_SILENCE ) { - previousState = currentState; ast_verb(3, "AMD: Channel [%s]. Changed state to STATE_IN_SILENCE\n", chan->name); } /* Find words less than word duration */ @@ -343,7 +341,6 @@ static void isAnsweringMachine(struct ast_channel *chan, const char *data) if (consecutiveVoiceDuration >= minimumWordLength && currentState == STATE_IN_SILENCE) { iWordsCount++; ast_verb(3, "AMD: Channel [%s]. Word detected. iWordsCount:%d\n", chan->name, iWordsCount); - previousState = currentState; currentState = STATE_IN_WORD; } if (consecutiveVoiceDuration >= maximumWordLength){ diff --git a/apps/app_festival.c b/apps/app_festival.c index f6f3734ca..a30302fa7 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -163,7 +163,6 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in { int res = 0; int fds[2]; - int pid = -1; int needed = 0; struct ast_format owriteformat; struct ast_frame *f; @@ -196,7 +195,6 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in res = send_waveform_to_fd(waveform, length, fds[1]); if (res >= 0) { - pid = res; /* Order is important -- there's almost always going to be mp3... we want to prioritize the user */ for (;;) { @@ -258,10 +256,6 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in close(fds[0]); close(fds[1]); -#if 0 - if (pid > -1) - kill(pid, SIGKILL); -#endif if (!res && owriteformat.id) ast_set_write_format(chan, &owriteformat); return res; @@ -285,7 +279,6 @@ static int festival_exec(struct ast_channel *chan, const char *vdata) char ack[4]; char *waveform; int filesize; - int wave; char bigstring[MAXFESTLEN]; int i; struct MD5Context md5ctx; @@ -494,7 +487,6 @@ static int festival_exec(struct ast_channel *chan, const char *vdata) /* Read back info from server */ /* This assumes only one waveform will come back, also LP is unlikely */ - wave = 0; do { int read_data; for (n = 0; n < 3; ) { diff --git a/apps/app_followme.c b/apps/app_followme.c index c53264b14..7ed874928 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -804,7 +804,6 @@ static void findmeexec(struct fm_args *tpargs) char *rest, *number; struct findme_user *tmpuser; struct findme_user *fmuser; - struct findme_user *headuser; struct findme_user_listptr *findme_user_list; int status; @@ -915,7 +914,6 @@ static void findmeexec(struct fm_args *tpargs) fmuser = NULL; tmpuser = NULL; - headuser = NULL; if (winner) break; diff --git a/apps/app_ices.c b/apps/app_ices.c index b7eea944c..729375313 100644 --- a/apps/app_ices.c +++ b/apps/app_ices.c @@ -112,7 +112,6 @@ static int ices_exec(struct ast_channel *chan, const char *data) int pid = -1; int flags; struct ast_format oreadformat; - struct timeval last; struct ast_frame *f; char filename[256]=""; char *c; @@ -123,8 +122,6 @@ static int ices_exec(struct ast_channel *chan, const char *data) return -1; } - last = ast_tv(0, 0); - if (pipe(fds)) { ast_log(LOG_WARNING, "Unable to create pipe\n"); return -1; diff --git a/apps/app_minivm.c b/apps/app_minivm.c index 55373698c..196f8fc42 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1266,13 +1266,22 @@ static int sendmail(struct minivm_template *template, struct minivm_account *vmu char tmpcmd[PATH_MAX]; int tmpfd; + /** + * XXX + * /bug tmpfd is a leaked fd. The file is also never unlinked. + * See app_voicemail.c for how the code works there that + * doesn't have this bug. + */ + ast_copy_string(newtmp, "/tmp/XXXXXX", sizeof(newtmp)); ast_debug(3, "newtmp: %s\n", newtmp); tmpfd = mkstemp(newtmp); - snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, filename, format, newtmp, format); - ast_safe_system(tmpcmd); - finalfilename = newtmp; - ast_debug(3, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", filename, format, vmu->volgain, vmu->username); + if (tmpfd > -1) { + snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, filename, format, newtmp, format); + ast_safe_system(tmpcmd); + finalfilename = newtmp; + ast_debug(3, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", filename, format, vmu->volgain, vmu->username); + } } else { finalfilename = ast_strdupa(filename); } @@ -1828,7 +1837,6 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav char callerid[256]; FILE *txt; int res = 0, txtdes; - int msgnum; int duration = 0; char date[256]; char tmpdir[PATH_MAX]; @@ -1871,7 +1879,6 @@ static int leave_voicemail(struct ast_channel *chan, char *username, struct leav pbx_builtin_setvar_helper(chan, "MVM_RECORD_STATUS", "FAILED"); return res; } - msgnum = 0; userdir = check_dirpath(tmpdir, sizeof(tmpdir), vmu->domain, username, "tmp"); @@ -2452,7 +2459,6 @@ static int minivm_accmess_exec(struct ast_channel *chan, const char *data) char *message = NULL; char *prompt = NULL; int duration; - int cmd; if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "MinivmAccmess needs at least two arguments: account and option\n"); @@ -2526,7 +2532,7 @@ static int minivm_accmess_exec(struct ast_channel *chan, const char *data) } snprintf(filename,sizeof(filename), "%s%s/%s/%s", MVM_SPOOL_DIR, vmu->domain, vmu->username, message); /* Maybe we should check the result of play_record_review ? */ - cmd = play_record_review(chan, prompt, filename, global_maxgreet, default_vmformat, 0, vmu, &duration, NULL, FALSE); + play_record_review(chan, prompt, filename, global_maxgreet, default_vmformat, 0, vmu, &duration, NULL, FALSE); ast_debug(1, "Recorded new %s message in %s (duration %d)\n", message, filename, duration); @@ -3238,12 +3244,10 @@ static int minivm_account_func_read(struct ast_channel *chan, const char *cmd, c check_dirpath(buf, len, vmu->domain, vmu->username, NULL); } else { /* Look in channel variables */ struct ast_variable *var; - int found = 0; for (var = vmu->chanvars ; var ; var = var->next) if (!strcmp(var->name, colname)) { ast_copy_string(buf, var->value, len); - found = 1; break; } } diff --git a/apps/app_originate.c b/apps/app_originate.c index 94ac3596c..bc811d958 100644 --- a/apps/app_originate.c +++ b/apps/app_originate.c @@ -101,7 +101,6 @@ static int originate_exec(struct ast_channel *chan, const char *data) char *parse; char *chantech, *chandata; int res = -1; - int outgoing_res = 0; int outgoing_status = 0; static const unsigned int timeout = 30; static const char default_exten[] = "s"; @@ -154,14 +153,14 @@ static int originate_exec(struct ast_channel *chan, const char *data) ast_debug(1, "Originating call to '%s/%s' and connecting them to extension %s,%s,%d\n", chantech, chandata, args.arg1, exten, priority); - outgoing_res = ast_pbx_outgoing_exten(chantech, cap_slin, chandata, + ast_pbx_outgoing_exten(chantech, cap_slin, chandata, timeout * 1000, args.arg1, exten, priority, &outgoing_status, 0, NULL, NULL, NULL, NULL, NULL); } else if (!strcasecmp(args.type, "app")) { ast_debug(1, "Originating call to '%s/%s' and connecting them to %s(%s)\n", chantech, chandata, args.arg1, S_OR(args.arg2, "")); - outgoing_res = ast_pbx_outgoing_app(chantech, cap_slin, chandata, + ast_pbx_outgoing_app(chantech, cap_slin, chandata, timeout * 1000, args.arg1, args.arg2, &outgoing_status, 0, NULL, NULL, NULL, NULL, NULL); } else { diff --git a/apps/app_queue.c b/apps/app_queue.c index 465356e61..48e30b0d9 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -4323,7 +4323,6 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce char *agiexec = NULL; char *macroexec = NULL; char *gosubexec = NULL; - int ret = 0; const char *monitorfilename; const char *monitor_exec; const char *monitor_options; @@ -4838,7 +4837,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce /* We purposely lock the CDR so that pbx_exec does not update the application data */ if (qe->chan->cdr) ast_set_flag(qe->chan->cdr, AST_CDR_FLAG_LOCKED); - ret = pbx_exec(qe->chan, mixmonapp, mixmonargs); + pbx_exec(qe->chan, mixmonapp, mixmonargs); if (qe->chan->cdr) ast_clear_flag(qe->chan->cdr, AST_CDR_FLAG_LOCKED); @@ -4970,7 +4969,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce application = pbx_findapp("agi"); if (application) { agiexec = ast_strdupa(agi); - ret = pbx_exec(qe->chan, application, agiexec); + pbx_exec(qe->chan, application, agiexec); } else ast_log(LOG_WARNING, "Asked to execute an AGI on this channel, but could not find application (agi)!\n"); } diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 396ed8bd9..81387429d 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7061,7 +7061,6 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st char *dir; int curmsg; char urgent_str[7] = ""; - char tmptxtfile[PATH_MAX]; int prompt_played = 0; #ifndef IMAP_STORAGE char msgfile[PATH_MAX], textfile[PATH_MAX], backup[PATH_MAX], backup_textfile[PATH_MAX]; @@ -7074,7 +7073,6 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st dir = vms->curdir; curmsg = vms->curmsg; - tmptxtfile[0] = '\0'; while (!res && !valid_extensions) { int use_directory = 0; if (ast_test_flag((&globalflags), VM_DIRECFORWARD)) { |