call_DecodeCallRequest()
Decode address, facilities and user data in a call request packet.
#include "call.h" Diagnostic call_DecodeCallRequest ( CallSetupData data, CallBuffer buffer, CallBufferSize size, LBoolean standard );
data | output for decoded data |
buffer | input buffer containing call request data |
size | size of buffer in bytes |
standard | TRUE for standard addressing mode |
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.
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.
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 */ }