Previous PageTable Of Contents../index.htmlIndexNext Page

r2_playbsig( )

Description | Example | Errors | Cautions | See Also

Name:

int r2_playbsig(chdev,backwardsig,forwardsig,mode)

Inputs:

int chdev

  channel device handle

 

int backwardsig

  group A/B backward signal

 

int forwardsig

  group I/II forward signal

 

int mode

  asynchronous/synchronous

Returns:

0 if success

 

error return code

Includes:

srllib.h

 

dxxxlib.h

Category:

R2MF

Mode:

asynchronous/synchronous

Top Of PageDescription

The r2_playbsig( ) function plays a specified backward R2MF signal on the specified channel until a tone-off event is detected for the specified forward signal.

The r2_playbsig( ) function is a convenience function that plays a tone and controls the timing sequence required by the R2MF compelled signaling procedure.

Compelled signaling sends each signal, until it is responded to by a return signal, which in turn is sent until responded to by the other party. See the Voice Software Reference: Voice Features Guide for more information about R2MF Compelled signaling.

NOTE:
This function calls the dx_playtone( ) function to play the tone.

Asynchronous Operation

    1. Enable forward signal detection using r2_creatfsig( ).
    2. Use SRL to asynchronously wait for TDX_CST event(s).
    3. Use sr_getevtdatap( ) to retrieve the DX_CST structure, which will contain a DE_TONEON event in the cst_event field.
    4. Determine which forward signal was detected by matching the tone ID returned cst_data field (from 101 to 115) with the forward signal Group I or Group II defines (see forwardsig argument description for a list of the forward signal defines).
    5. Decide which backward signal should be played in response to the forward signal.
    6. Use the r2_playbsig( ) function to play the desired backward signal.
    7. r2_playbsig( ) will terminate automatically when a tone-off event is detected. There is a 60-second default duration for playing the backward signal. If the forward signal tone-off is not detected within 60 seconds, the backward signal will terminate with a TDX_PLAYTONE event, and ATDX_TERMMSK will return TM_MAXTIME.

Synchronous Operation

    1. Enable forward signal detection using r2_creatfsig( ).
    2. Call dx_getevt( ) to wait for a DX_TONEON event. Events are returned in the DX_EBLK structure.
    3. Determine which forward signal was detected by matching the tone ID contained in the ev_data field (from 101 to 115) with the forward signal Group I or Group II defines (see forwardsig argument description for a list of the forward signal defines).
    4. Decide which backward signal should be played in response to the forward signal.
    5. Use the r2_playbsig( ) function to play the desired backward signal.
    6. r2_playbsig( ) will terminate automatically when a tone-off event is detected. There is a 60-second default duration for playing the backward signal. If the forward signal tone-off is not detected within 60 seconds, the backward signal will terminate, and ATDX_TERMMSK( ) will return TM_MAXTIME.

Parameter

Description

chdev

specifies the valid channel device handle obtained when the channel was opened using dx_open( ).

backwardsig

specifies the name of a Group A or Group B backward signal to play. Set to one of the defines in Group A or one of the defines in Group B:

Specify one of:

Associated
Tone ID
Group A
Group B

SIGA_1

SIGB_1

101

SIGA_2

SIGB_2

102

SIGA_3

SIGB_3

103

SIGA_4

SIGB_4

104

SIGA_5

SIGB_5

105

SIGA_6

SIGB_6

106

SIGA_7

SIGB_7

107

SIGA_8

SIGB_8

108

SIGA_9

SIGB_9

109

SIGA_10

SIGB_10

110

SIGA_11

SIGB_11

111

SIGA_12

SIGB_12

112

SIGA_13

SIGB_13

113

SIGA_14

SIGB_14

114

SIGA_15

SIGB_15

115

 

forwardsig:

specifies the name of the Group I or Group II forward signal for which a tone-on event was detected, and for which a tone-off event will terminate this function. Set to one of defines from Group I or one of the defines from Group II:

Specify one of:

Associated
Tone ID
Group I
Group II

SIGI_1

SIGII_1

101

SIGI_2

SIGII_2

102

SIGI_3

SIGII_3

103

SIGI_4

SIGII_4

104

SIGI_5

SIGII_5

105

SIGI_6

SIGII_6

106

SIGI_7

SIGII_7

107

SIGI_8

SIGII_8

108

SIGI_9

SIGII_9

109

SIGI_10

SIGII_10

110

SIGI_11

SIGII_11

111

SIGI_12

SIGII_12

112

SIGI_13

SIGII_13

113

SIGI_14

SIGII_14

114

SIGI_15

SIGII_15

115

The following procedure describes how to use the r2_playbsig( ) function:

Top Of PageExample

Top Of PageErrors

If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:

EDX_BADPARM

  • Invalid parameter

EDX_BADPROD

  • Function not supported on this board

EDX_BADTPT

  • Invalid DV_TPT entry

EDX_BUSY

  • Busy executing I/O function

EDX_AMPLGEN

  • Invalid amplitude value in TN_GEN structure

EDX_FREQGEN

  • Invalid frequency component in TN_GEN structure

EDX_FLAGGEN

  • Invalid tn_dflag field in TN_GEN structure

EDX_SYSTEM

Top Of PageCautions

The channel must be idle when calling this function.

Top Of PageSee Also


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002