Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_db

$_db : object

Handle for the current database connection.

Type

object

$_write_db

$_write_db : object

Handle for the current writable database connection.

Type

object

$_connected

$_connected : boolean

Boolean indicating whether or not we're connected to the LDAP server.

Type

boolean

Methods

__construct()

__construct(array  $params = array()) 

Constructs a new Shout LDAP driver object.

Parameters

array $params

A hash containing connection parameters.

getAccounts()

getAccounts() : array

Get a list of accounts from the instantiated driver and filter the returned accounts for those which the current user can see/edit

Returns

array —

Accounts valid for this user

checkAccountType()

checkAccountType(string  $account, string  $type) : boolean

For the given account and type, make sure the account has the appropriate properties, that it is effectively of that "type"

Parameters

string $account

the account to check type for

string $type

the type to verify the account is of

Returns

boolean —

true of the account is of type, false if not

getUsers()

getUsers(string  $account) : array

Get a list of users valid for the current account. Return an array indexed by the extension.

Parameters

string $account

Account for which users should be returned

Returns

array —

User information indexed by voice mailbox number

getHomeAccount()

getHomeAccount() : string

Returns the name of the user's default account

Returns

string —

User's default account

getAccountProperties()

getAccountProperties(string  $account) : integer

Get a account's properties

Parameters

string $account

Account for which to get properties

Returns

integer —

Bitfield of properties valid for this account

getDialplan()

getDialplan(string  $account) : array

Get a account's extensions and return as a multi-dimensional associative array

Parameters

string $account

account to return extensions for

Returns

array —

Multi-dimensional associative array of extensions data

saveExtension()

saveExtension(string  $account, string  $extension, array  $userdetails) : TRUE

Save a user to the LDAP tree

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

string $account

Account to which the user should be added

string $extension

Extension to be saved

array $userdetails

Phone numbers, PIN, options, etc to be saved

Returns

TRUE —

on success, PEAR::Error object on error

deleteExtension()

deleteExtension(string  $account, string  $extension) : boolean

Deletes a user from the LDAP tree

Parameters

string $account

Account to delete the user from

string $extension

Extension of the user to be deleted

Returns

boolean —

True on success, PEAR::Error object on error

saveDevice()

saveDevice(string  $account, string  $devid, array  $details) : TRUE

Save a device (add or edit) to the backend.

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

string $account

The account in which this device is valid

string $devid

Device ID to save

array $details

Array of device details

Returns

TRUE —

on success, PEAR::Error object on error

deleteDevice()

deleteDevice(\<type>  $account, \<type>  $devid) 

Delete a device from the backend.

This method is intended to be overridden by a child class. However it also implements some basic checks, so a typical backend will still call this method via parent::

Parameters

\ $account
\ $devid

factory()

factory(  $class, string  $driver = null, array  $params = null) : mixed

Attempts to return a concrete Shout_Driver instance based on $driver.

Parameters

$class
string $driver

The type of the concrete Shout_Driver subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.

array $params

(optional) A hash containing any additional configuration or connection parameters a subclass might need.

Returns

mixed —

The newly created concrete Shout_Driver instance, or false on an error.

saveAccount()

saveAccount(  $code,   $name,   $adminpin) 

Parameters

$code
$name
$adminpin

getMenus()

getMenus(  $account) 

Parameters

$account

saveMenuInfo()

saveMenuInfo(  $account,   $details) 

Parameters

$account
$details

deleteMenu()

deleteMenu(  $account,   $menu) 

Parameters

$account
$menu

getMenuActions()

getMenuActions(  $account,   $menu) 

Parameters

$account
$menu

deleteMenuAction()

deleteMenuAction(  $account,   $menu,   $digit) 

Parameters

$account
$menu
$digit

saveMenuAction()

saveMenuAction(  $account,   $menu,   $digit,   $action,   $args) 

Parameters

$account
$menu
$digit
$action
$args

getDevices()

getDevices(string  $account) : array

Get a list of devices for a given account

Parameters

string $account

Account in which to search for devicess

Returns

array —

Array of devices within this account with their information

getExtensions()

getExtensions(string  $account) : array

Get a list of users valid for the accounts

Parameters

string $account

Account on which to search

Returns

array —

User information indexed by voice mailbox number

getConferences()

getConferences(  $account) 

Parameters

$account

saveConference()

saveConference(  $account,   $roomno,   $details) 

Parameters

$account
$roomno
$details

getRecordings()

getRecordings(  $account) 

Parameters

$account

getRecordingByName()

getRecordingByName(  $account,   $filename) 

Parameters

$account
$filename

addRecording()

addRecording(  $account,   $name) 

Parameters

$account
$name

deleteRecording()

deleteRecording(  $account,   $name) 

Parameters

$account
$name

getNumbers()

getNumbers(  $account = null) 

Parameters

$account

deleteNumber()

deleteNumber(  $number) 

Parameters

$number

saveNumber()

saveNumber(  $number,   $account,   $menu) 

Parameters

$number
$account
$menu

_connect()

_connect() 

Attempts to open a persistent connection to the SQL server.

Throws

\Shout_Exception

_disconnect()

_disconnect() 

Disconnects from the SQL server and cleans up the connection.