Update status_registrations.php

Add moteus fix to display lan ip for grandstream.
This commit is contained in:
FusionPBX 2017-01-20 03:42:20 -07:00 committed by GitHub
parent 283253ac17
commit f16b7851d6
1 changed files with 14 additions and 5 deletions

View File

@ -47,7 +47,16 @@ function get_registrations($sip_profile_name) {
//get the LAN IP address if it exists replace the external ip //get the LAN IP address if it exists replace the external ip
$call_id_array = explode('@', $row->{'call-id'}); $call_id_array = explode('@', $row->{'call-id'});
if (isset($call_id_array[1])) { if (isset($call_id_array[1])) {
$registrations[$x]['lan-ip'] = "<a href='http://".$call_id_array[1]."' target='_blank'>".$call_id_array[1]."</a>"; $agent = $row->{'agent'};
$lan_ip = $call_id_array[1];
if (false !== stripos($agent, 'grandstream')) {
$lan_ip = str_ireplace(
array('A','B','C','D','E','F','G','H','I','J'),
array('0','1','2','3','4','5','6','7','8','9'),
$lan_ip
);
}
$registrations[$x]['lan-ip'] = "<a href='http://".$lan_ip."' target='_blank'>".$lan_ip."</a>";
}else{ }else{
$registrations[$x]['lan-ip'] = "&nbsp;"; $registrations[$x]['lan-ip'] = "&nbsp;";
} }