Fix the CID (#2588)

* Fixes CID

Although you already had somehow fixed the caller id here. you need to put origination and effective. For some reason, not all carriers get the CID from the same field in the SIP payload. origination_* and effective_* affects different parts of the SIP invite.

* Fix the CID


Although you already had somehow fixed the caller id here. you need to put origination and effective. For some reason, not all carriers get the CID from the same field in the SIP payload. origination_* and effective_* affects different parts of the SIP invite.

* Update follow_me.php

* Update call_forward.php
This commit is contained in:
Luis Daniel Lucio Quiroz
2017-05-26 17:41:50 -04:00
committed by FusionPBX
parent e51a7bf3e3
commit 2b5926ffd7
2 changed files with 30 additions and 12 deletions

View File

@@ -126,16 +126,25 @@ include "root.php";
else {
// setting here presence_id equal extension not dialed number allows work BLF and intercept.
$presence_id = extension_presence_id($this->extension, $this->number_alias);
if (strlen($caller_id_number) > 0) {
- //set the caller id if it is set
- if (strlen($caller_id_name) > 0) {
$dial_string .= ",origination_caller_id_name=".$caller_id_name;
$dial_string .= ",effective_caller_id_name=".$caller_id_name;
}
- $dial_string .= ",origination_caller_id_number=".$caller_id_number;
$dial_string .= ",effective_caller_id_number=".$caller_id_number;
- }
- else {
- //set the outbound caller id number if the caller id number is a user
$dial_string .='{origination_caller_id_number=${cond(${from_user_exists} == true ? ${outbound_caller_id_number} : ${origination_caller_id_number})}}';
$dial_string .='{effective_caller_id_number=${cond(${from_user_exists} == true ? ${outbound_caller_id_number} : ${effective_caller_id_number})}}';
$dial_string .='{origination_caller_id_name=${cond(${from_user_exists} == true ? ${outbound_caller_id_name} : ${origination_caller_id_name})}}';
$dial_string .='{effective_caller_id_name=${cond(${from_user_exists} == true ? ${outbound_caller_id_name} : ${effective_caller_id_name})}}';
- }
if (strlen($caller_id_number) > 0) {
//set the caller id if it is set
if (strlen($caller_id_name) > 0) { $dial_string .= ",origination_caller_id_name=".$caller_id_name; }
$dial_string .= ",origination_caller_id_number=".$caller_id_number;
}
else {
//set the outbound caller id number if the caller id number is a user
$dial_string .= ",\${cond(\${user_exists id \${caller_id_number} \${domain_name}} == true ? origination_caller_id_name=\${outbound_caller_id_name},origination_caller_id_number=\${outbound_caller_id_number} : )}";
}
// $presence_id = $this->forward_all_destination;
$dial_string .= ",presence_id=".$presence_id."@".$_SESSION['domain_name'];
$dial_string .= "}";

View File

@@ -378,26 +378,35 @@ include "root.php";
}
else {
$presence_id = extension_presence_id($this->extension, $this->number_alias);
$dial_string .= "[";
$dial_string .= "[anyvar=";
//set the caller id
if ($_SESSION['cdr']['follow_me_fix']['boolean'] == "true") {
if (strlen($this->outbound_caller_id_name) > 0) {
$dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix.$this->outbound_caller_id_name;
$dial_string .= ",effective_caller_id_name=".$this->cid_name_prefix.$this->outbound_caller_id_name;
}
if (strlen($this->outbound_caller_id_number) > 0) {
$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix.$this->outbound_caller_id_number;
$dial_string .= ",effective_caller_id_number=".$this->cid_number_prefix.$this->outbound_caller_id_number;
}
}
else {
if (strlen($caller_id_number) > 0) {
//set the caller id if it is set
if (strlen($caller_id_name) > 0) { $dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix.$caller_id_name; }
if (strlen($caller_id_name) > 0) {
$dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix.$caller_id_name;
$dial_string .= ",effective_caller_id_name=".$this->cid_name_prefix.$caller_id_name;
}
$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix.$caller_id_number;
$dial_string .= ",effective_caller_id_number=".$this->cid_number_prefix.$caller_id_number;
}
else {
//set the outbound caller id number if the caller id number is a user
$dial_string .= ",\${cond(\${user_exists id \${caller_id_number} \${domain_name}} == true ? origination_caller_id_name=".$this->cid_name_prefix."\${outbound_caller_id_name},origination_caller_id_number=".$this->cid_number_prefix."\${outbound_caller_id_number} : )}";
$dial_string .=',origination_caller_id_number=${cond(${from_user_exists} == true ? ${outbound_caller_id_number} : ${origination_caller_id_number})}';
$dial_string .=',effective_caller_id_number=${cond(${from_user_exists} == true ? ${outbound_caller_id_number} : ${effective_caller_id_number})}';
$dial_string .=',origination_caller_id_name=${cond(${from_user_exists} == true ? ${outbound_caller_id_name} : ${origination_caller_id_name})}';
$dial_string .=',effective_caller_id_name=${cond(${from_user_exists} == true ? ${outbound_caller_id_name} : ${effective_caller_id_name})}';
}
}