Update providers.php

This commit is contained in:
FusionPBX 2019-02-23 16:18:35 -07:00 committed by GitHub
parent 9f6a119239
commit 25f29bc0d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -640,9 +640,10 @@ if (!class_exists('providers')) {
//get the hostname
if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); }
//delete each gateway
$gateways = $this->gateways($provider);
foreach ($gateways as $row) {
//delete outbound routes
$outbound_routes = $this->outbound_routes($provider);
foreach ($outbound_routes as $row) {
//delete child data
$sql = "delete from v_dialplan_details ";
$sql .= "where dialplan_uuid = '".$row['dialplan_uuid']."'; ";
@ -654,7 +655,11 @@ if (!class_exists('providers')) {
$sql .= "where dialplan_uuid = '".$row['dialplan_uuid']."'; ";
$this->db->query($sql);
unset($sql);
}
//delete each gateway
$gateways = $this->gateways($provider);
foreach ($gateways as $row) {
//stop the gateway
$cmd = "sofia profile ".$sip_profile_name." killgw ".$row['uuid'];
if ($fp) { event_socket_request($fp, "api ".$cmd); }