[Freeswitch-svn] [commit] r12546 - in freeswitch/trunk/src: . include
FreeSWITCH SVN
anthm at freeswitch.org
Tue Mar 10 06:16:14 PDT 2009
Author: anthm
Date: Tue Mar 10 08:16:14 2009
New Revision: 12546
Log:
add origination_pricacy var to originate api
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/switch_ivr_originate.c
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Tue Mar 10 08:16:14 2009
@@ -381,6 +381,7 @@
#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)
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Tue Mar 10 08:16:14 2009
@@ -916,7 +916,6 @@
const char *cid_tmp;
originate_global_t oglobals = { 0 };
-
oglobals.idx = IDX_NADA;
oglobals.early_ok = 1;
oglobals.session = session;
@@ -1422,6 +1421,35 @@
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");
More information about the Freeswitch-svn
mailing list