diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php
index 5943185b64..5b2972dba1 100644
--- a/app/sip_status/sip_status.php
+++ b/app/sip_status/sip_status.php
@@ -101,6 +101,14 @@ if ($_GET['a'] == "download") {
$gateways = $prep_statement->fetchAll(PDO::FETCH_NAMED);
unset ($prep_statement, $sql);
+//get the sip profiles
+ $sql = "select sip_profile_name from v_sip_profiles ";
+ $sql .= "order by sip_profile_name asc ";
+ $prep_statement = $db->prepare(check_sql($sql));
+ $prep_statement->execute();
+ $sip_profiles = $prep_statement->fetchAll();
+ unset ($prep_statement, $sql);
+
//sofia status
if ($fp && permission_exists('system_status_sofia_status')) {
$cmd = "api sofia xmlstatus";
@@ -177,90 +185,89 @@ if ($_GET['a'] == "download") {
//sofia status profile
if (permission_exists('system_status_sofia_status_profile')) {
- foreach (ListFiles($_SESSION['switch']['conf']['dir'].'/sip_profiles') as $key=>$sip_profile_file){
- if (substr($sip_profile_file, -4) == ".xml") {
- $sip_profile_name = str_replace(".xml", "", $sip_profile_file);
- if ($fp) {
- $cmd = "api sofia xmlstatus profile ".$sip_profile_name."";
- $xml_response = trim(event_socket_request($fp, $cmd));
- if ($xml_response == "Invalid Profile!") { $xml_response = "Invalid Profile!"; }
- $xml_response = str_replace("", "", $xml_response);
- $xml_response = str_replace("", "", $xml_response);
- try {
- $xml = new SimpleXMLElement($xml_response);
- }
- catch(Exception $e) {
- echo $e->getMessage();
- exit;
- }
- echo "
\n";
+ foreach ($sip_profiles as $row) {
+ $sip_profile_name = $row["sip_profile_name"];
- echo "";
- echo "
\n";
- echo "\n";
- echo "| | \n";
- echo " | \n";
- echo "
\n";
-
- foreach ($xml->profile_info as $row) {
- echo " | name | ".$row->name." |
\n";
- echo " | domain-name | ".$row->{'domain-name'}." |
\n";
- echo " | auto-nat | ".$row->{'auto-nat'}." |
\n";
- echo " | db-name | ".$row->{'db-name'}." |
\n";
- echo " | pres-hosts | ".$row->{'pres-hosts'}." |
\n";
- echo " | dialplan | ".$row->dialplan." |
\n";
- echo " | context | ".$row->context." |
\n";
- echo " | challenge-realm | ".$row->{'challenge-realm'}." |
\n";
- echo " | rtp-ip | ".$row->{'rtp-ip'}." |
\n";
- echo " | ext-rtp-ip | ".$row->{'ext-rtp-ip'}." |
\n";
- echo " | sip-ip | ".$row->{'sip-ip'}." |
\n";
- echo " | ext-sip-ip | ".$row->{'ext-sip-ip'}." |
\n";
- echo " | url | ".$row->url." |
\n";
- echo " | bind-url | ".$row->{'bind-url'}." |
\n";
- echo " | tls-url | ".$row->{'tls-url'}." |
\n";
- echo " | tls-bind-url | ".$row->{'tls-bind-url'}." |
\n";
- echo " | hold-music | ".$row->{'hold-music'}." |
\n";
- echo " | outbound-proxy | ".$row->{'outbound-proxy'}." |
\n";
- echo " | inbound-codecs | ".$row->{'inbound-codecs'}." |
\n";
- echo " | outbound-codecs | ".$row->{'outbound-codecs'}." |
\n";
- echo " | tel-event | ".$row->{'tel-event'}." |
\n";
- echo " | dtmf-mode | ".$row->{'dtmf-mode'}." |
\n";
- echo " | cng | ".$row->cng." |
\n";
- echo " | session-to | ".$row->{'session-to'}." |
\n";
- echo " | max-dialog | ".$row->{'max-dialog'}." |
\n";
- echo " | nomedia | ".$row->nomedia." |
\n";
- echo " | late-neg | ".$row->{'late-neg'}." |
\n";
- echo " | proxy-media | ".$row->{'proxy-media'}." |
\n";
- echo " | aggressive-nat | ".$row->{'aggressive-nat'}." |
\n";
- echo " | stun-enabled | ".$row->{'stun-enabled'}." |
\n";
- echo " | stun-auto-disable | ".$row->{'stun-auto-disable'}." |
\n";
- echo " | user-agent-filter | ".$row->{'user-agent-filter'}." |
\n";
- echo " | max-registrations-per-extension | ".$row->{'max-registrations-per-extension'}." |
\n";
- echo " | calls-in | ".$row->{'calls-in'}." |
\n";
- echo " | calls-out | ".$row->{'calls-out'}." |
\n";
- echo " | failed-calls-in | ".$row->{'failed-calls-in'}." |
\n";
- echo " | failed-calls-out | ".$row->{'failed-calls-out'}." |
\n";
- }
- echo "
\n";
- echo "
";
- unset($xml);
+ if ($fp) {
+ $cmd = "api sofia xmlstatus profile ".$sip_profile_name."";
+ $xml_response = trim(event_socket_request($fp, $cmd));
+ if ($xml_response == "Invalid Profile!") { $xml_response = "Invalid Profile!"; }
+ $xml_response = str_replace("", "", $xml_response);
+ $xml_response = str_replace("", "", $xml_response);
+ try {
+ $xml = new SimpleXMLElement($xml_response);
}
+ catch(Exception $e) {
+ echo $e->getMessage();
+ exit;
+ }
+ echo "\n";
+
+ echo "";
+ echo "
\n";
+ echo "\n";
+ echo "| | \n";
+ echo " | \n";
+ echo "
\n";
+
+ foreach ($xml->profile_info as $row) {
+ echo " | name | ".$row->name." |
\n";
+ echo " | domain-name | ".$row->{'domain-name'}." |
\n";
+ echo " | auto-nat | ".$row->{'auto-nat'}." |
\n";
+ echo " | db-name | ".$row->{'db-name'}." |
\n";
+ echo " | pres-hosts | ".$row->{'pres-hosts'}." |
\n";
+ echo " | dialplan | ".$row->dialplan." |
\n";
+ echo " | context | ".$row->context." |
\n";
+ echo " | challenge-realm | ".$row->{'challenge-realm'}." |
\n";
+ echo " | rtp-ip | ".$row->{'rtp-ip'}." |
\n";
+ echo " | ext-rtp-ip | ".$row->{'ext-rtp-ip'}." |
\n";
+ echo " | sip-ip | ".$row->{'sip-ip'}." |
\n";
+ echo " | ext-sip-ip | ".$row->{'ext-sip-ip'}." |
\n";
+ echo " | url | ".$row->url." |
\n";
+ echo " | bind-url | ".$row->{'bind-url'}." |
\n";
+ echo " | tls-url | ".$row->{'tls-url'}." |
\n";
+ echo " | tls-bind-url | ".$row->{'tls-bind-url'}." |
\n";
+ echo " | hold-music | ".$row->{'hold-music'}." |
\n";
+ echo " | outbound-proxy | ".$row->{'outbound-proxy'}." |
\n";
+ echo " | inbound-codecs | ".$row->{'inbound-codecs'}." |
\n";
+ echo " | outbound-codecs | ".$row->{'outbound-codecs'}." |
\n";
+ echo " | tel-event | ".$row->{'tel-event'}." |
\n";
+ echo " | dtmf-mode | ".$row->{'dtmf-mode'}." |
\n";
+ echo " | cng | ".$row->cng." |
\n";
+ echo " | session-to | ".$row->{'session-to'}." |
\n";
+ echo " | max-dialog | ".$row->{'max-dialog'}." |
\n";
+ echo " | nomedia | ".$row->nomedia." |
\n";
+ echo " | late-neg | ".$row->{'late-neg'}." |
\n";
+ echo " | proxy-media | ".$row->{'proxy-media'}." |
\n";
+ echo " | aggressive-nat | ".$row->{'aggressive-nat'}." |
\n";
+ echo " | stun-enabled | ".$row->{'stun-enabled'}." |
\n";
+ echo " | stun-auto-disable | ".$row->{'stun-auto-disable'}." |
\n";
+ echo " | user-agent-filter | ".$row->{'user-agent-filter'}." |
\n";
+ echo " | max-registrations-per-extension | ".$row->{'max-registrations-per-extension'}." |
\n";
+ echo " | calls-in | ".$row->{'calls-in'}." |
\n";
+ echo " | calls-out | ".$row->{'calls-out'}." |
\n";
+ echo " | failed-calls-in | ".$row->{'failed-calls-in'}." |
\n";
+ echo " | failed-calls-out | ".$row->{'failed-calls-out'}." |
\n";
+ }
+ echo "
\n";
+ echo "
";
+ unset($xml);
}
}
}