Finalize changing origination_callee_id_name from destination_number to caller_destination in domain_variables and variables dialplan. (#6782)

* Add the / character to the ALLOWED_CHARS variable to fix bug with front slashes being stripped. Previously was turning /var/lib/freeswitch into varlibfreeswitch

* Update app_defaults.php

Updating app defaults for Dialplan -> Domain Variables to set origination_callee_id_name to match the caller_destination instead of the destination number so that if you call another tenant in the same Fusion instance without is_local enabled the caller_destination shows instead of the tenant's called extension.

* Update app_defaults.php

Instead of removing the export all together we need to update it from destination_number to caller_destination.

* Update 020_domain-variables.xml

Set origination callee ID to caller_destination so internal calls don't show "Outbound Call"

---------

Authored-by: Jacob Buscher <jacob@bfitec.com>
This commit is contained in:
jacobbuscher-bt
2023-08-02 12:25:45 -06:00
committed by GitHub
parent 80580bb931
commit 2d872a3566
2 changed files with 11 additions and 10 deletions

View File

@@ -132,18 +132,18 @@
$database = new database;
$num_rows = $database->select($sql, null, 'column');
if ($num_rows > 0) {
$sql = "delete from v_dialplan_details \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables') \n";
$sql .= "and dialplan_detail_data like 'origination_callee_id_name%'; \n";
$database->execute($sql);
$sql = "update v_dialplan_details set dialplan_detail_data = 'origination_callee_id_name=\${caller_destination}', update_date = now() \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables') \n";
$sql .= "and dialplan_detail_data = 'origination_callee_id_name=\${destination_number}'; \n";
$database->execute($sql);
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\"/>', ''), update_date = now() \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
$database->execute($sql);
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${destination_number}\"/>', '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\"/>'), update_date = now() \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
$database->execute($sql);
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\" inline=\"true\"/>', ''), update_date = now() \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
$database->execute($sql);
$sql = "update v_dialplans set dialplan_xml = REPLACE(dialplan_xml, '<action application=\"export\" data=\"origination_callee_id_name=\${destination_number}\" inline=\"true\"/>', '<action application=\"export\" data=\"origination_callee_id_name=\${caller_destination}\" inline=\"true\"/>'), update_date = now() \n";
$sql .= "where dialplan_uuid in (select dialplan_uuid from v_dialplans where dialplan_name = 'domain-variables' or dialplan_name = 'variables'); \n";
$database->execute($sql);
}
unset($sql, $num_rows);
}

View File

@@ -1,5 +1,6 @@
<extension name="domain-variables" number="" context="${domain_name}" continue="true" app_uuid="9f356fe7-8cf8-4c14-8fe2-6daf89304458" order="20">
<condition>
<action application="export" data="origination_callee_id_name=${caller_destination}" enabled="true"/>
<action application="set" data="operator=1000" inline="true" enabled="true"/>
</condition>
</extension>