Previous PageTable Of Contents../index.htmlIndexNext Page

dx_sethook( )

Description | Cautions | Example 1: | Example 2: | Errors | See Also

Name:

int dx_sethook(chdev,hookstate,mode)

Inputs:

int chdev

  valid Dialogic channel device handle

 

int hookstate

  hook state (on-hook or off-hook)

 

unsigned short mode

  asynchronous/synchronous

Returns:

0 if successful

 

-1 if failure

Includes:

srllib.h

 

dxxxlib.h

Category:

Configuration

Mode:

asynchronous/synchronous

Top Of PageDescription

The function parameters are defined as follows:

Parameter

Description

chdev

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

hookstate

forces the hookstate of the specified channel to on-hook or off-hook. The following values can be specified:

 

DX_ONHOOK:

set to on-hook state

 

DX_OFFHOOK:

set to off-hook state

mode

specifies whether to run dx_sethook( ) asynchronously or synchronously. Specify one of the following:

 

EV_ASYNC:

Run dx_sethook( ) asynchronously.

 

EV_SYNC:

Run dx_sethook( ) synchronously (default).

The dx_sethook( ) function provides control of the hookswitch status of the specified channel. A hookswitch state may be either on-hook or off-hook.

NOTES:
1. Do not call this function for a digital T-1 SCbus configuration that includes a D/240SC, D/240SC-T1, DTI/241SC, or DTI/301SC board. Transparent signaling for SCbus digital interface devices is not supported.
2. Calling dx_sethook( ) with no parameters clears the loop current and silence history from the channel's buffers.

Asynchronous Operation

To run dx_sethook( ) asynchronously, set the mode field to EV_ASYNC. The function will return 0 to indicate it has initiated successfully, and will generate a termination event to indicate completion. Use the SRL Event Management functions to handle the termination event.

If running asynchronously, termination is indicated by a TDX_SETHOOK event. The cst_event field in the data structure will specify one of the following:

Use the Event Management function sr_getevtdatap( ) to return a pointer to the DX_CST structure.

ATDX_HOOKST( ) will also return the type of hookstate event.

Synchronous Operation

By default, this function runs synchronously.

If running synchronously (default) dx_sethook( ) will return 0 when complete.

Top Of PageCautions

None.

Top Of PageExample 1: Using dx_sethook( ) in synchronous mode

Top Of PageExample 2: Using dx_sethook( ) in asynchronous mode

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_SYSTEM

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