Page Multiple Tenants at Once
If you would require to page to all or to a certain number of tenants at once, you can create a very simple custom script. See our Custom Scripts page on Developer Resource Center.

2007-10-13

ScopServ Telephony 1.4.5, Asterisk 1.4.13 and Wanpipe 3.2.0
more...



How to build Addons Modules for ScopServ GUI

Using simple PHP code and configurations files, you can easily enhance options and create custom modules that will be displayed on the ScopServ GUI.

Please note that some PHP programming knowledge are required.

Directories and Files

All Addons must be installed under ScopServ configuration directory.

The base directory is  /var/www/scopserv/telephony/config/addons/{module}  where {module} is the directory name of the module/addon.

A skeleton with examples is available under skeleton/ directory.

FilenameDescription
info.phpThis is a mandatory file and contain Name and Description of the addon.
tabs.phpTabs structure.
columns.phpColumns definitions for each List and Multi List.
params.phpForm parameters.
commit.phpCommit functions/procedures.

If you want to add extra parameters to system sections, you must create the file {section}_extra.php where {section} is the section name. Here some examples:

FilenameSectionDescription
phone_extra.phpphonePhones -> Extensions
line_in_extra.phpline_inLines -> Incoming Lines
line_out_extra.phpline_outLines -> Outgoing Lines

Functions

Theses functions are exclusivly available on the commit.php script. Please refer to ScopServ API for more details on available functions.

getInfos ( string $type )
Get informations from database for the specified type/section.

getConfig ( )
Get configurations from database for the current addon.

addToDialplan ( string $tenant, string $context, string $exten, int $prio, array $cmd )
This function will add new extension into context for a specific Tenant. If there is an existence of extension with the same priority we simply replace this extension.

removeFromDialplan ( string $tenant, string $context [, string $exten [, int $prio [, array $cmd ]]] )
Remove an dialplan from a given context. If an extension is given, only that specific extension from the given context will be removed.

addToDatabase ( string $family, string $key, string $value )
Adds or updates an entry in the Asterisk database for a given family, key, and value.

removeFromDatabase ( string $family [, string $key ] )
Deletes a family or specific keytree within a family in the Asterisk database.

Predefined Variables

Theses read-only variables are exclusivly available on the commit.php script.

NameTypeDescription
$tenantsarrayList of Tenants
$addonstringName of the Addon
$addon_namestringDescription of the Addon
$dataarrayInternal Data container (Reserved Variable)