Prosody generic: API: sm_channel_dispatcher_connect

Prototype Definition

int sm_channel_dispatcher_connect(struct sm_channel_dispatcher_connect_parms *dp)

Parameters

*dp
a structure of the following type:
typedef struct sm_channel_dispatcher_connect_parms {
	tSMDispatcherId dest;					/* in */
	tSMChannelId channel;					/* in */
} SM_CHANNEL_DISPATCHER_CONNECT_PARMS;

Description

Connects an input channel to a dispatcher, replacing the previous dispatcher connected to it. The dest must be a dispatcher created by a call to sm_udp_dispatcher_create(). or the value kSMNullDispatcherId. The input channel, channel, will use data dispatcher to pass on data it produces (e.g. for record or receive operations).

There must be no operation in progress (e.g. record) on the input half of the channel when this function is called.

The default dispatcher for a channel is kSMNullDispatcherId, which dispatches data through the API (e.g. via smdc_rx_data()).

Fields

dest
The dispatcher to which the channel should pass data
channel
The channel that will produce the data

Returns

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


This function is part of the Prosody generic API.