Prosody generic: API: sm_find_channel

This function is only in Prosody version 1 (see also the conversion guide for further details).

Prototype Definition

int sm_find_channel(struct sm_find_channel_parms *findp)

Parameters

*findp
a structure of the following type:
typedef struct sm_find_channel_parms {
	tSM_INT is_output;					/* in */
	tSM_INT st;						/* in */
	tSM_INT ts;						/* in */
	tSM_INT card;						/* in */
	tSM_INT from_ix;					/* inout */
	tSMChannelId channel;					/* out */
	tSM_INT channel_ix;					/* out */
} SM_FIND_CHANNEL_PARMS;

Description

Given the switching location < card, st, ts > (see sm_channel_info()) of either channel's input (is_output set to zero) or output (is_output set to non-zero), returns both channel identifier (in channel) and channel index (in channel_ix - see sm_get_channel_ix()).

Normally the from_ix parameter should be set to zero before invoking this function, and the first channel corresponding to the switching location will be found. If a switching location potentially has multiple associated channels (for example multiple input channels having data switched from the same external bus location), then this function may be used to find all the associated channels if the application invokes sm_find_channel() first with from_ix set to zero, then subsequently with from_ix set to one plus the returned channel_ix from the previous call to sm_find_channel().

Fields

is_output (Only in Prosody version 1)
Whether the specified stream and timeslot are the input (0) or output (non-zero) of the channel to search for.
st (Only in Prosody version 1)
Stream of the channel to search for.
ts (Only in Prosody version 1)
Timeslot of the channel to search for.
card (Only in Prosody version 1)
The card number of the channel to search for.
from_ix (Only in Prosody version 1)
The place to start the search. Zero means to search all channels, otherwise this is derived from the index number of the last channel found.
channel (Only in Prosody version 1)
The channel that was found.
channel_ix (Only in Prosody version 1)
The index number of the channel that was found.

Returns

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


This function is part of the Prosody generic API.