Prosody generic: API: sm_channel_set_event

Prototype Definition

int sm_channel_set_event(struct sm_channel_set_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_channel_set_event_parms {
	tSMChannelId channel;					/* in */
	tSM_INT event_type;					/* in */
	tSM_INT issue_events;					/* in */
	tSMEventId event;					/* in */
} SM_CHANNEL_SET_EVENT_PARMS;

Description

This call may be used to control read/write and/or recognition event notification for channels.

Channel associated events must be allocated through a call to smd_ev_create().

In general an application can hibernate in an operating system specific way waiting for data activity on specific channels, or on any channel.

A channel may have events associated with reading data, writing data and recognition. The event_type parameter should be set to the type required as follows:

Type Associated with
kSMEventTypeReadData Recording of data
kSMEventTypeWriteData Replay of data, dial completion, tone generation
kSMEventTypeRecog Recognition of tone, digit etc

To enable channel specific event notification for a particular channel, set channel to the required channel, issue_events to kSMChannelSpecificEvent, and event to an operating system specific event handle.

To specify the event to be used when waiting for read/write/recognition activity on any channel, set channel to kSMNullChannelId, issue_events to kSMAnyChannelEvent, and event to an operating system specific event handle. To disable further use of this event make the same call but with issue_events set to kSMChannelNoEvent.

To enable "any channel" event notification for a particular channel, set channel to the required channel, issue_events to kSMAnyChannelEvent, the event parameter is not used.

To disable read/write/recognition event notification for a particular channel, set channel to the required channel, and issue_events to kSMChannelNoEvent.

By default, no events are associated with a channel.

Fields

channel
The channel with which an event is to be associated.
event_type
The type of the event to associate. One of these values: kSMEventTypeReadData, kSMEventTypeWriteData, or kSMEventTypeRecog.
issue_events
Controls the scope of events: none, one channel, or any channel. One of these values: kSMChannelNoEvent, kSMChannelSpecificEventNonIdle, kSMChannelSpecificEvent, or kSMAnyChannelEvent.
event
The event to associate.

Returns

0 if call completed successfully, otherwise a standard error such as:


This function is part of the Prosody generic API.