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
This commit is contained in:
Brian West 2009-06-01 13:55:17 +00:00
parent dd1e4b2d23
commit c22d626c79
1 changed files with 4 additions and 10 deletions

View 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 */