git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4123 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-02-05 17:56:09 +00:00
parent 021de27399
commit 96e32a8d4c
2 changed files with 27 additions and 5 deletions

View File

@ -1567,8 +1567,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_outgoing_channel(switch_core
ecaller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name");
ecaller_id_number = switch_channel_get_variable(channel, "effective_caller_id_number");
if (ecaller_id_name || ecaller_id_number) {
if (!ecaller_id_name) {
ecaller_id_name = caller_profile->caller_id_name;
}
if (!ecaller_id_number) {
ecaller_id_number = caller_profile->caller_id_number;
}
outgoing_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
caller_profile->username,
caller_profile->dialplan,

View File

@ -2555,6 +2555,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
early_ok = 0;
}
if (!cid_name_override) {
cid_name_override = switch_event_get_header(var_event, "origination_caller_id_name");
}
if (!cid_num_override) {
cid_num_override = switch_event_get_header(var_event, "origination_caller_id_number");
}
or_argc = switch_separate_string(data, '|', pipe_names, (sizeof(pipe_names) / sizeof(pipe_names[0])));
if (caller_channel && or_argc > 1 && !ringback_data) {
@ -2603,7 +2612,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
}
caller_caller_profile = caller_profile_override ? caller_profile_override : switch_channel_get_caller_profile(caller_channel);
if (!cid_name_override) {
cid_name_override = caller_caller_profile->caller_id_name;
}
@ -2616,9 +2625,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
caller_caller_profile->dialplan,
cid_name_override,
cid_num_override,
caller_caller_profile->network_addr,
caller_caller_profile->network_addr,
NULL,
NULL,
NULL,
caller_caller_profile->rdnis,
caller_caller_profile->source,
caller_caller_profile->context,
@ -2983,15 +2992,22 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
*cause = SWITCH_CAUSE_UNALLOCATED;
if (var_event) {
if (!caller_channel) { /* install the vars from the {} params */
switch_event_header_t *header;
for (header = var_event->headers; header; header = header->next) {
switch_channel_set_variable(peer_channel, header->name, header->value);
}
}
switch_event_destroy(&var_event);
}
if (status == SWITCH_STATUS_SUCCESS) {
if (caller_channel) {
switch_channel_set_variable(caller_channel, "originate_disposition", "call accepted");
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n", switch_channel_get_name(peer_channel));
*cause = SWITCH_CAUSE_SUCCESS;
} else {
if (peer_channel) {
*cause = switch_channel_get_cause(peer_channel);