Share via


TSPI_lineGenerateTone

This function generates the specified tone inband over the specified call. Invoking this function with a zero for dwToneMode aborts any tone generation currently in progress on the specified call. Invoking TSPI_lineGenerateTone or the TSPI_lineGenerateDigits function while tone generation is in progress aborts the current tone generation or digit generation in progress and initiates the generation of the newly specified tone or digits.

LONG TSPIAPI TSPI_lineGenerateTone(
  HDRVCALL hdCall, 
  DWORD dwEndToEndID, 
  DWORD dwToneMode, 
  DWORD dwDuration, 
  DWORD dwNumTones, 
  LPLINEGENERATETONE const lpTones 
);

Parameters

  • hdCall
    Service provider's handle to the call on which tone generation is to be performed. The call state of hdCall can be any state except idle.

  • dwEndToEndID
    Unique, uninterpreted identifier of the request for its entire lifetime, that is, until the matching LINE_GENERATE message is sent. The service provider includes this identifier as one of the parameters in the message.

  • dwToneMode
    Tone to be generated. Tones can be either standard or custom. A custom tone is composed of a set of arbitrary frequencies. A small number of standard tones are predefined. The duration of the tone is specified by dwDuration for both standard and custom tones. If dwToneMode is set to zero, any digit or tone generation in progress is canceled. This parameter uses one and only one of the LINETONEMODE constants.

  • dwDuration
    Duration, in milliseconds, during which the tone is sustained. A value of zero for dwDuration uses a default duration for the specified tone. The following table shows the default values for this paramter.

    Value Description
    CUSTOM Infinite duration
    RINGBACK Infinite duration
    BUSY Infinite duration
    BEEP Infinite duration
    BILLING Fixed (single cycle) duration

    This parameter is not validated by TAPI when this function is called.

  • dwNumTones
    Number of entries in the lpTones array. This parameter is ignored if dwToneMode is not equal to LINETONEMODE_CUSTOM.

  • lpTones
    Pointer to a LINEGENERATETONE array that specifies the tone's components. This parameter is ignored for noncustom tones. If lpTones is a multifrequency tone, the various tones are played simultaneously.

Return Values

Returns zero if the function succeeds or an error number if an error occurs. The following table shows the return values for this function.

Value Description
LINEERR_INVALCALLHANDLE The handle to the call is invalid.
LINEERR_NOMEM Not enough memory is available.
LINEERR_INVALCALLSTATE The call state is invalid.
LINEERR_OPERATIONUNAVAIL The operation is unavailable.
LINEERR_INVALTONEMODE The tone mode is invalid.
LINEERR_OPERATIONFAILED The operation failed.
LINEERR_INVALTONE The tone is invalid.
LINEERR_RESOURCEUNAVAIL The resource is unavailable.

Remarks

TSPI_lineGenerateTone returns zero (success) when the tone generation is successfully initiated; not when the generation of the tone is finished. The function allows the inband generation of several predefined tones, such as ringback, busy tones, and beep. It also allows for the fabrication of custom tones by specifying their component frequencies, cadence and volume, if this is supported by the service provider. Because these tones are generated as inband tones, the call would typically have to be in the connected state for tone generation to be effective. When tone generation is complete, or when tone generation is canceled, a LINE_GENERATE message is sent to TAPI.

Only one inband generation request (tone generation or digit generation) is allowed to be in progress per call. This implies that if tone generation is currently in progress on a call, invoking either TSPI_lineGenerateDigits or TSPI_lineGenerateTone cancels the tone generation. The service provider must terminate any tone generation in progress when a subsequent TSPI_lineGenerateDigits or TSPI_lineGenerateTone function is invoked.

The corresponding function at the TAPI level does not include the formal parameter dwEndToEndID. At that level, there is no end-to-end marking. TAPI uses end-to-end marking at the TSPI level to distinguish one TSPI_lineGenerateTone request from another.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Tapicomn.h.
Link Library: Coredll.lib.

See Also

TSPI_lineGenerateDigits

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.