From 4793ab03113b97fbf798ff851043e41a74ca04d3 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Mon, 23 Jun 2014 23:05:16 +0000 Subject: [PATCH] Account for a gateway uuid which in a rare edge case the UUID is upper case --- app/gateways/gateways.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/gateways/gateways.php b/app/gateways/gateways.php index 834dc59e30..210cad58aa 100644 --- a/app/gateways/gateways.php +++ b/app/gateways/gateways.php @@ -74,7 +74,12 @@ else { function switch_gateway_status($gateway_uuid, $result_type = 'xml') { $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); $cmd = 'api sofia xmlstatus gateway '.$gateway_uuid; - return trim(event_socket_request($fp, $cmd)); + $response = trim(event_socket_request($fp, $cmd)); + if ($response == "Invalid Gateway!") { + $cmd = 'api sofia xmlstatus gateway '.strtoupper($gateway_uuid); + $response = trim(event_socket_request($fp, $cmd)); + } + return $response; } } }