diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index f2e95b86d1..c2b0f0d09d 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -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, '', ''), 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, '', ''), 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, '', ''), 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, '', ''), 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); } diff --git a/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml b/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml index 34dcd96d94..24c1cb27fe 100644 --- a/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml +++ b/app/dialplans/resources/switch/conf/dialplan/020_domain-variables.xml @@ -1,5 +1,6 @@ +