CA_Open_Channel()

Purpose

Open a voice channel for writing digital voice data.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
int CA_Open_Channel (
 short link_id,
 mode_t mode,
 CHANNEL_INFO_ST *chan_info_sp
);

Description

This subroutine opens a voice channel to enable a custom server to write voice data to a telephony channel. Use CA_Open_Channel() in user functions invoked by the PlayVoiceFromHost state table action. Even though the channel is opened by the custom server, the channel process owns and starts it using the previous actions. If a user function containing this action is invoked by a SendData it fails because the channel process did not start it. A channel can be opened only once concurrently. The file descriptors for open channels are not inherited by child processes, so the channel can only be written to, or closed by the process issuing CA_Open_Channel().

This function is required as part of a custom server that needs to write voice data directly to a telephony channel, such as a text to speech application.

Do not use this subroutine to open a music channel; use CA_Open_Music_Channel().

Parameters

link_id
The ID of the channel process that owns the voice channel, provided by a previous CA_Receive_DT_Msg() subroutine. The parameter is held in the DT_MSG_INFO_ST structure.
mode
Should be set to CHANNEL_WRITE_MODE. Other modes are for compatibility with previous releases.
chan_info_sp
A pointer to a CHANNEL_INFO_ST output structure that will be filled in on return as described in CHANNEL_INFO_ST. (This includes the vpack and channel identifiers.)

Return codes

0
Successful
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA _CHANNEL_ALREADY_OPEN
CA_CHANNEL_ALREADY_ALLOCATED
CA_FUNC_FAILED
CA_INTERNAL_CHANNEL_MODE_ERROR
CA_INV_ADDR
CA_INV_CHANNEL_MODE
CA_INV_LINK_ID
CA_INV_PACK
CA_NO_DEVICE
CA_NOT_CHANNEL_OWNER
CA_NOT_INIT
CA_TERMINATING

Related information

CA_Close_Channel(), CA_Open_Music_Channel(), CA_Open_Record_Channel(), CA_Play_Voice_Elements(), CA_Play_Voice_Stream(), CA_Poll().