diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index 194b8723a3..aad525283b 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -124,6 +124,30 @@ } +//remove origination_callee_id_name from domain-variables dialplan + if ($domains_processed == 1) { + $sql = "select count(*) from v_dialplans "; + $sql .= "where dialplan_name = 'domain-variables' "; + $sql .= "and dialplan_xml like '%origination_callee_id_name%' "; + $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_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); + } + //add not found dialplan to inbound routes /* if ($domains_processed == 1) {