mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-23 18:04:07 +00:00
FS-7464 mod_callcenter moh-sound needs to be expanded when containing variables.
This commit is contained in:
parent
d3bac671d2
commit
1bc241922e
@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* Marc Olivier Chouinard <mochouinard@moctel.com>
|
* Marc Olivier Chouinard <mochouinard@moctel.com>
|
||||||
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
|
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
|
||||||
*
|
* Ítalo Rossi <italorossib@gmail.com>
|
||||||
*
|
*
|
||||||
* mod_callcenter.c -- Call Center Module
|
* mod_callcenter.c -- Call Center Module
|
||||||
*
|
*
|
||||||
@ -2518,6 +2518,7 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||||||
const char *cc_base_score = switch_channel_get_variable(member_channel, "cc_base_score");
|
const char *cc_base_score = switch_channel_get_variable(member_channel, "cc_base_score");
|
||||||
int cc_base_score_int = 0;
|
int cc_base_score_int = 0;
|
||||||
const char *cur_moh = NULL;
|
const char *cur_moh = NULL;
|
||||||
|
char *moh_expanded = NULL;
|
||||||
char start_epoch[64];
|
char start_epoch[64];
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
switch_time_t t_member_called = local_epoch_time_now(NULL);
|
switch_time_t t_member_called = local_epoch_time_now(NULL);
|
||||||
@ -2679,6 +2680,7 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||||||
cur_moh = switch_core_session_strdup(member_session, queue->moh);
|
cur_moh = switch_core_session_strdup(member_session, queue->moh);
|
||||||
}
|
}
|
||||||
queue_rwunlock(queue);
|
queue_rwunlock(queue);
|
||||||
|
moh_expanded = switch_channel_expand_variables(member_channel, cur_moh);
|
||||||
|
|
||||||
while (switch_channel_ready(member_channel)) {
|
while (switch_channel_ready(member_channel)) {
|
||||||
switch_input_args_t args = { 0 };
|
switch_input_args_t args = { 0 };
|
||||||
@ -2701,9 +2703,8 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||||||
|
|
||||||
switch_core_session_flush_private_events(member_session);
|
switch_core_session_flush_private_events(member_session);
|
||||||
|
|
||||||
if (moh_valid && cur_moh) {
|
if (moh_valid && moh_expanded) {
|
||||||
switch_status_t status = switch_ivr_play_file(member_session, NULL, cur_moh, &args);
|
switch_status_t status = switch_ivr_play_file(member_session, NULL, moh_expanded, &args);
|
||||||
|
|
||||||
if (status == SWITCH_STATUS_FALSE /* Invalid Recording */ && SWITCH_READ_ACCEPTABLE(status)) {
|
if (status == SWITCH_STATUS_FALSE /* Invalid Recording */ && SWITCH_READ_ACCEPTABLE(status)) {
|
||||||
/* Sadly, there doesn't seem to be a return to switch_ivr_play_file that tell you the file wasn't found. FALSE also mean that the channel got switch to BRAKE state, so we check for read acceptable */
|
/* Sadly, there doesn't seem to be a return to switch_ivr_play_file that tell you the file wasn't found. FALSE also mean that the channel got switch to BRAKE state, so we check for read acceptable */
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_WARNING, "Couldn't play file '%s', continuing wait with no audio\n", cur_moh);
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_WARNING, "Couldn't play file '%s', continuing wait with no audio\n", cur_moh);
|
||||||
@ -2724,6 +2725,9 @@ SWITCH_STANDARD_APP(callcenter_function)
|
|||||||
}
|
}
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
}
|
}
|
||||||
|
if (moh_expanded != cur_moh) {
|
||||||
|
switch_safe_free(moh_expanded);
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure an agent was found, as we might break above without setting it */
|
/* Make sure an agent was found, as we might break above without setting it */
|
||||||
if (!agent_found && (p = switch_channel_get_variable(member_channel, "cc_agent_found"))) {
|
if (!agent_found && (p = switch_channel_get_variable(member_channel, "cc_agent_found"))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user