Previous PageTable Of Contents../index.htmlIndexNext Page

dt_casmgmt( )

Description | Caution | Example | Errors

Name:

int dt_casmgmt (devh,cmdmsgp, replymsgp)

Inputs:

int devh

  Valid DTI board or time slot device handle

 

void *cmdmsgp

  Pointer to command message block

 

void *replymsgp

  Pointer to reply message block buffer

Returns:

0 on success
-1 on failure

Includes:

dtilib.h
ditcas.h

Category:

I/O

Mode:

synchronous

Top Of PageDescription

The dt_casmgmt( ) function is used to manage the CAS DTI templates used for the detection and transmission of signaling patterns with precise time intervals. Timing constraints in signaling protocols may make it very difficult to detect or transmit a signal at the application level and respond quickly. It is also difficult to ensure accurate timing between signal transitions, pulses or trains. This function allows the application to predefine a signal set (a set templates of signal transitions, pulses and/or trains and times to remain at each signal state) in the board's firmware, effectively offloading signal detection and transmission from the host. Signal templates, once created, apply to all channels on a board. Each signal template is enabled or disabled on a per channel basis. The signal detection and transmission characteristics are communicated to the board via the command message blocks describe below.

Each template created for a signal set must have a distinct identifier. The creation and deletion of a template is initiated by a command from the application. The changing of the parameters of a template is done by deleting the old template and adding a new template. Once defined, each template has all channels disabled, and must be enabled or disabled individually for each channel which it is intended. If a template is deleted by the application, all signal matching or transmission for that template on all channels is abandoned and the application will not be notified. If a template is disabled on a specific channel by the application, all signal matching or transmission for that template on that specific channel is abandoned and the application will not be notified.

For signal detection, once a template is enabled on a channel, all incoming signaling changes are matched against the template on that channel. If more than one template is enabled on a channel, incoming signaling changes are matched against all templates on that channel. As soon as all the parameters on a template(s) are matched, an unsolicited event (DTEV_CASTEVT) is sent to the application. The event data contains the identifier of the template that was detected. The firmware will send the event each time a transition, pulse or train of pulses is received and validated.

For signal transmission, once a template is defined and enabled, an application can transmit signals matching that template using a subcommand DTCAS_TRANSMIT_TEMPLATE. The board immediately acknowledges the send command with DTCAS_TRANSMIT_TEMPLATE_COMPLETE. The application receives an unsolicited event (DTEV_CASSENDENDEVT) after send command succeeds.

Signal detection or transmission is terminated when any of the following conditions are satisfied:

This function operates in the synchronous (blocking) mode, however, signal detection or transmission once enabled, occurs asynchronously. All data structures used for creating a template, deleting a template, enabled a template, disabling a template, detecting a signal, and transmitting a signal are defined in dticas.h.

Parameter

Description

devh

Specifies the valid board or time slot device handle returned by the call to dt_open( ). The type of handle depends on the cmdmsgp argument.

cmdmsgp

Points to the command message block. Descriptions of valid command message blocks are listed in Appendix B - Message Blocks. Although the number of fields and their meaning are different for each command message block, they all contain one or more of the data types described in the Common Data Types section.

replymsgp

Points to the reply message block buffer supplied by the application. If the function returns 0, this buffer is filled with the reply message block. Descriptions of the reply message block expected by each command is listed in Appendix B - Message Blocks. Although the number of fields and their meaning are different for each reply message block, they all contain one or more of the data types described in the Common Data Types section.


WARNING

The application is responsible for allocating a reply message block buffer of sufficient length.


If event handling is set up properly for your application, the sr_getevttype( ) function included in the SRL will return DTEV_CASTEVT, when a signal pattern match occurs and DTEV_CASSENDENDEVT, when signal transmission is complete . The DTEV_CASTEVT and DTEV_CASTSENDENDEVT event blocks are described in Appendix B - Message Blocks.

Although each message block is different, they all contain one or more of the following data types, however, there are three fields that are common to each parameter follows:


Table 4. Common Data Types

template_id

A template identifier which is a two byte quantity with no implicit value or order. It is used to identify the template in recognition events and to select the template in transmission commands. The application is free to use it for any unique identifier. However, it is recommended that the following convention be used: The 2-byte template IDs should consist of the high byte being a protocol number and the low byte being the template "meaning" (1=idle, 2=ring, 3=seize, etc.).

prefixCode

The signal pattern for matching and setting templates. This is a bit pattern that represents the signaling bits, and is used as a building block to specify templates. This parameter is similar to the dt_settssigsim( ) bitmask. The prefixCode can be 0 or a logical OR of one or more of the following values:

 

  DTB_AON - A signaling bit on

  DTB_AOFF - A signaling bit off

  DTB_BON - B signaling bit on

  DTB_BOFF - B signaling bit off

  DTB_CON - C signaling bit on (E-1 only)

  DTB_COFF - C signaling bit off (E-1 only)

  DTB_DON - D signaling bit on (E-1 only)

  DTB_DOFF - D signaling bit off (E-1 only)

 

NOTE: It is incorrect to OR ON and OFF states for the same signaling bit, i.e., it is incorrect to OR DTB_AON and DTB_AOFF. The ON state will be the one matched.

prefixInterval

The time interval. Time intervals are specified in units of 1ms, however due to the internal clock mechanism this value may vary _5ms. The maximum value which can be specified is 63 seconds.

Top Of PageCaution

This function will fail under the following conditions:

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 types.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2001, Dialogic Corporation
All rights reserved
This page generated November, 2001