CAS R2 scripting

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Adding more text.)
Line 3: Line 3:
 
Refer to the default script (itu.lua) in the Toolpack Web Portal for a complete working variant script example.
 
Refer to the default script (itu.lua) in the Toolpack Web Portal for a complete working variant script example.
  
= Mandatory elements =
+
== Mandatory elements ==
 
In order for CAS R2 variant scripts to work, some variables, tables and events must be defined from within scripts. All of the following elements are required; if one of these elements is not present, it will not be possible to save it in the Toolpack Web Portal.
 
In order for CAS R2 variant scripts to work, some variables, tables and events must be defined from within scripts. All of the following elements are required; if one of these elements is not present, it will not be possible to save it in the Toolpack Web Portal.
  
== VARIANT_ID ==
+
=== VARIANT_ID ===
 
The VARIANT_ID variable must be filled to distinguish variants from another. More precisely, it is used when transporting [[#Group B conversion information|group B]] and [[#Category conversion information|category]] information with calls in order to possibly convert information meaning across variants.
 
The VARIANT_ID variable must be filled to distinguish variants from another. More precisely, it is used when transporting [[#Group B conversion information|group B]] and [[#Category conversion information|category]] information with calls in order to possibly convert information meaning across variants.
  
 
Default CAS R2 TelcoBridges scripts have variant IDs starting from 1. To avoid future conflicts, user scripts variant IDs should be prefixed with a sufficiently high value. For example, a modified ITU variant could have a ID equal to 0x0001001.
 
Default CAS R2 TelcoBridges scripts have variant IDs starting from 1. To avoid future conflicts, user scripts variant IDs should be prefixed with a sufficiently high value. For example, a modified ITU variant could have a ID equal to 0x0001001.
  
== Group B conversion information ==
+
=== Group B conversion information ===
 
Group B conversion information in scripts is used to convert group B information between CAS R2 variants and between other signaling types. The following elements must be filled so that these conversions can be completed successfully.
 
Group B conversion information in scripts is used to convert group B information between CAS R2 variants and between other signaling types. The following elements must be filled so that these conversions can be completed successfully.
  
=== GROUPB_DIGIT_TO_MEANING ===
+
==== GROUPB_DIGIT_TO_MEANING ====
 
Each GROUPB_DIGIT_TO_MEANING table element must contain two values: a digit and a meaning. The digit must be a valid digit value (1 to 15) and the meaning must be a valid meaning (see [[#Group B meanings|Group B meanings]]). Each digit must be present in the table.
 
Each GROUPB_DIGIT_TO_MEANING table element must contain two values: a digit and a meaning. The digit must be a valid digit value (1 to 15) and the meaning must be a valid meaning (see [[#Group B meanings|Group B meanings]]). Each digit must be present in the table.
  
 
This table is used to convert group B digits to meaning in the context of an outgoing call. For a given digit, the specified meaning will be propagated to Toolpack.
 
This table is used to convert group B digits to meaning in the context of an outgoing call. For a given digit, the specified meaning will be propagated to Toolpack.
  
=== GROUPB_MEANING_TO_DIGIT ===
+
==== GROUPB_MEANING_TO_DIGIT ====
 
Each GROUPB_MEANING_TO_DIGIT table element must contain two values: a meaning and a digit. All meanings must not appear more than once in the table.
 
Each GROUPB_MEANING_TO_DIGIT table element must contain two values: a meaning and a digit. All meanings must not appear more than once in the table.
  
Line 26: Line 26:
 
If a meaning is not found in this table, the meaning corresponding to [[#GROUPB_DEFAULT_DIGIT|GROUPB_DEFAULT_DIGIT]] will be used.
 
If a meaning is not found in this table, the meaning corresponding to [[#GROUPB_DEFAULT_DIGIT|GROUPB_DEFAULT_DIGIT]] will be used.
  
=== GROUPB_DEFAULT_DIGIT ===
+
==== GROUPB_DEFAULT_DIGIT ====
 
This variable must be filled with a valid digit value. It will be used when lookups in the [[#GROUPB_MEANING_TO_DIGIT|GROUPB_MEANING_TO_DIGIT]] table fail.
 
This variable must be filled with a valid digit value. It will be used when lookups in the [[#GROUPB_MEANING_TO_DIGIT|GROUPB_MEANING_TO_DIGIT]] table fail.
  
=== GROUPB_OTHER_DIGITS ===
+
==== GROUPB_OTHER_DIGITS ====
  
  
== Category conversion information ==
+
=== Category conversion information ===
=== CATEGORY_DIGIT_TO_MEANING ===
+
==== CATEGORY_DIGIT_TO_MEANING ====
=== CATEGORY_MEANING_TO_DIGIT ===
+
==== CATEGORY_MEANING_TO_DIGIT ====
=== CATEGORY_OTHER_DIGITS ===
+
==== CATEGORY_OTHER_DIGITS ====
=== CATEGORY_DEFAULT_DIGIT ===
+
==== CATEGORY_DEFAULT_DIGIT ====
  
== Backward event handlers ==
+
=== Backward event handlers ===
=== Bwd_HandleNewCall ===
+
==== Bwd_HandleNewCall ====
=== Bwd_HandleFwdSignal ===
+
==== Bwd_HandleFwdSignal ====
  
== Forward event handlers ==
+
=== Forward event handlers ===
=== Fwd_HandleNewCall ===
+
==== Fwd_HandleNewCall ====
=== Fwd_HandleBwdSignal ===
+
==== Fwd_HandleBwdSignal ====
  
= Optional elements =
+
== Optional elements ==
  
== SCRIPT_FILE_NAME ==
+
=== SCRIPT_FILE_NAME ===
== VARIABLES ==
+
=== VARIABLES ===
  
= Reference =
+
== Reference ==
== Stack variables ==
+
=== Stack variables ===
== Group B meanings ==
+
=== Group B meanings ===
== Category meanings ==
+
=== Category meanings ===

Revision as of 16:28, 21 June 2010

This page contains information about Toolpack CAS R2 variant scripting.

Refer to the default script (itu.lua) in the Toolpack Web Portal for a complete working variant script example.

Contents

Mandatory elements

In order for CAS R2 variant scripts to work, some variables, tables and events must be defined from within scripts. All of the following elements are required; if one of these elements is not present, it will not be possible to save it in the Toolpack Web Portal.

VARIANT_ID

The VARIANT_ID variable must be filled to distinguish variants from another. More precisely, it is used when transporting group B and category information with calls in order to possibly convert information meaning across variants.

Default CAS R2 TelcoBridges scripts have variant IDs starting from 1. To avoid future conflicts, user scripts variant IDs should be prefixed with a sufficiently high value. For example, a modified ITU variant could have a ID equal to 0x0001001.

Group B conversion information

Group B conversion information in scripts is used to convert group B information between CAS R2 variants and between other signaling types. The following elements must be filled so that these conversions can be completed successfully.

GROUPB_DIGIT_TO_MEANING

Each GROUPB_DIGIT_TO_MEANING table element must contain two values: a digit and a meaning. The digit must be a valid digit value (1 to 15) and the meaning must be a valid meaning (see Group B meanings). Each digit must be present in the table.

This table is used to convert group B digits to meaning in the context of an outgoing call. For a given digit, the specified meaning will be propagated to Toolpack.

GROUPB_MEANING_TO_DIGIT

Each GROUPB_MEANING_TO_DIGIT table element must contain two values: a meaning and a digit. All meanings must not appear more than once in the table.

This table is used to convert meanings to digits for an incoming call. This is mostly used for calls where the other leg belongs to another signaling type, although it will be used if the other leg's signaling type is CAS R2 but the variant is different and there was no match in the GROUPB_OTHER_DIGITS table.

If a meaning is not found in this table, the meaning corresponding to GROUPB_DEFAULT_DIGIT will be used.

GROUPB_DEFAULT_DIGIT

This variable must be filled with a valid digit value. It will be used when lookups in the GROUPB_MEANING_TO_DIGIT table fail.

GROUPB_OTHER_DIGITS

Category conversion information

CATEGORY_DIGIT_TO_MEANING

CATEGORY_MEANING_TO_DIGIT

CATEGORY_OTHER_DIGITS

CATEGORY_DEFAULT_DIGIT

Backward event handlers

Bwd_HandleNewCall

Bwd_HandleFwdSignal

Forward event handlers

Fwd_HandleNewCall

Fwd_HandleBwdSignal

Optional elements

SCRIPT_FILE_NAME

VARIABLES

Reference

Stack variables

Group B meanings

Category meanings

Personal tools