From: Marc Olivier Chouinard Date: Sat, 9 Jul 2011 02:00:04 +0000 (-0400) Subject: mod_protovm: Basic update of caller display with current message cid/name X-Git-Tag: v1.2-rc1~108^2^2~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee91b6374a8bd2a3ab37381c2f1c2c71cd089b72;p=thirdparty%2Ffreeswitch.git mod_protovm: Basic update of caller display with current message cid/name --- diff --git a/src/mod/applications/mod_protovm/menu.c b/src/mod/applications/mod_protovm/menu.c index d6eb3d1576..d48e5473c8 100644 --- a/src/mod/applications/mod_protovm/menu.c +++ b/src/mod/applications/mod_protovm/menu.c @@ -96,6 +96,8 @@ void mtvm_menu_main(switch_core_session_t *session, vmivr_profile_t *profile) { /* TODO Add Detection of new message and notify the user */ for (retry = MAX_ATTEMPT; switch_channel_ready(channel) && retry > 0; retry--) { + switch_core_session_message_t msg = { 0 }; + char cid_buf[1024] = ""; dtmf_ss_t loc; char *dtmfa[16] = { 0 }; switch_event_t *phrase_params = NULL; @@ -139,6 +141,14 @@ void mtvm_menu_main(switch_core_session_t *session, vmivr_profile_t *profile) { append_event_message(session, profile, phrase_params, msg_list_params, current_msg); /* Save in profile the current msg info for other menu processing AND restoration of our current position */ + switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", switch_str_nil(switch_event_get_header(phrase_params, "VM-Message-Caller-Number")), switch_str_nil(switch_event_get_header(phrase_params, "VM-Message-Caller-Name"))); + + /* Display MSG CID/Name to caller */ + msg.from = __FILE__; + msg.string_arg = cid_buf; + msg.message_id = SWITCH_MESSAGE_INDICATE_DISPLAY; + switch_core_session_receive_message(session, &msg); + profile->current_msg = current_msg; profile->current_msg_uuid = switch_core_session_strdup(session, switch_event_get_header(phrase_params, "VM-Message-UUID"));