Пример #1
0
 private function addDeviceToUser($deviceName, $userId, $phoneNumber, $extension = null, $linePort)
 {
     $deviceName = OCIBuilder::buildSearch([OCIDataTypes::OCI_PARAMS => ['deviceLevel' => 'Group', 'deviceName' => $deviceName]]);
     $accessDevice = OCIBuilder::buildSearch([OCIDataTypes::OCI_PARAMS => ['accessDevice' => $deviceName, 'linePort' => $linePort]]);
     $accessDeviceEnpoint = OCIBuilder::buildSearch([OCIDataTypes::OCI_PARAMS => ['accessDeviceEndpoint' => $accessDevice]]);
     $extension = !empty($extension) ? $extension : OCIDataTypes::XSI_NIL;
     $request = OCISchemaUser::UserModifyRequest17sp4($userId, null, null, null, null, null, null, $phoneNumber, $extension, null, null, null, null, null, null, null, $accessDeviceEnpoint);
     return ['schema' => 'OCISchemaUser', 'command' => $request];
 }
Пример #2
0
 public function AssignServicePacks($user)
 {
     foreach ($user->getConfig()->UserServiceGetAssignmentListResponse->servicePacksAssignmentTable['row'] as $value) {
         if ($value['col'][1] == "true") {
             fwrite($this->migrator->logfile, "Assigning {$value['col'][0]} to {$user->userId}\n");
             $this->migrator->send(OCISchemaUser::UserServiceAssignListRequest($user->userId, null, $value['col'][0]));
             $this->migrator->getResponse();
         }
     }
 }
Пример #3
0
<?php

require_once '../Broadworks_OCI-P/common.php';
Factory::getOCISchemaServiceProvider();
if (!isset($argv[1])) {
    die("Provide service provider id as second argument.\n");
}
$mongo = new MongoClient('mongodb://pillock.net:27017');
$collection = $mongo->selectDB($argv[1])->selectCollection('UserGetListInServiceProviderRequest');
$client = CoreFactory::getOCIClient('http://bsews1.ipt.intechnology.co.uk/webservice/services/ProvisioningService');
$client->login('luke_script', 'waiodjjAWDOAWdlaiojhawiopjh4');
$client->send(OCISchemaUser::UserGetListInServiceProviderRequest($argv[1]));
if ($client->getResponse()) {
    foreach ($client->getResponse()->userTable['row'] as $row) {
        $userId = $row['col'][0];
        $client->send(OCISchemaUser::UserGetRequest17sp4($userId));
        $data = $client->getResponse();
        $data->userId = $userId;
        $collection->insert([bin2hex($userId) => $data]);
    }
}