public function __construct($user = null, $pass = null, $host = 'http://bsews1.ipt.intechnology.co.uk/webservice/services/ProvisioningService', $device_map = [])
 {
     $this->errorControl = CoreFactory::getErrorControl();
     $this->client = CoreFactory::getOCIClient($host, false);
     $this->client->setTimeout(5);
     if (!$this->client->login($user, $pass)) {
         throw new Exception("Unable to login");
     }
     if (empty($device_map)) {
         $this->device_map['Polycom Soundpoint IP 321'] = 'DMS-Polycom-321';
         $this->device_map['Polycom Soundpoint IP 331'] = 'DMS-Polycom-331';
         $this->device_map['Polycom Soundpoint IP 430'] = 'DMS-Polycom-430';
         $this->device_map['Polycom Soundpoint IP 450'] = 'DMS-Polycom-450';
         $this->device_map['Polycom Soundpoint IP 550'] = 'DMS-Polycom-550';
         $this->device_map['Polycom Soundpoint IP 650'] = 'DMS-Polycom-650';
         $this->device_map['Polycom Soundpoint IP 670'] = 'DMS-Polycom-670';
         $this->device_map['Polycom Soundpoint IP 5000'] = 'DMS-Polycom-5000';
         $this->device_map['Polycom Soundpoint IP 6000'] = 'DMS-Polycom-6000';
         $this->device_map['Polycom Soundpoint IP 7000'] = 'DMS-Polycom-7000';
         $this->device_map['Polycom SoundStation IP 5000'] = 'DMS-Polycom-5000';
         $this->device_map['Polycom SoundStation IP 5000'] = 'DMS-Polycom-5000';
     } else {
         $this->device_map = $device_map;
     }
 }
<?php

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