BusinessPhone Communication Platform 5.1

## BMS Script Programmers Guide

BMS Sessions
BMS Script Language
BMS Script Language Reference
BMS Templates
Apply templates

## BMS Sessions

Frequently used configuration tasks can be managed by using sessions. A session is a script of programming commands that are executed automatically when you start a session.

BMS knows two different types of sessions:

- System sessions

- These sessions are part of BMS and therefore cannot be modified.

- User defined sessions

- If you want to use your own scripts, you must create and save a user-defined session first. When you need to perform a configuration task in the future, your script will always be available.

To access the dialog, open the last menu in the Configuration directory tree, click on the last menu item “+” and then click on the "Sessions" submenu. The Select Script dialog opens, consisting of two tables: a list of all system sessions and a separate list showing all defined user scripts.

The tables show the following information and actions for each session:

- Run

- Click on this link to start a session

- Script-Name

- The name of the script file

- Description

- A brief description of the session

- View link

- To view the source code of the session

####

System Session Files |  | To export (download) a system session |
User Session Files |  | To export or import (download or upload) user defined session file |

Actions:

### Running a session

- Click on the Run link of a session. This will start the session automatically.
- A new window is displayed, showing the details of the running script.
- If you need to enter some information - e.g. an extension directory number -, an edit box and a list box will be displayed. You can either enter or select the required input.
- Click on the Submit button to resume the session.
- If the configured data should be copied to other objects (e.g. extensions, trunks), a Copy dialog will open, listing the directory numbers of all available objects.
- Select the respective objects and click on the Submit button to resume the session.

### Source code

- If you want to view the source code of a session, just click on the respective session’s view link. A new dialog will be displayed showing the session code in detail.
- Click the Back button to return to the Select Script dialog.

### Creating a session

BMS allows you to write and install your own sessions.

Note

Only user session files can be installed. The system sessions are part of BMS and therefore cannot be modified.
There is no macro recorder for creating sessions.

A session is created as a plain text file, using the BMS script language. For more information about the script language, see section BMS Script Language in this document.

The text file can be created with any text editor like Notepad or WordPad. If you use a word processing program like MS Word, do not forget to save your file in plain text format.

After the file has been created, you can upload (import) it into BMS, see section Importing a User session. If the upload has been successful, the new session will be shown in the session list of the main dialog.

### Importing a user session

When you have finished writing your user session script file, the next step is to install and use the session within BMS. To do so, you must import the script file first:

- Click on the User Session Files button at the bottom of the Select Script dialog.
- The Script Files – File Manager dialog appears, showing a list of all user sessions that have already been installed in BMS.
- Enter the file name of the session you would like to import or use the Browse button to select the file.
- When you have selected your import file, click on the Submit button. The session will be imported to BMS and will appear in the sessions list above.
- Click on the Back button to return to the Select Script dialog.

Note

You cannot import a system session. System session files are part of BMS and therefore cannot be changed.

### Deleting a user session

If you do not need a session any longer, you can delete it from BMS.

- Press the User Session Files button in the Select Script dialog. The Script Files – File Manager dialog appears, showing a list of all user sessions that have been installed in BMS.
- Next to each file name you see a Delete button. To delete a session, click on the respective Delete button. The session will be deleted from BMS and is no longer displayed in the sessions list.
- Click on the Back button to return to the Select Script dialog.

Note

You cannot delete a system session. System session files are part of BMS and therefore cannot be changed.

### Exporting a session

You can export or download any session from BMS. This way you can retrieve the file from BMS to store it on your local PC.

- To export a System session, click on the System Session Files button at the bottom the Select Script dialog.
- OR:
- To export a User session, click on the User Session Files button at the bottom the Select Script dialog.
- The Script Files – File Manager dialog appears, showing a list of all system or user sessions that have been installed in BMS.
- To download a session, click on the file name of the desired sessions. A Save File dialog will be displayed.
- Select the location on the local PC and click on OK to save the file.
- Click the Back button to return to the Select Script dialog.

## BMS Script Language

The BMS sessions use a quite simple script language, and the sessions are saved in plain text format. Below you find an example of a session, which presents most of the script language constructs:

//[DESC] AUSTRALIA Trunk session 2 wire tieline TrunkMO aa; aa.userDIRentry(); aa.set( "1607","0", // allowed 12=1 or 16=0 "1608", "0", // range 0-7 "1609","115", // range 98 - 125 "1610","-6.5", // range -12.0 - +6.0 in steps of 0.1 "1611","0", // range -12.0 - +6.0 in steps of 0.1 "1612", "3", // range 0 - 7 "1613","0", // no comment "1614","-21" // range -20.0 - -45.0 in steps of 0.5 ); aa.mark2copy("1607","1608","1609","1610","1611","1612","1613v, "1614"); |

In general, writing sessions consists of the following basic steps:

- Definition of a managed object

