[Fixed set of timeout for each soap connection Adrian Georgescu **20080302145252] hunk ./provisioning/ngnpro_client_lib.phtml 137 - var $timeout = 10; + var $timeout = 5; hunk ./provisioning/ngnpro_client_lib.phtml 418 + if (strlen($this->soapEngines[$this->soapEngine]['timeout'])) { + $this->timeout=intval($this->soapEngines[$this->soapEngine]['timeout']); + } + hunk ./provisioning/ngnpro_client_lib.phtml 468 - $this->soapclient->setOpt('curl', CURLOPT_TIMEOUT, $this->timeout); hunk ./provisioning/ngnpro_client_lib.phtml 472 - //dprint_r($this->login_credentials); - - if (strlen($this->soapEngines[$this->soapEngine]['depends'])) { - $this->soapRemote=$this->soapEngines[$this->soapEngine]['depends']; - - if (strlen($this->soapRemote) && in_array($this->soapRemote,array_keys($this->soapEngines))) { - $this->soapEngineRemote = $this->soapEngines[$this->soapRemote]; - $this->impersonateRemote = intval($this->soapEngines[$this->soapRemote]['impersonate']); - - $this->SOAPloginRemote = array( - "username" => $this->soapEngines[$this->soapRemote]['username'], - "password" => $this->soapEngines[$this->soapRemote]['password'], - "admin" => true, - "impersonate" => $this->impersonateRemote - ); - - dprint_r($this->SOAPloginRemote); - $this->SOAPurlRemote=$this->soapEngines[$this->soapRemote]['url']; - - if ($this->adminonly) { - //printf ("and syncronize changes to %s",$this->SOAPurlRemote,$this->SOAPurlRemote); - } - $this->SoapAuthRemote = array('auth', $this->SOAPloginRemote , 'urn:AGProjects:NGNPro', 0, ''); - - // Instantiate the SOAP client dependency - $this->soapclientRemote = new $this->soap_class($this->SOAPurlRemote); - - $this->soapclientRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); - $this->soapclientRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); - } - } + // set the timeout + $this->soapclient->_options['timeout'] = $this->timeout; hunk ./provisioning/ngnpro_client_lib.phtml 476 - hunk ./provisioning/ngnpro_client_lib.phtml 490 + + if (strlen($this->soapEngines[$this->customer_engine]['timeout'])) { + $this->soapclientCustomers->_options['timeout'] = intval($this->soapEngines[$this->customer_engine]['timeout']); + } else { + $this->soapclientCustomers->_options['timeout'] = $this->timeout; + } hunk ./provisioning/ngnpro_client_lib.phtml 516 - $this->soapclient->setOpt('curl', CURLOPT_TIMEOUT, $this->timeout); hunk ./provisioning/ngnpro_client_lib.phtml 543 - if (is_object($this->soapclientRemote)) { - $this->soapclientRemote->setOpt('curl', CURLOPT_TIMEOUT, $this->timeout); - - $this->soapclientRemote->addHeader($this->SoapAuthRemote); - - $resultRemote = call_user_func_array(array($this->soapclientRemote,$function['commit']['name']),$function['commit']['parameters']); - - if (PEAR::isError($resultRemote)) { - $this->error_msg = $resultRemote->getMessage(); - $this->error_fault = $resultRemote->getFault(); - $this->error_code = $resultRemote->getCode(); - - $this->exception = $this->error_fault->detail->exception; + $this->soapclient->addHeader($this->SoapAuth); + $result = call_user_func_array(array(&$this->soapclient,$function['commit']['name']),$function['commit']['parameters']); + if (PEAR::isError($result)) { + $this->error_msg = $result->getMessage(); + $this->error_fault = $result->getFault(); + $this->error_code = $result->getCode(); hunk ./provisioning/ngnpro_client_lib.phtml 550 - if ($html) { - printf ("

