From 159c4ce95d1314bde9f747b0a0857c46fbf25a4f Mon Sep 17 00:00:00 2001 From: Stephane Alnet Date: Fri, 2 Feb 2018 10:19:03 +0100 Subject: [PATCH] FS-6816 [mod_sofia] Set empty callee id if `_undef_` In some scenarios (e.g. MetaSwitch interop) the `display` field of callee-id should be left empty instead of being overwritten with the number. As is done in other places, we allow for `_undef_` to mean "leave the field empty". --- src/mod/endpoints/mod_sofia/sofia.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index fc8a8acfa7..54f3e6802a 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1173,6 +1173,10 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons if (zstr(number)) { name = number = "UNKNOWN"; } + + if (!zstr(name) && !strcmp(name,"_undef_")) { + name = ""; + } } else { if (zstr(name)) { name = caller_profile->callee_id_name; @@ -1189,6 +1193,10 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons if (zstr(number)) { number = caller_profile->destination_number; } + + if (!zstr(name) && !strcmp(name,"_undef_")) { + name = ""; + } } if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) {