From 52728c253cb9e64dd9236cbe084ccb9decc067eb Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 3 Feb 2017 17:14:26 -0600 Subject: [PATCH] FS-10006: [core] Allow adding parameters to P-Asserted-Identity #resolve --- src/mod/endpoints/mod_sofia/sofia_glue.c | 25 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index b1e5e8d97f..ef2a47b5c2 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -837,6 +837,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) const char *invite_from_uri = switch_channel_get_variable(tech_pvt->channel, "sip_invite_from_uri"); const char *invite_contact_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_contact_params"); const char *invite_from_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_from_params"); + const char *invite_pid_params = switch_channel_get_variable(tech_pvt->channel, "sip_invite_pid_params"); const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri"); const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display"); const char *invite_req_uri = switch_channel_get_variable(tech_pvt->channel, "sip_invite_req_uri"); @@ -1112,20 +1113,28 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) case CID_TYPE_PID: if (switch_test_flag(caller_profile, SWITCH_CPF_SCREEN)) { 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); + tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "", + use_number, rpid_domain, + invite_pid_params ? ";" : "", + invite_pid_params ? invite_pid_params : ""); } else { - tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", - use_name, use_number, rpid_domain); + tech_pvt->asserted_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\" ", + use_name, use_number, rpid_domain, + invite_pid_params ? ";" : "", + invite_pid_params ? invite_pid_params : ""); } } else { 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); + tech_pvt->preferred_id = switch_core_session_sprintf(tech_pvt->session, "", + tech_pvt->caller_profile->caller_id_number, rpid_domain, + invite_pid_params ? ";" : "", + invite_pid_params ? invite_pid_params : ""); } else { - tech_pvt->preferred_id = switch_core_session_sprintf(tech_pvt->session, "\"%s\"", + 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); + tech_pvt->caller_profile->caller_id_number, rpid_domain, + invite_pid_params ? ";" : "", + invite_pid_params ? invite_pid_params : ""); } }