Actions

Difference between revisions of "AlphaWeb Custom Scripts"

From Zenitel Wiki

(Upload and Test Scripts)
(Test examples)
Line 66: Line 66:
  
 
== Test examples==
 
== Test examples==
From an internet browser, enter the  
+
Here are some examples on using the default '''call_handle.php''' script. From an internet browser, enter the following URL in the address field:
  
 
Set up a call from 101 to 102:
 
Set up a call from 101 to 102:

Revision as of 16:08, 13 March 2012

The Custom Scripts allows end users to make and upload their own web pages and php scripts. These scripts will typically implement 'Click to Call' applications.

The Custom Script page is protected by a 'Custom Script User' which can access the Custom Scripts page as well as all Admin pages.

Default login:

User: scripter
Passwd: alphascript

The Custom Script page has two main views:


Upload and Test Scripts

A base script package is included by default. If you log on to the Custom Scripts menu in AlphaWeb, and do a select on the script, a description and list of all possible URI parameters will appear (this information is based on a header within the script). The script package includes the script call_handle.php which can be used to set up calls.

The script call_handle.php will have the following URI:

http://{ip-address}/cmd/call_handle.php?{uri-params}

If enabled secure http transfer can be used_

https://{ip-address}/cmd/call_handle.php?{uri-params}

You can also upload/download your own scripts, html documents and pictures for the documents if needed.
All script uploaded will be placed in the webfolder /cmd/.

AlphaScript Header

This has to be put in the script within a comment block. AlphaWeb will parse this header and present the information when the script is selected. AlphaWeb will also generate a input form with all possible URI parametrs to help test the script.

Alphaweb will parse the text between '<-AlphaScriptComment-' and '-AlphaScriptComment->'. The comment '*' will be removed by AlphaWeb.

AlphaScriptComment Tags:

  • --Description--
    All text until next is presented a general description of the script. Html syntax can be included
  • --URI_PARAM_N name=xx opt=xx input=xx
    All these will be put in input table form. name is the URI parameter name, opt tells if the field is required/optional, input is string describing the input value type.
  • --TEST_WINDOW width=nnn hight=nnn--
    A test link will be generated from the URI input values. The test window will be open in a new browser window with width and height from this tag.

AlphaScriptComment Example:

/* <-AlphaScriptComment- 
 *  --Description--
 *   This script do call handling on a sub-station.
 *   All operations targets one station addressed by its directory number.   
 *     
 *   Syntax examples: 
 *     From station 101 to station 102:
 *      call_handle.php?from=101&to=102
* From station 1001 in node 1 to station 1001 in node 2: * call_handle.php?from=(1)1001&to=(2)1001
* * --URI_PARAM_1 name=from opt=required input=INT-- * --URI_PARAM_2 name=to opt=optional input=INT-- * --URI_PARAM_3 name=conf opt=optional input=INT-- * --URI_PARAM_4 name=group opt=optional input=INT-- * --URI_PARAM_5 name=mkey opt=optional input={PRESS,REL}-- * --URI_PARAM_6 name=ckey opt=optional input=INT-- * --URI_PARAM_7 name=dial_digit opt=optional input=INT(*INT*INT)-- * --URI_PARAM_8 name=single_digit opt=optional input={P,R}INT(*INT*{P,R}INT)-- * --URI_PARAM_9 name=dial_dak opt=optional input=INT-- * --TEST_WINDOW width=600 hight=200-- * * -AlphaScriptComment-> */

Test examples

Here are some examples on using the default call_handle.php script. From an internet browser, enter the following URL in the address field:

Set up a call from 101 to 102:

http://10.5.101.30/cmd/call_handle.php?from=101&to=102

Press M-key on 101:

http://10.5.101.30/cmd/call_handle.php?from=101&mkey=PRESS

Release M-key on 101:

http://10.5.101.30/cmd/call_handle.php?from=101&mkey=REL

Press C-key on 101:

http://10.5.101.30/cmd/call_handle.php?from=101&ckey=PRESS

Script Security Configuration

Here you can configure access rights for running theses script (additional system to standard AlphaWeb access rights)

You can give username/password (in this version the username/password is fixed)
Default credentials:

Login: script
Passwd: alphascript

You can also add a list of hosts that only are allowed access (example 10.5.2 will give access to the subnetwork, 10.5.2.107 only this IP)