From 9fca678d84db5793288e25bc2eae0256f324c21f Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 19 Aug 2011 05:28:39 +0000 Subject: [PATCH] mod_callcenter: add cc_outbound_cid_name_prefix Prefixes the displayed caller_id_name when calling outbound agents without affecting the caller_id_name of the underlying member channel. --- src/mod/applications/mod_callcenter/mod_callcenter.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 6942e1f61f..277026a3c6 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1445,6 +1445,14 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa /* CallBack Mode */ if (!strcasecmp(h->agent_type, CC_AGENT_TYPE_CALLBACK)) { + switch_channel_t *member_channel = switch_core_session_get_channel(member_session); + char *cid_name = NULL; + const char *cid_name_prefix = NULL; + if ((cid_name_prefix = switch_channel_get_variable(member_channel, "cc_outbound_cid_name_prefix"))) { + cid_name = switch_mprintf("%s%s", cid_name_prefix, h->member_cid_name); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Setting outbound caller_id_name to: %s\n", cid_name); + } + switch_event_create(&ovars, SWITCH_EVENT_REQUEST_PARAMS); switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, "cc_queue", "%s", h->queue_name); switch_event_add_header(ovars, SWITCH_STACK_BOTTOM, "cc_member_uuid", "%s", h->member_uuid); @@ -1460,9 +1468,9 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa t_agent_called = local_epoch_time_now(NULL); dialstr = switch_mprintf("%s", h->originate_string); - status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, 60, NULL, h->member_cid_name, h->member_cid_number, NULL, ovars, SOF_NONE, NULL); - + status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, 60, NULL, cid_name ? cid_name : h->member_cid_name, h->member_cid_number, NULL, ovars, SOF_NONE, NULL); switch_safe_free(dialstr); + switch_safe_free(cid_name); switch_event_destroy(&ovars); /* UUID Standby Mode */