From 3e8e4152e3080538b046239abeb90eb314557b65 Mon Sep 17 00:00:00 2001 From: sluther Date: Thu, 17 Sep 2009 01:28:54 -0700 Subject: [PATCH] Fixed an issue with adding Australian DIDs to the cart. --- modules/voip/base_voip_plugin.inc.php | 4 ++++ .../voip_did_plugin/voip_did_plugin.inc.php | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/modules/voip/base_voip_plugin.inc.php b/modules/voip/base_voip_plugin.inc.php index 66fd32f1..3a6f01e3 100644 --- a/modules/voip/base_voip_plugin.inc.php +++ b/modules/voip/base_voip_plugin.inc.php @@ -87,6 +87,10 @@ class base_voip_plugin extends base_product_plugin $station = substr($e164, 8); $sql = sqlSelect($db,"voip_pool","*", "(date_reserved IS NULL OR date_reserved=0) AND (account_id IS NULL OR account_id=0) AND country_code=$cc AND npa=$npa AND nxx=$nxx AND station=$station"); + } elseif ($cc == '61') { + $station = substr($e164, 12); + $sql = sqlSelect($db,"voip_pool","*", + "(date_reserved IS NULL OR date_reserved=0) AND (account_id IS NULL OR account_id=0) AND country_code=$cc AND npa=$npa AND nxx=$nxx AND station=$station"); } else { $station = substr($e164, 4 + strlen($cc)); $sql = sqlSelect($db,"voip_pool","*", diff --git a/modules/voip_did_plugin/voip_did_plugin.inc.php b/modules/voip_did_plugin/voip_did_plugin.inc.php index ca58a9b6..f1783d8e 100644 --- a/modules/voip_did_plugin/voip_did_plugin.inc.php +++ b/modules/voip_did_plugin/voip_did_plugin.inc.php @@ -105,6 +105,12 @@ class voip_did_plugin date_reserved=".time().", account_id=".intval(SESS_ACCOUNT)." WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND (account_id IS NULL or account_id=0) AND country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; + } elseif($cc == '61') { + $station = substr($e164, 12); + $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET + date_reserved=".time().", account_id=".intval(SESS_ACCOUNT)." + WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND (account_id IS NULL or account_id=0) AND + country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; } else { $station = substr($e164, 4 + strlen($cc)); $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET @@ -138,6 +144,12 @@ class voip_did_plugin date_reserved=NULL, account_id=".intval($this->account_id)." WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; + } elseif($cc == '61') { + $station = substr($e164, 12); + $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET + date_reserved=NULL, account_id=".intval($this->account_id)." + WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND + country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; } else { $station = substr($e164, 4 + strlen($cc)); $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET @@ -171,6 +183,12 @@ class voip_did_plugin date_reserved=NULL, account_id=NULL WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; + } elseif($cc == '61'){ + $station = substr($e164, 12); + $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET + date_reserved=NULL, account_id=NULL + WHERE voip_did_plugin_id=".$voip_did_plugin_id." AND + country_code=".$db->qstr($cc)." AND npa=".$db->qstr($npa)." AND nxx=".$db->qstr($nxx)." AND station=".$db->qstr($station)." AND site_id=".DEFAULT_SITE; } else { $station = substr($e164, 4 + strlen($cc)); $sql = "UPDATE ".AGILE_DB_PREFIX."voip_pool SET