# adiStartPulse

Starts the generation of an out-of-band
pulse.

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStartPulse ( CTAHD ctahd, unsigned signal, unsigned timeon, unsigned timeoff)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.
signal | Bit mask/pattern to pulse (assert temporarily), which is a combination of the following constants: ADI_A_BIT (0x8) ADI_B_BIT (0x4) ADI_C_BIT (0x2) ADI_D_BIT (0x1) zero (0)
timeon | Duration of the pulse (in milliseconds) with the pattern activated.
timeoff | Duration after the pulse (in milliseconds), before the DONE event is sent.

#### Return values

Return value | Description
SUCCESS |
ADIERR_INVALID_CALL_STATE | Function not valid in the current call state.
CTAERR_FUNCTION_ACTIVE | Function already started.
CTAERR_FUNCTION_NOT_AVAIL | Necessary .dsp file was not downloaded to the board.
CTAERR_INVALID_CTAHD | Context handle is invalid.
CTAERR_INVALID_STATE | Function not valid in the current port state.
CTAERR_SVR_COMM | Server communication error.

#### Events

Event | Description
ADIEVN_PULSE_DONE | Generated by the ADI service when the pulse function terminates. The event value field contains the termination reason.

#### Details

AG 2000 and AG 2000C boards require signal.m54 to be loaded.

Use adiStartPulse to output a specified signaling bit pattern for a precise duration. This function is non-blocking and returns back to the application immediately after starting the pulse.

The out-of-band signal pattern is either the physical out-of-band signal bits of a digital protocol or it relates to the control of an analog interface board. In both cases, four signaling bits, A, B, C, and D, often written as ABCD, and defined by a bit mask (0x8, 0x4, 0x2, and 0x1, respectively), are used. The following constants are in adidef.h. They can be combined by using the OR operation to define any group of bits: ADI_A_BIT, ADI_B_BIT, ADI_C_BIT, and ADI_D_BIT. For example, if the line is off-hook, a 0 (zero) is pulsed (for example, generate a flash hook).

When using this function with an analog interface board, refer to the hardware installation manual for the analog interface board for specific information on how the A and B bits affect the telephone line.

This function is not available if the current protocol reserves use of out-of-band signaling. Typically, call control protocols take over the line signaling and the application does not need to assert or reset line codes or pulses explicitly.

adiStartPulse overrides adiAssertSignal. For the duration of the pulse, the line pattern is determined by the signaling state specified by adiStartPulse. It then reverts to the pattern previously asserted by adiAssertSignal.

For more information, refer to Performing low-level call control.