Prosody generic: API: sm_switch_channel_output
Prototype Definition
int sm_switch_channel_output(struct sm_switch_channel_parms *switchp)
Parameters
- *switchp
-
a structure of the following type:
typedef struct sm_switch_channel_parms {
tSMChannelId channel; /* in */
tSM_INT st; /* in */
tSM_INT ts; /* in */
/* Only in Prosody version 2 (TiNG) */
enum kSMTimeslotType type; /* in */
/* End of part only in Prosody version 2 (TiNG) */
} SM_SWITCH_CHANNEL_PARMS;
Description
Assigns (or de-assigns) a timeslot
(overriding any automatically assigned timeslot) to
channel.
Applicable only to channels located on Prosody
ISA card speech processing modules.
The streams which can be used with this call depend on the type
of Prosody carrier card being used. On the ISA Prosody card, the
accessible streams are on the external bus (MVIP), while on
other cards they are special internal streams which are only
accessible to Prosody and the switch driver.
No timeslot can be used as output by more than one channel at a
time.
To assign an SCbus timeslot for
channel,
set
st
to 24 (the stream assigned to the SCbus) and
ts
to an SCbus timeslot number.
SCbus access is not implemented.
To assign an MVIP bus timeslot for
channel,
set
st
to a value between 0 and 7 for the DSo stream required and set
ts
to the required timeslot number.
To de-assign any kind of timeslot, set both
st
and
ts
to a value of -1.
Note that the hardware can only support one type of companding
on a stream. This means that A-law and mu-law cannot be mixed on
the same stream (though data and non-data can be mixed) so, for
example, on a P1 (PCI) card, it is not possible to use stream
48, timeslot 0 for A-law at the same time as using stream 48,
timeslot 1 for mu-law, but it is possible to use A-law for
timeslots on stream 48 while having mu-law timeslots on stream
49. Note that it is an error to try to specify a different type
for the same timeslot on two channels simultaneously. i.e. if
one channel is reading A-law from 48:7, then any other channel
reading from 48:7 must not try to use it as mu-law or data.
This function can be used with Prosody X cards in TDM only applications
for backward compatibility. To use this function with a Prosody X
card the module
datafeed
must be downloaded.
Fields
- channel
- The channel from which the output is to be switched.
- st
- The destination stream.
- ts
- The destination timeslot.
- type (Only in Prosody version 2 (TiNG))
- The data encoding used on this timeslot.
Returns
0
if call completed successfully, otherwise a standard error such as:
- ERR_SM_DEVERR - device error
- ERR_SM_WRONG_CHANNEL_TYPE - if channel has no output
- ERR_SM_BAD_PARAMETER - if invalid parameter specified or channel is associated with BR module
This function is part of the Prosody generic API.