TCAPGetComp

Extracts a specific component and, optionally, its associated parameters from a TCAP transaction data message received through TCAPRetrieveMessage.

Prototype

DWORD TCAPGetComp ( U8 *pMessage, U8 index, TcapComp *pComp, U16 *pParamLen, U8 *pParamBuf)

Argument

Description

pMessage

Pointer to the address of the caller's message buffer containing a message of type TCAP_EVENT_DAT_IND that was previously received through TCAPRetrieveMessage.

index

Index of the component being retrieved. Valid range is 0 to (TcapTransEvent.numComps - 1), where TcapTransEvent is the event structure associated with this message that was returned by TCAPRetrieveMessage.

pComp

Pointer to the address of the caller's TcapComp area where the component body is returned.

pParamLen

On input, this field is set to the maximum number of bytes of parameters to be copied into the caller's parameter buffer. On return, this field is set to the actual number of bytes of parameters copied to the caller's parameter buffer.

pParamBuf

Pointer to the address of the caller's parameter buffer where parameters belonging to this component are returned to the caller. The size of this buffer is passed initially in pParamLen.


Return values

Return value

Description

TCAP_SUCCESS

 

TCAP_INDEX

Specified component index does not exist in the message buffer passed by the caller, or it was not a valid TCAP transaction message in the buffer.

TCAP_OVERFLOW

Caller's parameter buffer was not large enough to hold the parameters for this component.

TCAP_PARAM

pComp buffer is NULL.

TCAP_UNINIT

Supplied message buffer (pMessage) is not a valid message.


Details

Preserve the contents of the message buffer between the call to TCAPRetrieveMessage that returned the message and the last call to TCAPGetComp to retrieve the last component. Once the last call to TCAPGetComp returns, the message buffer can be released or reused.

If the caller does not expect any parameters with this component, then NULL pointers can be specified for pParamLen and pParamBuf.

If the number of bytes of component parameters belonging to the specified component exceeds the size of the caller's parameter buffer (as specified by the input value of pParamLen), then: