/** Release a reserved DID */ function release() { # DIDx doesn't support an API method to cancel a DID # So, I guess the number remains ours - just free it from the customer. require_once PATH_MODULES . "voip_did_plugin/voip_did_plugin.inc.php"; $plugin = new voip_did_plugin(); return $plugin->release($this->id, $this->did); }
/** * Release a reserved DID * */ function release() { $this->config(); # include the magrathea/telnet classes include_once PATH_INCLUDES . "telnet/magrathea.inc.php"; $bOk = false; $t = new magrathea(); $ret = $t->login($this->server, $this->user, $this->pass); if ($ret !== false) { if ($t->deactivate(substr($this->did, 5)) === false) { $this->log_message('release', 'Error while calling activate'); } else { $bOk = true; } } $t->logout(); if ($bOk == false) { $this->log_message('release', $this->did . ':Magrathea-Telecom request for deactivating DID failed:'); return false; } require_once PATH_MODULES . "voip_did_plugin/voip_did_plugin.inc.php"; $plugin = new voip_did_plugin(); return $plugin->release($this->id, $this->did); }
/** * Release a reserved DID * * sub ReleaseDID("584884","asdf5","44554645587") */ function release() { $this->config(); # include the soap classes include_once(PATH_INCLUDES."nusoap/lib/nusoap.php"); $bOk = false; $client = new soapclient("http://didx.org/cgi-bin/WebReleaseDIDServer.cgi", false); $err = $client->getError(); if ($err) { global $C_debug; $C_debug->error('DIDX.php', 'release', 'Could not acquire information from DIDx.org'); } else { $params = array( 'UserID' => $this->user, 'Password' => $this->pass, 'DIDNumber' => $this->did ); $result = $client->call('ReleaseDID', $params, 'http://didx.org/Release'); if (is_array($result)) { while ((list($k,$v)=each($result)) !== false) { if (is_array($v)) { if ($v[0] < 0) { # error occured, let's log it! $this->log_message('release', 'SOAP Response: '.$this->codes[$v[0]]); } else { $bOk = true; } } } } else { if ($result < 0) { # error occured, let's log it! $this->log_message('release', 'SOAP Response: '.$this->codes[$result]); } else { $bOk = true; } } } if ($bOk == false) { $this->log_message('release', $this->did.':SOAP Request for release DID failed:'.$result); return false; } require_once(PATH_MODULES."voip_did_plugin/voip_did_plugin.inc.php"); $plugin = new voip_did_plugin; return $plugin->release($this->id, $this->did); }