CAS R2 scripting

From TBwiki
Revision as of 09:07, 22 June 2010 by Atremblay (Talk | contribs)
Jump to: navigation, search

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

Overview

CAS R2 signaling is done in two parts: line signaling and register signaling. In CAS R2 for E1 trunks, line signaling uses a single timeslot to communicate call states (such as off-hook, answering) for the remaining timeslots. Register signaling is the exchange of tones to convey information such as the calling number, called number and calling party category. Toolpack CAS R2 scripts allow complete customization of the register signaling process, while having some characteristics of the line signaling process customizable. Scripts also contain information relative to the conversion of register signaling data - group B signals and categories - into a format that Toolpack can interpret.

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 the script 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

Each GROUPB_OTHER_DIGITS table element must contain three values: a variant ID and two valid digit values. This table may be empty but cannot be omitted.

This table is used to convert a variant ID and a digit combination to a digit for the current variant in an outgoing call scenario.

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

Variable name Default value Description
TIMER_BWD_TONE 15000 Maximum time before a call is closed because the forward end did not emit a tone.
TIMER_BWD_PULSE 250 Length of a pulsed digit.
TIMER_BWD_PULSE_GUARD 100 Time between the end of a compelled sequence and the beginning of a pulsed digit.
TIMER_BWD_PULSE_DETECTION 3000 Time elapsed after a compelled sequence that triggers a pulsed digit.
TIMER_BWD_ALERT 14000 Maximum wait time for an ALERT API message.
TIMER_BWD_ANSWER 14000 Maximum wait time for an ANSWER API message.
TIMER_BWD_TERMINATE 3000 Maximum wait time for an TERMINATE API message.
TIMER_BWD_HOLD_ANSWER 100 Maximum time for which the CAS bits should stay in the ANSWER state before chaning to CLEAR_BACKWARD.
TIMER_BWD_HOLD_CLEAR_BACKWARD 200 Maximum time for which the CAS bits should stay in the CLEAR_BACKWARD state.
TIMER_BWD_HOLD_FORCED_RELEASE 200 Maximum time for which the CAS bits should stay in the FORCED_RELEASE state.
TIMER_BWD_HOLD_IDLE 100 Maximum time for which the CAS bits should stay in the IDLE state before starting a new call on the same timeslot.
TIMER_FWD_TONE 15000 Maximum time before a call is closed because the forward end did not emit a tone.
TIMER_FWD_TONE_GUARD 0 Time between the end of a compelled sequence and the beginning of the next one.
TIMER_FWD_SEIZURE_ACK_BIT 200 Maximum time for which the forward end should wait for a CAS bits SEIZURE_ACKNOWLEDGE state.
TIMER_FWD_ANSWER_BIT 14000 Maximum time for which the forward end should wait for a CAS bits ANSWER state.
TIMER_FWD_TERMINATE 3000 Maximum wait time for an TERMINATE API message.
TIMER_FWD_HOLD_SEIZURE 100 Maximum time for which the SEIZURE CAS bits state should be held in case of a collision.
TIMER_FWD_HOLD_IDLE 100 Maximum time for which the CAS bits should stay in the IDLE state before starting a new call on the same timeslot.
TIMER_CAS_CHANGE 20 Time required for a CAS bits state change to take effect.
ABCD_PATTERN_IDLE 0x1001 CAS R2 bit pattern for the IDLE state.
ABCD_PATTERN_BLOCKED 0x1101 CAS R2 bit pattern for the BLOCKED state.
ABCD_PATTERN_FWD_SEIZURE 0x0001 CAS R2 bit pattern for the forward SEIZURE state.
ABCD_PATTERN_FWD_CLEAR_FWD 0x1001 CAS R2 bit pattern for the forward CLEAR state.
ABCD_PATTERN_BWD_SEIZURE_ACK 0x1101 CAS R2 bit pattern for the backward SEIZURE ACKNOWLEDGE state.
ABCD_PATTERN_BWD_ANSWERED 0x0101 CAS R2 bit pattern for the backward ANSWERED state.
ABCD_PATTERN_BWD_CLEAR_BWD 0x1101 CAS R2 bit pattern for the backward CLEAR state.
ABCD_PATTERN_BWD_FORCED_RELEASE 0x0001 CAS R2 bit pattern for the backward FORCED RELEASE state.
USE_FORCED_RELEASE 0 Flag indicating if the CAS R2 line signaling state machine should use the forced release method.

Group B meanings

Here is the list of all defined group B meanings:

ACCEPT_CHARGE
ACCEPT_NO_CHARGE
REJECT_UNSPECIFIED
REJECT_UNALLOCATED_NUMBER
REJECT_NO_ROUTE_TO_NETWORK
REJECT_NO_ROUTE_TO_DESTINATION
REJECT_USER_BUSY
REJECT_SUBSCRIBER_ABSENT
REJECT_CALL_REJECTED
REJECT_NUMBER_CHANGED
REJECT_EXCHANGE_ROUTING_ERROR
REJECT_DESTINATION_OUT_OF_ORDER
REJECT_ADDRESS_INCOMPLETE
REJECT_NO_CIRCUIT_AVAILABLE
REJECT_NETWORK_OUT_OF_ORDER
REJECT_TEMPORARY_FAILURE
REJECT_SWITCHING_EQUIP_CONGESTION
REJECT_REQUESTED_CIRCUIT_NOT_AVAILABLE
REJECT_RESOURCE_UNAVAILABLE
REJECT_SERVICE_NOT_AVAILABLE
REJECT_CALL_IDENTITY_DOES_NOT_EXIST
REJECT_CALL_IDENTITY_IN_USE
REJECT_PROTOCOL_ERROR
REJECT_INTERWORKING_UNSPECIFIED

Category meanings

Here is the list of all defined category meanings:

CATEGORY_UNKNOWN
CATEGORY_OPERATOR_FRENCH
CATEGORY_OPERATOR_ENGLISH
CATEGORY_OPERATOR_GERMAN
CATEGORY_OPERATOR_RUSSIAN
CATEGORY_OPERATOR_SPANISH
CATEGORY_SUBSCRIBER
CATEGORY_SUBSCRIBER_WITH_PRIORITY
CATEGORY_DATA
CATEGORY_TEST
CATEGORY_PAYPHONE
Personal tools