Table of Contents Index NMS Glossary Previous Page Next Page (Page 47 of 69 in this chapter) Version


adiStartSignalDetector

Description

Starts the detection of changes in incoming out-of-band signaling bits.

Prototype

DWORD adiStartSignalDetector ( CTAHD ctahd,
unsigned initial,
unsigned mask,
unsigned timeon,
unsigned timeoff )

ctahd CTA context handle returned by ctaCreateContext.

initial Mask indicating the expected incoming line state (refer to mask below for possible values).

mask Mask indicating which bits should be monitored (For example, by setting this mask to ADI_A_BIT, all transitions of the A bit will be reported and transitions of the other bits will be ignored. The following constants are in adidef.h and can be ORed to monitor any group of bits: ADI_A_BIT, ADI_B_BIT, ADI_C_BIT, and ADI_D_BIT).

timeon Deglitching (debounce) time (in milliseconds) for the ON state of the masked bits (A bit transition to HIGH is not reported unless it exceeds timeon).

timeoff Deglitching (debounce) time (in milliseconds) for the OFF state of the masked bits (A bit transition to LOW is not reported unless it exceeds timeoff).

Return Values

Events

DSP File

This function requires that a signal DSP file has been specified in the configuration file for the board you are running on.

For QX hardware, this function is supported in the standard DSP file.

The following table lists the DSP files and their associated boards:
Boards

CT Access Version

Signal DSP File Name

AG-8, AG-24/30/48/60, AG-T1/E1

3.0

signal.dsp

AG Dual/Quad T1/E1

3.0 or 4.0

None

AG 2000

3.0 or 4.0

signal.m54

AG 4000

3.0 or 4.0

None

CG 6000C

4.0

None

Details

This function enables the detection of incoming out-of-band signaling bits. After this function is called, transitions of masked bits are reported as events, along with the current state of all bits.

If the line state does not match the value set in initial, then after qualification time, timeon, or timeoff, an event will be generated.

Note: This function is incompatible with standard call control. CTA contexts running a standard protocol are usually excluded from use of this function. Protocols usually use out-of-band signaling bits for call set-up (detection of incoming calls) and call teardown (detection of hang-up). For more information about controlling calls under specific TCPs refer to the AG CAS for the ADI Service Installation and Developer's Manual.

See Also

adiStopSignalDetector, adiQuerySignalState

Example


#define ALL_BITS (ADI_A_BIT|ADI_B_BIT|ADI_C_BIT|ADI_D_BIT)

int myMonitorSignal( CTAHD ctahd )
{
 CTA_EVENT event;
 /* start function to monitor all bit changes of 100 ms */
    if( adiStartSignalDetector( ctahd, 0, ALL_BITS, 100, 100 ) != SUCCESS )
        return MYFAILURE;

    while( 1 )
    {
        const char *pc;

        myGetEvent( &event );           /* see ctaWaitEvent example */

        switch( event.id )
        {
            case ADIEVN_SIGNAL_DETECT_DONE:
                if( event.value == CTA_REASON_STOPPED )
                    return SUCCESS;
                else
                    return MYFAILURE;

            case ADIEVN_SIGNALBIT_CHANGED:
                switch( event.value )       /* value contains the change   */
                {                           /* size contains current state */
                    case 0xA1: pc = "A ON";  break;
                    case 0xB1: pc = "B ON";  break;
                    case 0xC1: pc = "C ON";  break;
                    case 0xD1: pc = "D ON";  break;
                    case 0xA0: pc = "A OFF"; break;
                    case 0xB0: pc = "B OFF"; break;
                    case 0xC0: pc = "C OFF"; break;
                    case 0xD0: pc = "D OFF"; break;
                }
                printf( "MVIP bit change: %s\tsignalling bits = 0x%x  "                                                                                                "(%c%c%c%c)\n",
                        pc, (event.value&0xf),
                        (event.size&0x8)?'A':'-', (event.size&0x4)?'B':'-',
                        (event.size&0x2)?'C':'-', (event.size&0x1)?'D':'-' );
                break;
   /* might include cases to handle disconnect event, DTMFs, etc. */
        }
    }
}


Table of Contents Index NMS Glossary Previous Page Next Page (Page 47 of 69 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.