Update registrations.php

This commit is contained in:
FusionPBX 2020-04-08 13:32:49 -06:00 committed by GitHub
parent 66504dbb54
commit 71b9d3eaae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2019
Portions created by the Initial Developer are Copyright (C) 2008-2020
the Initial Developer. All Rights Reserved.
Contributor(s):
@ -79,6 +79,7 @@ if (!class_exists('registrations')) {
$sql .= "and sip_profile_name = :sip_profile_name ";
$parameters['sip_profile_name'] = $profile;
}
$sql .= "and sip_profile_enabled = 'true' ";
$database = new database;
$sip_profiles = $database->select($sql, $parameters, 'all');
if (is_array($sip_profiles) && @sizeof($sip_profiles) != 0) {
@ -87,6 +88,7 @@ if (!class_exists('registrations')) {
//get sofia status profile information including registrations
$cmd = "api sofia xmlstatus profile ".$field['sip_profile_name']." reg";
$xml_response = trim(event_socket_request($fp, $cmd));
$xml_response = iconv("utf-8", "utf-8//ignore", $xml_response);
if ($xml_response == "Invalid Profile!") { $xml_response = "<error_msg>".$text['label-message']."</error_msg>"; }
$xml_response = str_replace("<profile-info>", "<profile_info>", $xml_response);
$xml_response = str_replace("</profile-info>", "</profile_info>", $xml_response);
@ -97,7 +99,9 @@ if (!class_exists('registrations')) {
$xml = new SimpleXMLElement($xml_response);
}
catch(Exception $e) {
echo $e->getMessage();
echo basename(__FILE__).'<br />';
echo 'line: '.__line__.'<br />';
echo 'error: '.$e->getMessage();
exit;
}
$array = json_decode(json_encode($xml), true);
@ -179,6 +183,7 @@ if (!class_exists('registrations')) {
}
unset($array);
}
}
}