[Freeswitch-svn] [commit] r8825 - in freeswitch/trunk/src: . mod/applications/mod_dptools
Freeswitch SVN
anthm at freeswitch.org
Mon Jun 23 15:04:18 EDT 2008
Author: anthm
Date: Mon Jun 23 15:04:17 2008
New Revision: 8825
Modified:
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/switch_ivr_originate.c
Log:
fix issue with user channel and cid
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Mon Jun 23 15:04:17 2008
@@ -1961,6 +1961,13 @@
char *d_dest = NULL;
switch_channel_t *channel;
switch_originate_flag_t myflags = SOF_NONE;
+ char *cid_name_override = NULL;
+ char *cid_num_override = NULL;
+
+ if (var_event) {
+ cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name");
+ cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
+ }
if (session) {
channel = switch_core_session_get_channel(session);
@@ -1992,7 +1999,8 @@
myflags |= SOF_NOBLOCK;
}
- if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL, NULL, NULL, NULL, myflags) == SWITCH_STATUS_SUCCESS) {
+ if (switch_ivr_originate(session, new_session, &cause, d_dest, timelimit, NULL,
+ cid_name_override, cid_num_override, NULL, myflags) == SWITCH_STATUS_SUCCESS) {
const char *context;
switch_caller_profile_t *cp;
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Mon Jun 23 15:04:17 2008
@@ -708,11 +708,15 @@
}
}
- if (!cid_name_override) {
+ if (cid_name_override) {
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_caller_id_name", cid_name_override);
+ } else {
cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name");
}
- if (!cid_num_override) {
+ if (cid_num_override) {
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_caller_id_number", cid_num_override);
+ } else {
cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
}
@@ -861,9 +865,9 @@
}
}
- if (vdata && (var_begin = switch_stristr("effective_caller_id_number=", vdata))) {
+ if (vdata && (var_begin = switch_stristr("origination_caller_id_number=", vdata))) {
char tmp[512] = "";
- var_begin += strlen("effective_caller_id_number=");
+ var_begin += strlen("origination_caller_id_number=");
var_end = strchr(var_begin, '|');
if (var_end) {
strncpy(tmp, var_begin, var_end-var_begin);
@@ -873,9 +877,9 @@
new_profile->caller_id_number = switch_core_strdup(new_profile->pool, tmp);
}
- if (vdata && (var_begin = switch_stristr("effective_caller_id_name=", vdata))) {
+ if (vdata && (var_begin = switch_stristr("origination_caller_id_name=", vdata))) {
char tmp[512] = "";
- var_begin += strlen("effective_caller_id_name=");
+ var_begin += strlen("origination_caller_id_name=");
var_end = strchr(var_begin, '|');
if (var_end) {
strncpy(tmp, var_begin, var_end-var_begin);
More information about the Freeswitch-svn
mailing list