Actions

CAS R2 BACK DIGITS

Revision as of 15:34, 22 October 2018 by Luc Morissette (talk | contribs) (LM Added dial plan examples and end_of_called number)

The default CAS R2 scripts included with Toolpack present a way to configure the sequence of tone requests sent by the backward end.

To learn how to set a CAS R2 variable in Toolpack, refer to the latest Web_Portal Tutorial Guide.

The digit meanings in this article are the ones defined in the CAS R2 ITU specification. Digit meanings may vary depending on the variant specification.

Compelled sequence and information exchange

Casr2 fwd bwd diagram.png

In most implementations, the information available from CAS R2 signaling is exchanged with a compelled sequences of tones. In a compelled sequence, the forward end sends a digit and the backward end responds with a second digit. The backward end confirms reception of the digit by stopping to emit, and waits for the forward end to do so as well to initiate the next sequence. In a way, the forward end is mostly passive: it responds to backward end requests, except when the requests cannot be met, or for the first sequence.

One way of representing such exchanges can be expressed as follows:

Called number: 4506558993
Forward  : 4  5  0  6  5  5  8  9  9  3 
Backward :   1  1  1  1  1  1  1  1  1  6

In the previous example, the forward end emits the first digit of the called number '4'. The backward end responds with the '1' digit, which request the next called number digit. The exchanges goes on until the backward end has received all the digits it needed, and closed the exchange with the '6' digit, which means the call was accepted.

The incoming end may (and will, most of the time) request the calling number and the calling party category as well:

Called number: 4506558993
Calling number: 4506559511
Calling party category: 1 (Subscriber without priority)
Forward  : 4  5  0  6  5  5  8  9  9  3  1  4  5  0  6  5  5  9  5  1  1
Backward :   1  1  1  1  1  1  1  1  1  5  5  5  5  5  5  5  5  5  5  5  6

In this example, the backward end requested the calling party category (using digit '5') after having received all the called number digits. Still using digit '5', it then requested the calling number. Once it was fully received, the backward end accepted the call with digit '6'.

Here is a second example where the backward send an extra '5' when gathering the calling number (The picture also shows the different CAS R2 concepts and TelcoBridges Cas R2 script BACK_DIGITS variable):

Called number: 4506558993
Calling number: 4506559511
Calling party category: 2 (Subscriber without priority)

Backward digit string overview

Finally, here is a final example:

Called number: 4506558993
Calling number: 12345
Calling party category: 2 (Subscriber with priority)
Forward  : 4  5  0  6  5  5  8  9  9  3  2  1  2  3  4  5  F  2
Backward :   1  1  1  1  1  1  1  1  1  5  5  5  5  5  5  5  3  6

In this final example, the backward end sent an extra extra '5' digit, and the backward end responded with 'F' to mark the end of the calling number. Then, the backward end sent digit '3' which represent two things: request of the category again, and also signify to the forward end that the next digit belongs to a different grouping (named "Group B"). Once the category was received, the backward end accepted the call with the '6'.

The BACK_DIGITS variable

In the CAS R2 default scripts found in Toolpack, the BACK_DIGITS variable expresses the digits that must be emitted from the backward end (incoming CAS R2 call). A functioning BACK_DIGITS variable that complies with the second example of the last section would be:

BACK_DIGITS = "111111111555555536"

However, such a sequence has many problems. Firsthand, the called number may be invalid and the call should be refused. To let Toolpack handle the decision of accepting or refusing the call when in group B, the 'V' symbol is used. With the aid of tables found in the script, Toolpack will be able to find the appropriate digit to emit considering the acceptation or refusal of the call.

BACK_DIGITS = "11111111155555553V"

To simplify the variable contents, the 'A' symbol may be used. What it does is send the '5' digit until 'F' is received. The variable would be slimmer:

BACK_DIGITS = "1111111115A3V"

With such a string, the only thing to worry about is the length of the called number. If the called number length may vary, the number of '1's must match the longest possible number. In the case where the forward end receives a '1' when it has sent all its digits, the conventional way of handling this is for the forward end to not emit anything for a while, until the backward end detects this condition and requests something else. In this case, the default scripts in Toolpack will handle this case gracefully and skip the remaining '1's found in the BACK_DIGITS variable.

(2.7+ only) The 'G' symbol may be used to indicate that '1's should be sent until no digit or a 'F' is received. The BACK_DIGITS thus becomes the following:

BACK_DIGITS = "G5A3V"

(2.7.31+ only) The 'P' symbol may be used like the 'G' symbol, except that the number of called number digits is determined by the DIAL_PLAN variable, such as the following:

 DIAL_PLAN =
 {
 --  Matching pattern        Number of called number digits to request
   { "^12",                  6  }, -- Expect 6 called number digits, must start with "12" to match
   { "^0",                   10 }, -- Expect 4 digits total, start with 0
   { "^[23456789]",          10 }  -- Expect 10 digits total, start with everything except 0 and 1
   -- If no matching pattern works, an unlimited number of called number digits
   -- are requested until the remote equipment stops providing them.
 };


(2.7.36+ only) The default end digit is 'F' or value 15. Some variants may be using value 12 ("C") or if end digit is not used, change it to "NO_DIGIT" like this:

 VARIABLES =
 {
   --  Variable name           Default value   Description
   { "BACK_DIGITS",          "G5A3V",        "The backward digit string." },
   { "END_OF_CALLED_NUMBER", NO_DIGIT,  },
 };