INT_VOICE_ST

This structure describes the format of voice data stored in Blueworx Voice Response voice elements.

data
A pointer to the voice element buffer.
total_elements
The number of voice elements in the buffer, for export, or the capacity of the buffer in voice elements, for import. Each element (corresponding to 0.2 seconds of voice data) is COMPRESSED_ELEMENT_LENGTH bytes for compressed voice, or UNCOMPRESSED_ELEMENT_LENGTH for uncompressed voice.
compression_type
For export, the compression type of the input voice elements. For import, the required compression type of the output voice elements. Possible values are COMPRESSED_VOICE or UNCOMPRESSED_VOICE.
format
For export, the format of the input voice elements. For import, the required format of the output voice elements. Possible values are FORMAT_ALAW or FORMAT_ULAW. If compression_type is COMPRESSED_VOICE, this value is ignored.

You can use CA_Get_DT_Info() to find out if the trunk type is E1 (use FORMAT_ALAW) or T1 (use FORMAT_ULAW).