Retrieves the next message from the TCAP layer.
DWORD TCAPRetrieveMessage ( CTAHD ctahd, U8 *pMessage, TcapRecvInfo *pInfoBlk)
Argument |
Description |
ctahd |
Context handle returned by ctaCreateContext. |
pMessage |
Pointer to the address of the caller's message buffer where the received message is returned to the caller. This buffer must be at least TCAP_MSG_SIZE bytes long (currently 512). |
pInfoBlk |
Pointer to the address of the caller's receive information block where information regarding the received message is returned to the caller. |
Return value |
Description |
TCAP_SUCCESS |
|
TCAP_DRIVER |
Error occurred accessing the CPI driver. |
TCAP_NOMSG |
No event messages are waiting. |
Periodically call this function to receive messages from the TCAP layer.
When a message is received, TCAPRetrieveMessage copies the message to the caller's message buffer and performs any necessary byte order translation to convert to the host's native byte ordering. Information about the received message is returned to the caller in the pinfoBlk parameter. The event structure associated with a received message and the information returned in the receive information block depend on the type of message received from the TCAP layer (as determined by the value of the pinfoBlk.indType field).
For all events other than TCAP_EVENT_DAT_IND events, all relevant event information is copied from the message buffer directly to the caller's receive information block and the message buffer can be deallocated or reused immediately upon return from this function.
For TCAP_EVENT_DAT_IND events, however, the component portion, application component, parameters, and any user dialog information present in the message remain in the caller's message buffer upon return from this function. Therefore, the caller must preserve the contents of the message buffer until all component data, component parameters, and dialog portion user information has been retrieved through TCAPGetComp and processed completely or copied to a safe location.
pinfoBlk defines the type of event received and other event-specific attributes of the incoming message. For more information, refer to General receive information block structure.