CA_Get_Segment()

Purpose

Retrieves a voice segment.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
#include "CA_access_db.h"
int CA_Get_Segment (
 SEGMENT_PARM_ST  *segment_parm_sp,
 unsigned long    start_element,
 unsigned long    element_count,
 unsigned char    *voice_data
);

Description

This subroutine retrieves a voice segment from the Blueworx Voice Response database based on the information provided in the SEGMENT_PARM_ST input structure. The calling routine should first call the CA_Get_Segment_Info() routine to get the complete message information and the size of the buffer required to hold the complete voice message. The calling routine can then specify the starting voice element and the number of elements to retrieve from the database. The calling routine is responsible for passing the appropriate start element number so as to keep the voice data in sequence. The element_count is defined by the calling routine based on the space it previously allocated. Once the voice data is retrieved, it is stored in the previously allocated voice_data buffer.

Parameters

segment_parm_sp
A pointer to a SEGMENT_PARM_ST input structure that is filled in as described in SEGMENT_PARM_ST.
start_element
Starting voice element (range from 1 to total_elements). If you are retrieving the entire voice segment with a single call to this routine, the value of start_element will be 1.
element_count
Number of voice elements to retrieve (range from 1 to total_elements). If you are retrieving the entire voice segment with a single call to this routine, the value of element_count will be the same as total_elements.
voice_data
Address of the previously declared space to hold the voice data.

Return codes

0
Successful; number of elements retrieved. If not equal to element_count, CA_errno is set to CA_END_OF_DATA_REACHED.
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_ACCESS_NOBUFS
CA_CHECK_LANG_FAILED
CA_END_OF_DATA_REACHED
CA_INV_ADDR
CA_INV_COMPRESSION_TYPE
CA_INV_ELEMENT_COUNT
CA_INV_REQUEST
CA_INV_SEGMENT_ID
CA_INV_START_ELEMENT
CA_LANG_NOT_FOUND
CA_LANG_NOT_IN_USE
CA_NO_MSG_RECV
CA_NOT_INIT
CA_REQ_FAILED
CA_OM_REQ_FAILED
CA_SEGMENT_NOT_FOUND
CA_TERMINATING

Related information

CA_Create_Segment(), CA_Delete_Segment(), CA_Export_Voice(), CA_Get_Segment_Info().