OpenR2
Introduction
We have integrated "OpenR2" stack into All the Next Gen Digital VEGA for handling R2 protocol.
OpenR2 VEGA support would be available on/after "R11.0 S021" release dated on 3rd Oct 2016.
OpenR2 Vega Configuration
VEGA GUI -> E1T1-> ISDN section R2 configuration -
All the parameters as mentioned below are commonly used OpenR2 parameters when we run asterisk with OpenR2.
Please refer to below wiki for details of OpenR2 configuration parameters.
OpenR2 Vega Cli commands
Please find below list of cli commands -
MFCR2 SET BLOCK <port> <channel> Reset MFC/R2 channel forcing it to BLOCKED
MFCR2 SET BLOCK <port> ALL Reset ALL MFC/R2 channel forcing it to BLOCKED
MFCR2 SET IDLE <port> <channel> Reset MFC/R2 channel forcing it to IDLE
MFCR2 SET IDLE <port> ALL Reset ALL MFC/R2 channel forcing it to IDLE
MFCR2 SHOW CHANNELS <port> Show MFC/R2 channels
MFCR2 SHOW VERSION Show OpenR2 library version
OpenR2 Vega Advanced configuration
We can have option to upload advanced r2 protocol configuration file in VEGA for OpenR2 stack.
WARNING: advanced users only as it allows you custom define tone definitions used in the protocol!
Ref: MFCR2 Configuration
We can download default/existing r2proto.conf file from VEGA and then after modification same can be uploaded back to VEGA.
Please note that new r2 protocol configuration file will take effect only after rebooting vega.
OpenR2 Vega logging
All the logging as mentioned in below wiki page to capture R2 logs will also be applicable to OpenR2 supported VEGA firmware.
Please note - If issue is happening on 1 call itself then it would be nice to capture detail logs of CAS/ISDN module as mentioned below -
debug enable router rs
debug enable isdn rs
debug enable _cas ietf1234567
debug enable _isdn ietf1234567
debug enable _logger i
sip monitor on
log display off
debug on
OpenR2 Vega log analysis
All the CAS logs are prefixed with [sXcY] keyword where X is port number and Y is channel number.
Logs prefixed with "R2-DSL" is coming from the OpenR2 stack.
We can always filter the logs based on "R2-DSL" and "[sXcY] " to get the OpenR2 stack logs for X port and Y channel call.
SIP to R2 Call flow
Calling party = 1234567 , Called party = 0101
CAS :Trace : 0074860: 00000:ISDN :[s1c31] Requested to make call (ANI=1234567, DNIS=0101, category=National Subscriber, ANI restricted = no)
CAS :Trace : 0074860: 00000:ISDN :[s1c31] Outgoing call proceeding: ANI=1234567, DNIS=0101, Category=National Subscriber
CAS :ABCD : 0074860: 00000:ISDN :[s1c31] CAS Tx >> [SEIZE] 0x00
CAS :ABCD : 0075015: 00000:R2-DSL:[s1c31] CAS Rx << [SEIZE ACK] 0x0C
CAS :Trace : 0075015: 00000:R2-DSL:[s1c31] MFC/R2 seize acknowledge received!
CAS :Trace : 0075015: 00000:R2-DSL:[s1c31] Sending DNIS digit 0
CAS :CAS-RG: 0075015: 00000:R2-DSL:[s1c31] MF Tx >> 0 [ON]
CAS :CAS-RG: 0075240: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0075240: 00000:R2-DSL:[s1c31] MF Tx >> 0 [OFF]
CAS :CAS-RG: 0075495: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0075495: 00000:R2-DSL:[s1c31] Sending category National Subscriber
CAS :CAS-RG: 0075495: 00000:R2-DSL:[s1c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 0075760: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0075760: 00000:R2-DSL:[s1c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 0075995: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0075995: 00000:R2-DSL:[s1c31] Sending ANI digit 1
CAS :CAS-RG: 0075995: 00000:R2-DSL:[s1c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 0076265: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0076265: 00000:R2-DSL:[s1c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 0076490: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0076490: 00000:R2-DSL:[s1c31] Sending ANI digit 2
CAS :CAS-RG: 0076490: 00000:R2-DSL:[s1c31] MF Tx >> 2 [ON]
CAS :CAS-RG: 0076765: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0076765: 00000:R2-DSL:[s1c31] MF Tx >> 2 [OFF]
CAS :CAS-RG: 0076995: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0076995: 00000:R2-DSL:[s1c31] Sending ANI digit 3
CAS :CAS-RG: 0076995: 00000:R2-DSL:[s1c31] MF Tx >> 3 [ON]
CAS :CAS-RG: 0077245: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0077245: 00000:R2-DSL:[s1c31] MF Tx >> 3 [OFF]
CAS :CAS-RG: 0077495: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0077495: 00000:R2-DSL:[s1c31] Sending ANI digit 4
CAS :CAS-RG: 0077495: 00000:R2-DSL:[s1c31] MF Tx >> 4 [ON]
CAS :CAS-RG: 0077740: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0077740: 00000:R2-DSL:[s1c31] MF Tx >> 4 [OFF]
CAS :CAS-RG: 0077995: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0077995: 00000:R2-DSL:[s1c31] Sending ANI digit 5
CAS :CAS-RG: 0077995: 00000:R2-DSL:[s1c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 0078265: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0078265: 00000:R2-DSL:[s1c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 0078495: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0078495: 00000:R2-DSL:[s1c31] Sending ANI digit 6
CAS :CAS-RG: 0078495: 00000:R2-DSL:[s1c31] MF Tx >> 6 [ON]
CAS :CAS-RG: 0078725: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0078725: 00000:R2-DSL:[s1c31] MF Tx >> 6 [OFF]
CAS :CAS-RG: 0078970: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0078970: 00000:R2-DSL:[s1c31] Sending ANI digit 7
CAS :CAS-RG: 0078970: 00000:R2-DSL:[s1c31] MF Tx >> 7 [ON]
CAS :CAS-RG: 0079225: 00000:R2-DSL:[s1c31] MF Rx << 5 [ON]
CAS :CAS-RG: 0079225: 00000:R2-DSL:[s1c31] MF Tx >> 7 [OFF]
CAS :CAS-RG: 0079475: 00000:R2-DSL:[s1c31] MF Rx << 5 [OFF]
CAS :Trace : 0079475: 00000:R2-DSL:[s1c31] Sending more ANI unavailable
CAS :CAS-RG: 0079475: 00000:R2-DSL:[s1c31] MF Tx >> F [ON]
CAS :CAS-RG: 0079725: 00000:R2-DSL:[s1c31] MF Rx << 1 [ON]
CAS :CAS-RG: 0079725: 00000:R2-DSL:[s1c31] MF Tx >> F [OFF]
CAS :CAS-RG: 0079980: 00000:R2-DSL:[s1c31] MF Rx << 1 [OFF]
CAS :Trace : 0079980: 00000:R2-DSL:[s1c31] Sending DNIS digit 1
CAS :CAS-RG: 0079980: 00000:R2-DSL:[s1c31] MF Tx >> 1 [ON]
CAS :Trace : 0079980: 00000:R2-DSL:[s1c31] Group A DNIS request handled
CAS :CAS-RG: 0080230: 00000:R2-DSL:[s1c31] MF Rx << 1 [ON]
CAS :CAS-RG: 0080230: 00000:R2-DSL:[s1c31] MF Tx >> 1 [OFF]
CAS :Trace : 0080475: 00010:R2-DSL:[s1c31] Handling tone change event
CAS :CAS-RG: 0080475: 00000:R2-DSL:[s1c31] MF Rx << 1 [OFF]
CAS :Trace : 0080475: 00000:R2-DSL:[s1c31] Sending DNIS digit 0
CAS :CAS-RG: 0080475: 00000:R2-DSL:[s1c31] MF Tx >> 0 [ON]
CAS :Trace : 0080475: 00000:R2-DSL:[s1c31] Group A DNIS request handled
CAS :CAS-RG: 0080725: 00000:R2-DSL:[s1c31] MF Rx << 1 [ON]
CAS :CAS-RG: 0080725: 00000:R2-DSL:[s1c31] MF Tx >> 0 [OFF]
CAS :CAS-RG: 0080970: 00000:R2-DSL:[s1c31] MF Rx << 1 [OFF]
CAS :Trace : 0080970: 00000:R2-DSL:[s1c31] Sending DNIS digit 1
CAS :CAS-RG: 0080970: 00000:R2-DSL:[s1c31] MF Tx >> 1 [ON]
CAS :Trace : 0080970: 00000:R2-DSL:[s1c31] Group A DNIS request handled
CAS :CAS-RG: 0081225: 00000:R2-DSL:[s1c31] MF Rx << 3 [ON]
CAS :CAS-RG: 0081225: 00000:R2-DSL:[s1c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 0081475: 00000:R2-DSL:[s1c31] MF Rx << 3 [OFF]
CAS :Trace : 0081475: 00000:R2-DSL:[s1c31] Sending category National Subscriber
CAS :CAS-RG: 0081475: 00000:R2-DSL:[s1c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 0081725: 00000:R2-DSL:[s1c31] MF Rx << 7 [ON]
CAS :CAS-RG: 0081725: 00000:R2-DSL:[s1c31] MF Tx >> 1 [OFF]
CAS :ABCD : 0081890: 00000:R2-DSL:[s1c31] CAS Rx << [ANSWER] 0x04
CAS :CAS-RG: 0081955: 00000:R2-DSL:[s1c31] MF Rx << 7 [OFF]
R2 to SIP Call flow
AS :ABCD : 2398397: 00000:R2-DSL:[s2c31] CAS Rx << [SEIZE] 0x00
CAS :Trace : 2398397: 00000:R2-DSL:[s2c31] Initialized R2 MF detector
CAS :Trace : 2398397: 00000:R2-DSL:[s2c31]: Received request to start call :(is_openr2.c;785)^[[1;32;40m^M
CAS :ABCD : 2398442: 00000:R2-DSL:[s2c31] CAS Tx >> [SEIZE ACK] 0x0C
CAS :CAS-RG: 2398622: 00000:R2-DSL:[s2c31] MF Rx << 0 [ON]
CAS :Trace : 2398622: 00000:R2-DSL:[s2c31] Getting DNIS digit 0
CAS :CAS-RG: 2398622: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2398872: 00000:R2-DSL:[s2c31] MF Rx << 0 [OFF]
CAS :CAS-RG: 2398872: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2399137: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :CAS-RG: 2399137: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2399392: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2399392: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2399647: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :Trace : 2399647: 00000:R2-DSL:[s2c31] Getting ANI digit 1
CAS :Trace : 2399647: 00000:R2-DSL:[s2c31] ANI so far: 1, expected length: 10
CAS :CAS-RG: 2399647: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2399922: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2399922: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2400167: 00000:R2-DSL:[s2c31] MF Rx << 2 [ON]
CAS :Trace : 2400167: 00000:R2-DSL:[s2c31] Getting ANI digit 2
CAS :CAS-RG: 2400167: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2400442: 00000:R2-DSL:[s2c31] MF Rx << 2 [OFF]
CAS :CAS-RG: 2400442: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2400687: 00000:R2-DSL:[s2c31] MF Rx << 3 [ON]
CAS :Trace : 2400687: 00000:R2-DSL:[s2c31] Getting ANI digit 3
CAS :CAS-RG: 2400687: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2400962: 00000:R2-DSL:[s2c31] MF Rx << 3 [OFF]
CAS :CAS-RG: 2400962: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2401212: 00000:R2-DSL:[s2c31] MF Rx << 4 [ON]
CAS :Trace : 2401212: 00000:R2-DSL:[s2c31] Getting ANI digit 4
CAS :CAS-RG: 2401212: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2401482: 00000:R2-DSL:[s2c31] MF Rx << 4 [OFF]
CAS :CAS-RG: 2401482: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2401732: 00000:R2-DSL:[s2c31] MF Rx << 5 [ON]
CAS :Trace : 2401732: 00000:R2-DSL:[s2c31] Getting ANI digit 5
CAS :CAS-RG: 2401732: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2401982: 00000:R2-DSL:[s2c31] MF Rx << 5 [OFF]
CAS :CAS-RG: 2401982: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2402212: 00000:R2-DSL:[s2c31] MF Rx << 6 [ON]
CAS :Trace : 2402212: 00000:R2-DSL:[s2c31] Getting ANI digit 6
CAS :Trace : 2402212: 00000:R2-DSL:[s2c31] ANI so far: 123456, expected length: 10
CAS :CAS-RG: 2402212: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2402482: 00000:R2-DSL:[s2c31] MF Rx << 6 [OFF]
CAS :CAS-RG: 2402482: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2402727: 00000:R2-DSL:[s2c31] MF Rx << 7 [ON]
CAS :Trace : 2402727: 00000:R2-DSL:[s2c31] Getting ANI digit 7
CAS :Trace : 2402727: 00000:R2-DSL:[s2c31] ANI so far: 1234567, expected length: 10
CAS :CAS-RG: 2402727: 00000:R2-DSL:[s2c31] MF Tx >> 5 [ON]
CAS :CAS-RG: 2403002: 00000:R2-DSL:[s2c31] MF Rx << 7 [OFF]
CAS :CAS-RG: 2403002: 00000:R2-DSL:[s2c31] MF Tx >> 5 [OFF]
CAS :CAS-RG: 2403252: 00000:R2-DSL:[s2c31] MF Rx << F [ON]
CAS :Trace : 2403252: 00000:R2-DSL:[s2c31] Got end of ANI
CAS :Trace : 2403252: 00000:R2-DSL:[s2c31] Requesting next DNIS with signal 0x31.
CAS :CAS-RG: 2403252: 00000:R2-DSL:[s2c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 2403522: 00000:R2-DSL:[s2c31] MF Rx << F [OFF]
CAS :CAS-RG: 2403522: 00000:R2-DSL:[s2c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 2403772: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :Trace : 2403772: 00000:R2-DSL:[s2c31] Getting DNIS digit 1
CAS :Trace : 2403772: 00000:R2-DSL:[s2c31] DNIS so far: 01, expected length: 4
CAS :Trace : 2403772: 00000:R2-DSL:[s2c31] Requesting next DNIS with signal 0x31.
CAS :CAS-RG: 2403772: 00000:R2-DSL:[s2c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 2404047: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2404047: 00000:R2-DSL:[s2c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 2404297: 00000:R2-DSL:[s2c31] MF Rx << 0 [ON]
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] Getting DNIS digit 0
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] DNIS so far: 010, expected length: 4
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] Requesting next DNIS with signal 0x31.
CAS :CAS-RG: 2404297: 00000:R2-DSL:[s2c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 2404542: 00000:R2-DSL:[s2c31] MF Rx << 0 [OFF]
CAS :CAS-RG: 2404542: 00000:R2-DSL:[s2c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 2404817: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :Trace : 2404817: 00000:R2-DSL:[s2c31] Getting DNIS digit 1
CAS :Trace : 2403772: 00000:R2-DSL:[s2c31] DNIS so far: 01, expected length: 4
CAS :Trace : 2403772: 00000:R2-DSL:[s2c31] Requesting next DNIS with signal 0x31.
CAS :CAS-RG: 2403772: 00000:R2-DSL:[s2c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 2404047: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2404047: 00000:R2-DSL:[s2c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 2404297: 00000:R2-DSL:[s2c31] MF Rx << 0 [ON]
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] Getting DNIS digit 0
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] DNIS so far: 010, expected length: 4
CAS :Trace : 2404297: 00000:R2-DSL:[s2c31] Requesting next DNIS with signal 0x31.
CAS :CAS-RG: 2404297: 00000:R2-DSL:[s2c31] MF Tx >> 1 [ON]
CAS :CAS-RG: 2404542: 00000:R2-DSL:[s2c31] MF Rx << 0 [OFF]
CAS :CAS-RG: 2404542: 00000:R2-DSL:[s2c31] MF Tx >> 1 [OFF]
CAS :CAS-RG: 2404817: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :Trace : 2404817: 00000:R2-DSL:[s2c31] Getting DNIS digit 1
CAS :Trace : 2404817: 00000:R2-DSL:[s2c31] DNIS so far: 0101, expected length: 4
CAS :Trace : 2404817: 00000:R2-DSL:[s2c31] Requesting change to Group II with signal 0x33
CAS :CAS-RG: 2404817: 00000:R2-DSL:[s2c31] MF Tx >> 3 [ON]
CAS :CAS-RG: 2405062: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2405062: 00000:R2-DSL:[s2c31] MF Tx >> 3 [OFF]
CAS :CAS-RG: 2405337: 00000:R2-DSL:[s2c31] MF Rx << 1 [ON]
CAS :Trace : 2405337: 00000:R2-DSL:[s2c31]: Call offered with ANI = 1234567, DNIS = 0101, Category = National Subscriber, ANI restricted = No :(is_openr2.c;879)^[
CAS :CAS-RG: 2405582: 00000:R2-DSL:[s2c31] MF Rx << 1 [OFF]
CAS :CAS-RG: 2405582: 00000:R2-DSL:[s2c31] MF Tx >> 7 [OFF]
CAS :Trace : 2405617: 00000:R2-DSL:[s2c31]: MFC/R2 call has been accepted on backward channel
CAS :ABCD : 2405617: 00000:R2-DSL:[s2c31] CAS Tx >> [ANSWER] 0x04
CAS :ABCD : 2405617: 00000:R2-DSL:[s2c31] CAS Raw Tx >> 0x05
[[include:TOC]]