Error from %s: %s (%s): %s\n",$this->SOAPurlRemote,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } else { - printf ("Error from %s: %s (%s): %s\n",$this->SOAPurlRemote,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } + $this->exception = $this->error_fault->detail->exception; hunk ./provisioning/ngnpro_client_lib.phtml 552 - return false; + if ($html) { + printf ("

Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); return false; hunk ./provisioning/ngnpro_client_lib.phtml 555 - if ($html) { - printf ("

%s at %s \n",$function['commit']['logs']['success'],$this->SOAPurlRemote); - } else { - printf ("%s at %s\n",$function['commit']['logs']['success'],$this->SOAPurlRemote); - } - - $this->soapclient->addHeader($this->SoapAuth); - $result = call_user_func_array(array($this->soapclient,$function['commit']['name']),$function['commit']['parameters']); - - if (PEAR::isError($result)) { - $this->error_msg = $result->getMessage(); - $this->error_fault = $result->getFault(); - $this->error_code = $result->getCode(); - - $this->exception = $this->error_fault->detail->exception; - - if ($html) { - printf ("

Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } else { - printf ("Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } - if ($function['rollback']['name']) { - - $this->soapclientRemote->addHeader($this->SoapAuthRemote); - $this->counterRemote++; - - $resultRemote = call_user_func_array(array($this->soapclientRemote,$function['rollback']['name']),$function['rollback']['parameters']); - - if (PEAR::isError($result)) { - $this->error_msg=$result->getMessage(); - $this->error_fault=$result->getFault(); - $this->error_code=$result->getCode(); - - if ($html) { - printf ("

Error roll back at %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } else { - printf ("Error roll back at %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); - } - - } else { - if ($html) { - printf ("

Rolled back action at %s \n",$this->SOAPurlRemote); - } else { - printf ("Rolled back action at %s\n",$this->SOAPurlRemote); - } - } - } - - return false; - } else { - if ($function['commit']['logs']['success']) { - if ($html) { - printf ("

%s at %s \n",$function['commit']['logs']['success'],$this->SOAPurl); - } else { - printf ("%s at %s\n",$function['commit']['logs']['success'],$this->SOAPurl); - } - } - } + printf ("Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); return false; hunk ./provisioning/ngnpro_client_lib.phtml 557 - hunk ./provisioning/ngnpro_client_lib.phtml 558 - - $this->soapclient->addHeader($this->SoapAuth); - $result = call_user_func_array(array(&$this->soapclient,$function['commit']['name']),$function['commit']['parameters']); - if (PEAR::isError($result)) { - $this->error_msg = $result->getMessage(); - $this->error_fault = $result->getFault(); - $this->error_code = $result->getCode(); - - $this->exception = $this->error_fault->detail->exception; - - if ($html) { - printf ("

Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); return false; + if ($function['commit']['logs']['success']) { + if ($html) { + printf ("

%s \n",$function['commit']['logs']['success']); hunk ./provisioning/ngnpro_client_lib.phtml 562 - printf ("Error from %s: %s (%s): %s\n",$this->SOAPurl,$this->error_msg, $this->error_fault->detail->exception->errorcode,$this->error_fault->detail->exception->errorstring); return false; - } - } else { - if ($function['commit']['logs']['success']) { - if ($html) { - printf ("

%s \n",$function['commit']['logs']['success']); - } else { - printf ("%s\n",$function['commit']['logs']['success']); - } + printf ("%s\n",$function['commit']['logs']['success']); hunk ./provisioning/ngnpro_client_lib.phtml 589 + hunk ./provisioning/ngnpro_client_lib.phtml 634 + hunk ./provisioning/ngnpro_client_lib.phtml 900 - $this->SoapEngine->timeout = 60; - - $this->SoapEngine->soapclient->setOpt('curl', CURLOPT_TIMEOUT,$this->SoapEngine->timeout); - hunk ./provisioning/ngnpro_client_lib.phtml 7418 + + if (strlen($this->soapEngines[$customer_engine_remote]['timeout'])) { + $this->SoapEngineCustomerRemote->_options['timeout'] = intval($this->soapEngines[$customer_engine_remote]['timeout']); + } else { + $this->SoapEngineCustomerRemote->_options['timeout'] = $this->soapTimeout; + } + hunk ./provisioning/ngnpro_client_lib.phtml 8901 - $this->PresencePort->setOpt('curl', CURLOPT_TIMEOUT, $this->SoapEngine->timeout); hunk ./provisioning/ngnpro_client_lib.phtml 8946 - $this->PresencePort->setOpt('curl', CURLOPT_TIMEOUT, $this->SoapEngine->timeout); hunk ./provisioning/ngnpro_engines.inc.sample 31 - 'welcome_message' => '

NGNPro provisionig client

' + 'welcome_message' => '

NGNPro provisionig client

', + 'timeout' => 5 hunk ./provisioning/sip_settings_lib.phtml 15 - var $login_type = 'subscriber'; + var $soapTimeout = 5; + var $login_type = 'subscriber'; hunk ./provisioning/sip_settings_lib.phtml 410 + if (strlen($this->soapEngines[$this->sip_engine]['timeout'])) { + $this->soapTimeout=intval($this->soapEngines[$this->sip_engine]['timeout']); + } + hunk ./provisioning/sip_settings_lib.phtml 423 - $this->SipPort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + $this->SipPort->_options['timeout'] = $this->soapTimeout; + hunk ./provisioning/sip_settings_lib.phtml 444 - $this->VoicemailPort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + if (strlen($this->soapEngines[$this->voicemail_engine]['timeout'])) { + $this->VoicemailPort->_options['timeout'] = intval($this->soapEngines[$this->voicemail_engine]['timeout']); + } else { + $this->VoicemailPort->_options['timeout'] = $this->soapTimeout; + } + hunk ./provisioning/sip_settings_lib.phtml 469 - $this->EnumPort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + if (strlen($this->soapEngines[$this->enum_engine]['timeout'])) { + $this->EnumPort->_options['timeout'] = intval($this->soapEngines[$this->enum_engine]['timeout']); + } else { + $this->EnumPort->_options['timeout'] = $this->soapTimeout; + } + hunk ./provisioning/sip_settings_lib.phtml 494 - $this->RatingPort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + if (strlen($this->soapEngines[$this->rating_engine]['timeout'])) { + $this->RatingPort->_options['timeout'] = intval($this->soapEngines[$this->rating_engine]['timeout']); + } else { + $this->RatingPort->_options['timeout'] = $this->soapTimeout; + } + hunk ./provisioning/sip_settings_lib.phtml 518 - $this->CustomerPort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + if (strlen($this->soapEngines[$this->customer_engine]['timeout'])) { + $this->CustomerPort->_options['timeout'] = intval($this->soapEngines[$this->customer_engine]['timeout']); + } else { + $this->CustomerPort->_options['timeout'] = $this->soapTimeout; + } + hunk ./provisioning/sip_settings_lib.phtml 536 - $this->PresencePort->setOpt('curl', CURLOPT_TIMEOUT, 5); + + if (strlen($this->soapEngines[$this->presence_engine]['timeout'])) { + $this->PresencePort->_options['timeout'] = intval($this->soapEngines[$this->presence_engine]['timeout']); + } else { + $this->PresencePort->_options['timeout'] = $this->soapTimeout; + } +