From 83e7c8a065496544867bacc3453a395d7b800d22 Mon Sep 17 00:00:00 2001 From: Michael Fenton Date: Wed, 13 May 2015 11:20:06 +1000 Subject: [PATCH] Provide NotFound and Error return values Providing a Not Found Message when a Third Party entity is not found to match with details provided, and providing an Error Message when the SQL Lookup fails. This will help Asterisk Users determine whether the CallerID would be usable from Dolibarr or to reject and continue with existing CID from Asterisk --- htdocs/asterisk/cidlookup.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index 6b566e60f55..d1d965d99a7 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -32,7 +32,8 @@ include '../master.inc.php'; $phone = GETPOST('phone'); - +$notfound = "Not found"; +$error = "Error" // Security check if (empty($conf->clicktodial->enabled)) { @@ -64,13 +65,15 @@ if ($resql) if ($obj) { $found = $obj->name; + } else { + $found = $notfound; } $db->free($resql); } else { dol_print_error($db,'Error'); + $found = $error; } echo $found; -