make eavesdrop indicate display of who you are listening to

This commit is contained in:
Anthony Minessale 2010-06-18 09:08:51 -05:00
parent c2bcc926c5
commit d942d9f4c2
2 changed files with 10 additions and 4 deletions

View File

@ -1418,7 +1418,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
cc_t cc = { 0 };
char *forward_file_path = NULL;
switch_core_session_message_t msg = { 0 };
char cid_buf[1024];
char cid_buf[1024] = "";
if (switch_channel_ready(channel)) {

View File

@ -672,9 +672,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
uint32_t tlen;
const char *macro_name = "eavesdrop_announce";
const char *id_name = NULL;
switch_codec_implementation_t tread_impl = { 0 }, read_impl = {
0};
switch_codec_implementation_t tread_impl = { 0 }, read_impl = { 0 };
switch_core_session_message_t msg = { 0 };
char cid_buf[1024] = "";
switch_caller_profile_t *cp = NULL;
if (!switch_channel_media_ready(channel)) {
goto end;
@ -787,7 +788,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session
/* Tell the channel we are going to be in a bridge */
msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
switch_core_session_receive_message(session, &msg);
cp = switch_channel_get_caller_profile(tchannel);
switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cp->caller_id_number, cp->caller_id_name);
msg.string_arg = cid_buf;
msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
switch_core_session_receive_message(tsession, &msg);
while (switch_channel_ready(tchannel) && switch_channel_ready(channel)) {
uint32_t len = sizeof(buf);