fixed sending exten num to outbound calleees. Fixed presence bug (set presence for non-extension). Correct caller id num will show for internally generated calls and externally generated calls (inbound). Can also view presence ringing for devices set to follow to only an external (mobile) number.

This commit is contained in:
James Rose 2013-11-08 21:04:28 +00:00
parent 9f4365ccfb
commit 5833d83ae7
1 changed files with 379 additions and 359 deletions

View File

@ -305,28 +305,48 @@ include "root.php";
if (strlen($this->cid_name_prefix) > 0) {
$dial_string .= ",origination_caller_id_name=".$this->cid_name_prefix."#\${caller_id_name}";
}
else
$dial_string .= ",origination_caller_id_name=\${caller_id_name}";
if (strlen($this->cid_number_prefix) > 0) {
//$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."";
$dial_string .= ",origination_caller_id_number=".$this->cid_number_prefix."#\${caller_id_number}";
}
else
$dial_string .= ",origination_caller_id_number=\${caller_id_number}";
if (strlen($this->accountcode) > 0) {
$dial_string .= ",accountcode=".$this->accountcode;
}
//if ($this->call_prompt == "true") {
//$dial_string .= ",group_confirm_key=exec,group_confirm_file=lua confirm.lua";
//}
$dial_string .= "}";
foreach ($result as &$row) {
$dial_string .= "[presence_id=".$row["follow_me_destination"]."@".$_SESSION['domain_name'].",";
$dial_string .= "[";
if (extension_exists($row["follow_me_destination"])) {
$dial_string .= "outbound_caller_id_number=\${caller_id_number},";
$dial_string .= "presence_id=".$row["follow_me_destination"]."@".$_SESSION['domain_name'].",";
if ($this->call_prompt == "true") {
$dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,";
}
$dial_string .= "leg_delay_start=".$row["follow_me_delay"].",";
$dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]";
if (extension_exists($row["follow_me_destination"])) {
$dial_string .= "\${sofia_contact(".$row["follow_me_destination"]."@".$_SESSION['domain_name'].")},";
}
else {
$dial_string .= "outbound_caller_id_number=\${outbound_caller_id_number},";
$dial_string .= "presence_id=".$this->extension."@".$_SESSION['domain_name'].",";
if ($this->call_prompt == "true") {
$dial_string .= "group_confirm_key=exec,group_confirm_file=lua confirm.lua,";
}
$dial_string .= "leg_delay_start=".$row["follow_me_delay"].",";
$dial_string .= "leg_timeout=".$row["follow_me_timeout"]."]";
$bridge = outbound_route_to_bridge ($_SESSION['domain_uuid'], $row["follow_me_destination"]);
//if (strlen($bridge[0]) > 0) {
// $dial_string .= "".$bridge[0].",";