[Added changelog for version 5.2.5: Adrian Georgescu **20070903101538 * Replaced multiple SOAP definitions from global.inc with a pointer to and entry from the $soapEngines defined in soap_engines.inc * Fixed read of HTTP vars in sip trace, public traces are now visible when gloabl vars are turned off More work on provisioning Fixed broken statististics ] hunk ./cdrlib_ser.phtml 4198 - global $soapEngines; + require(soap_engines.inc); hunk ./cdrlib_ser.phtml 4206 - if ($DATASOURCES[$cdr_source]['soapEngineId']) { - $this->soapEngineId=$DATASOURCES[$cdr_source]['soapEngineId']; + if ($DATASOURCES[$cdr_source]['SoapEngineId']) { + $this->SoapEngineId=$DATASOURCES[$cdr_source]['SoapEngineId']; hunk ./cdrlib_ser.phtml 4212 - "username" => $this->soapEngines[$this->soapEngineId]['username'], - "password" => $this->soapEngines[$this->soapEngineId]['password'], + "username" => $this->soapEngines[$this->SoapEngineId]['username'], + "password" => $this->soapEngines[$this->SoapEngineId]['password'], hunk ./cdrlib_ser.phtml 4217 - $this->SOAPurl=$this->soapEngines[$this->soapEngineId]['url']; + $this->SOAPurl=$this->soapEngines[$this->SoapEngineId]['url']; hunk ./debian/changelog 1 +cdrtool (5.2.5) unstable; urgency=low + + * Replaced multiple SOAP definitions from global.inc with a pointer + to and entry from the $soapEngines defined in soap_engines.inc + * Fixed read of HTTP vars in sip trace, public traces are now visible + when gloabl vars are turned off + + -- Adrian Georgescu Mon, 03 Sep 2007 12:13:57 +0200 + hunk ./provisioning.phtml 19 -include("provisioning_soap_library.phtml"); -include("provisioning_logic.phtml"); +require_once("provisioning_soap_library.phtml"); +require_once("provisioning_logic.phtml"); hunk ./provisioning_logic.phtml 96 + printf ("Connection to NGN-Pro at %s ",$this->SOAPurl,$this->SOAPurl); hunk ./provisioning_logic.phtml 121 + printf ("and syncronize writes to NGN-Pro at %s",$this->SOAPurlRemote,$this->SOAPurlRemote); + hunk ./provisioning_logic.phtml 146 - hunk ./provisioning_logic.phtml 147 + hunk ./provisioning_logic.phtml 401 - $actions->performActions(&$this->selectionKeys,$_REQUEST['sub_action'],$_REQUEST['sub_action_parameter']); + $actions->performActions(&$this->selectionKeys,$_REQUEST['sub_action'],trim($_REQUEST['sub_action_parameter'])); hunk ./provisioning_logic.phtml 542 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 750 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 829 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 910 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 951 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1088 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1168 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1241 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1405 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1432 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1495 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1643 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1670 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1743 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1891 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 1978 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2005 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2057 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2105 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2290 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2326 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2414 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2487 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2668 - printf ("

Remote Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurlRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2671 + printf ("

SIP account %s@%s has been deleted from %s ",$this->filters['username'],$this->filters['domain'],$this->SOAPEngine->SOAPurlRemote); + hunk ./provisioning_logic.phtml 2680 - printf ("

Local Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2683 - printf ("

SIP account %s@%s has been deleted. ",$this->filters['username'],$this->filters['domain']); + printf ("

SIP account %s@%s has been deleted from %s. ",$this->filters['username'],$this->filters['domain'],$this->SOAPEngine->SOAPurl); hunk ./provisioning_logic.phtml 2697 - printf ("

Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2818 - printf ("

Remote Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurlRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2821 + printf ("

SIP account %s@%s has been added at %s ",$username,$domain,$this->SOAPEngine->SOAPurlRemote); + hunk ./provisioning_logic.phtml 2830 - printf ("

Local Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + + // Atttempt to roll back remote + $deleteAccount=array('username' => $username, + 'domain' => $domain); + + $this->SOAPEngine->soapclientRemote->addHeader($this->SOAPEngine->SoapAuthRemote); + $resultRemote = $this->SOAPEngine->soapclientRemote->deleteAccount($deleteAccount); + hunk ./provisioning_logic.phtml 2841 - printf ("

SIP account %s@%s has been added. ",$username,$domain); + printf ("

SIP account %s@%s has been added at %s ",$username,$domain,$this->SOAPEngine->SOAPurl); hunk ./provisioning_logic.phtml 2854 - printf ("

Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2891 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 2975 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3102 - printf ("

Remote Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurlRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3112 - printf ("

Local Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3130 - printf ("

Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3243 - $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); - - $result = $this->SOAPEngine->soapclient->addAlias($alias); - - if (PEAR::isError($result)) { - $error_msg = $result->getMessage(); - $error_fault= $result->getFault(); - $error_code = $result->getCode(); - printf ("

Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); - return false; - } else { - printf ("

SIP alias %s@%s has been added. ",$alias_els[0],$alias_els[1]); - return 1; - } hunk ./provisioning_logic.phtml 3252 - printf ("

Remote Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurlRemote,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3255 + printf ("

SIP alias %s@%s has been added at %s ",$username,$domain,$this->SOAPEngine->SOAPurlRemote); + hunk ./provisioning_logic.phtml 3264 - printf ("

Local Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + + // Atttempt to roll back remote + $deleteAlias=array('username' => $username, + 'domain' => $domain); + + $this->SOAPEngine->soapclientRemote->addHeader($this->SOAPEngine->SoapAuthRemote); + $resultRemote = $this->SOAPEngine->soapclientRemote->deleteAlias($deleteAlias); + hunk ./provisioning_logic.phtml 3275 - printf ("

SIP alias %s@%s has been added. ",$alias_els[0],$alias_els[1]); + printf ("

SIP alias %s@%s has been added at %s ",$username,$domain,$this->SOAPEngine->SOAPurl); hunk ./provisioning_logic.phtml 3288 - printf ("

Soap error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + printf ("

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3291 - printf ("

SIP alias %s@%s has been added. ",$alias_els[0],$alias_els[1]); + printf ("

SIP alias %s@%s has been added. ",$username,$domain); hunk ./provisioning_logic.phtml 3306 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3342 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3459 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3468 - function showAddForm() { - if ($this->selectionActive) return; - print " -

- - - "; - printf ("",$_SERVER['PHP_SELF']); - print " - - - "; - $this->printHiddenFormElements(); - - print " - - -
- "; - - print " - - "; - - printf (" Domain: "); - - print " - - "; - print " -
- "; - } - hunk ./provisioning_logic.phtml 3480 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3516 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3627 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3682 - printf ("

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

Error from %s: %s (%s): %s",$this->SOAPEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); hunk ./provisioning_logic.phtml 3767 - 'setquota' => 'Set quota of SIP account to:' + 'setquota' => 'Set quota of SIP account to:', + 'rpidasusername' => 'Set PSTN caller ID as the username', + 'prefixtorpid' => 'Add to PSTN caller ID this prefix:' hunk ./provisioning_logic.phtml 3949 - $result->prepaid=0; hunk ./provisioning_logic.phtml 3961 + } + } else if ($action=='rpidasusername') { + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->getAccount($account); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + break; + } else { + //print_r($result); + // Sanitize data types due to PHP bugs + + if (!is_array($result->properties)) $result->properties=array(); + if (!is_array($result->groups)) $result->groups=array(); + if (is_numeric($username)) $result->rpid=$username; + $result->quota=intval($result->quota); + + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->updateAccount($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + break; + } else { + printf ("
  • SIP account %s has PSTN caller ID set to %s ",$key,$username); + } + } + } else if ($action=='prefixtorpid') { + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->getAccount($account); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + break; + } else { + //print_r($result); + // Sanitize data types due to PHP bugs + + if (!is_array($result->properties)) $result->properties=array(); + if (!is_array($result->groups)) $result->groups=array(); + if (is_numeric($sub_action_parameter)) { + $result->rpid=$sub_action_parameter.$result->rpid; + } else { + printf ("Error: '%s' must be numeric",$sub_action_parameter); + continue; + } + $result->quota=intval($result->quota); + + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + $result = $this->SOAPEngine->soapclient->updateAccount($result); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("
  • Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + break; + } else { + printf ("
  • SIP account %s has PSTN caller ID set to %s%s ",$key,$sub_action_parameter,$result->rpid); + } hunk ./rating_lib.phtml 2682 - if ($DATASOURCES[$this->cdr_source]['SOAPUsername'] && - $DATASOURCES[$this->cdr_source]['SOAPPassword'] && - $DATASOURCES[$this->cdr_source]['SOAPURL'] ) { + if ($DATASOURCES[$this->cdr_source]['SoapEngineId']) { hunk ./rating_lib.phtml 2684 - $this->NGNProURL=$DATASOURCES[$this->cdr_source]['SOAPURL']; + require_once("provisioning_soap_library.phtml"); + require("soap_engines.inc"); hunk ./rating_lib.phtml 2687 - //syslog(LOG_NOTICE, "SOAP/XML URL: $this->NGNProURL"); + if (in_array($SoapEngineId,array_keys($soapEngines))) { + + $this->SOAPurl = $soapEngines[$SoapEngineId]['url']; + $this->SOAPlogin = array( + "username" => $soapEngines[$SoapEngineId]['username'], + "password" => $soapEngines[$SoapEngineId]['password'], + "admin" => $soapEngines[$SoapEngineId]['admin'] + ); + + $this->SoapAuth=array('auth', $this->SOAPlogin , 'urn:AGProjects:NGNPro', 0, ''); hunk ./rating_lib.phtml 2698 - $this->SOAPlogin=array( - "username" =>$DATASOURCES[$this->cdr_source]['SOAPUsername'], - "password" =>$DATASOURCES[$this->cdr_source]['SOAPPassword'], - "admin" =>$DATASOURCES[$this->cdr_source]['SOAPAdmin'] - ); + $this->soapclient = new WebService_NGNPro_SipPort($this->SOAPurl); hunk ./rating_lib.phtml 2700 - $this->SoapAuth=array('auth', $this->SOAPlogin , 'urn:AGProjects:NGNPro', 0, ''); + $this->soapclient->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); + $this->soapclient->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + $this->soapclient->setOpt('curl', CURLOPT_TIMEOUT, 2); + + } hunk ./rating_lib.phtml 2706 - $this->soapclient = new NGNProSip($this->NGNProURL); - $this->soapclient->setOpt('curl', CURLOPT_TIMEOUT, 5); - $this->soapclient->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); - $this->soapclient->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); hunk ./rating_lib.phtml 4466 -} - -// class that connects to NGN-Pro to block/unblock accounts - -class NGNProSip extends SOAP_Client { - function NGNProSip($SOAPURL) { - $this->SOAP_Client($SOAPURL, 0); - } - - function &addToGroup($sipId, $group) { - return $this->call("addToGroup", - $v = array("sipId"=>$sipId, "group"=>$group), - array('namespace'=>'urn:AGProjects:NGNPro:Sip', - 'soapaction'=>'', - 'style'=>'rpc', - 'use'=>'encoded' )); - } - function &removeFromGroup($sipId, $group) { - return $this->call("removeFromGroup", - $v = array("sipId"=>$sipId, "group"=>$group), - array('namespace'=>'urn:AGProjects:NGNPro:Sip', - 'soapaction'=>'', - 'style'=>'rpc', - 'use'=>'encoded' )); - } hunk ./scripts/buildStatistics.php 6 + +$errorReporting = (E_ALL & ~(E_NOTICE | E_WARNING)); +//$errorReporting = 1; // temporary until warnings are fixed +error_reporting($errorReporting); hunk ./scripts/harvestStatistics.php 7 + +$errorReporting = (E_ALL & ~(E_NOTICE | E_WARNING)); +//$errorReporting = 1; // temporary until warnings are fixed +error_reporting($errorReporting); hunk ./sip_statistics_lib.phtml 32 - hunk ./sip_statistics_lib.phtml 78 - //print_r($this->SipEnabledZones); + //dprint_r($this->SipEnabledZones); hunk ./sip_statistics_lib.phtml 411 - hunk ./sip_statistics_lib.phtml 420 - $this->publishPresence ($this->StatisticsPresentities[$key]['SOAPEngine'], + + $this->publishPresence ($this->StatisticsPresentities[$key]['SoapEngineId'], hunk ./sip_statistics_lib.phtml 620 - function publishPresence ($SOAPEngine,$SIPaccount,$note,$activity) { + function publishPresence ($SoapEngineId,$SIPaccount,$note,$activity) { + + require_once("provisioning_soap_library.phtml"); + require("soap_engines.inc"); hunk ./sip_statistics_lib.phtml 625 - require_once("provisioning_lib.phtml"); + $this->soapEngines = $soapEngines; hunk ./sip_statistics_lib.phtml 627 - $this->PresencePort = new WebService_GeckoSIMPLEProxy_PresencePort($SOAPEngine['url']); + if (!in_array($SoapEngineId,array_keys($this->soapEngines))) { + print "Error: SoapEngineId '$SoapEngineId' does not exist.\n"; + return false; + } + + $this->SOAPurl = $this->soapEngines[$SoapEngineId]['url']; + $this->PresencePort = new WebService_GeckoSIMPLEProxy_PresencePort($this->SOAPurl); hunk ./sip_statistics_lib.phtml 636 + $this->PresencePort->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0); + $this->PresencePort->setOpt('curl', CURLOPT_TIMEOUT, 1); hunk ./sip_statistics_lib.phtml 639 - $this->SOAPLoginPresence = array("username" => $SOAPEngine['username'], - "password" => $SOAPEngine['password'] - ); + $this->SOAPloginPresence = array( + "username" => $this->soapEngines[$SoapEngineId]['username'], + "password" => $this->soapEngines[$SoapEngineId]['password'], + "admin" => true + ); + + $this->SoapAuthPresence = array('auth', $this->SOAPloginPresence, 'urn:AGProjects:PresenceEngine', 0, ''); hunk ./sip_statistics_lib.phtml 647 - $this->SoapAuthPresence = array('auth', $this->SOAPLoginPresence , 'urn:AGProjects:PresenceEngine', 0, ''); - hunk ./version 1 -5.2.4 +5.2.5