CA_Create_Voice_Msg()

Purpose

Creates a voice message.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
#include "CA_access_db.h"
int CA_Create_Voice_Msg (
 CREATE_VOICE_MSG_PARM_ST  *create_voice_msg_parm_sp,
 unsigned long             start_element,
 unsigned long             element_count,
 unsigned char             *voice_data
);

Description

This subroutine creates a voice message by storing voice data referenced by the CREATE_VOICE_MSG_PARM_ST input structure in the Blueworx Voice Response database. If the message is not sent after it is created, it is deleted from the database 24 hours later.

The function is similar to the RecordVoiceMessage state table action. Before calling this subroutine, the real voice message data should already be accessible by the calling routine. The calling routine can then specify the starting voice element offset and the number of elements to add to the message.

If the voice message is very large, you may not wish to pass the entire data in a single call to this subroutine. In this case, you can call the routine several times, with appropriate values for start_element, element_count, and voice_data. A return code of 0 indicates that the voice message is complete.

This subroutine should be preceded by the CA_Create_Voice_Msg_Id() subroutine to create a unique identifier for the message.

Parameters

create_voice_msg_parm_sp
A pointer to a CREATE_VOICE_MSG_PARM_ST input structure that is filled in as described in CREATE_VOICE_MSG_PARM_ST.
start_element
Starting voice element (range from 1 to total_elements). If you are creating the entire voice message with a single call to this subroutine, the value of start_element will be 1.
element_count
Number of voice elements to add to the voice message (range from 1 to total_elements). If you are creating the entire voice message with a single call to this subroutine, the value of element_count will be the same as total_elements.
voice_data
Address of the voice data.

Return codes

0
Successful (entire voice message data stored in database)
>0
Successful; number of voice elements left to be added to database
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_ACCESS_NOBUFS
CA_DISK_FULL
CA_INV_ADDR
CA_INV_COMPRESSION_TYPE
CA_INV_MSG_ID
CA_INV_ELEMENT_COUNT
CA_INV_REQUEST
CA_INV_START_ELEMENT
CA_INV_TOTAL_ELEMENTS
CA_INV_VOICE_ELEMENT
CA_NO_MSG_RECV
CA_NOT_INIT
CA_OM_REQ_FAILED
CA_REQ_FAILED
CA_TERMINATING

Related information

CA_Create_Voice_Msg_Id(), CA_Delete_Voice_Msg(), CA_Get_Voice_Msg(), CA_Get_Voice_Msg_Info(), CA_Import_Voice(), CA_Save_Voice_Msg(), CA_Send_Voice_Msg(), CA_Set_Send_Voice_Msg_Defaults().