다음을 통해 공유


lineSetTerminal (Compact 2013)

3/26/2014

This function enables an application to specify which terminal information related to the specified line, address, or call is to be routed. The lineSetTerminal function can be used while calls are in progress on the line to allow an application to route these events to different devices as required.

Syntax

LONG WINAPI lineSetTerminal(
  HLINE hLine,
  DWORD dwAddressID,
  HCALL hCall,
  DWORD dwSelect,
  DWORD dwTerminalModes,
  DWORD dwTerminalID,
  DWORD bEnable 
);

Parameters

  • hLine
    Handle to an open line device.
  • dwAddressID
    Address on the given open line device. An address identifier is permanently associated with an address; the identifier remains constant across operating system upgrades.
  • hCall
    Handle to a call. The call state of hCall can be any state, if the dwSelect parameter is CALL.
  • dwSelect
    Value that specifies whether the terminal setting is requested for the line, the address, or just the specified call. If line or address is specified, events either apply to the line or address itself or serve as a default initial setting for all new calls on the line or address. This parameter uses one of the LINECALLSELECT constants.
  • dwTerminalModes
    Class or classes of low-level events to be routed to the given terminal. This parameter uses one or more of the LINETERMMODE constants.
  • dwTerminalID
    Device identifier of the terminal device where the given events are to be routed. Terminal identifiers are small integers in the range of zero to one less than dwNumTerminals, where dwNumTerminals, and the terminal modes each terminal is capable of handling, are returned by the lineGetDevCaps function.

    Note

    These terminal identifiers have no relation to other device identifiers and are defined by the service provider using device capabilities.

  • bEnable
    If TRUE, dwTerminalID is valid and the specified event classes are routed to or from that terminal. If FALSE, these events are not routed to or from the terminal device with identifier equal to dwTerminalID.

Return Value

Returns a positive request identifier if the function is completed asynchronously, or a negative error number if an error occurs. The dwParam2 parameter of the corresponding LINE_REPLY message is zero if the function succeeds or it is a negative error number if an error occurs. The following table shows the return values for this function.

Value

Description

LINEERR_INVALADDRESSID

The address identifier is invalid.

LINEERR_NOMEM

Not enough memory is available.

LINEERR_INVALCALLHANDLE

The handle to the call is invalid.

LINEERR_OPERATIONUNAVAIL

The operation is invalid.

LINEERR_INVALCALLSELECT

The specified select parameter is invalid.

LINEERR_OPERATIONFAILED

The operation failed.

LINEERR_INVALLINEHANDLE

The handle to the open line device is invalid.

LINEERR_RESOURCEUNAVAIL

The resources are unavailable.

LINEERR_INVALTERMINALID

The terminal identifier is invalid.

LINEERR_UNINITIALIZED

A parameter is uninitialized.

LINEERR_INVALTERMINALMODE

The terminal mode is invalid.

Remarks

An application can use this function to route certain classes of low-level line events to the specified terminal device or to suppress the routing of these events. For example, voice can be routed to an audio I/O device (headset), lamps and display events can be routed to the local phone device, and button events and ringer events can be suppressed altogether.

This function can be called at any time, even when a call is active on the given line device. This allows a user to switch from using the local phone set to another audio I/O device. This function can be called multiple times to route the same events to multiple terminals simultaneously. To reroute events to a different terminal, the application should first disable routing to the existing terminal and then route the events to the new terminal.

Terminal identifier assignments are made by the line's service provider. Device capabilities indicate only which terminal identifiers the service provider has available. Service providers that do not support this type of event routing would indicate that they have no terminal devices (dwNumTerminals in the LINEDEVCAPS structure would be zero).

Invoking lineSetTerminal on a line or address affects all existing calls on that line or address, but does not affect calls on other addresses. It also sets the default for future calls on that line or address. A line or address that has multiple connected calls active at one time can have different routing in effect for each call.

Disabling the routing of low-level events to a terminal when these events are not currently routed to or from that terminal does not necessarily generate an error so long as the function succeeds (the specified events are not routed to or from that terminal).

TAPI routes call progress tones and messages to the same location as set by the lineSetTerminal function for "media". For example, if audio signals are going to the phone, then so will busy signals (analog) or Q.931 messages indicating busy (digital).

Requirements

Header

tapi.h

Library

TAPI32.dll

See Also

Reference

TAPI Line Device Functions
lineGetDevCaps
LINE_REPLY
LINEDEVCAPS