[Use instead of absolute URIs Adrian Georgescu **20080226083256 Removed unnecessary code used in the past for replication of changes to remote soap engine ] hunk ./provisioning/sip_settings_lib.phtml 127 - dprint_r($loginCredentials); + //dprint_r($loginCredentials); hunk ./provisioning/sip_settings_lib.phtml 415 - $this->sip_engine_remote=$this->soapEngines[$this->sip_engine]['depends']; - hunk ./provisioning/sip_settings_lib.phtml 426 - // sip remote - if (strlen($this->sip_engine_remote) && in_array($this->sip_engine_remote,array_keys($this->soapEngines))) { - $impersonateRemote=intval($this->soapEngines[$this->sip_engine_remote]['impersonate']); - - $this->SOAPloginRemote = array( - "username" => $this->soapEngines[$this->sip_engine_remote]['username'], - "password" => $this->soapEngines[$this->sip_engine_remote]['password'], - "admin" => true, - "impersonate" => $impersonateRemote - ); - - //print_r($this->SOAPloginRemote); - $this->SOAPurlRemote=$this->soapEngines[$this->sip_engine_remote]['url']; - $this->SoapAuthRemote = array('auth', $this->SOAPloginRemote , 'urn:AGProjects:NGNPro', 0, ''); - - // Instantiate the SOAP client depends - $this->SipPortRemote = new $this->soapClassSipPort($this->SOAPurlRemote); - - $this->SipPortRemote->setOpt('curl', CURLOPT_TIMEOUT, 5); - $this->SipPortRemote->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); - $this->SipPortRemote->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); - - if ($this->showSoapConnectionInfo) { - printf ("and sync to %s as %s ",$this->SOAPurlRemote,$this->SOAPurlRemote,$this->soapEngines[$this->sip_engine_remote]['username']); - } - - } - hunk ./provisioning/sip_settings_lib.phtml 531 - dprint_r($result); + //dprint_r($result); hunk ./provisioning/sip_settings_lib.phtml 861 - if (is_object($this->SipPortRemote)) { - dprint("addAliasRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->addAlias($_aliasObject); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("addAliasLocal"); + dprint("addAlias"); hunk ./provisioning/sip_settings_lib.phtml 863 - dprint_r($this->SoapAuth); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->addAlias($_aliasObject); hunk ./provisioning/sip_settings_lib.phtml 866 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->AddAlias($_aliasObject); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("addAliasLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->addAlias($_aliasObject); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 894 - if (is_object($this->SipPortRemote)) { - dprint("deleteAliasRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->deleteAlias($_aliasObject); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("deleteAliasLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->deleteAlias($_aliasObject); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("deleteAliasLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->deleteAlias($_aliasObject); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + dprint("deleteAlias"); + + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->deleteAlias($_aliasObject); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 943 - $this->voicemailMailbox=$result->mailbox; + $this->voicemailMailbox = $result->mailbox; hunk ./provisioning/sip_settings_lib.phtml 1224 - if ($uri =="") $uri = $this->voicemail['Account']; + //if ($uri =="") $uri = $this->voicemail['Account']; hunk ./provisioning/sip_settings_lib.phtml 1236 - if (is_object($this->SipPortRemote)) { - - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $result = $this->SipPortRemote->getSipDeviceLocations(array($this->sipId)); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - foreach ($result[0]->locations as $locationStructure) { - $contact=$locationStructure->address.":".$locationStructure->port; - if ($locationStructure->publicAddress) { - $publicContact=$locationStructure->publicAddress.":".$locationStructure->publicPort; - } else { - $publicContact=$contact; - } - - $this->locations[]=array( - "contact" => $contact, - "publicContact" => $publicContact, - "expires" => $locationStructure->expires, - "user_agent" => $locationStructure->userAgent, - "transport" => $locationStructure->transport - ); - } - } - - } else { - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->getSipDeviceLocations(array($this->sipId)); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->getSipDeviceLocations(array($this->sipId)); hunk ./provisioning/sip_settings_lib.phtml 1239 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - foreach ($result[0]->locations as $locationStructure) { - $contact=$locationStructure->address.":".$locationStructure->port; - if ($locationStructure->publicAddress) { - $publicContact=$locationStructure->publicAddress.":".$locationStructure->publicPort; - } else { - $publicContact=$contact; - } - $this->locations[]=array("contact" => $contact, - "publicContact" => $publicContact, - "expires" => $locationStructure->expires, - "user_agent" => $locationStructure->userAgent, - "transport" => $locationStructure->transport - ); + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + foreach ($result[0]->locations as $locationStructure) { + $contact=$locationStructure->address.":".$locationStructure->port; + if ($locationStructure->publicAddress) { + $publicContact=$locationStructure->publicAddress.":".$locationStructure->publicPort; + } else { + $publicContact=$contact; hunk ./provisioning/sip_settings_lib.phtml 1253 + $this->locations[]=array("contact" => $contact, + "publicContact" => $publicContact, + "expires" => $locationStructure->expires, + "user_agent" => $locationStructure->userAgent, + "transport" => $locationStructure->transport + ); hunk ./provisioning/sip_settings_lib.phtml 1272 + if ($this->absolute_voicemail_uri) { + $value=$this->voicemail['Account']; + } else { + $value=""; + } + hunk ./provisioning/sip_settings_lib.phtml 1279 - "value" => $this->voicemail['Account'], + "value" => $value, hunk ./provisioning/sip_settings_lib.phtml 2119 - if (is_object($this->SipPortRemote)) { - dprint("setBarringPrefixesRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setBarringPrefixes($this->sipId,$prefixes); + dprint("setBarringPrefixes"); hunk ./provisioning/sip_settings_lib.phtml 2121 - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setBarringPrefixesLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setBarringPrefixes($this->sipId,$prefixes); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setBarringPrefixesLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setBarringPrefixes($this->sipId,$prefixes); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setBarringPrefixes($this->sipId,$prefixes); hunk ./provisioning/sip_settings_lib.phtml 2124 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 2284 - if (is_object($this->SipPortRemote)) { - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $this->SipPortRemote->removeFromGroup(array("username" => $this->username,"domain"=> $this->domain), "quota"); - } - hunk ./provisioning/sip_settings_lib.phtml 2411 - if (is_object($this->SipPortRemote)) { - dprint("saveSettingsRemote"); - // if we have remote SOAP connection defined - - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->updateAccount($result); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - dprint("saveSettingsLocal"); - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->updateAccount($result); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->updateAccount($result); hunk ./provisioning/sip_settings_lib.phtml 2414 + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 2421 - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->updateAccount($result); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - dprint("Call updateAccount"); - } + dprint("Call updateAccount"); hunk ./provisioning/sip_settings_lib.phtml 2482 - if (!preg_match("/^sips?:/",$selectedURI)) { - $uri="sip:".$selectedURI; - } else { - $uri = $selectedURI; - } + $uri = $selectedURI; hunk ./provisioning/sip_settings_lib.phtml 2484 - if (!$this->voicemail['Account'] && $uri_description=='Voicemail') { + if (!$this->voicemail['Account'] && $uri_description == 'Voicemail') { hunk ./provisioning/sip_settings_lib.phtml 2493 - } else if ($uri_description!='Disabled' && $selectedURI) { + } else if ($uri_description != 'Disabled' && $selectedURI) { hunk ./provisioning/sip_settings_lib.phtml 2498 - if ("sip:" . $this->CallPrefDbURI[$condition] != $uri) { + if ($this->CallPrefDbURI[$condition] != $uri) { hunk ./provisioning/sip_settings_lib.phtml 2501 - $diversions[$condition]=$this->CallPrefDbURI[$condition]; + $diversions[$condition]=$this->CallPrefDbURI[$condition]; hunk ./provisioning/sip_settings_lib.phtml 2522 - if (preg_match("/^(sip:|sips:)(.*)$/",$uri,$m)) { - $last_other=$m[2]; - } else { - $last_other=$uri; - } + $last_other=$uri; hunk ./provisioning/sip_settings_lib.phtml 2535 - //dprint_r($diversions); hunk ./provisioning/sip_settings_lib.phtml 2541 - if ($diversions[$key] && $diversions[$key] != "" && !preg_match("/^sips?:/",$diversions[$key])) { - $diversionsSOAP[$key]="sip:".$diversions[$key]; - $voicemailUri="sip:".$this->voicemail['Account']; - if (!$this->absolute_voicemail_uri && $diversionsSOAP[$key] == $voicemailUri) { - $diversionsSOAP[$key] = ""; + if ($diversions[$key] && $diversions[$key] != "") { + $diversionsSOAP[$key]='sip:'.$diversions[$key]; + + if ($this->absolute_voicemail_uri && $diversionsSOAP[$key] == "") { + $diversionsSOAP[$key] = 'sip:'.$this->voicemail['Account']; hunk ./provisioning/sip_settings_lib.phtml 2547 + hunk ./provisioning/sip_settings_lib.phtml 2558 - dprint_r($diversionsSOAP); + //dprint_r($diversionsSOAP); hunk ./provisioning/sip_settings_lib.phtml 2560 - if (is_object($this->SipPortRemote)) { - dprint("setDiversionsRemote"); - // if we have remote SOAP connection defined - //dprint_r($result); + dprint("setDiversions"); hunk ./provisioning/sip_settings_lib.phtml 2562 - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setCallDiversions($this->sipId,$diversionsSOAP); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setDiversionsLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$diversionsSOAP); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error1 (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setDiversionsLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$diversionsSOAP); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error2 (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setCallDiversions($this->sipId,$diversionsSOAP); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error2 (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 2620 + hunk ./provisioning/sip_settings_lib.phtml 2622 - if (!preg_match("/^(sip:|sips:)/",$uri)) $uri="sip:".$uri; + if ($uri != "") { + if (!preg_match("/^(sip:|sips:)/",$uri)) $uri="sip:".$uri; + } hunk ./provisioning/sip_settings_lib.phtml 2632 - if ($uri =="") $uri = $this->voicemail['Account']; + + if ($this->absolute_voicemail_uri && $uri == "") { + $uri = $this->voicemail['Account']; + } + hunk ./provisioning/sip_settings_lib.phtml 2640 + hunk ./provisioning/sip_settings_lib.phtml 2647 - if (is_object($this->SipPortRemote)) { - dprint("setDiversionsRemote"); - // if we have remote SOAP connection defined - //dprint_r($result); + dprint("setDiversions"); hunk ./provisioning/sip_settings_lib.phtml 2649 - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setCallDiversions($this->sipId,$result); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setDiversionsLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$result); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setDiversionsLocal"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setCallDiversions($this->sipId,$result); hunk ./provisioning/sip_settings_lib.phtml 2652 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$result); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 2677 - if (is_object($this->SipPortRemote)) { - dprint("setDiversionsRemote"); - - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setCallDiversions($this->sipId,$diversions); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setDiversionsLocal"); + dprint("setDiversions"); hunk ./provisioning/sip_settings_lib.phtml 2679 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$diversions); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setDiversionsLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setCallDiversions($this->sipId,$diversions); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setCallDiversions($this->sipId,$diversions); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 2714 - } else { - if (is_object($this->VoicemailPortRemote)) { - // if we have remote SOAP connection defined - //dprint_r($result); - - dprint("update Voicemail remote"); - - $this->VoicemailPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->VoicemailPortRemote->updateAccount($account); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (VoicemailPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } hunk ./provisioning/sip_settings_lib.phtml 2742 - - } else { - - if (is_object($this->VoicemailPortRemote)) { - // if we have remote SOAP connection defined - - $this->VoicemailPort->addHeader($this->SoapAuthVoicemail); - $result = $this->VoicemailPort->getAccount($this->sipId); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - if ($error_fault->detail->exception->errorcode != "2000") { - printf ("

