From: Anthony Minessale Date: Mon, 2 Apr 2012 19:37:40 +0000 (-0500) Subject: FS-3984 --resolve X-Git-Tag: v1.2-rc1~19^2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe704c40829b3b794a13d1b9aeac938f3d1176e0;p=thirdparty%2Ffreeswitch.git FS-3984 --resolve --- diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 72267d7ea4..2531d816a3 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -2439,11 +2439,22 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) switch (cid_type) { case CID_TYPE_PID: if (switch_test_flag(caller_profile, SWITCH_CPF_SCREEN)) { - tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", use_name, use_number, rpid_domain); + if (zstr(tech_pvt->caller_profile->caller_id_name) || !strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { + tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "", + use_number, rpid_domain); + } else { + tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", + use_name, use_number, rpid_domain); + } } else { - tech_pvt->preferred_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", - tech_pvt->caller_profile->caller_id_name, - tech_pvt->caller_profile->caller_id_number, rpid_domain); + if (zstr(tech_pvt->caller_profile->caller_id_name) || !strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { + tech_pvt->preferred_id = switch_core_session_sprintf(tech_pvt->session, "", + tech_pvt->caller_profile->caller_id_number, rpid_domain); + } else { + tech_pvt->preferred_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", + tech_pvt->caller_profile->caller_id_name, + tech_pvt->caller_profile->caller_id_number, rpid_domain); + } } if (switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER)) {