Поделиться через


lineAnswer (Compact 2013)

3/26/2014

This function answers the specified offering call.

Syntax

LONG WINAPI lineAnswer(
  HCALL hCall,
  LPCSTR lpsUserUserInfo,
  DWORD dwSize 
);

Parameters

  • hCall
    Handle to the call to be answered. The application must be an owner of this call. The call state of hCall must be offering or accepted.
  • lpsUserUserInfo
    Pointer to a string containing user-user information to be sent to the remote party at the time the call is answered. This pointer can be left NULL if no user-user information is to be sent. User-user information is only sent if supported by the underlying network. For more information, see LINEDEVCAPS. The protocol discriminator field for the user-user information, if required, should appear as the first byte of the buffer pointed to by lpsUserUserInfo, and must be accounted for in the dwSize parameter.
  • dwSize
    Size, in bytes, of the user-user information in lpsUserUserInfo. If lpsUserUserInfo is NULL, no user-user information is sent to the calling party and dwSize is ignored.

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_INUSE

The line is in use.

LINEERR_OPERATIONUNAVAIL

The operation is unavailable. With code division multiple access (CDMA), this function will fail if a call is currently in progress.

CDMA does not provide the necessary functionality to support the following TAPI functions:

Some cellular carriers provide equivalent functionality through the flash feature, which with TAPI 2.2 can be accessed with the lineGenerateDigits function. Because the exact flash sequences are controlled by the cellular providers, the application must be completely aware of the necessary codes implemented by the cellular providers.

LINEERR_INVALCALLHANDLE

The call handle is invalid

LINEERR_OPERATIONFAILED

The operation failed.

LINEERR_INVALCALLSTATE

The call state is invalid.

LINEERR_RESOURCEUNAVAIL

The resource is unavailable.

LINEERR_INVALPOINTER

The pointer is invalid.

LINEERR_UNINITIALIZED

The parameter is uninitialized.

LINEERR_NOMEM

Not enough memory is available.

LINEERR_USERUSERINFOTOOBIG

The user-user information is too big.

LINEERR_NOTOWNER

The application is not the owner of the call.

Remarks

When a new call arrives, applications with an interest in the call are sent a LINE_CALLSTATE message to provide the new call handle and to inform the application about the call's state and the privileges to the new call (such as monitor or owner). The application with owner privilege for the call can answer this call using lineAnswer. After the call has been successfully answered, the call typically transitions to the connected state. Initially, only one application is given owner privilege to the incoming call.

In some telephony environments (like ISDN), where user alerting is separate from call offering, the application can have the option to accept a call prior to answering or to reject or redirect the offering call.

If a call comes in (is offered) at the time another call is already active, invoking lineAnswer connects to the new call. The effect this has on the existing active call depends on the line's device capabilities. The first call can be unaffected, it can automatically be dropped, or it can automatically be placed on hold. The appropriate LINE_CALLSTATE messages report state transitions to the application about both calls.

In a bridged situation, if a call is connected but in the LINECONNECTEDMODE_INACTIVE state, it can be joined using the lineAnswer function.

The application has the option to send user-user information at the time of the answer. Even if user-user information can be sent, there is no guarantee that the network will deliver this information to the calling party. An application should consult a line's device capabilities to determine whether sending user-user information upon answering the call is available.

Note

This function is for TAPI version 2.0.

Requirements

Header

tapi.h

Library

TAPI32.dll

See Also

Reference

TAPI Line Device Functions
LINE_CALLSTATE (TAPI)
LINE_REPLY
LINEDEVCAPS