- All exchange objects (extensions, trunks, facilities, etc) are modeled as Managed Objects. For example, if you want to work with a trunk, you must define a trunk object first, called TrunkMO. All further operations will apply to this object. Furthermore, you can define more than one object within the same session.

- Reading of user entry inputs

- This step is necessary, if the user, for example, has to enter the directory number of the trunk to be configured. The reading of user entries is done by the userDIRentry() function, i.e. if you have defined a trunk object aa, the userDIRentry() function must be called: aa.userDIRentry().

- Setting up values (commands)

- This is done by the function set() of the corresponding object, followed by a list of commands and respective values. For example:
- aa.set(1607, 0, 1608, 1);
- This way, you can access all object related commands.

- Copying of parameters to other extensions or trunks

- For this purpose, you can use the function mark2copy(). The parameter list of the function contains a list of commands that can be copied to other objects. For example, if you want to copy the configured commands to other trunks, you must call the function aa.mark2copy(1607,1608); This means that the commands 1607 and 1608 will be copied. A selection window will appear, listing all available target trunks for copying the data. Select the respective trunks and click on Submit. The copy function can be applied to objects of the same type only.

## BMS Script Language Reference

Below you find a description of the syntax of the BMS Script language and a list of all available functions.

### Comments

Comments must always start with // . For example, this line is a comment:

// This is a comment |

Comments can be entered in any place in the script code. The only restriction is that the complete line after the comment mark // is considered to be a comment. Here is another example of comments:

aa.set( "1607","0", // allowed 12=1 or 16=0 "1608", "0" // range 0-7 ); |

The text after the characters // at the end of the lines define that this line is a comment.

The C-like comment style is supported, too.

For example: :

/* This is a comment in several lines */ aa.set( "1607","0", /* allowed 12=1 or 16=0 */ "1608","0" /* range 0-7 */ ); |

### Description

You can add a description to each session. This description will be displayed when the sessions are listed in the BMS main session dialog.

A description is similar to a comment, but consists of only one line, always starting with: //[DESC].

This is an example for a description::

//[DESC] AUSTRALIA Trunk session 2 wire tieline |

If you want to add a more detailed description, BMS will add one or more line(s) that are displayed in the description part of the session table.

For example:

//[DESC] This is line 1 of the description //[DESC] This is line 2 of the description //[DESC] This is line 3 of the description //[DESC] This is line 4 of the description |

### Statements

A statement in the script language must always end with ; for example:

TrunkMO aa; // define a trunk object aa.userDIRentry(); // read user entry for directory number aa.set("1607","0","1608", "0"); // set values (commands) |

The semicolon is called the delimiter between each statement. You can write more than one statement in a line. It is also possible to use more than one line for a statement.

### Managed objects

All functions are performed by using managed objects. A managed object represents an exchange object, for example an extension, a trunk, a facility, etc.

The syntax for defining a managed object is:

TrunkMO aa; |

This statement defines an object called aa that represents a trunk. In this example, you can perform all available trunk functions for the object aa.

Other objects are:

- ExtensionMO
- HotelMO, ToneMO, etc.

To perform a function on a defined managed object, you can use the following way:

aa.userDIRentry(); |

This means that a dialog will be displayed, requesting an input from the user. The user can enter the required directory number or select it from a list.

### User entries

If a user entry is required in order to run the session, the corresponding function of the MO can be used. Currently, only one function is defined a for entering the directory number::

TrunkMO aa; aa.userDIRentry(); |

A dialog will be displayed and the user can either enter the value directly or select a value from a list. After clicking on Submit, the session will be resumed.

### Setting values (commands)

The main function of a session is to set specific commands. This is done with the function set(). Several commands can be set in one call to the function. This function has the following syntax:

TrunkMO aa; ... aa.set("1607","0", "1608","0", "1609","115" ); |

The call to the set() function will apply three commands for the selected trunk. Although we used three lines for the function to provide a better readability, you could use the following format, too:

aa.set("1607","0","1608","0","1609","115"); |

### Copy function

Sometimes you will need to copy the configured data to several other trunks or extensions. This is done by the mark2copy() function. All commands that can be copied are shown in the parameter list.

The copy function can be used for the same type of objects only, i.e. if the session configures a trunk, the copy will be done only to trunks.

After executing this function, BMS will display a list of all trunks to which the data can be copied. Select the trunks by marking the respective check boxes and click on Submit:

aa.mark2copy("1607","1608","1609","1610","1611","1612","1613","1614" ); |

## BMS Templates

With a BMS template, you can create a configuration with predefined parameters in offline mode. There are three types of templates:

- Board templates

- Templates are created per board type: ELUA, ELUD, ELUC, BTUA, BTUB, BTUD-C, BTUD-P, MFU, ICCU, IPU. More than one template can be created for each board type.

- CPU template

- You can also create a template for the system data, i.e. data not referring to a board. For more convenience, this type of template is defined as a CPU template.

- BP template

You can create a template for a complete system. A template of this kind is called a BP Template. When the template has been applied, you can select another template to apply to a particular board.

Note

Except for the BP template, you need to be in online mode to create a template.

### Writing a template

The internal implementation of the templates is based on the same script language as the sessions, but you do not need to write the script code manually.

The following functions are available:

- Create a template
- Create a template for system data
- Create BP template
- Apply a template
- Apply a template for system data
- Apply BP template
- Import a template
- Export a template
- Delete a template

To access the template features, open the last menu in the Configuration directory tree and click on the last menu item “+“. Now you can see two template submenus: “Create Templates” and “Apply Templates”.

### Creating a template

If you want to create a template for a specific board group, e.g. ELUA, you should configure the first individual (extension) with the desired default values first.

- Click on the “Create Templates” submenu of the last menu item in the configuration directory tree.

- The Create Template dialog opens. The dialog shows the available BusinessPhone cabinets. Each board is represented by a link.

- To create a template for a board, select the board by clicking on the link.
- Enter the name of the template.
- Enter short description for the template.
- Click on the Submit button.

- A script will be created based on the values that are programmed for the first individual of the selected board. The script is saved under the entered file name.

Create BP template |  | To create a BP template. You can import this template to a new BMS installation |
Submit |  | To submit your changes to the system. |
Cancel |  | To abort the process and to return to the previous page. |

Actions:

### Creating a system data template

If you want to create a template for the system data – i.e. data not referring to a board - you should configure the required parameters with the desired default values first.

- Click on the “Create Templates” submenu of the last menu item in the configuration directory tree. The Create Template dialog opens. The CPU is represented by a link.
- To create a system data template, click on the CPU link. A file will be created in the BMS import/export format (not a script!) from the values programmed in the System (and other) parameters.

### Creating a BP template

If you want to create a template for the complete system (as in RASC), you should create a reference system containing all boards that are of interest and program the required parameters with the desired default values first.

- Click on the “Create Templates” submenu of the last menu item in the configuration directory tree.

- The Create Template dialog opens. The dialog shows the available BusinessPhone cabinets. Each board is represented by a link.

- Click on the Create BP Template button.
- Enter a name for the template.
- Enter a short description for the template.
- Click on the Submit button.

- A script is created for each of the boards present in the system as well as for the system data. A list of these scripts will be included in the file.

## Apply templates

To program a board with a template, you have to select the board and the desired template first:

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens.

- The dialog shows the available BusinessPhone cabinets. For each board, you find a selection list comprising the templates that are available for this kind of board group.

- Select the templates for one or more boards.
- Click on the Submit button.

- The boards will be programmed with the data from the selected templates.

Submit |  | To submit your changes to the system. |
Apply BP template |  | To load a BP template that has been exported before from another BMSinstallation. |
Template file |  | To export or import (download or upload) a template file |

Actions:

### Applying a system data template

You can program the system data by applying a template.

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens. The dialog shows the available BusinessPhone cabinets.
- Select the CPU board.
- Select the template you would like to apply.
- Click on the Submit button. The CPU board will be programmed with the selected system template data.

### Applying a BP template

You can initialize a system by using the programmed data that has been saved as a BP template (similar to RASC templates).

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens.
- Click on the Apply BP Template button at the bottom of the dialog.
- Select the ASB template you would like to use for the system programming.
- Click on the Submit button.
- The template is applied and you return to the Apply Templates dialog automatically. Now the selection boxes of all board show the board templates that are part of the applied BP template. If required, you can change some of them.
- Click on the Submit button. All boards as well as the system data will be programmed with the data from the selected template.

### Importing a template

In BMS, you can import a template that has been exported from another BMS installation.

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens.
- Click on the Template Files button at the bottom of the dialog.
- The Script Files – File Manager dialog opens, showing all templates that are installed in BMS.
- Enter the file name of the template you would like to import or use the Browse button to select the file.
- Click on the Submit button. The template will be imported to BMS and will appear in the template list above.
- Click on the Back button to return to the Apply Templates dialog.

### Exporting a template

You can export a template from BMS to be installed in another BMS installation.

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens.
- Click on the Template Files button at the bottom of the dialog.
- The Script Files – File Manager dialog opens, showing all templates that are installed in BMS.
- To download a template, click on the file name of the desired sessions. A Save File dialog will be displayed.
- Select the location on the local PC and click on OK to save the file.
- Click on the Back button to return to the Apply Templates dialog.

### Deleting a template

If you do not need a template any longer, you can delete it from BMS.

- Click on the “Apply Templates” submenu of the last menu item in the configuration directory tree. The Apply Templates dialog opens.
- Click on the Template Files button at the bottom of the dialog.
- The Script Files – File Manager dialog opens, showing all templates that are installed in BMS.
- Next to each file name you see a Delete button. To delete a template, click on the respective Delete button. The template will be removed from BMS and is no longer displayed in the templates list.
- Click on the Back button to return to the Apply Templates dialog.

Revision: B © Ericsson Enterprise 2003