]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make eavesdrop indicate display of who you are listening to
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Jun 2010 14:08:51 +0000 (09:08 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Jun 2010 14:08:51 +0000 (09:08 -0500)
src/mod/applications/mod_voicemail/mod_voicemail.c
src/switch_ivr_async.c

index dfbbfa788385e41c8687b5795b216d9a74d2ba38..a1072c816e85f5e54c29bdbad3fad6dc80e7c57d 100644 (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)) {
 
index 708e1c335c0a0aca8eefa2f9aba7332ba6f99432..71c35005cd7833a0640f03a1f913662a0df01477 100644 (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);