From 360afc83b9240395258569ad662b6d35a5bd7c01 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 11 Mar 2009 15:14:24 +0000 Subject: [PATCH] add sip_from_display var and fix backwards switch_strisr calls git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12566 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_glue.c | 6 ++++-- src/switch_ivr_originate.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index eb10805379..101a0dd481 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1176,6 +1176,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) 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 *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"); if (switch_strlen_zero(tech_pvt->dest)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "URL Error!\n"); @@ -1277,10 +1278,11 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session) or did he just suggest it to make our lives miserable? */ use_from_str = from_str; - if (!strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { + if (!from_display && !strcasecmp(tech_pvt->caller_profile->caller_id_name, "_undef_")) { from_str = switch_core_session_sprintf(session, "<%s>", use_from_str); } else { - from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str); + from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", from_display ? from_display : + tech_pvt->caller_profile->caller_id_name, use_from_str); } if (!(call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id"))) { diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index dfe608d2c7..7f3b8346dc 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1435,15 +1435,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess new_profile->flags = SWITCH_CPF_NONE; - if (switch_stristr(tmp, "screen")) { + if (switch_stristr("screen", tmp)) { switch_set_flag(new_profile, SWITCH_CPF_SCREEN); } - if (switch_stristr(tmp, "hide_name")) { + if (switch_stristr("hide_name", tmp)) { switch_set_flag(new_profile, SWITCH_CPF_HIDE_NAME); } - if (switch_stristr(tmp, "hide_number")) { + if (switch_stristr("hide_number", tmp)) { switch_set_flag(new_profile, SWITCH_CPF_HIDE_NUMBER); }