mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Registrations page: Parse for LAN IP in "Contact" field (#4617)
* Registrations XML from Freeswitch contains invalid characters '>' and '<' in the contact field; stripped. Registrations does not parse the Freeswitch 'Contact' field for a Yealink LAN IP address; added condition. * Fix the indentation.
This commit is contained in:
@@ -54,6 +54,8 @@ if (!class_exists('registrations')) {
|
||||
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);
|
||||
$xml_response = str_replace("<", "", $xml_response);
|
||||
$xml_response = str_replace(">", "", $xml_response);
|
||||
if (strlen($xml_response) > 101) {
|
||||
try {
|
||||
$xml = new SimpleXMLElement($xml_response);
|
||||
@@ -117,6 +119,10 @@ if (!class_exists('registrations')) {
|
||||
}
|
||||
$registrations[$id]['lan-ip'] = $lan_ip;
|
||||
}
|
||||
else if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $row['contact'], $ip_match)) {
|
||||
$lan_ip = preg_replace('/_/', '.', $ip_match[0]);
|
||||
$registrations[$id]['lan-ip'] = "$lan_ip";
|
||||
}
|
||||
else {
|
||||
$registrations[$id]['lan-ip'] = '';
|
||||
}
|
||||
@@ -207,4 +213,4 @@ $registrations = $obj->get('all');
|
||||
print($registrations);
|
||||
*/
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user