Error (VoicemailPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - return true; - } - } else { - dprint("create Voicemail remote"); - - $this->VoicemailPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->VoicemailPortRemote->addAccount($result); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - if ($error_fault->detail->exception->errorcode != "2000") { - printf ("

Error (VoicemailPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - return true; - } - } - } - } hunk ./provisioning/sip_settings_lib.phtml 2761 - } else { - if (is_object($this->VoicemailPortRemote)) { - // if we have remote SOAP connection defined - //dprint_r($result); - - dprint("delete Voicemail remote"); - $this->VoicemailPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->VoicemailPortRemote->deleteAccount($this->sipId); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (VoicemailPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } hunk ./provisioning/sip_settings_lib.phtml 2894 - if (is_object($this->SipPortRemote)) { - dprint("GetPrepaidAccountInfoRemote"); - // if we have remote SOAP connection defined - //dprint_r($result); - - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - if ($this->SOAPversion > 1) { - $result = $this->SipPortRemote->getPrepaidStatusNew(array($this->sipId)); - } else { - $result = $this->SipPortRemote->getPrepaidStatus($this->sipId); - } - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - if ($this->SOAPversion > 1) { - return $result[0]; - } else { - return $result; - } - } - + $this->SipPort->addHeader($this->SoapAuth); + if ($this->SOAPversion > 1) { + $result = $this->SipPort->getPrepaidStatusNew(array($this->sipId)); hunk ./provisioning/sip_settings_lib.phtml 2898 - dprint("GetPrepaidAccountInfoLocal"); - $this->SipPort->addHeader($this->SoapAuth); - if ($this->SOAPversion > 1) { - $result = $this->SipPort->getPrepaidStatusNew(array($this->sipId)); + $result = $this->SipPort->getPrepaidStatus($this->sipId); + } + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + if ($this->SOAPversion > 1) { + return $result[0]; hunk ./provisioning/sip_settings_lib.phtml 2911 - $result = $this->SipPort->getPrepaidStatus($this->sipId); - } - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - if ($this->SOAPversion > 1) { - return $result[0]; - } else { - return $result; - } + return $result; hunk ./provisioning/sip_settings_lib.phtml 2928 - if (is_object($this->SipPortRemote)) { - dprint("AddPrepaidBalanceRemote($prepaidCard,$prepaidId)"); + dprint("AddPrepaidBalanceLocal($prepaidCard,$prepaidId)"); hunk ./provisioning/sip_settings_lib.phtml 2930 - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $result = $this->SipPortRemote->addBalanceFromVoucher($this->sipId,$card); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - return $result; - } - } else { - dprint("AddPrepaidBalanceLocal($prepaidCard,$prepaidId)"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->addBalanceFromVoucher($this->sipId,$card); hunk ./provisioning/sip_settings_lib.phtml 2933 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->addBalanceFromVoucher($this->sipId,$card); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - return $result; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + return $result; hunk ./provisioning/sip_settings_lib.phtml 2975 - if (is_object($this->SipPortRemote)) { - dprint("showBalanceHistoryRemote"); - // if we have remote SOAP connection defined - //dprint_r($result); - - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $result = $this->SipPortRemote->getCreditHistory($this->sipId); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - } - - } else { - dprint("showBalanceHistoryLocal"); - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->getCreditHistory($this->sipId); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - if ($error_fault->detail->exception->errorcode != "2000") { - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - } + dprint("showBalanceHistory"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->getCreditHistory($this->sipId); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + if ($error_fault->detail->exception->errorcode != "2000") { + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning/sip_settings_lib.phtml 2986 - hunk ./provisioning/sip_settings_lib.phtml 2987 - + hunk ./provisioning/sip_settings_lib.phtml 3116 - if ($this->CallPrefDbURI[$condition] == "") { - $this->CallPrefDbURI[$condition] = $this->voicemail['Account']; - } - hunk ./provisioning/sip_settings_lib.phtml 3495 - if (is_object($this->SipPortRemote)) { - dprint("getCallsRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $result = $this->SipPortRemote->getCalls($this->sipId,$CallsQuery); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - - } else { + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->getCalls($this->sipId,$CallsQuery); hunk ./provisioning/sip_settings_lib.phtml 3498 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->getCalls($this->sipId,$CallsQuery); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 3549 - if (is_object($this->SipPortRemote)) { - dprint("getCallStatisticsRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $result = $this->SipPortRemote->getCallStatistics($this->sipId,$CallsQuery); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - - } else { + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->getCallStatistics($this->sipId,$CallsQuery); hunk ./provisioning/sip_settings_lib.phtml 3552 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->getCallStatistics($this->sipId,$CallsQuery); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 3575 - if (is_object($this->SipPortRemote)) { - dprint("addPhonebookEntryRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->addPhonebookEntry($this->sipId,$phonebookEntry); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("addPhonebookEntryLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->addPhonebookEntry($this->sipId,$phonebookEntry); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("addPhonebookEntryLocal"); - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->addPhoneBookEntry($this->sipId,$phonebookEntry); + dprint("addPhonebookEntry"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->addPhoneBookEntry($this->sipId,$phonebookEntry); hunk ./provisioning/sip_settings_lib.phtml 3579 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 3615 - if (is_object($this->SipPortRemote)) { - dprint("updatePhonebookEntryRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->updatePhonebookEntry($this->sipId,$phonebookEntry); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("updatePhonebookEntryLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->updatePhonebookEntry($this->sipId,$phonebookEntry); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("updatePhonebookEntryLocal"); - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->updatePhoneBookEntry($this->sipId,$phonebookEntry); + dprint("updatePhonebookEntry"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->updatePhoneBookEntry($this->sipId,$phonebookEntry); hunk ./provisioning/sip_settings_lib.phtml 3619 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 3636 - if (is_object($this->SipPortRemote)) { - dprint("deletePhonebookEntryRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->deletePhoneBookEntry($this->sipId,$uri); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - if ($error_fault->detail->exception->errorcode!="1040") { - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - dprint("deletePhonebookEntryLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->deletePhoneBookEntry($this->sipId,$uri); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - - } else { - dprint("deletePhonebookEntryLocal"); - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->deletePhoneBookEntry($this->sipId,$uri); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + dprint("deletePhonebookEntry"); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->deletePhoneBookEntry($this->sipId,$uri); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 4070 - if (is_object($this->SipPortRemote)) { - dprint("setRejectMembersRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setRejectMembers($this->sipId,$members); + dprint("setRejectMembers"); hunk ./provisioning/sip_settings_lib.phtml 4072 - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setRejectMembersLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setRejectMembers($this->sipId,$members); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setRejectMembersLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setRejectMembers($this->sipId,$members); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setRejectMembers($this->sipId,$members); hunk ./provisioning/sip_settings_lib.phtml 4075 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; hunk ./provisioning/sip_settings_lib.phtml 4258 - if (is_object($this->SipPortRemote)) { - dprint("setAcceptRulesRemote"); - $this->SipPortRemote->addHeader($this->SoapAuthRemote); - $resultRemote = $this->SipPortRemote->setAcceptRules($this->sipId,$rules); - - if (PEAR::isError($resultRemote)) { - $error_msg = $resultRemote->getMessage(); - $error_fault= $resultRemote->getFault(); - $error_code = $resultRemote->getCode(); - printf ("

Error (SipPortRemote): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - - dprint("setAcceptRulesLocal"); - - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setAcceptRules($this->sipId,$rules); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } - } - - } else { - dprint("setAcceptRulesLocal"); + dprint("setAcceptRules"); hunk ./provisioning/sip_settings_lib.phtml 4260 - $this->SipPort->addHeader($this->SoapAuth); - $result = $this->SipPort->setAcceptRules($this->sipId,$rules); + $this->SipPort->addHeader($this->SoapAuth); + $result = $this->SipPort->setAcceptRules($this->sipId,$rules); hunk ./provisioning/sip_settings_lib.phtml 4263 - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error (SipPort): %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false;