Update the caller ID when using intercept
When intercept is used then use the last_sent_callee_id_name and last_sent_callee_id_number for the caller ID information.
This commit is contained in:
parent
17bc6ca382
commit
a16ec80ce4
|
|
@ -418,22 +418,21 @@ if (!class_exists('xml_cdr')) {
|
|||
}
|
||||
|
||||
//if the call is outbound use the external caller ID
|
||||
if (isset($xml->variables->effective_caller_id_name)) {
|
||||
if (urldecode($call_direction) == 'outbound' && isset($xml->variables->effective_caller_id_name)) {
|
||||
$caller_id_name = urldecode($xml->variables->effective_caller_id_name);
|
||||
}
|
||||
|
||||
if (isset($xml->variables->origination_caller_id_name)) {
|
||||
$caller_id_name = urldecode($xml->variables->origination_caller_id_name);
|
||||
}
|
||||
|
||||
if (isset($xml->variables->origination_caller_id_number)) {
|
||||
$caller_id_number = urldecode($xml->variables->origination_caller_id_number);
|
||||
}
|
||||
|
||||
if (urldecode($call_direction) == 'outbound' && isset($xml->variables->effective_caller_id_number)) {
|
||||
$caller_id_number = urldecode($xml->variables->effective_caller_id_number);
|
||||
}
|
||||
|
||||
//if intercept is used then update use the last sent callee id name and number
|
||||
if ($xml->variables->last_app == 'intercept' && !empty($xml->variables->last_sent_callee_id_name)) {
|
||||
$caller_id_name = urldecode($xml->variables->last_sent_callee_id_name);
|
||||
}
|
||||
if ($xml->variables->last_app == 'intercept' && !empty($xml->variables->last_sent_callee_id_number)) {
|
||||
$caller_id_number = urldecode($xml->variables->last_sent_callee_id_number);
|
||||
}
|
||||
|
||||
//if the sip_from_domain and domain_name are not the same then original call direction was inbound
|
||||
//when an inbound call is forward the call_direction is set to inbound and then updated to outbound
|
||||
//use sip_from_display and sip_from_user to get the original caller ID instead of the updated caller ID info from the forward
|
||||
|
|
@ -458,11 +457,6 @@ if (!class_exists('xml_cdr')) {
|
|||
}
|
||||
unset($i);
|
||||
|
||||
//if last_sent_callee_id_number is set use it for the destination_number
|
||||
if (!empty($xml->variables->last_sent_callee_id_number)) {
|
||||
$destination_number = urldecode($xml->variables->last_sent_callee_id_number);
|
||||
}
|
||||
|
||||
//remove the provider prefix
|
||||
if (isset($xml->variables->provider_prefix) && isset($destination_number)) {
|
||||
$provider_prefix = $xml->variables->provider_prefix;
|
||||
|
|
@ -2072,4 +2066,4 @@ if (!class_exists('xml_cdr')) {
|
|||
} //class
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue