diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_alarmreceiver.c | 2 | ||||
-rw-r--r-- | apps/app_chanspy.c | 9 | ||||
-rw-r--r-- | apps/app_dial.c | 3 | ||||
-rw-r--r-- | apps/app_disa.c | 2 | ||||
-rw-r--r-- | apps/app_minivm.c | 3 | ||||
-rw-r--r-- | apps/app_osplookup.c | 10 | ||||
-rw-r--r-- | apps/app_queue.c | 4 | ||||
-rw-r--r-- | apps/app_voicemail.c | 38 |
8 files changed, 35 insertions, 36 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index 20171e023..44782f0c7 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -251,7 +251,7 @@ static int receive_dtmf_digits(struct ast_channel *chan, char *digit_string, int break; } - if ((r = ast_waitfor(chan, -1) < 0)) { + if ((r = ast_waitfor(chan, -1)) < 0) { ast_debug(1, "Waitfor returned %d\n", r); continue; } diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 4c709cfcc..ab7887764 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -614,7 +614,7 @@ static int channel_spy(struct ast_channel *chan, struct ast_autochan *spyee_auto has arrived, since the spied-on channel could have gone away while we were waiting */ - while ((res = ast_waitfor(chan, -1) > -1) && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) { + while (ast_waitfor(chan, -1) > -1 && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) { if (!(f = ast_read(chan)) || ast_check_hangup(chan)) { running = -1; break; @@ -771,7 +771,6 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, int waitms; int res; char *ptr; - int num; int num_spyed_upon = 1; struct ast_channel_iterator *iter = NULL; @@ -962,6 +961,7 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, res = ast_app_sayname(chan, local_mailbox, local_context); } if (!ast_test_flag(flags, OPTION_NAME) || res < 0) { + int num; if (!ast_test_flag(flags, OPTION_NOTECH)) { if (ast_fileexists(peer_name, NULL, NULL) > 0) { res = ast_streamfile(chan, peer_name, ast_channel_language(chan)); @@ -976,8 +976,9 @@ static int common_exec(struct ast_channel *chan, struct ast_flags *flags, res = ast_say_character_str(chan, peer_name, "", ast_channel_language(chan)); } } - if ((num = atoi(ptr))) - ast_say_digits(chan, atoi(ptr), "", ast_channel_language(chan)); + if ((num = atoi(ptr))) { + ast_say_digits(chan, num, "", ast_channel_language(chan)); + } } } diff --git a/apps/app_dial.c b/apps/app_dial.c index 18cbe8d76..d900f4f2c 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1706,7 +1706,6 @@ static int setup_privacy_args(struct privacy_args *pa, char callerid[60]; int res; char *l; - int silencethreshold; if (chan->caller.id.number.valid && !ast_strlen_zero(chan->caller.id.number.str)) { @@ -1781,7 +1780,7 @@ static int setup_privacy_args(struct privacy_args *pa, "At the tone, please say your name:" */ - silencethreshold = ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE); + int silencethreshold = ast_dsp_get_threshold_from_settings(THRESHOLD_SILENCE); ast_answer(chan); res = ast_play_and_record(chan, "priv-recordintro", pa->privintro, 4, "sln", &duration, NULL, silencethreshold, 2000, 0); /* NOTE: I've reduced the total time to 4 sec */ /* don't think we'll need a lock removed, we took care of diff --git a/apps/app_disa.c b/apps/app_disa.c index 78830f1c3..7d92b7642 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -214,7 +214,7 @@ static int disa_exec(struct ast_channel *chan, const char *data) break; } - if ((res = ast_waitfor(chan, -1) < 0)) { + if ((res = ast_waitfor(chan, -1)) < 0) { ast_debug(1, "Waitfor returned %d\n", res); continue; } diff --git a/apps/app_minivm.c b/apps/app_minivm.c index da9f68954..3ffe06187 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -3343,7 +3343,6 @@ static int access_counter_file(char *directory, char *countername, int value, in static int minivm_counter_func_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { char *username, *domain, *countername; - struct minivm_account *vmu = NULL; char userpath[BUFSIZ]; int res; @@ -3381,7 +3380,7 @@ static int minivm_counter_func_read(struct ast_channel *chan, const char *cmd, c } /* If we can't find account or if the account is temporary, return. */ - if (!ast_strlen_zero(username) && !(vmu = find_account(domain, username, FALSE))) { + if (!ast_strlen_zero(username) && !find_account(domain, username, FALSE)) { ast_log(LOG_ERROR, "Minivm account does not exist: %s@%s\n", username, domain); return 0; } diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 336de102c..4ce2846cf 100644 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -614,7 +614,6 @@ struct osp_metrics { float min; /* Minimum */ float max; /* Maximum */ float avg; /* Average */ - float ndev; /* Normal deviation */ float sdev; /* Standard deviation */ }; @@ -1452,7 +1451,7 @@ static int osp_create_callid( if (callid == NULL) { ast_log(LOG_ERROR, "Invalid parameters\n"); - res = OSP_ERROR; + return OSP_ERROR; } callid->len = sizeof(callid->buf); @@ -1463,6 +1462,7 @@ static int osp_create_callid( case OSP_CALLID_SIP: case OSP_CALLID_IAX: res = OSP_FAILED; + break; default: res = OSP_ERROR; break; @@ -1529,7 +1529,7 @@ static int osp_lookup( if (results == NULL) { ast_log(LOG_ERROR, "Invalid parameters\n"); - res = OSP_ERROR; + return OSP_ERROR; } osp_convert_inout(results->dest, dest, sizeof(dest)); @@ -1787,7 +1787,7 @@ static int osp_lookup( /*! * \brief OSP Lookup Next function * \param name OSP provider name - * \param cause Asterisk hangup cuase + * \param cause Asterisk hangup cause * \param results Lookup results, in/output * \return OSP_OK Found , OSP_FAILED No route, OSP_ERROR Error */ @@ -1809,7 +1809,7 @@ static int osp_next( if (results == NULL) { ast_log(LOG_ERROR, "Invalid parameters\n"); - res = OSP_ERROR; + return OSP_ERROR; } results->outtech[0] = '\0'; diff --git a/apps/app_queue.c b/apps/app_queue.c index 6557d512b..12bdb45ba 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -4860,10 +4860,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce /* Begin Monitoring */ if (qe->parent->monfmt && *qe->parent->monfmt) { if (!qe->parent->montype) { - const char *monexec, *monargs; + const char *monexec; ast_debug(1, "Starting Monitor as requested.\n"); ast_channel_lock(qe->chan); - if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || (monargs = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))) { + if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS")) { which = qe->chan; monexec = monexec ? ast_strdupa(monexec) : NULL; } diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 48b757d39..710787714 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -1949,9 +1949,8 @@ static int imap_retrieve_greeting(const char *dir, const int msgnum, struct ast_ *vms_p->introfn = '\0'; ast_mutex_lock(&vms_p->lock); - init_mailstream(vms_p, GREETINGS_FOLDER); - if (!vms_p->mailstream) { - ast_log(AST_LOG_ERROR, "IMAP mailstream is NULL\n"); + if (init_mailstream(vms_p, GREETINGS_FOLDER) || !vms_p->mailstream) { + ast_log(AST_LOG_ERROR, "IMAP mailstream is NULL or can't init_mailstream\n"); ast_mutex_unlock(&vms_p->lock); return -1; } @@ -2570,7 +2569,7 @@ static int has_voicemail(const char *mailbox, const char *folder) */ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir, char *flag) { - struct vm_state *sendvms = NULL, *destvms = NULL; + struct vm_state *sendvms = NULL; char messagestring[10]; /*I guess this could be a problem if someone has more than 999999999 messages...*/ if (msgnum >= recip->maxmsg) { ast_log(LOG_WARNING, "Unable to copy mail, mailbox %s is full\n", recip->mailbox); @@ -2580,7 +2579,7 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i ast_log(LOG_ERROR, "Couldn't get vm_state for originator's mailbox!!\n"); return -1; } - if (!(destvms = get_vm_state_by_imapuser(recip->imapuser, 0))) { + if (!get_vm_state_by_imapuser(recip->imapuser, 0)) { ast_log(LOG_ERROR, "Couldn't get vm_state for destination mailbox!\n"); return -1; } @@ -2704,7 +2703,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box) { SEARCHPGM *pgm; SEARCHHEADER *hdr; - int ret, urgent = 0; + int urgent = 0; /* If Urgent, then look at INBOX */ if (box == 11) { @@ -2720,7 +2719,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box) vms->imapversion = vmu->imapversion; ast_debug(3, "Before init_mailstream, user is %s\n", vmu->imapuser); - if ((ret = init_mailstream(vms, box)) || !vms->mailstream) { + if (init_mailstream(vms, box) || !vms->mailstream) { ast_log(AST_LOG_ERROR, "Could not initialize mailstream\n"); return -1; } @@ -3047,7 +3046,7 @@ static char *get_header_by_tag(char *header, char *tag, char *buf, size_t len) static char *get_user_by_mailbox(char *mailbox, char *buf, size_t len) { - char *start, *quote, *eol_pnt; + char *start, *eol_pnt; if (ast_strlen_zero(mailbox)) return NULL; @@ -3057,15 +3056,16 @@ static char *get_user_by_mailbox(char *mailbox, char *buf, size_t len) ast_copy_string(buf, start+6, len); - if (!(quote = strchr(buf, '\"'))) { - if (!(eol_pnt = strchr(buf, '/'))) - eol_pnt = strchr(buf,'}'); - *eol_pnt = '\0'; + if (!(quote = strchr(buf, '"'))) { + if ((eol_pnt = strchr(buf, '/')) || (eol_pnt = strchr(buf, '}'))) { + *eol_pnt = '\0'; + } return buf; } else { - eol_pnt = strchr(buf+1,'\"'); - *eol_pnt = '\0'; - return buf+1; + if ((eol_pnt = strchr(quote + 1, '"'))) { + *eol_pnt = '\0'; + } + return quote + 1; } } @@ -6347,8 +6347,8 @@ static int save_to_folder(struct ast_vm_user *vmu, struct vm_state *vms, int msg COPY(dir, msg, ddir, x, username, context, sfn, dfn); } ast_unlock_path(ddir); -#endif return 0; +#endif } static int adsi_logo(unsigned char *buf) @@ -7344,10 +7344,10 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st prompt_played++; if (res || prompt_played > 4) break; - if ((res = ast_readstring(chan, username, sizeof(username) - 1, 2000, 10000, "#") < 0)) + if ((res = ast_readstring(chan, username, sizeof(username) - 1, 2000, 10000, "#")) < 0) break; } - + /* start all over if no username */ if (ast_strlen_zero(username)) continue; @@ -12775,7 +12775,7 @@ static int vmsayname_exec(struct ast_channel *chan, const char *data) context = "default"; } - if ((res = sayname(chan, args_copy, context) < 0)) { + if ((res = sayname(chan, args_copy, context)) < 0) { ast_debug(3, "Greeting not found for '%s@%s', falling back to mailbox number.\n", args_copy, context); res = ast_stream_and_wait(chan, "vm-extension", AST_DIGIT_ANY); if (!res) { |