From fb395e14db35936af5569d15501b809d373baadc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Oct 2009 22:04:34 +0000 Subject: [PATCH] add ignore_display_updates variable to block display updates on that leg git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15218 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_types.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 4 ++++ src/switch_core_session.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 70eed55e22..42e6513e88 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -111,6 +111,7 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_PATH_SEPARATOR "/" #endif #define SWITCH_URL_SEPARATOR "://" +#define SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE "ignore_display_updates" #define SWITCH_AUDIO_SPOOL_PATH_VARIABLE "audio_spool_path" #define SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE "bridge_hangup_cause" #define SWITCH_READ_TERMINATOR_USED_VARIABLE "read_terminator_used" diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 89cb6ce963..c24d19a5a1 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -430,6 +430,10 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro const char *val; int fs = 0; + if (switch_true(switch_channel_get_variable(channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) { + return; + } + if (sip->sip_to) { number = sip->sip_to->a_url->url_user; } diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 23c404eecc..83c16ada53 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -615,6 +615,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line, switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s receive message [%s]\n", switch_channel_get_name(session->channel), message_names[message->message_id]); + + + if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY && + switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) { + switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line, + switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "Ignoring display update.\n"); + return SWITCH_STATUS_SUCCESS; + } if (session->endpoint_interface->io_routines->receive_message) { status = session->endpoint_interface->io_routines->receive_message(session, message);