diff --git a/sources/source-OpenCNAM.module b/sources/source-OpenCNAM.module index 6d37027e..469a63db 100644 --- a/sources/source-OpenCNAM.module +++ b/sources/source-OpenCNAM.module @@ -21,17 +21,18 @@ class OpenCNAM extends superfecta_base { ); function get_caller_id($thenumber, $run_param=array()) { - + $run_param['Account_SID'] = isset($run_param['Account_SID'])?$run_param['Account_SID']:null; + $run_param['Auth_Token'] = isset($run_param['Auth_Token'])?$run_param['Auth_Token']:null; $caller_id = null; $this->DebugPrint("Searching OpenCNAM ... "); if ($run_param['Account_SID'] == null or $run_param['Auth_Token'] == null) { // Hobbyist Tier URL (limited to 60 cached lookups per hour) - $url = "https://api.opencnam.com/v2/phone/" . $thenumber . "?format=pbx"; + $url = "https://api.opencnam.com/v3/phone/" . $thenumber . "?format=pbx"; } else { // Professional Tier URL (unlimited real-time CNAM lookups) - $url = "https://api.opencnam.com/v2/phone/" . $thenumber . "?format=pbx&ref=possa&account_sid=".$run_param['Account_SID']."&auth_token=".$run_param['Auth_Token']; + $url = "https://api.opencnam.com/v3/phone/" . $thenumber . "?format=pbx&ref=possa&account_sid=".$run_param['Account_SID']."&auth_token=".$run_param['Auth_Token']; } $sname = $this->get_url_contents($url); @@ -58,4 +59,4 @@ class OpenCNAM extends superfecta_base { return($caller_id); } -} \ No newline at end of file +}