[mod_callcenter] FS-9891: Checking if we got a valid pointer for a queue

This commit is contained in:
Italo Rossi 2016-12-29 12:59:24 -03:00
parent d28f29594f
commit 72927b994c
1 changed files with 8 additions and 6 deletions

View File

@ -3122,9 +3122,10 @@ SWITCH_STANDARD_APP(callcenter_function)
switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_name")),
switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_number")),
queue_name, cc_member_cancel_reason2str(h->member_cancel_reason));
queue = get_queue(queue_name);
queue->calls_abandoned++;
queue_rwunlock(queue);
if ((queue = get_queue(queue_name))) {
queue->calls_abandoned++;
queue_rwunlock(queue);
}
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Member %s <%s> is answered by an agent in queue %s\n", switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_name")), switch_str_nil(switch_channel_get_variable(member_channel, "caller_id_number")), queue_name);
@ -3136,9 +3137,10 @@ SWITCH_STANDARD_APP(callcenter_function)
/* Update some channel variables for xml_cdr needs */
switch_channel_set_variable_printf(member_channel, "cc_cause", "%s", "answered");
queue = get_queue(queue_name);
queue->calls_answered++;
queue_rwunlock(queue);
if ((queue = get_queue(queue_name))) {
queue->calls_answered++;
queue_rwunlock(queue);
}
}