add origination_pricacy var to originate api

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12546 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-03-10 13:16:14 +00:00
parent 2c364e6cba
commit 674a18f930
2 changed files with 30 additions and 1 deletions

View File

@ -381,6 +381,7 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
#define SWITCH_ACCEPTABLE_INTERVAL(_i) (_i && _i <= SWITCH_MAX_INTERVAL && (_i % 10) == 0)
typedef enum {
SWITCH_CPF_NONE = 0,
SWITCH_CPF_SCREEN = (1 << 0),
SWITCH_CPF_HIDE_NAME = (1 << 1),
SWITCH_CPF_HIDE_NUMBER = (1 << 2)

View File

@ -916,7 +916,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
const char *cid_tmp;
originate_global_t oglobals = { 0 };
oglobals.idx = IDX_NADA;
oglobals.early_ok = 1;
oglobals.session = session;
@ -1422,6 +1421,35 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
new_profile->caller_id_name = switch_core_strdup(new_profile->pool, tmp);
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_uuid", tmp);
}
if (vdata && (var_begin = switch_stristr("origination_privacy=", vdata))) {
char tmp[512] = "";
var_begin += strlen("origination_privacy=");
var_end = strchr(var_begin, '|');
if (var_end) {
strncpy(tmp, var_begin, var_end-var_begin);
} else {
strncpy(tmp, var_begin, strlen(var_begin));
}
new_profile->flags = SWITCH_CPF_NONE;
if (switch_stristr(tmp, "screen")) {
switch_set_flag(new_profile, SWITCH_CPF_SCREEN);
}
if (switch_stristr(tmp, "hide_name")) {
switch_set_flag(new_profile, SWITCH_CPF_HIDE_NAME);
}
if (switch_stristr(tmp, "hide_number")) {
switch_set_flag(new_profile, SWITCH_CPF_HIDE_NUMBER);
}
new_profile->caller_id_name = switch_core_strdup(new_profile->pool, tmp);
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_privacy", tmp);
}
switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "originate_early_media", oglobals.early_ok ? "true" : "false");