| 1 |
--------------------------------------------------------------------------- |
|---|
| 2 |
VoicePulse Global Provisioning System (VGPS) |
|---|
| 3 |
by Ketan Patel |
|---|
| 4 |
Copyright (C) 2006 VoicePulse Inc. |
|---|
| 5 |
|
|---|
| 6 |
The VoicePulse Global Provisioning System (VGPS) is a PHP/MySQL-based |
|---|
| 7 |
provisioning system intended to generate vendor-specific configuration files |
|---|
| 8 |
for via a generic HTTP API. |
|---|
| 9 |
--------------------------------------------------------------------------- |
|---|
| 10 |
|
|---|
| 11 |
TABLE OF CONTENTS |
|---|
| 12 |
|
|---|
| 13 |
1.0 Background |
|---|
| 14 |
2.0 Concepts |
|---|
| 15 |
2.1 Templates |
|---|
| 16 |
2.2 Generic Features |
|---|
| 17 |
3.0 Architecture |
|---|
| 18 |
3.1 Models |
|---|
| 19 |
3.2 Devices |
|---|
| 20 |
3.3 Generic Settings |
|---|
| 21 |
3.4 Generic Mappings |
|---|
| 22 |
3.5 Generic Translations |
|---|
| 23 |
3.6 Device Settings |
|---|
| 24 |
4.0 Installation |
|---|
| 25 |
4.1 Download |
|---|
| 26 |
4.2 Extract |
|---|
| 27 |
4.3 Database |
|---|
| 28 |
4.4 Test |
|---|
| 29 |
4.5 Requirements |
|---|
| 30 |
5.0 Integration |
|---|
| 31 |
6.0 Contributing |
|---|
| 32 |
6.1 Templates |
|---|
| 33 |
6.2 SQL Script |
|---|
| 34 |
6.3 Test.php |
|---|
| 35 |
|
|---|
| 36 |
1.0 BACKGROUND |
|---|
| 37 |
|
|---|
| 38 |
The VoicePulse Global Provisioning System is the latest version of |
|---|
| 39 |
VoicePulse's in-house provisioning system for Voice-over-IP phone |
|---|
| 40 |
configuration files. As most others who have tried to tackle the issue |
|---|
| 41 |
of mass configuring phones, we have gone through the usual revisions: |
|---|
| 42 |
|
|---|
| 43 |
1. Hard-coded script: This is usually a perl script with the majority |
|---|
| 44 |
of the configuration file text hard-coded and a couple variables looked |
|---|
| 45 |
up from a database. This is a very quick and simple solution until you |
|---|
| 46 |
need to support multiple phones. Scripts are usually setup via cron to |
|---|
| 47 |
batch generate configuration files at some interval. This soon |
|---|
| 48 |
becomes a problem because the batch job takes longer and longer as your |
|---|
| 49 |
customer base grows. Also, batch jobs prevent settings from taking |
|---|
| 50 |
effect immediately as expected by customers. |
|---|
| 51 |
|
|---|
| 52 |
2. Fully database driven: The next step is usually an over-compensation |
|---|
| 53 |
for the hard-coded script. "Hey, if I just create a database with one |
|---|
| 54 |
table for every manufacturer and one column for every setting, it'll be |
|---|
| 55 |
infinitely flexible." That's true, but it's also very difficult to add |
|---|
| 56 |
a new device because you have to create a SQL script with every possible |
|---|
| 57 |
setting (or leave out settings and be required to change the schema when |
|---|
| 58 |
you want to support a new setting). |
|---|
| 59 |
|
|---|
| 60 |
On our third attempt at coming up with a provisioning system that would |
|---|
| 61 |
handle multiple manufacturers, we finally came up with a solution that |
|---|
| 62 |
would: |
|---|
| 63 |
|
|---|
| 64 |
1. Support any text or XML based configuration file |
|---|
| 65 |
2. Allow you to make global changes just by editing a text/XML file |
|---|
| 66 |
(e.g. Set a new proxy, DNS server, etc) |
|---|
| 67 |
3. Allow your customer website or GUI to make setting changes without |
|---|
| 68 |
having to know what type of device is being configured |
|---|
| 69 |
(e.g. Turn on call waiting for an Aastra, Cisco, Linksys, Sipura, etc |
|---|
| 70 |
phone using the same function call) |
|---|
| 71 |
4. Provide a simple HTTP API for integration with GUIs written in any |
|---|
| 72 |
language |
|---|
| 73 |
|
|---|
| 74 |
2.0 CONCEPTS |
|---|
| 75 |
|
|---|
| 76 |
There are two key concepts that drive the VoicePulse Global Provisioning |
|---|
| 77 |
System -- templates and generic features. |
|---|
| 78 |
|
|---|
| 79 |
2.1 TEMPLATES |
|---|
| 80 |
|
|---|
| 81 |
Using templates in their original form allows for much easier implementation |
|---|
| 82 |
and troubleshooting of configuration files. We generally obtain templates |
|---|
| 83 |
from documentation or utilities (such as Sipura's spc.exe). It is not |
|---|
| 84 |
mandatory that the template have every possible setting supported by |
|---|
| 85 |
the device, but it's easier to start with a known working template than |
|---|
| 86 |
creating one by hand. |
|---|
| 87 |
|
|---|
| 88 |
When a request to regenerate a configuration file is submitted via the API, |
|---|
| 89 |
VGPS will determine the model of device, open it's template file and modify |
|---|
| 90 |
just the unique settings for that device before saving the unique output |
|---|
| 91 |
configuration file. |
|---|
| 92 |
|
|---|
| 93 |
Template files are found in the "input" directory. The name of the file |
|---|
| 94 |
is entered into the `models` table when support for that model is added to |
|---|
| 95 |
the database. |
|---|
| 96 |
|
|---|
| 97 |
2.2 GENERIC FEATURES |
|---|
| 98 |
|
|---|
| 99 |
Previous systems have required the calling application (your GUI or |
|---|
| 100 |
customer service management interface) to know the exact name and value |
|---|
| 101 |
that needs to be set in the configuration file. This means if you want to |
|---|
| 102 |
support a different model device, all of your applications have to know |
|---|
| 103 |
how to translate that request for different devices (e.g. to set the SIP |
|---|
| 104 |
username on a Linksys, output "<User_ID_1_>VoicePulseUser</User_ID_1_>", but |
|---|
| 105 |
to set it on a Grandstream, output "P35 = VoicePulseUser"). This can make |
|---|
| 106 |
it almost impossible to support a new device if there are numerous |
|---|
| 107 |
applications which must be updated to do so. |
|---|
| 108 |
|
|---|
| 109 |
A key concept of the VGPS is the generic feature. Using generic features, |
|---|
| 110 |
you can tell VGPS: |
|---|
| 111 |
|
|---|
| 112 |
Set "line_01_username" to "VoicePulseUser" for device "000E01234567" |
|---|
| 113 |
|
|---|
| 114 |
Since you have already entered the device MAC address and model into VGPS, |
|---|
| 115 |
it will automatically look up the model, and translate your request into: |
|---|
| 116 |
|
|---|
| 117 |
"<User_ID_1_>VoicePulseUser</User_ID_1_>" for a Linksys phone |
|---|
| 118 |
|
|---|
| 119 |
or |
|---|
| 120 |
|
|---|
| 121 |
"sip line1 user name: VoicePulseUser" for an Aastra phone |
|---|
| 122 |
|
|---|
| 123 |
or |
|---|
| 124 |
|
|---|
| 125 |
"P35 = VoicePulseUser" for a Grandstream phone |
|---|
| 126 |
|
|---|
| 127 |
This means your GUI no longer has to have any knowledge of device-specific |
|---|
| 128 |
settings! If you add a new device to the system at a later time, your GUI |
|---|
| 129 |
does not have to be updated! |
|---|
| 130 |
|
|---|
| 131 |
3.0 ARCHITECTURE |
|---|
| 132 |
|
|---|
| 133 |
This section will describe the major entities in the VGPS. Understanding |
|---|
| 134 |
how these entities are related will make it easier for you to use and improve |
|---|
| 135 |
VGPS. |
|---|
| 136 |
|
|---|
| 137 |
3.1 MODELS |
|---|
| 138 |
|
|---|
| 139 |
A model is defined for each manufacturer you are provisioning devices for. |
|---|
| 140 |
You can also define multiple models for different firmware versions of the |
|---|
| 141 |
same device if the configuration files are different. You may also create |
|---|
| 142 |
different models of the same device if you want to use different templates |
|---|
| 143 |
for different deployments of the same device (e.g. Linksys PAP2T's in the |
|---|
| 144 |
main office and a remote office). A model is defined as: |
|---|
| 145 |
|
|---|
| 146 |
MODEL_ID: A unique ID for this model (primary key). |
|---|
| 147 |
|
|---|
| 148 |
NAME: The descriptive name of this model (e.g. Linksys PAP2T) |
|---|
| 149 |
|
|---|
| 150 |
TAG: An internal name for this model (e.g. linksys_pap2t). Use all |
|---|
| 151 |
lowercase letters and underscores for spaces. |
|---|
| 152 |
|
|---|
| 153 |
FORMAT: Either XML or TEXT. If you use XML, all generic mappings must be |
|---|
| 154 |
specified using XPath to find the right node. If you use TEXT, the REGEX |
|---|
| 155 |
field must specify how to parse each line into a key/value pair. |
|---|
| 156 |
|
|---|
| 157 |
REGEX: Must be specified if FORMAT is TEXT. This is a regular expression |
|---|
| 158 |
that describes how to parse the configuration file on a line-by-line |
|---|
| 159 |
basis. The sample models already include the common formats: |
|---|
| 160 |
|
|---|
| 161 |
key with spaces: value |
|---|
| 162 |
key_without_spaces: value |
|---|
| 163 |
key = value (<-- alphanumeric key) |
|---|
| 164 |
123 = value (<-- numeric key) |
|---|
| 165 |
|
|---|
| 166 |
INPUT_FILENAME: The template input path + filename. This is the file that |
|---|
| 167 |
is usually supplied or generated from the manufacturer and contains all |
|---|
| 168 |
possible configuration settings. |
|---|
| 169 |
|
|---|
| 170 |
OUTPUT_FILENAME: The device-specific configuration file's output filename. |
|---|
| 171 |
You can use tokens [mac] or [MAC] in the output filename. These will be |
|---|
| 172 |
replaced by the lowercase MAC address or uppercase MAC address when the |
|---|
| 173 |
final file is saved. |
|---|
| 174 |
|
|---|
| 175 |
POST_PROCESSING: This is a command that is run after the device-specific |
|---|
| 176 |
configuration file has been generated. This can be used for compiling the |
|---|
| 177 |
output file into a binary (e.g. for Cisco ATAs). This can also be used |
|---|
| 178 |
for encrypting the output file or copying it to a different location. |
|---|
| 179 |
|
|---|
| 180 |
3.2 DEVICES |
|---|
| 181 |
|
|---|
| 182 |
A device is defined for every unique device that configuration files will |
|---|
| 183 |
be generated for. The MAC address of the device is the unique identifier |
|---|
| 184 |
used in all API calls. A device is defined as: |
|---|
| 185 |
|
|---|
| 186 |
DEVICE_ID: A unique ID for this device (primary key). |
|---|
| 187 |
|
|---|
| 188 |
MODEL_ID: The ID from the MODELS table that specifies the model of this |
|---|
| 189 |
device. |
|---|
| 190 |
|
|---|
| 191 |
MAC_ADDRESS: The MAC address of this device. The MAC address of the device |
|---|
| 192 |
is the unique identifier used in all API calls. |
|---|
| 193 |
|
|---|
| 194 |
LOCATION: An optional text field to be used to specify the location of this |
|---|
| 195 |
device. |
|---|
| 196 |
|
|---|
| 197 |
NOTE: An optional text field to be used to keep notes on this device. |
|---|
| 198 |
|
|---|
| 199 |
3.3 GENERIC SETTINGS |
|---|
| 200 |
|
|---|
| 201 |
A generic setting is defined for every configuration file setting you may |
|---|
| 202 |
want to set, regardless of the model of the device. The database is pre- |
|---|
| 203 |
populated with generic settings for the most common settings -- proxy, |
|---|
| 204 |
username, password, display name, and call waiting. |
|---|
| 205 |
|
|---|
| 206 |
GENERIC_SETTING_ID: A unique ID for this generic setting (primary key). |
|---|
| 207 |
|
|---|
| 208 |
NAME: The descriptive name of this generic setting (e.g. Line 01 Username) |
|---|
| 209 |
|
|---|
| 210 |
TAG: A programmatic name for this generic setting (e.g. line_01_username). |
|---|
| 211 |
Use all lowercase letters and underscores for spaces. This value will |
|---|
| 212 |
be used when you try to set the value of a setting through the API. |
|---|
| 213 |
|
|---|
| 214 |
3.4 GENERIC MAPPINGS |
|---|
| 215 |
|
|---|
| 216 |
A generic mapping is defined for every combination of model and generic |
|---|
| 217 |
setting. This is because you must tell the system what to translate the |
|---|
| 218 |
generic settings into for a specific model (e.g. for a Linksys PAP2T, |
|---|
| 219 |
generic setting line_01_username translates into User_ID_1_ in the final |
|---|
| 220 |
device-specific configuration file). |
|---|
| 221 |
|
|---|
| 222 |
GENERIC_MAPPING_ID: A unique ID for this generic mapping (primary key). |
|---|
| 223 |
|
|---|
| 224 |
MODEL_ID: The ID from the MODELS table that specifies the model of this |
|---|
| 225 |
mapping (e.g. Linksys PAP2T). |
|---|
| 226 |
|
|---|
| 227 |
GENERIC_SETTING_ID: The ID from the GENERIC_SETTINGS table that specifies |
|---|
| 228 |
the generic setting of this mapping (e.g. line_01_username). |
|---|
| 229 |
|
|---|
| 230 |
PROFILE_KEY: If the format of the configuration file is TEXT, this should |
|---|
| 231 |
be the key of the key/value pair. If the format of the configuraion file |
|---|
| 232 |
is XML, this should be the XPath of the xml node where the setting is |
|---|
| 233 |
(e.g. /flat-profile/User_ID_1_ for Linksys PAP2T). |
|---|
| 234 |
|
|---|
| 235 |
3.5 GENERIC TRANSLATIONS |
|---|
| 236 |
|
|---|
| 237 |
A generic translation is defined for every combination of model and generic |
|---|
| 238 |
setting. This is because you must tell the system what to translate the |
|---|
| 239 |
generic settings into for a specific model (e.g. for a Linksys PAP2T, |
|---|
| 240 |
generic value 0 translates into No in the final device-specific |
|---|
| 241 |
configuration file. If there is no translation, the value supplied by the |
|---|
| 242 |
API will be set directly, with no translation. |
|---|
| 243 |
|
|---|
| 244 |
GENERIC_TRANSLATION_ID: A unique ID for this generic translation |
|---|
| 245 |
(primary key). |
|---|
| 246 |
|
|---|
| 247 |
MODEL_ID: The ID from the MODELS table that specifies the model of this |
|---|
| 248 |
mapping (e.g. Linksys PAP2T). |
|---|
| 249 |
|
|---|
| 250 |
GENERIC_SETTING_ID: The ID from the GENERIC_SETTINGS table that specifies |
|---|
| 251 |
the generic setting of this mapping (e.g. line_01_username). |
|---|
| 252 |
|
|---|
| 253 |
GENERIC_VALUE: The generic value you will call the API with when setting |
|---|
| 254 |
this generic setting (e.g. 0). |
|---|
| 255 |
|
|---|
| 256 |
PROFILE_VALUE: The value that should be used in the configuration file |
|---|
| 257 |
(e.g. No). |
|---|
| 258 |
|
|---|
| 259 |
3.6 DEVICE SETTINGS |
|---|
| 260 |
|
|---|
| 261 |
This table holds the device settings that have been defined for each |
|---|
| 262 |
device. The values stored in this table are translated into their final |
|---|
| 263 |
key/pair values. |
|---|
| 264 |
|
|---|
| 265 |
* This values in this table should not be set/modified directly. * |
|---|
| 266 |
|
|---|
| 267 |
4.0 INSTALLATION |
|---|
| 268 |
|
|---|
| 269 |
4.1 DOWNLOAD |
|---|
| 270 |
|
|---|
| 271 |
Download the necessary files from http://www.sourceforge.net/vgps/. |
|---|
| 272 |
|
|---|
| 273 |
4.2 EXTRACT |
|---|
| 274 |
|
|---|
| 275 |
To uncompress and extract the VGPS files, run: |
|---|
| 276 |
|
|---|
| 277 |
tar -zxvf vgps-0.1.tar.gz |
|---|
| 278 |
|
|---|
| 279 |
Since VGPS is a web based system, you probably want to extract the files |
|---|
| 280 |
into: |
|---|
| 281 |
|
|---|
| 282 |
/var/www/html/vgps/ (or your equivalent web root directory) |
|---|
| 283 |
|
|---|
| 284 |
4.3 DATABASE |
|---|
| 285 |
|
|---|
| 286 |
A SQL script is provided to initialize the VGPS database. To run the |
|---|
| 287 |
script, type the following from the command line (assumes Mysql is running |
|---|
| 288 |
on localhost): |
|---|
| 289 |
|
|---|
| 290 |
mysql -h localhost -u root -p < vgps.sql |
|---|
| 291 |
|
|---|
| 292 |
WARNING! This will drop any existing VGPS database! |
|---|
| 293 |
|
|---|
| 294 |
After running the script, you should see the following in your Mysql |
|---|
| 295 |
database: |
|---|
| 296 |
|
|---|
| 297 |
mysql> use voicepulse_global_provisioning_system; |
|---|
| 298 |
Database changed |
|---|
| 299 |
mysql> show tables; |
|---|
| 300 |
+-------------------------------------------------+ |
|---|
| 301 |
| Tables_in_voicepulse_global_provisioning_system | |
|---|
| 302 |
+-------------------------------------------------+ |
|---|
| 303 |
| device_settings | |
|---|
| 304 |
| devices | |
|---|
| 305 |
| generic_mappings | |
|---|
| 306 |
| generic_settings | |
|---|
| 307 |
| generic_translations | |
|---|
| 308 |
| models | |
|---|
| 309 |
+-------------------------------------------------+ |
|---|
| 310 |
6 rows in set (0.00 sec) |
|---|
| 311 |
|
|---|
| 312 |
4.4 TEST |
|---|
| 313 |
|
|---|
| 314 |
To test your installation, change to the directory you extracted the files |
|---|
| 315 |
into. Assuming you extracted them into /var/www/html/vgps/ and the URL to |
|---|
| 316 |
reach those files is http://localhost/vgps/: |
|---|
| 317 |
|
|---|
| 318 |
cd /var/www/html/vgps/ |
|---|
| 319 |
php test.php |
|---|
| 320 |
|
|---|
| 321 |
If the test is successful, you should see: |
|---|
| 322 |
|
|---|
| 323 |
[root@host vgps]# php test.php |
|---|
| 324 |
Content-type: text/html |
|---|
| 325 |
X-Powered-By: PHP/4.3.11 |
|---|
| 326 |
|
|---|
| 327 |
SUCCESS |
|---|
| 328 |
SUCCESS |
|---|
| 329 |
SUCCESS |
|---|
| 330 |
... |
|---|
| 331 |
|
|---|
| 332 |
You should also see the generated configuration files for the sample devices |
|---|
| 333 |
in the output directory. |
|---|
| 334 |
|
|---|
| 335 |
[root@host vgps]# cd output |
|---|
| 336 |
[root@host output]# ls |
|---|
| 337 |
000413000000.htm 00085D000000.cfg 000B82000000.cfg 000E08000000.xml |
|---|
| 338 |
phone0004F2000000.cfg |
|---|
| 339 |
|
|---|
| 340 |
If the URL of your VGPS installation is not http://localhost/vgps/, you must |
|---|
| 341 |
edit $root_url in test.php. |
|---|
| 342 |
|
|---|
| 343 |
4.5 REQUIREMENTS |
|---|
| 344 |
|
|---|
| 345 |
PHP 4.3.11 or greater |
|---|
| 346 |
Mysql 4 or greater |
|---|
| 347 |
Apache |
|---|
| 348 |
|
|---|
| 349 |
5.0 INTEGRATION |
|---|
| 350 |
|
|---|
| 351 |
To integrate your systems with the VGPS, you have to submit HTTP GET requests |
|---|
| 352 |
to the execute.php file. A working sample can be found in index.php and |
|---|
| 353 |
client_lib.php. |
|---|
| 354 |
|
|---|
| 355 |
ADD/MODIFY A DEVICE |
|---|
| 356 |
|
|---|
| 357 |
http://localhost/vgps/execute.php?op=set_device&model=$model&mac=$mac&location=$location¬e=$note |
|---|
| 358 |
|
|---|
| 359 |
Returns a string containing: |
|---|
| 360 |
|
|---|
| 361 |
ERROR: Error message with details |
|---|
| 362 |
or |
|---|
| 363 |
SUCCESS |
|---|
| 364 |
|
|---|
| 365 |
DELETE A DEVICE |
|---|
| 366 |
|
|---|
| 367 |
http://localhost/vgps/execute.php?op=delete_device&mac=$mac |
|---|
| 368 |
|
|---|
| 369 |
Returns a string containing: |
|---|
| 370 |
|
|---|
| 371 |
ERROR: Error message with details |
|---|
| 372 |
or |
|---|
| 373 |
SUCCESS |
|---|
| 374 |
|
|---|
| 375 |
SET A DEVICE SETTING |
|---|
| 376 |
|
|---|
| 377 |
http://localhost/vgps/execute.php?op=set_setting&mac=$mac&key=$key&value=$value |
|---|
| 378 |
|
|---|
| 379 |
Returns a string containing: |
|---|
| 380 |
|
|---|
| 381 |
ERROR: Error message with details |
|---|
| 382 |
or |
|---|
| 383 |
SUCCESS |
|---|
| 384 |
|
|---|
| 385 |
DELETE A DEVICE SETTING |
|---|
| 386 |
|
|---|
| 387 |
http://localhost/vgps/execute.php?op=delete_setting&mac=$mac&key=$key |
|---|
| 388 |
|
|---|
| 389 |
Returns a string containing: |
|---|
| 390 |
|
|---|
| 391 |
ERROR: Error message with details |
|---|
| 392 |
or |
|---|
| 393 |
SUCCESS |
|---|
| 394 |
|
|---|
| 395 |
REGENERATE |
|---|
| 396 |
|
|---|
| 397 |
http://localhost/vgps/execute.php?op=regen&mac=$mac |
|---|
| 398 |
|
|---|
| 399 |
Returns a string containing: |
|---|
| 400 |
|
|---|
| 401 |
ERROR: Error message with details |
|---|
| 402 |
or |
|---|
| 403 |
SUCCESS |
|---|
| 404 |
|
|---|
| 405 |
LIST DEVICES |
|---|
| 406 |
|
|---|
| 407 |
http://localhost/vgps/execute.php?op=list_devices |
|---|
| 408 |
|
|---|
| 409 |
Returns a string with a header row, data fields delimited with ||, and |
|---|
| 410 |
rows delimited with \n: |
|---|
| 411 |
|
|---|
| 412 |
mac_address||location||note||name||tag |
|---|
| 413 |
000413000000||||Sample Snom 300||Snom 300||snom_300 |
|---|
| 414 |
0004F2000000||||Sample Polycom Soundpoint IP 501||Polycom Soundpoint IP 501||polycom_soundpoint_ip_501 |
|---|
| 415 |
00085D000000||||Sample Aastra 480i||Aastra 480i||aastra_480i |
|---|
| 416 |
000B82000000||||Sample Grandstream GXP2000 1.1.0.16||Grandstream GXP2000 1.1.0.16||grandstream_gxp2000_1_1_0_16 |
|---|
| 417 |
000E08000000||||Sample Linksys PAP2||Linksys PAP2T||linksys_pap2t |
|---|
| 418 |
|
|---|
| 419 |
LIST DEVICE SETTINGS |
|---|
| 420 |
|
|---|
| 421 |
http://localhost/vgps/execute.php?op=list_device_settings&mac=$mac |
|---|
| 422 |
|
|---|
| 423 |
Returns a string with data fields delimited with ||, and rows delimited |
|---|
| 424 |
with \n: |
|---|
| 425 |
|
|---|
| 426 |
line_01_password||vppassword |
|---|
| 427 |
line_01_proxy||sip.voicepulse.com |
|---|
| 428 |
line_01_username||vpusername |
|---|
| 429 |
|
|---|
| 430 |
|
|---|
| 431 |
LIST MODELS |
|---|
| 432 |
|
|---|
| 433 |
http://localhost/vgps/execute.php?op=list_models |
|---|
| 434 |
|
|---|
| 435 |
Returns a string with a header row, data fields delimited with ||, and |
|---|
| 436 |
rows delimited with \n: |
|---|
| 437 |
|
|---|
| 438 |
name||tag |
|---|
| 439 |
Aastra 480i||aastra_480i |
|---|
| 440 |
Grandstream GXP2000 1.1.0.16||grandstream_gxp2000_1_1_0_16 |
|---|
| 441 |
Linksys PAP2T||linksys_pap2t |
|---|
| 442 |
Polycom Soundpoint IP 501||polycom_soundpoint_ip_501 |
|---|
| 443 |
Snom 300||snom_300 |
|---|
| 444 |
|
|---|
| 445 |
6.0 CONTRIBUTING |
|---|
| 446 |
|
|---|
| 447 |
If you would like VGPS to support a device that is currently not included in |
|---|
| 448 |
this version, it's very easy to do so! |
|---|
| 449 |
|
|---|
| 450 |
6.1 TEMPLATES |
|---|
| 451 |
|
|---|
| 452 |
The first step in supporting a new device is providing the template file |
|---|
| 453 |
that will go in the input directory. We would prefer templates that were |
|---|
| 454 |
provided directly from the manufacturer or created by a utility provided by |
|---|
| 455 |
the manufacturer. |
|---|
| 456 |
|
|---|
| 457 |
6.2 SQL SCRIPT |
|---|
| 458 |
|
|---|
| 459 |
The next step is to provide the appropriate data to be entered into Mysql. |
|---|
| 460 |
The SQL script that comes with VGPS, vgps.sql, shows how to populate the |
|---|
| 461 |
data for a new device. We will walk through the required items below: |
|---|
| 462 |
|
|---|
| 463 |
# First, we need to insert a new model: |
|---|
| 464 |
INSERT INTO `voicepulse_global_provisioning_system`.`models` (`name`, `tag`, `format`, `regex`, `input_filename`, `output_filename`, `post_processing`) VALUES ('Linksys PAP2T', 'linksys_pap2t', 'XML', '', 'input/linksys_pap2t.xml', 'output/[MAC].xml', ''); |
|---|
| 465 |
|
|---|
| 466 |
# We select the @MODEL_ID for use in the statements to follow: |
|---|
| 467 |
SET @MODEL_ID = (SELECT LAST_INSERT_ID()); |
|---|
| 468 |
|
|---|
| 469 |
# Since we have already defined the most common generic mappings across all |
|---|
| 470 |
# devices, we'll use those to pre-populate the GENERIC_MAPPINGS table: |
|---|
| 471 |
INSERT INTO `voicepulse_global_provisioning_system`.`generic_mappings` (`model_id`, `generic_setting_id`, `profile_key`) |
|---|
| 472 |
SELECT @MODEL_ID, generic_setting_id, tag FROM `voicepulse_global_provisioning_system`.`generic_settings`; |
|---|
| 473 |
|
|---|
| 474 |
# Now that the GENERIC_MAPPINGS table has a copy of the most common |
|---|
| 475 |
# mappings, we will update those rows with the actual values. In the |
|---|
| 476 |
# following rows, you should set the first `profile_key` to the actual key |
|---|
| 477 |
# used in the device-specific configuration file you are trying to support. |
|---|
| 478 |
# Follow this pattern: |
|---|
| 479 |
# UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '[SET_THE_PROFILE_KEY_HERE]' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'admin_password'; |
|---|
| 480 |
# |
|---|
| 481 |
# The most common mappings (admin password, line_01_proxy, line_01_username, |
|---|
| 482 |
# etc) are all provided below. The lines below are for a configuration file |
|---|
| 483 |
# that is in XML format, so the `profile_key` is in XPath format. |
|---|
| 484 |
# |
|---|
| 485 |
|
|---|
| 486 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Admin_Passwd' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'admin_password'; |
|---|
| 487 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Proxy_1_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_01_proxy'; |
|---|
| 488 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/User_ID_1_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_01_username'; |
|---|
| 489 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Password_1_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_01_password'; |
|---|
| 490 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Display_Name_1_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_01_display_name'; |
|---|
| 491 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/CW_Setting_1_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_01_call_waiting'; |
|---|
| 492 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Proxy_2_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_02_proxy'; |
|---|
| 493 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/User_ID_2_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_02_username'; |
|---|
| 494 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Password_2_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_02_password'; |
|---|
| 495 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/Display_Name_2_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_02_display_name'; |
|---|
| 496 |
UPDATE `voicepulse_global_provisioning_system`.`generic_mappings` SET `profile_key` = '/flat-profile/CW_Setting_2_' WHERE `model_id` = @MODEL_ID AND `profile_key` = 'line_02_call_waiting'; |
|---|
| 497 |
|
|---|
| 498 |
# Next, if you have settings with an ON/OFF value, such as Call Waiting, |
|---|
| 499 |
# you should set a mapping. In the example below, we set a mapping for |
|---|
| 500 |
# 0 = No and 1 = Yes. If the device you are trying to add uses the words |
|---|
| 501 |
# "Off" and "On" instead of "No" or "Yes", this is where you would specify |
|---|
| 502 |
# that. |
|---|
| 503 |
|
|---|
| 504 |
# First, select the generic setting you need a mapping for: |
|---|
| 505 |
SET @GENERIC_SETTING_ID = (SELECT generic_setting_id FROM `voicepulse_global_provisioning_system`.`generic_settings` WHERE `tag` = 'line_01_call_waiting'); |
|---|
| 506 |
|
|---|
| 507 |
# Next, insert the two mappings: |
|---|
| 508 |
INSERT INTO `voicepulse_global_provisioning_system`.`generic_translations` (`model_id`, `generic_setting_id`, `generic_value`, `profile_value`) |
|---|
| 509 |
SELECT @MODEL_ID, @GENERIC_SETTING_ID, '0', 'No'; |
|---|
| 510 |
INSERT INTO `voicepulse_global_provisioning_system`.`generic_translations` (`model_id`, `generic_setting_id`, `generic_value`, `profile_value`) |
|---|
| 511 |
SELECT @MODEL_ID, @GENERIC_SETTING_ID, '1', 'Yes'; |
|---|
| 512 |
|
|---|
| 513 |
# Again, select the generic setting you need a mapping for: |
|---|
| 514 |
SET @GENERIC_SETTING_ID = (SELECT generic_setting_id FROM `voicepulse_global_provisioning_system`.`generic_settings` WHERE `tag` = 'line_02_call_waiting'); |
|---|
| 515 |
|
|---|
| 516 |
# Again, insert the two mappings: |
|---|
| 517 |
INSERT INTO `voicepulse_global_provisioning_system`.`generic_translations` (`model_id`, `generic_setting_id`, `generic_value`, `profile_value`) |
|---|
| 518 |
SELECT @MODEL_ID, @GENERIC_SETTING_ID, '0', 'No'; |
|---|
| 519 |
INSERT INTO `voicepulse_global_provisioning_system`.`generic_translations` (`model_id`, `generic_setting_id`, `generic_value`, `profile_value`) |
|---|
| 520 |
SELECT @MODEL_ID, @GENERIC_SETTING_ID, '1', 'Yes'; |
|---|
| 521 |
|
|---|
| 522 |
# Finally, you should insert a sample device for testing purposes. |
|---|
| 523 |
INSERT INTO `voicepulse_global_provisioning_system`.`devices` (model_id, mac_address, location, note) VALUES (@MODEL_ID, '000E08000000', '', 'Sample Linksys PAP2'); |
|---|
| 524 |
|
|---|
| 525 |
6.3 TEST.PHP |
|---|
| 526 |
|
|---|
| 527 |
Finally, you should modify test.php to call the three set_setting API calls |
|---|
| 528 |
using the MAC address of the sample device you have added. If test.php runs |
|---|
| 529 |
successfully, you should see the generated output file in the output |
|---|
| 530 |
directory. This file should have the values of the line 1 username, |
|---|
| 531 |
password, and proxy set to the values used in test.php. |
|---|