From c22d626c79c983b6020cb920efce0d734f6e9b3f Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 1 Jun 2009 13:55:17 +0000 Subject: [PATCH] ok only do this is callee_id_name is set git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13528 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/mod_sofia.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 2d1bf3b30a..605a0d7c12 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -179,21 +179,15 @@ char * generate_pai_str(switch_core_session_t *session) { private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session); const char *callee_name = NULL, *callee_number = NULL; - const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent"); - - if (ua && switch_stristr("polycom", ua)) { - if (!(callee_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name"))) { - callee_name = ""; - } + char *pai = NULL; + if ((callee_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name"))) { if (!(callee_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number"))) { callee_number = tech_pvt->caller_profile->destination_number; } - - return switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>", callee_name, callee_number); + pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>", callee_name, callee_number); } - - return NULL; + return pai; } /* map QSIG cause codes to SIP from RFC4497 section 8.4.1 */