call_DecodeClearRequest()
Decode cause and diagnostic codes, address, facilities and user data in a clear request packet.
#include "call.h" Diagnostic call_DecodeClearRequest ( CallClearData data, CallBuffer buffer, CallBufferSize size, LBoolean standard );
data | output for decoded data |
buffer | input buffer containing call clear data |
size | size of buffer in bytes |
standard | TRUE for standard addressing mode |
call_DecodeClearRequest() decodes cause and diagnostic codes, address, facilities and user data
of a clear request packet into a C language representation. The example code
given below shows how to set up the data structures passed to call_DecodeClearRequest().
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_DecodeClearRequest() 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.
CallClearDataStruct callClearData; 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; callClearData.callSetupData = &callSetupData; result = call_DecodeClearRequest(&callClearData, packet, packetSize, call_STANDARD_ADDRESS_FORMAT); if (result != dg_NONE) { /* Error decoding */ } else { /* Cause and diagnostic are in callClearData */ /* Addresses are in addressBlock.std */ /* Non-zero entries in facilities are decoded values */ /* Check userDataCount > 0 */ }