diff --git a/app/providers/resources/classes/providers.php b/app/providers/resources/classes/providers.php index 9ff21f6c6b..59ac8dc6d0 100644 --- a/app/providers/resources/classes/providers.php +++ b/app/providers/resources/classes/providers.php @@ -1,4 +1,4 @@ -2uuid = $dialplan_uuid; $dialplans->xml(); - //clear the cache - $cache = new cache; - $cache->delete("configuration:acl.conf"); - $cache->delete("configuration:sofia.conf:".$sip_profile_hostname); - //create the event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); //get the hostname if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); } + //clear the cache + $cache = new cache; + $cache->delete("configuration:acl.conf"); + $cache->delete("configuration:sofia.conf:".$sip_profile_hostname); + //reload acl and rescan the sip profile if ($fp) { event_socket_request($fp, "api reloadacl"); } if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." rescan"); } @@ -527,11 +527,15 @@ if (!class_exists('providers')) { //create the event socket connection $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + //get the hostname + if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); } + //delete each gateway foreach ($gateways as $row) { //stop the gateway - if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." killgw ".$row['uuid']); } - + $cmd = "sofia profile ".$sip_profile_name." killgw ".$row['uuid']; + if ($fp) { event_socket_request($fp, "api ".$cmd); } + //delete the gateway $sql = "delete from v_gateways "; $sql .= "where gateway_uuid = '".$row['uuid']."'; "; @@ -544,9 +548,6 @@ if (!class_exists('providers')) { $cache->delete("configuration:acl.conf"); $cache->delete("configuration:sofia.conf:".$sip_profile_hostname); - //get the hostname - if ($fp) { $sip_profile_hostname = event_socket_request($fp, 'api switchname'); } - //reload acl and rescan the sip profile if ($fp) { event_socket_request($fp, "api reloadacl"); } if ($fp) { event_socket_request($fp, "api sofia profile ".$sip_profile_name." rescan"); } @@ -562,4 +563,4 @@ if (!class_exists('providers')) { $provider->setup(); */ -?> \ No newline at end of file +?>