X.25 Call Setup

Decode Call Request

call_DecodeCallRequest()

Decode address, facilities and user data in a call request packet.

Syntax
#include "call.h"

Diagnostic  call_DecodeCallRequest
    (
        CallSetupData     data,
        CallBuffer        buffer,
        CallBufferSize    size,
        LBoolean          standard
    );
dataoutput for decoded data
bufferinput buffer containing call request data
sizesize of buffer in bytes
standardTRUE for standard addressing mode
Description

call_DecodeCallRequest() decodes the address, facilities and user data of a call request packet into a C language representation. The example code given below shows how to set up the data structures passed to call_DecodeCallRequest(). If any member of the output structure is NULL, the corresponding part of the packet is not decoded.

If the packet is successfully decoded, non-zero fields in the facilities structure are decoded values.

Return Values

If successful, call_DecodeCallRequest() returns dg_NONE. Otherwise, it returns a diagnostic value indicating the reason the decode failed. This code can be used in the diagnostic field of a clear request packet.

See Also

call_EncodeCallRequest()

Example
CallSetupDataStruct    callSetupData;
AddressBlock           addressBlock;
FacilitiesStruct       facilitiesStruct;
char                   userData[call_USER_DATA_MAX];
Diagnostic             result;

/* Set up call setup data block */
callSetupData.address       = &addressBlock;
callSetupData.facilities    = &facilitiesStruct;
callSetupData.userData      = userData;
callSetupData.userDataCount = call_USER_DATA_MAX;

result = call_DecodeCallRequest(&callSetupData,
                                packet,
                                packetSize,
                                call_STANDARD_ADDRESS_FORMAT);

if (result != dg_NONE)
{
    /* Error decoding */
    /* Encode clear request and reject the call */
    lgo_ConnectReject(cid, packet, packetSize);
}
else
{
    /* Addresses are in addressBlock.std */
    /* Non-zero entries in facilities are decoded values */
    /* Check userDataCount > 0 */
}