[Added RPID to SIP accounts in ENUM generator Adrian Georgescu **20081028180159 Added mysql id fields to ENUM mappings Added replication to an optional second NGNPro server for Dns and Enum ports ] hunk ./library/ngnpro_client.php 2648 + if (strlen($dictionary['rpid'])) { + $rpid=$dictionary['rpid']; + } else { + $rpid=trim($_REQUEST['rpid']); + } + hunk ./library/ngnpro_client.php 2732 + 'rpid' => $rpid, hunk ./library/ngnpro_client.php 3467 + + if ($this->reseller) { + dprint_r($this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]); + + $enum_engine_remote=$this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]['enum_engine_remote']; + + if (strlen($enum_engine_remote) && $this->SoapEngine->soapEngine != $enum_engine_remote) { + // replicate change + + if (in_array($enum_engine_remote,array_keys($this->SoapEngine->soapEngines))) { + $this->SOAPloginEnumRemote = array( + "username" => $this->SoapEngine->soapEngines[$enum_engine_remote]['username'], + "password" => $this->SoapEngine->soapEngines[$enum_engine_remote]['password'], + "admin" => true, + "impersonate" => intval($this->reseller) + ); + + //dprint_r($this->SOAPloginEnumRemote); + $this->SOAPurlEnumRemote=$this->SoapEngine->soapEngines[$enum_engine_remote]['url']; + + $log=sprintf ("and syncronize changes to %s",$this->SOAPurlEnumRemote,$this->SOAPurlEnumRemote); + dprint($log); + + $this->SoapAuthEnumRemote = array('auth', $this->SOAPloginEnumRemote , 'urn:AGProjects:NGNPro', 0, ''); + + $this->SoapEngineEnumRemote = new $this->SoapEngine->soap_class($this->SOAPurlEnumRemote); + + if (strlen($this->soapEngines[$enum_engine_remote]['timeout'])) { + $this->SoapEngineEnumRemote->_options['timeout'] = intval($this->soapEngines[$enum_engine_remote]['timeout']); + } else { + $this->SoapEngineEnumRemote->_options['timeout'] = $this->soapTimeout; + } + + $this->SoapEngineEnumRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); + $this->SoapEngineEnumRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + } + } + } + hunk ./library/ngnpro_client.php 3802 - unset($this->filters); - return $this->SoapEngine->execute($function,$this->html); + unset($this->filters); + + if ($result = $this->SoapEngine->execute($function,$this->html)) { + // delete remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->deleteRange($rangeId); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlEnumRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + unset($this->selectionActive); + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 3948 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->addRange($range); hunk ./library/ngnpro_client.php 3953 + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlEnumRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + + return false; + } else { + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 4240 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + // update remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->updateRange($range); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlEnumRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 4437 + + if ($this->reseller) { + dprint_r($this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]); + + $enum_engine_remote=$this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]['enum_engine_remote']; + + if (strlen($enum_engine_remote) && $this->SoapEngine->soapEngine != $enum_engine_remote) { + // replicate change + + if (in_array($enum_engine_remote,array_keys($this->SoapEngine->soapEngines))) { + $this->SOAPloginEnumRemote = array( + "username" => $this->SoapEngine->soapEngines[$enum_engine_remote]['username'], + "password" => $this->SoapEngine->soapEngines[$enum_engine_remote]['password'], + "admin" => true, + "impersonate" => intval($this->reseller) + ); + + $this->SOAPurlEnumRemote=$this->SoapEngine->soapEngines[$enum_engine_remote]['url']; + + $log=sprintf ("and syncronize changes to %s",$this->SOAPurlEnumRemote,$this->SOAPurlEnumRemote); + dprint($log); + + $this->SoapAuthEnumRemote = array('auth', $this->SOAPloginEnumRemote , 'urn:AGProjects:NGNPro', 0, ''); + + $this->SoapEngineEnumRemote = new $this->SoapEngine->soap_class($this->SOAPurlEnumRemote); + + if (strlen($this->soapEngines[$enum_engine_remote]['timeout'])) { + $this->SoapEngineEnumRemote->_options['timeout'] = intval($this->soapEngines[$enum_engine_remote]['timeout']); + } else { + $this->SoapEngineEnumRemote->_options['timeout'] = $this->soapTimeout; + } + + $this->SoapEngineEnumRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); + $this->SoapEngineEnumRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + } + } + } hunk ./library/ngnpro_client.php 4534 - Id + hunk ./library/ngnpro_client.php 4536 + hunk ./library/ngnpro_client.php 4545 + Id hunk ./library/ngnpro_client.php 4690 + %s hunk ./library/ngnpro_client.php 4704 + $_mapping->id, hunk ./library/ngnpro_client.php 4751 + %s hunk ./library/ngnpro_client.php 4756 + $_mapping->id, hunk ./library/ngnpro_client.php 5036 - 'priority' => $_mapping->priority + 'priority' => $_mapping->priority, + 'id' => $_mapping->id hunk ./library/ngnpro_client.php 5050 + + if ($result = $this->SoapEngine->execute($function,$this->html)) { hunk ./library/ngnpro_client.php 5053 + // update remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->updateNumber($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngineEnumRemote->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + unset($this->selectionActive); + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 5079 + + if ($result = $this->SoapEngine->execute($function,$this->html)) { + + // update remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->deleteNumber($enum_id); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngineEnumRemote->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + unset($this->selectionActive); + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 5106 - return $this->SoapEngine->execute($function,$this->html); + hunk ./library/ngnpro_client.php 5447 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + + // add remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->addNumber($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngineEnumRemote->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 5480 - 'priority' => $_mapping->priority + 'priority' => $_mapping->priority, + 'id' => $_mapping->id hunk ./library/ngnpro_client.php 5502 - - return $this->SoapEngine->execute($function,$this->html); + + if ($result = $this->SoapEngine->execute($function,$this->html)) { + + // add remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->updateNumber($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngineEnumRemote->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 5644 + print "Id"; hunk ./library/ngnpro_client.php 5655 + printf ("%d",$_mapping->id,$_mapping->id); hunk ./library/ngnpro_client.php 5657 - hunk ./library/ngnpro_client.php 5681 + print ""; hunk ./library/ngnpro_client.php 5770 + $id = $_REQUEST['mapping_id'][$j]; hunk ./library/ngnpro_client.php 5796 - $new_mappings[]=array('type' => $type, + $new_mappings[]=array( 'type' => $type, hunk ./library/ngnpro_client.php 5798 + 'id' => intval($id), hunk ./library/ngnpro_client.php 5809 - print_r($new_mappings2); hunk ./library/ngnpro_client.php 5826 - - return $this->SoapEngine->execute($function,$this->html); + + if ($result = $this->SoapEngine->execute($function,$this->html)) { + + // update remote if remote engine is set + if (is_object($this->SoapEngineEnumRemote)) { + $this->SoapEngineEnumRemote->addHeader($this->SoapAuthEnumRemote); + $result = $this->SoapEngineEnumRemote->updateNumber($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngineEnumRemote->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 5905 + if ($this->reseller) { + dprint_r($this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]); + + $dns_engine_remote=$this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]['dns_engine_remote']; + + if (strlen($dns_engine_remote) && $this->SoapEngine->soapEngine != $dns_engine_remote) { + // replicate change + + if (in_array($dns_engine_remote,array_keys($this->SoapEngine->soapEngines))) { + $this->SOAPloginDnsRemote = array( + "username" => $this->SoapEngine->soapEngines[$dns_engine_remote]['username'], + "password" => $this->SoapEngine->soapEngines[$dns_engine_remote]['password'], + "admin" => true, + "impersonate" => intval($this->reseller) + ); + + $this->SOAPurlDnsRemote=$this->SoapEngine->soapEngines[$dns_engine_remote]['url']; + + $log=sprintf ("and syncronize changes to %s",$this->SOAPurlDnsRemote,$this->SOAPurlDnsRemote); + dprint($log); + + $this->SoapAuthDnsRemote = array('auth', $this->SOAPloginDnsRemote , 'urn:AGProjects:NGNPro', 0, ''); + + $this->SoapEngineDnsRemote = new $this->SoapEngine->soap_class($this->SOAPurlDnsRemote); + + if (strlen($this->soapEngines[$dns_engine_remote]['timeout'])) { + $this->SoapEngineDnsRemote->_options['timeout'] = intval($this->soapEngines[$dns_engine_remote]['timeout']); + } else { + $this->SoapEngineDnsRemote->_options['timeout'] = $this->soapTimeout; + } + + $this->SoapEngineDnsRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); + $this->SoapEngineDnsRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + } + } + } + hunk ./library/ngnpro_client.php 5943 + hunk ./library/ngnpro_client.php 6142 + $name=$this->filters['name']; + hunk ./library/ngnpro_client.php 6145 - 'parameters' => array($this->filters['name']), + 'parameters' => array($name), hunk ./library/ngnpro_client.php 6152 - return $this->SoapEngine->execute($function,$this->html); + + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + $result = $this->SoapEngineDnsRemote->deleteZone($name); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 6260 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + $result = $this->SoapEngineDnsRemote->addZone($zone); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + + return false; + } else { + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 6462 - return $this->SoapEngine->execute($function,$this->html); + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + $result = $this->SoapEngineDnsRemote->updateZone($zone); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + + return false; + } else { + return true; + } + } hunk ./library/ngnpro_client.php 6827 + + if ($this->reseller) { + dprint_r($this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]); + + $dns_engine_remote=$this->SoapEngine->login_credentials['reseller_filters'][$this->reseller]['dns_engine_remote']; + + if (strlen($dns_engine_remote) && $this->SoapEngine->soapEngine != $dns_engine_remote) { + // replicate change + + if (in_array($dns_engine_remote,array_keys($this->SoapEngine->soapEngines))) { + $this->SOAPloginDnsRemote = array( + "username" => $this->SoapEngine->soapEngines[$dns_engine_remote]['username'], + "password" => $this->SoapEngine->soapEngines[$dns_engine_remote]['password'], + "admin" => true, + "impersonate" => intval($this->reseller) + ); + + $this->SOAPurlDnsRemote=$this->SoapEngine->soapEngines[$dns_engine_remote]['url']; + + $log=sprintf ("and syncronize changes to %s",$this->SOAPurlDnsRemote,$this->SOAPurlDnsRemote); + dprint($log); + + $this->SoapAuthDnsRemote = array('auth', $this->SOAPloginDnsRemote , 'urn:AGProjects:NGNPro', 0, ''); + + $this->SoapEngineDnsRemote = new $this->SoapEngine->soap_class($this->SOAPurlDnsRemote); + + if (strlen($this->soapEngines[$dns_engine_remote]['timeout'])) { + $this->SoapEngineDnsRemote->_options['timeout'] = intval($this->soapEngines[$dns_engine_remote]['timeout']); + } else { + $this->SoapEngineDnsRemote->_options['timeout'] = $this->soapTimeout; + } + + $this->SoapEngineDnsRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); + $this->SoapEngineDnsRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + } + } + } + hunk ./library/ngnpro_client.php 6943 - Id + hunk ./library/ngnpro_client.php 6946 - Record id + Id hunk ./library/ngnpro_client.php 6957 - Id + hunk ./library/ngnpro_client.php 6960 - Record id + Id hunk ./library/ngnpro_client.php 7429 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + + if ($this->addRecordFunction == 'addRecord') { + $result = $this->SoapEngineDnsRemote->addRecord($result); + } else if ($this->addRecordFunction == 'addRecordFancy') { + $result = $this->SoapEngineDnsRemote->addRecordFancy($result); + } + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + + return false; + } else { + return true; + } + } + + } else { + return false; + } + hunk ./library/ngnpro_client.php 7520 - $this->SoapEngine->execute($function,$this->html); - + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + $result = $this->SoapEngineDnsRemote->addRecord($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + } + } + + } hunk ./library/ngnpro_client.php 7751 - return $this->SoapEngine->execute($function,$this->html); + if ($result = $this->SoapEngine->execute($function,$this->html)) { + if (is_object($this->SoapEngineDnsRemote)) { + $this->SoapEngineDnsRemote->addHeader($this->SoapAuthDnsRemote); + if ($this->updateRecordFunction == 'updateRecord') { + $result = $this->SoapEngineDnsRemote->updateRecord($result); + } else if ($this->updateRecordFunction == 'updateRecordFancy') { + $result = $this->SoapEngineDnsRemote->updateRecordFancy($result); + } hunk ./library/ngnpro_client.php 7760 + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SOAPurlDnsRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + unset($this->filters); + + return false; + } else { + return true; + } + } + + } else { + return false; + } hunk ./library/ngnpro_client.php 11216 - $this->showAddForm=false; + $this->showAddForm=false; hunk ./library/ngnpro_client.php 11536 + hunk ./library/ngnpro_client.php 12119 - //dprint_r($sipAccount); + dprint_r($sipAccount); hunk ./version 1 -6.6.10 +6.7.0