]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ok only do this is callee_id_name is set
authorBrian West <brian@freeswitch.org>
Mon, 1 Jun 2009 13:55:17 +0000 (13:55 +0000)
committerBrian West <brian@freeswitch.org>
Mon, 1 Jun 2009 13:55:17 +0000 (13:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13528 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 2d1bf3b30a3c77d30a286f38d30496a5262e4819..605a0d7c12640a84dcf6d166e447332ab181293d 100644 (file)
@@ -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 */