CID:1214163 Unchecked return value, check return value of switch_ivr_play_file and bail out if it fails

This commit is contained in:
Michael Jerris 2014-05-15 13:18:58 +00:00
parent 7c72e94a67
commit 452d7a3793
1 changed files with 13 additions and 3 deletions

View File

@ -3030,7 +3030,10 @@ SWITCH_STANDARD_APP(fifo_function)
const char *o_announce = NULL;
if ((o_announce = switch_channel_get_variable(channel, "fifo_outbound_announce"))) {
switch_ivr_play_file(session, NULL, o_announce, NULL);
status = switch_ivr_play_file(session, NULL, o_announce, NULL);
if (!SWITCH_READ_ACCEPTABLE(status)) {
break;
}
}
if (switch_ivr_originate(session, &other_session, &cause, url, 120, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL) != SWITCH_STATUS_SUCCESS) {
@ -3094,9 +3097,13 @@ SWITCH_STANDARD_APP(fifo_function)
}
if (announce) {
switch_ivr_play_file(session, NULL, announce, NULL);
status = switch_ivr_play_file(session, NULL, announce, NULL);
if (!SWITCH_READ_ACCEPTABLE(status)) {
break;
}
}
switch_channel_set_variable(other_channel, "fifo_serviced_by", my_id);
switch_channel_set_variable(other_channel, "fifo_serviced_uuid", switch_core_session_get_uuid(session));
switch_channel_set_flag(other_channel, CF_BREAK);
@ -3434,7 +3441,10 @@ SWITCH_STANDARD_APP(fifo_function)
memset(&args, 0, sizeof(args));
args.buf = buf;
args.buflen = sizeof(buf);
switch_ivr_play_file(session, NULL, fifo_consumer_wrapup_sound, &args);
status = switch_ivr_play_file(session, NULL, fifo_consumer_wrapup_sound, &args);
if (!SWITCH_READ_ACCEPTABLE(status)) {
break;
}
}
if (fifo_consumer_wrapup_time) {