Prosody generic: API

The following functions are provided by the Prosody generic API:

API call W Description
sm_channel_alloc_placed()   Allocate a channel on a specific module
sm_channel_collector_connect()   Connect a collector to a channel
sm_channel_datafeed_connect()   Connect a datafeed to a channel
sm_channel_dispatcher_connect()   Connect a channel to a dispatcher
sm_channel_get_datafeed()   Obtain a datafeed from an output channel
sm_channel_info()   Get channel information so data can be switched through to it
sm_channel_input_data_redirect()   Redirect the data received by an input channel to a datafeed
sm_channel_output_source_datafeed_connect()   Provide alternative source data to an output channel
sm_channel_release()   Release a previously allocated channel
sm_channel_set_event()   Associate event with specific/any channel
sm_channel_set_output_rate()   Configure the sample rate for a channel's output
sm_close_module()   Close a Prosody module
sm_close_prosody()   Closes a card, finishing potential use with Prosody.
sm_collector_destroy()   Destroy a data collector
sm_collector_get_event()   Obtain an event for a collector
sm_collector_status()   Determine collector status
sm_dispatcher_destroy()   Destroy a data dispatcher
sm_error_name()   Generate a name from an error code
sm_get_card_info()   Return information about card hosting one or more modules
sm_get_card_rev()   Return information about card hardware revision
sm_get_channel_type()   Determine channel type
sm_get_driver_info()   Return driver version information
sm_get_module_info()   Determine if firmware running, obtain module workload
sm_get_stream_info()   Return information about a TDM stream associated with a module
sm_module_get_event()   Obtain an event for a module
sm_module_status()   Report the status of a Prosody module connection
sm_open_module()   Open a Prosody module
sm_sec_module()   Configure module for API related traffic to be encrypted
sm_shutdown_module()   Initiate the closing of a Prosody module
sm_switch_channel_input()   Switch data from TDM timeslot to channel
sm_switch_channel_output()   Switch channel data to TDM timeslot
sm_tdmrx_create()   Create a TDM[rx] endpoint
sm_tdmrx_destroy()   Destroy a previously allocated TDM[rx]
sm_tdmrx_get_datafeed()   Obtain a datafeed from a TDM[rx]
sm_tdmtx_create()   Create a TDM[tx] endpoint
sm_tdmtx_datafeed_connect()   Connect a datafeed to a TDM[tx]
sm_tdmtx_destroy()   Destroy a previously allocated TDM[tx]
sm_udp_collector_create()   Create a UDP data collector
sm_udp_dispatcher_create()   Create a UDP data dispatcher
smd_ev_create()   Create operating system event for channel
smd_ev_free()   Free previously created operating system event
smd_ev_wait()   Wait for notification of operating system event
sm_config_module_switching() D Control assignment of channels to external bus timeslots
sm_get_card_switch_id() D Determine switch driver associated with card
sm_get_channel_ix() D Map channel identifier to integer
sm_get_channel_module_id() D Return the module on which a channel is located.
sm_get_firmware_info() D Determine what firmware has been downloaded.
sm_get_module_card_id() D Return the card on which a module is located.
sm_reset_module() D Hardware reset a module

Key to W column:

D Deprecated

This document is also available as separate pages for each function.


Prosody generic: API: sm_channel_alloc_placed

Prototype Definition

int sm_channel_alloc_placed(struct sm_channel_alloc_placed_parms *channelp)

Parameters

*channelp
a structure of the following type:
typedef struct sm_channel_alloc_placed_parms {
	tSMChannelId channel;					/* out */
	enum kSMChannelType {
		kSMChannelTypeInput,
		kSMChannelTypeOutput,
		kSMChannelTypeHalfDuplex,
		kSMChannelTypeFullDuplex,
	} type;							/* in */
	tSMModuleId module;					/* in */
	tSM_INT caps_mask;					/* in */
} SM_CHANNEL_ALLOC_PLACED_PARMS;

Description

Allocates, on a specific module, a new channel to generate output data and/or process input data. The type parameter determines which kind of channel is allocated

If the call completes successfully, the parameter channel will be set to the identifier for that channel.

The task of supporting this channel is assigned by the driver to the module specified by the module parameter.

The caps_mask parameter is ignored.

Fields

channel
The allocated channel.
type
The type of channel to allocate. One of these values:
kSMChannelTypeInput
An input channel, which can be used to record data, recognise digits and tones etc.
kSMChannelTypeOutput
An output channel, which can be used to replay data, generate tones, dial DTMF digits etc.
kSMChannelTypeHalfDuplex
A channel that may operate either in input mode or in output mode (but not both simultaneously, except for DTMF detection). Resources required by a channel are allocated only as soon as they are needed, so there is no advantage in using a half-duplex channel over a full-duplex channel, and since it is typically more complicated for an application to handle half-duplex channels than full-duplex channels, it is recommended that full-duplex channels always be used in preference to half-duplex channels.
kSMChannelTypeFullDuplex
A channel that may operate both in input mode and in output mode (simultaneous input and output possible).
module
A value obtained from sm_open_module() which indicates the module where the channel is to be allocated.
caps_mask
Bitmask of required capabilities, or zero to indicate that the default capabilities are required. This field is ignored.

Returns

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


Prosody generic: API: sm_channel_collector_connect

Prototype Definition

int sm_channel_collector_connect(struct sm_channel_collector_connect_parms *dp)

Parameters

*dp
a structure of the following type:
typedef struct sm_channel_collector_connect_parms {
	tSMCollectorId source;					/* in */
	tSMChannelId channel;					/* in */
} SM_CHANNEL_COLLECTOR_CONNECT_PARMS;

Description

Connects a collector to an output channel, replacing the previous collector connected to it. The source must be a collector created by a call to sm_udp_collector_create(). or the value kSMNullCollectorId. The output channel, channel, will use data collector as its source of data (e.g. for replay or transmit operations).

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

The default collector for a channel is kSMNullCollectorId, which collects data through the API (e.g. via smdc_tx_data()).

Fields

source
The collector which the channel should use as a source of data
channel
The channel that will receive the data

Returns

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


Prosody generic: API: sm_channel_datafeed_connect

Prototype Definition

int sm_channel_datafeed_connect(struct sm_channel_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_channel_datafeed_connect_parms {
	tSMDatafeedId data_source;				/* in */
	tSMChannelId channel;					/* in */
} SM_CHANNEL_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to an input channel. The data_source must be a datafeed obtained a call to any of the *_get_datafeed() functions. The input channel, channel, will receive any data that is generated by the object from which data_source was derived.

To disconnect a channel from a datafeed, specify kSMNullDatafeedId as the tSMDatafeedId in data_source.

Requires the module datafeed to have been downloaded.

Fields

data_source
The datafeed acting as a source of data
channel
The channel that will receive the data

Returns

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


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:


Prosody generic: API: sm_channel_get_datafeed

Prototype Definition

int sm_channel_get_datafeed(struct sm_channel_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_channel_datafeed_parms {
	tSMChannelId channel;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_CHANNEL_DATAFEED_PARMS;

Description

Request a datafeed identifier from an output channel. This identifer can subsequently be used in a call to any of the *_datafeed_connect() functions to connect the output from the channel to a destination. It is valid until the channel is released. Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the module datafeed to have been downloaded.

Fields

channel
The output channel from which to obtain a datafeed
datafeed
The datafeed object associated with the output channel

Returns

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


Prosody generic: API: sm_channel_info

Prototype Definition

int sm_channel_info(struct sm_channel_info_parms *infop)

Parameters

*infop
a structure of the following type:
typedef struct sm_channel_info_parms {
	tSMChannelId channel;					/* in */
	tSM_INT card;						/* out */
	tSM_INT ost;						/* out */
	tSM_INT ots;						/* out */
	enum kSMTimeslotType otype;				/* out */
	tSM_INT ist;						/* out */
	tSM_INT its;						/* out */
	enum kSMTimeslotType itype;				/* out */
	tSM_INT group;						/* out */
	tSM_INT caps_mask;					/* out */
} SM_CHANNEL_INFO_PARMS;

Description

This call allows an application to locate a previously allocated speech processing resource so that a data can be switched through to it by means of a call to the Aculab switch driver API.

If channel is an identifier for a previously allocated input, half-duplex, or full-duplex channel, then the parameters ist, and its returned by this call may be assigned to the ost and ots parameters of a switch driver CONNECT_MODE call to sw_set_output, with <ist, its> in the OUTPUT_PARMS parameter block being set to the source of the data to be processed by the channel.

If channel is an identifier for a previously allocated output, half-duplex, or full-duplex channel, then the parameters ost, and ots returned by this call may be assigned to the ist and its parameters of a switch driver CONNECT_MODE call to sw_set_output with <ost, ots> int the OUTPUT_PARMS parameter block being set to the destination for data to be generated by the channel.

The parameter card is an obsolete parameter set to the value -1

The parameter group is an obsolete parameter set to the value zero.

The parameter caps_mask is an obsolete parameter set to the value zero.

Fields

channel
The channel whose information is required.
card
Obsolete parameter
ost
The channel's output stream.
ots
The channel's output timeslot.
otype
The output timeslot type. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.
ist
The channel's input stream.
its
The channel's input timeslot.
itype
The input timeslot type. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.
group
Obsolete parameter.
caps_mask
Obsolete parameter.

Returns

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


Prosody generic: API: sm_channel_input_data_redirect

Prototype Definition

int sm_channel_input_data_redirect(struct sm_channel_input_data_redirect_parms *redp)

Parameters

*redp
a structure of the following type:
typedef struct sm_channel_input_data_redirect_parms {
	tSMChannelId channel;					/* in */
	tSM_INT enable;						/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_CHANNEL_INPUT_DATA_REDIRECT_PARMS;

Description

When enable is non-zero, request a datafeed identifier from an input channel that will carry the data usually retrieved through the api (e.g. sm_get_recorded_data() ). This identifer can subsequently be used in a call to any of the *_datafeed_connect() functions to connect the input data from the channel to a destination. Note though that the data will be raw octets and not audio data, so the destination must be expecting raw octets. The identifier is valid until the channel is released or this function is called with enable set to zero.

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

Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the modules datafeed and redirect to have been downloaded.

Fields

channel
The channel to redirect the received data on
enable
Enables (non-zero) or disables (zero) the redirection of data
datafeed
The datafeed which the received data is passed to when redirected

Returns

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


Prosody generic: API: sm_channel_output_source_datafeed_connect

Prototype Definition

int sm_channel_output_source_datafeed_connect(struct sm_channel_output_source_datafeed_connect_parms *outsrcp)

Parameters

*outsrcp
a structure of the following type:
typedef struct sm_channel_output_source_datafeed_connect_parms {
	tSMChannelId channel;					/* in */
	tSMDatafeedId data_source;				/* in */
	tSM_INT threshold;					/* in */
	tSM_INT timeout;					/* in */
} SM_CHANNEL_OUTPUT_SOURCE_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to an output channel. The output channel will use the datafeed as its source of data (e.g. for replay or transmit operations).

The data can be buffered before being made available to the output channel for processing. The buffer will wait until it has either threshold octets of data, or timeout milliseconds have passed since data was last provided to the buffer, before allowing the output channel to process the data. This buffering is repeated if the buffer underruns.

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

Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the modules datafeed and redirect to have been downloaded.

Fields

channel
The channel to connect the source to
data_source
The datafeed supplying the data
threshold
The number of octets to collect before data is ready
timeout
The data ready timeout in milliseconds. Zero means no timeout is used.

Returns

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


Prosody generic: API: sm_channel_release

Prototype Definition

int sm_channel_release(tSMChannelId channel)

Parameters

channel
The channel to release.

Description

Releases previously allocated channel. All resources used by the channel are freed. Any operations in progress on the channel are aborted. It is an error to attempt to refer to a channel which has been released.

Returns

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


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:


Prosody generic: API: sm_channel_set_output_rate

Prototype Definition

int sm_channel_set_output_rate(struct sm_channel_set_output_rate_parms *ratep)

Parameters

*ratep
a structure of the following type:
typedef struct sm_channel_set_output_rate_parms {
	tSMChannelId channel;					/* in */
	tSM_INT sample_rate;					/* in */
} SM_CHANNEL_SET_OUTPUT_RATE_PARMS;

Description

Configures the sample rate (in samples per second) to be used by the output half of a channel.

The sample rate should be configured before using the channel for any operation (such as replay) which depends on it. otherwise it will default to 8000 samples per second.

If a channel is connected to a timeslot using sm_switch_channel_output() the sample rate must be 8000, whether set explicitly or allowed to default to 8000.

Fields

channel
The channel to be configured.
sample_rate
The sample rate.

Returns

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


Prosody generic: API: sm_close_module

Prototype Definition

int sm_close_module(struct sm_close_module_parms *closep)

Parameters

*closep
a structure of the following type:
typedef struct sm_close_module_parms {
	tSMModuleId module_id;					/* in */
} SM_CLOSE_MODULE_PARMS;

Description

Closes a Prosody module that was opened with sm_open_module(). Note that this function only releases any resources allocated by sm_open_module() and does not tidy up other resources connected with the module which may have been allocated by other API functions or the application. It is a serious error to close a module on which there are open channels.

Fields

module_id
The value obtained from sm_open_module() to be closed.

Returns

0 if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_close_prosody

Prototype Definition

int sm_close_prosody(struct sm_close_prosody_parms *closep)

Parameters

*closep
a structure of the following type:
typedef struct sm_close_prosody_parms {
	tSMCardId card_id;					/* in */
} SM_CLOSE_PROSODY_PARMS;

Description

Reverses the effect of sm_open_prosody_x(), or sm_open_prosody_s_v3(). If, after closing the card, you want to use Prosody API functions which refer to this card you must invoke sm_open_prosody_x(), or sm_open_prosody_s_v3() again. It is a serious error to close a card on which there are open modules.

Fields

card_id
The card to close.

Returns

0 if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_collector_destroy

Prototype Definition

int sm_collector_destroy(tSMCollectorId collector)

Parameters

collector
A tSMCollectorId that has been prevously created by a call to sm_udp_collector_create().

Description

Destroys collector invalidating the tSMCollectorId.

Returns

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


Prosody generic: API: sm_collector_get_event

Prototype Definition

int sm_collector_get_event(struct sm_collector_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_collector_event_parms {
	tSMCollectorId collector;				/* in */
	tSMEventId event;					/* out */
} SM_COLLECTOR_EVENT_PARMS;

Description

If the call completes successfully event will hold the tSMEventId belonging to collector. The tSMEventId is valid until the collector is destroyed using sm_collector_destroy(). This event will be signalled when a status change occurs on the collector. When the event is signalled the user must call sm_collector_status() to discover the nature of the status change.

Fields

collector
The collector
event
The event identifier

Returns

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


Prosody generic: API: sm_collector_status

Prototype Definition

int sm_collector_status(struct sm_collector_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_collector_status_parms {
	tSMCollectorId collector;				/* in */
	enum kSMCollectorStatus {
		kSMCollectorStatusRunning,
		kSMCollectorStatusGotPorts,
		kSMCollectorStatusNewPeer,
		kSMCollectorStatusGotPortsIPv6,
		kSMCollectorStatusNewPeerIPv6,
	} status;						/* out */
	union {
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
		} ports;					/* out */
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
		} peer;						/* out */
		struct {
			struct in6_addr address;		/* out */
			int port;				/* out */
		} ports_ipv6;					/* out */
		struct {
			struct in6_addr address;		/* out */
			int port;				/* out */
		} peer_ipv6;					/* out */
	} u;							/* out */
} SM_COLLECTOR_STATUS_PARMS;

Description

Returns the current status of the collector or an error to indicate that an error has occurred.

When the collector event, obtained from sm_collector_get_event(), is signalled the user must call this function to determine the nature of the status change. The change in status may indicate that an error occurred whilst processing a user request or it may be notifiying the user of a change to the previous state of the collector.

Fields

collector
The collector to interrogate
status
One of these values:
kSMCollectorStatusRunning
The collector is running normally.
kSMCollectorStatusGotPorts
Indicates that IPv4 port information is available.
kSMCollectorStatusNewPeer
Indicates that UDP packets are being received from a new IPv4 source.
kSMCollectorStatusGotPortsIPv6
Indicates that IPv6 port information is available.
kSMCollectorStatusNewPeerIPv6
Indicates that UDP packets are being received from a new IPv6 source.
u
Additional information relating to the current status of the collector
ports
This field is only valid if the status is kSMCollectorStatusGotPorts.
address
The address on which this collector is listening.
port
The UDP port number on which this collector is listening
peer
This field is only valid if the status is kSMCollectorStatusNewPeer.
address
The address from which the data was received.
port
The UDP port number from which the data was received.
ports_ipv6
This field is only valid if the status is kSMCollectorStatusGotPortsIPv6.
address
The address on which this collector is listening.
port
The UDP port number on which this collector is listening
peer_ipv6
This field is only valid if the status is kSMCollectorStatusNewPeerIPv6.
address
The address from which the data was received.
port
The UDP port number from which the data was received.

Returns

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


Prosody generic: API: sm_dispatcher_destroy

Prototype Definition

int sm_dispatcher_destroy(tSMDispatcherId dispatcher)

Parameters

dispatcher
A tSMDispatcherId that has been prevously created by a call to sm_udp_dispatcher_create().

Description

Destroys dispatcher invalidating the tSMDispatcherId.

Returns

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


Prosody generic: API: sm_error_name

Prototype Definition

char *sm_error_name(struct sm_error_name_parms *errp)

Parameters

*errp
a structure of the following type:
typedef struct sm_error_name_parms {
	tSM_INT code;						/* in */
	char name[80];						/* out */
} SM_ERROR_NAME_PARMS;

Description

Generates a name for the supplied Prosody error code. The name is one of the standard names, unless the error code is unrecognised, in which case a suitable representation is used.

Fields

code
The error code whose name is required.
name
The generated name.

Returns

Returns the address of the name field in the supplied parameter structure. This allows the function return value to be used as a parameter to another function call. For example:

printf("Error calling sm_replay_start(): %s\n", sm_error_name(&e));

Since this is never null, it can be safely used immediately. .


Prosody generic: API: sm_get_card_info

Prototype Definition

int sm_get_card_info(struct sm_card_info_parms *cardinfop)

Parameters

*cardinfop
a structure of the following type:
typedef struct sm_card_info_parms {
	tSMCardId card;						/* in */
	enum kSMCarrierCardType {
		kSMCarrierCardTypeYetUnknown,
		kSMCarrierCardTypeISAS2,
		kSMCarrierCardTypeBR4,
		kSMCarrierCardTypeBR8,
		kSMCarrierCardTypePCIP1,
		kSMCarrierCardTypePCIC1,
		kSMCarrierCardTypePS,
		kSMCarrierCardTypePX,
	} card_type;						/* out */
	tSM_INT card_detected;					/* out */
	tSM_INT module_count;					/* out */
	tSM_UT32 physical_address;				/* out */
	tSM_UT32 io_address;					/* out */
	tSM_UT32 physical_irq;					/* out */
	char serial_no[kSMMaxSerialNoText];			/* out */
} SM_CARD_INFO_PARMS;

Description

Retrieves information about card hosting Prosody modules installed in system.

On return, card_type will be set to one of the following values:

Card Type Use
kSMCarrierCardTypeYetUnknown Card type not yet determined by driver.
kSMCarrierCardTypeISAS2 Obsolete card.
kSMCarrierCardTypeBR4 Obsolete card.
kSMCarrierCardTypeBR8 Obsolete card.
kSMCarrierCardTypePCIP1 Obsolete card.
kSMCarrierCardTypePCIC1 Obsolete card.
kSMCarrierCardTypePS Prosody S virtual 'card'
kSMCarrierCardTypePX Prosody X card

The parameter card_detected is obsolete.

The number of modules detected on the card is returned in module_count.

The parameters physical_address , io_address , and physical_irq are obsolete.

Some carrier cards have a machine readable serial number. For such cards the serial number is returned as a zero terminated text string in the character array serial_no.

Fields

card
The card about which information is required
card_type
The type of the card One of these values:
kSMCarrierCardTypeYetUnknown
The card type has not been determined.
kSMCarrierCardTypeISAS2
Obsolete card type.
kSMCarrierCardTypeBR4
Obsolete card type.
kSMCarrierCardTypeBR8
Obsolete card type.
kSMCarrierCardTypePCIP1
Obsolete card type.
kSMCarrierCardTypePCIC1
Obsolete card type.
kSMCarrierCardTypePS
A Prosody S virtual 'card'. This is a software entity which emulates a digital access card and provides a number of channels of telephony via the host's IP (Internet Protocol) communications.
kSMCarrierCardTypePX
A Prosody X card. This is a card which is controlled by IP (Internet Protocol).
card_detected
Obsolete parameter.
module_count
The number of modules on this card.
physical_address
Obsolete parameter.
io_address
Obsolete parameter.
physical_irq
Obsolete parameter.
serial_no
The serial number of this card.

Returns

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


Prosody generic: API: sm_get_card_rev

Prototype Definition

int sm_get_card_rev(struct sm_card_rev_parms *cardrevp)

Parameters

*cardrevp
a structure of the following type:
typedef struct sm_card_rev_parms {
	tSMCardId card;						/* in */
	tSM_INT rev[8];						/* out */
	char rev_additional[kSMMaxRevAddText];			/* out */
} SM_CARD_REV_PARMS;

Description

Obsolete call - not applicable to Prosody X or Prosody S.

Fields

card
The card about which information is required
rev
main revision information
rev_additional
additional revision information

Returns

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


Prosody generic: API: sm_get_channel_type

Prototype Definition

int sm_get_channel_type(tSMChannelId channel)

Parameters

channel
The channel whose type is to be returned.

Description

Given a channel identifier, channel, returns its type as was specified for sm_channel_alloc_placed() type parameter when channel allocated.

Returns

Channel type value (greater than or equal to zero) if call completed successfully, otherwise a standard error such as:


Prosody generic: API: sm_get_driver_info

Prototype Definition

int sm_get_driver_info(struct sm_driver_info_parms *drvinfop)

Parameters

*drvinfop
a structure of the following type:
typedef struct sm_driver_info_parms {
	tSM_INT major;						/* out */
	tSM_INT minor;						/* out */
	tSM_INT step;						/* out */
	tSM_INT custom;						/* out */
	tSM_INT quality;					/* out */
	tSM_INT buildno0;					/* out */
	tSM_INT buildno1;					/* out */
} SM_DRIVER_INFO_PARMS;

Description

Retrieves information about TiNG library version controlling Prosody modules installed in system.

On return, the parameters major, minor and step will be set to the values X, Y, and Z respectively of the three element version no. for the library X.Y.Z.

The custom parameter will be set to a non-zero value if the driver build is a custom special build of the driver for a specific customer.

The quality parameter will be set to one of the following character values:

Quality Character
'B' Beta quality version
'T' Test version
'D' Development (or alpha quality) version
'I' Released version

The buildno0 and buildno1 parameters are for Aculab use only. However, note that it is essential to include these two parameters when describing the version to Aculab support staff.

Fields

major
Major version number
minor
Minor version number
step
Version step.
custom
Indicator of custom software
quality
Quality code
buildno0
Part of build code
buildno1
Another part of build code

Returns

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


Prosody generic: API: sm_get_module_info

Prototype Definition

int sm_get_module_info(struct sm_module_info_parms *moduleinfop)

Parameters

*moduleinfop
a structure of the following type:
typedef struct sm_module_info_parms {
	tSMModuleId module;					/* in */
	tSM_INT firmware_running;				/* out */
	tSM_INT firmware_id;					/* out */
	tSM_INT average_loading;				/* out */
	tSM_INT max_loading;					/* out */
	tSM_INT module_slot;					/* out */
	tSM_INT min_stream;					/* out */
	tSM_INT stream_count;					/* out */
} SM_MODULE_INFO_PARMS;

Description

Fetches information about a module. Note that fields apart from module_slot , min_stream and stream_count are undefined for Prosody S and for Prosody X. The cpumon facility should be used to obtain work load information.

Fields

module
A value obtained from sm_open_module() which indicates the module on which information is required.
firmware_running
Indicator of whether or not firmware is running on this module. Zero if firmware is not running. Note that this refers to the kernel, not individual software modules.
firmware_id
This field is obsolete.
average_loading
The percentage (0..100) average work load of the module over the last second.
max_loading
The percentage (0..100) peak work load of the module over the last second.
module_slot
The position of the module on its carrier card.
min_stream
The number of the first stream accessible to this module.
stream_count
The count of streams accessible to this module.

Returns

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


Prosody generic: API: sm_get_stream_info

Prototype Definition

int sm_get_stream_info(struct sm_stream_info_parms *streaminfop)

Parameters

*streaminfop
a structure of the following type:
typedef struct sm_stream_info_parms {
	tSMModuleId module;					/* in */
	tSM_INT stream;						/* in */
	char serial_no[kSMMaxSerialNoText];			/* out */
	tSM_INT serial_port_ix;					/* out */
	tSM_INT timeslot_count;					/* out */
} SM_STREAM_INFO_PARMS;

Description

Retrieves information about a TDM stream associated with ProsodyS virtual card and provided by a thin TDM interface card installed in system.

On entry the parameter stream indicates module TDM stream for which information is required. On return the parameter serial_no indicates serial number of thin TDM interface card, serial_port_ix indicates stream index (starting from zero) relative to that thin TDM interface card. timeslot_count indicates number of timeslots in stream.

Fields

module
A value obtained from sm_open_module() which indicates the module on which information is required.
stream
Stream number for which information required (or index of that stream relative to module)
serial_no
The serial number of card providing this stream.
serial_port_ix
Serial port on card providing this stream
timeslot_count
The count of timeslots in this stream.

Returns

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


Prosody generic: API: sm_module_get_event

Prototype Definition

int sm_module_get_event(struct sm_module_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_module_event_parms {
	tSMModuleId module_id;					/* in */
	tSMEventId event;					/* out */
} SM_MODULE_EVENT_PARMS;

Description

If the call completes successfully event will hold the tSMEventId belonging to module_id. The tSMEventId is valid until the module is closed using sm_close_module(). This event will be signalled when a status change occurs on the module. When the event is signalled the user must call sm_module_status() to discover the nature of the status change.

Fields

module_id
The module
event
The event identifier

Returns

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


Prosody generic: API: sm_module_status

Prototype Definition

int sm_module_status(struct sm_module_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_module_status_parms {
	tSMModuleId module_id;					/* in */
	enum kSMModuleStatus {
		kSMModuleStatusRunning,
		kSMModuleStatusShutdown,
	} status;						/* out */
} SM_MODULE_STATUS_PARMS;

Description

Reports the status of a Prosody module connection that was opened with sm_open_module(). Card types that use asynchronous control methods may block in sm_close_module(). After using sm_shutdown_module() to initiate the closing of a module, this function will report a status of kSMModuleStatusShutdown when sm_close_module() will not block.

Fields

module_id
The value obtained from sm_open_module() to be closed.
status
One of these values:
kSMModuleStatusRunning
The module connection is running.
kSMModuleStatusShutdown
The module connection has been shutdown.

Returns

0 if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_open_module

Prototype Definition

int sm_open_module(struct sm_open_module_parms *module_parmsp)

Parameters

*module_parmsp
a structure of the following type:
typedef struct sm_open_module_parms {
	tSMCardId card_id;					/* in */
	tSM_UT32 module_ix;					/* in */
	tSMModuleId module_id;					/* out */
} SM_OPEN_MODULE_PARMS;

Description

Opens a specified Prosody module.

Fields

card_id
The card, which has been opened (e.g. with sm_open_prosody_x() ) and on which is the module to be opened,
module_ix
The physical module number of the module to open. This is the zero-based index of the module on the card specified by card_id. The module numbers refer to positions on the card, so a card which has connectors for plugging in a module will always use the same number for a module plugged into a particular position regardless of which other positions are occupied.
module_id
The opened module.

Returns

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


Prosody generic: API: sm_sec_module

Prototype Definition

int sm_sec_module(struct sm_sec_module_parms *module_parmsp)

Parameters

*module_parmsp
a structure of the following type:
typedef struct sm_sec_module_parms {
	tSMModuleId module_id;					/* in */
	tSM_INT exclude_data_to_module;				/* in */
	tSM_INT exclude_data_from_module;			/* in */
	tSM_INT key_id;						/* in */
	char *context;						/* in */
	tSMSecCallback encdec;					/* in */
} SM_SEC_MODULE_PARMS;

Description

Sets up encrypted communication with module. Must be used in conjunction with a compatible external encryption library, for example kmlib3des. If encryption is required, this function must be invoked immediately after calling sm_open_module(). Requires an encryption capable kernel to be running on the module.

Fields

module_id
An id for an open module previously obtained from sm_open_module()
exclude_data_to_module
If non-zero causes bulk data (e.g. replay data) sent to module to be excluded from encryption.
exclude_data_from_module
If non-zero causes bulk data (e.g. record data) sent from module to be excluded from encryption.
key_id
An id from an external encryption library used to identify a previously agreed key for use with this module.
context
The context from an external encryption library used by TiNG library in callbacks.
encdec
The callback with type void (*)(tSM_INT,tSM_INT,void*,tSM_UT8*) from an external encryption library used by TiNG library to encrypt and decrypt messages.

Returns

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


Prosody generic: API: sm_shutdown_module

Prototype Definition

int sm_shutdown_module(struct sm_shutdown_module_parms *shutdownp)

Parameters

*shutdownp
a structure of the following type:
typedef struct sm_shutdown_module_parms {
	tSMModuleId module_id;					/* in */
} SM_SHUTDOWN_MODULE_PARMS;

Description

Initiates the closing of a Prosody module that was opened with sm_open_module(). Card types that use asynchronous control methods may block in sm_close_module(). This function initiates the close procedure and does not block. The resources used are not released until sm_close_module() is called, which may still block unless sm_module_status() has reported a status of kSMModuleStatusShutdown. It is a serious error to close a module on which there are open channels.

Fields

module_id
The value obtained from sm_open_module() to be closed.

Returns

0 if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_switch_channel_input

Prototype Definition

int sm_switch_channel_input(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 */
	enum kSMTimeslotType type;				/* in */
} SM_SWITCH_CHANNEL_PARMS;

Description

Assigns (or de-assigns) a timeslot to channel. The same timeslot may be used as input to several channels.

This function can be used with Prosody X cards in TDM only applications for backward compatibility. For new applications it is recommended that sm_tdmrx_create() and sm_tdmrx_get_datafeed() be used. To use this function with a Prosody X card the module datafeed must be downloaded.

Fields

channel
The channel to which the input is to be switched.
st
The source stream.
ts
The source timeslot.
type
The data encoding used on this timeslot. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.

Returns

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


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 */
	enum kSMTimeslotType type;				/* in */
} SM_SWITCH_CHANNEL_PARMS;

Description

Assigns (or de-assigns) a timeslot to channel. No timeslot can be used as output by more than one channel at a time.

This function can be used with Prosody X cards in TDM only applications for backward compatibility. For new applications it is recommended that sm_tdmtx_create() and sm_tdmtx_datafeed_connect() be used. 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
The data encoding used on this timeslot. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.

Returns

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


Prosody generic: API: sm_tdmrx_create

Prototype Definition

int sm_tdmrx_create(struct sm_tdmrx_create_parms *tdmrxp)

Parameters

*tdmrxp
a structure of the following type:
typedef struct sm_tdmrx_create_parms {
	tSMTDMrxId tdmrx;					/* out */
	tSMModuleId module;					/* in */
	tSM_INT stream;						/* in */
	tSM_INT timeslot;					/* in */
	enum kSMTimeslotType type;				/* in */
} SM_TDMRX_CREATE_PARMS;

Description

Allocates, on a specific module, a new TDM[rx] to receive incoming TDM data. The TDM[rx] will receive it's data from the specified stream and timeslot. The streams which can be used with this call depend on the type of Prosody carrier card being used. They are special internal streams which are only accessible to Prosody and the switch driver. All data received by the tdmrx can be read from its datafeed. The datafeed may be obtained using sm_tdmrx_get_datafeed().

If the call completes successfully, the parameter tdmrx will be set to the identifier for that tdmrx.

On Prosody X this function requires the module datafeed to have been downloaded.

Fields

tdmrx
The newly created TDM[rx].
module
A value obtained from sm_open_module() which indicates the module where the TDM[rx] is to be allocated.
stream
The TDM stream to which the TDM[rx] will be attached
timeslot
The TDM timeslot to which the TDM[rx] will be attached
type
The data encoding used on this timeslot. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.

Returns

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


Prosody generic: API: sm_tdmrx_destroy

Prototype Definition

int sm_tdmrx_destroy(tSMTDMrxId tdmrx)

Parameters

tdmrx
A tSMTDMrxId that has been prevously created by a call to sm_tdmrx_create() .

Description

Destroys tdmrx and invalidates the tSMTDMrxId.

Returns

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


Prosody generic: API: sm_tdmrx_get_datafeed

Prototype Definition

int sm_tdmrx_get_datafeed(struct sm_tdmrx_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_tdmrx_datafeed_parms {
	tSMTDMrxId tdmrx;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_TDMRX_DATAFEED_PARMS;

Description

Request a datafeed identifier from a TDM[rx]. This identifer can subsequently be used in a call to any of the *_datafeed_connect() functions except sm_tdmtx_datafeed_connect(). It is valid until the TDM[rx] is destroyed. Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the module datafeed to have been downloaded.

Fields

tdmrx
The tdm[rx] from which to obtain a datafeed
datafeed
The datafeed object associated with the TDM[rx]

Returns

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


Prosody generic: API: sm_tdmtx_create

Prototype Definition

int sm_tdmtx_create(struct sm_tdmtx_create_parms *tdmtxp)

Parameters

*tdmtxp
a structure of the following type:
typedef struct sm_tdmtx_create_parms {
	tSMTDMtxId tdmtx;					/* out */
	tSMModuleId module;					/* in */
	tSM_INT stream;						/* in */
	tSM_INT timeslot;					/* in */
	enum kSMTimeslotType type;				/* in */
} SM_TDMTX_CREATE_PARMS;

Description

Allocates, on a specific module, a new TDM[tx] to send TDM data. The TDM[tx] will send it's data to the specified stream and timeslot. The streams which can be used with this call depend on the type of Prosody carrier card being used. They are special internal streams which are only accessible to Prosody and the switch driver. The tdmtx will begin sending data when it has been succesfully connected to a valid datafeed using sm_tdmtx_datafeed_connect().

If the call completes successfully, the parameter tdmtx will be set to the identifier for that tdmtx.

Fields

tdmtx
The newly created TDM[tx].
module
A value obtained from sm_open_module() which indicates the module where the TDM[tx] is to be allocated.
stream
The TDM stream to which the TDM[tx] will be attached
timeslot
The TDM timeslot to which the TDM[tx] will be attached
type
The data encoding used on this timeslot. One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.

Returns

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


Prosody generic: API: sm_tdmtx_datafeed_connect

Prototype Definition

int sm_tdmtx_datafeed_connect(struct sm_tdmtx_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_tdmtx_datafeed_connect_parms {
	tSMDatafeedId data_source;				/* in */
	tSMTDMtxId tdmtx;					/* in */
} SM_TDMTX_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to a TDM[tx]. The data_source must be a datafeed obtained from any of the *_get_datafeed() functions except sm_tdmrx_get_datafeed(). The TDM[tx] tdmtx will receive any data that is generated by the output task from which data_source was derived.

To disconnect a TDM[tx] from a datafeed, specify kSMNullDatafeedId as the tSMDatafeedId in data_source

Requires the module datafeed to have been downloaded.

Fields

data_source
The datafeed acting as a source of data
tdmtx
The TDM[tx] that will receive the data

Returns

0 if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_tdmtx_destroy

Prototype Definition

int sm_tdmtx_destroy(tSMTDMtxId tdmtx)

Parameters

tdmtx
A tSMTDMtxId that has been prevously created by a call to sm_tdmtx_create() .

Description

Destroys tdmtx and invalidates the tSMTDMtxId.

Returns

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


Prosody generic: API: sm_udp_collector_create

Prototype Definition

int sm_udp_collector_create(struct sm_udp_collector_create_parms *dp)

Parameters

*dp
a structure of the following type:
typedef struct sm_udp_collector_create_parms {
	tSMCollectorId collector;				/* out */
	tSMModuleId module;					/* in */
	enum kSMCollectorType {
		kSMCollectorTypeIPv4,
		kSMCollectorTypeIPv6,
	} type;							/* in */
	struct in_addr address;					/* in */
	struct in6_addr ipv6_address;				/* in */
} SM_UDP_COLLECTOR_CREATE_PARMS;

Description

Allocates, on a specific module, a new UDP collector to receive incoming UDP data. If the call completes successfully, the parameter collector will be set to the identifier for that collector.

A collector is automatically allocated a port number for incoming UDP data, this information may be obtained from sm_collector_status().

This requires the module fromudp to have been downloaded.

Fields

collector
The newly created collector.
module
A value obtained from sm_open_module() which indicates the module where the collector to be allocated.
type
One of these values:
kSMCollectorTypeIPv4
The collector is to receive IPv4 packets
kSMCollectorTypeIPv6
The collector is to receive IPv6 packets
address
The address on which this UDP collector is to listen if type is kSMCollectorTypeIPv4.
ipv6_address
The address on which this UDP collector is to listen if type is kSMCollectorTypeIPv6.

Returns

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


Prosody generic: API: sm_udp_dispatcher_create

Prototype Definition

int sm_udp_dispatcher_create(struct sm_udp_dispatcher_create_parms *dp)

Parameters

*dp
a structure of the following type:
typedef struct sm_udp_dispatcher_create_parms {
	tSMDispatcherId dispatcher;				/* out */
	tSMModuleId module;					/* in */
	enum kSMDispatcherType {
		kSMDispatcherTypeIPv4,
		kSMDispatcherTypeIPv6,
	} type;							/* in */
	SOCKADDR_IN destination;				/* in */
	SOCKADDR_IN source;					/* in */
	int TOS;						/* in */
	SOCKADDR_IN6 destination_ipv6;				/* in */
	SOCKADDR_IN6 source_ipv6;				/* in */
} SM_UDP_DISPATCHER_CREATE_PARMS;

Description

Allocates, on a specific module, a new UDP dispatcher to transmit data. If the call completes successfully, the parameter dispatcher will be set to the identifier for that dispatcher.

This requires the module toudp to have been downloaded.

Fields

dispatcher
The newly created dispatcher.
module
A value obtained from sm_open_module() which indicates the module where the dispatcher to be allocated.
type
One of these values:
kSMDispatcherTypeIPv4
The dispatcher is to receive IPv4 packets
kSMDispatcherTypeIPv6
The dispatcher is to receive IPv6 packets
destination
The SOCKADDR_IN structure specifying the destination IP address and port for the UDP stream. A struct SOCKADDR_IN must be configured with an address family, an IP address and a port. Note that most operating systems define this structure such that fields are in network byte order. The structure must be correctly cast such that an IP V4 address is specified.
This field is ignored unless type is kSMDispatcherTypeIPv4.
source
The SOCKADDR_IN structure allows you to specify the source IP address and port for the UDP stream. A struct SOCKADDR_IN must be configured with an address family. The IP address may be specified, or the value INADDR_ANY may be used to indicate that any suitable address may be used. The port number may be specified, or the value zero may be used to indicate that a suitable port number is to be automatically allocated and used. Note that most operating systems define this structure such that fields are in network byte order. The structure must be correctly cast such that an IP V4 address is specified.
This field is ignored unless type is kSMDispatcherTypeIPv4.
TOS
The Type Of Service (TOS) indicator to be sent in the UDP packets
This field is ignored unless type is kSMDispatcherTypeIPv4.
destination_ipv6
The SOCKADDR_IN6 structure specifying the destination IP address and port for the UDP stream. A struct SOCKADDR_IN6 must be configured with an address family, an IPv6 address and a port. Note that most operating systems define this structure such that fields are in network byte order.
This field is ignored unless type is kSMDispatcherTypeIPv6.
source_ipv6
The SOCKADDR_IN6 structure allows you to specify the source IPv6 address and port for the UDP stream. A struct SOCKADDR_IN6 must be configured with an address family. The IPv6 address may be specified, or the value INADDR_ANY may be used to indicate that any suitable address may be used. The port number may be specified, or the value zero may be used to indicate that a suitable port number is to be automatically allocated and used. Note that most operating systems define this structure such that fields are in network byte order.
This field is ignored unless type is kSMDispatcherTypeIPv6.

Returns

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


Prosody generic: API: smd_ev_create

Prototype Definition

int smd_ev_create(tSMEventId *eventId, tSMChannelId channelId, int eventType, int eventChannelBinding)

Parameters

eventId
The created event
channelId
The channel that this event will be associated with
eventType
The type of the event to create. One of these values: kSMEventTypeReadData, kSMEventTypeWriteData, or kSMEventTypeRecog.
eventChannelBinding
Indicator of whether the event is for 'any channel' use or a single specific channel. One of the following values: kSMChannelSpecificEvent, kSMChannelSpecificEventNonIdle, or kSMAnyChannelEvent.

Description

Creates an operating system event object suitable for use with a specific channel indicated by channelId (the parameter eventChannelBinding must be set to kSMChannelSpecificEvent in this case) or, alternatively, creates an operating system event object for collective use by all nominated channels (in which case channelId must be set to kSMNullChannelId and eventChannelBinding to kSMAnyChannelEvent).

Only on Prosody version 2 (TiNG): See the document Prosody TiNG: any channel operation for how to use 'any channel' events.

An application which waits on a channel-specific event will be woken whenever the channel is ready for servicing. This includes whenever an operation on the channel may have a status change to report, as well as whenever there is no operation in progress on the channel (because the channel is ready to start a new operation).

An application which waits on an 'any channel' event will be woken when any of the channels which have been associated with that event are ready for servicing. In this case a channel which has no operation in progress is not considered to be ready for servicing. This is because 'any channel' events are provided for backward compatibility with Prosody version 1, which had this behaviour.

Note that an application may sometimes be woken even though no status change is found. This happens in certain cases where the API library discovers when checking the status that the change is not of a type appropriate to report to the application (which may be because it related to a facility not currently in use or because it is only for internal purposes within the library).

The eventType parameter indicates which type of event should be created, see sm_channel_set_event() API call description for more details.

An identifier for the new event object is stored in the location pointed at by eventId. You can wait on the event as described in smd_ev_wait().

Returns

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


Prosody generic: API: smd_ev_free

Prototype Definition

int smd_ev_free(tSMEventId eventId)

Parameters

eventId

Description

Release operating system resources associated with use of event previously allocated by smd_ev_create().

Returns

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


Prosody generic: API: smd_ev_wait

Prototype Definition

int smd_ev_wait(tSMEventId eventId)

Parameters

eventId

Description

Wait until given event occurs.

Application developers may prefer to use the underlying operating system calls instead of this call, allowing them to exploit event wait timeouts, waiting for multiple events etc. The use of events on each operating system is described in Prosody events.

Returns

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


Prosody generic: API: sm_config_module_switching

This function is deprecated.

Prototype Definition

int sm_config_module_switching(struct sm_config_module_sw_parms *configp)

Parameters

*configp
a structure of the following type:
typedef struct sm_config_module_sw_parms {
	tSMModuleId module;					/* in */
	tSM_INT auto_assign_out_ts;				/* in */
	tSM_INT auto_assign_in_ts;				/* in */
	tSM_INT out_st0;					/* in */
	tSM_INT out_st1;					/* in */
	tSM_INT out_base_ts;					/* in */
	enum kSMTimeslotType {
		kSMTimeslotTypeALaw,
		kSMTimeslotTypeMuLaw,
		kSMTimeslotTypeData,
	} in_type;						/* in */
	tSM_INT in_st0;						/* in */
	tSM_INT in_st1;						/* in */
	tSM_INT in_base_ts;					/* in */
	enum kSMTimeslotType out_type;				/* in */
} SM_CONFIG_MODULE_SW_PARMS;

Description

Overrides default or configured assignment scheme used by driver to associate channels with timeslots on card external bus. 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.

When a channel is allocated, it can have an associated external bus MVIP or SCbus timeslot automatically assigned to it. Alternatively, timeslot assignment may be left to the application which can call sm_switch_channel_output() or sm_switch_channel_input() following channel allocation to explicitly assign an external bus timeslot.

If output channel timeslots for module module are to be assigned by the application through calls to sm_switch_channel_output(), then auto_assign_out_ts must be set to zero.

If output channel timeslots for module module are to be automatically assigned, then auto_assign_out_ts must be set to 1 and the fields out_st0, out_st1 and out_base_ts must be set up to specify the external bus streams and timeslots to be assigned.

If SCbus external bus timeslots are to be assigned, out_st0 and out_st1 should both be set to 24 (the stream assigned to the SCbus) and out_base_ts should be set to the first SCbus timeslot to be assigned for this module.

If MVIP external bus timeslots are to be assigned, out_st0 and out_st1 should be set to DSo stream numbers (0..7) for the first 32 and second 32 timeslots assigned, and out_base_ts must be set to zero.

If input channel timeslots for module module are to be assigned by the application through calls to sm_switch_channel_input(), then auto_assign_in_ts must be set to zero.

If input channel timeslots for module module are to be automatically assigned, then auto_assign_in_ts must be set to 1 and the fields in_st0, in_st1 and in_base_ts must be set up to specify the external bus streams and timeslots to be assigned.

If SCbus external bus timeslots are to be assigned, in_st0 and in_st1 should both be set to 24 (the stream assigned to the SCbus) and in_base_ts should be set to the first SCbus timeslot to be assigned for this module.

If MVIP external bus timeslots are to be assigned, in_st0 and in_st1 should be set to DSi stream numbers (0..7) for the first 32 and second 32 timeslots assigned, and in_base_ts must be set to zero.

The use of automatic timeslot assignment is not recommended. It prevents the sharing of a timeslot between multiple channels (which is useful when debugging as it permits the recording of an input without interfering with normal processing of that input). Normally it is trivial to assign timeslots explicitly (for example, by deriving the timeslot number from some property of a call, such as the port and timeslot number of the call).

The use of automatic timeslot assignment is not supported on ProsodyS or ProsodyX.

Fields

module (Deprecated)
A value obtained from sm_open_module() which indicates the module to configure.
auto_assign_out_ts (Deprecated)
Controls whether output timeslots should be assigned automatically. The value 1 enables automatic assignment, 0 selects assignment by the application.
auto_assign_in_ts (Deprecated)
Controls whether input timeslots should be assigned automatically. The value 1 enables automatic assignment, 0 selects assignment by the application.
out_st0 (Deprecated)
The first stream from which output timeslots are to be automatically assigned.
out_st1 (Deprecated)
The second stream from which output timeslots are to be automatically assigned.
out_base_ts (Deprecated)
The lowest numbered timeslot to use for automatic assignment of output timeslots. This field is ignored.
in_type (Deprecated)
The data encoding used on timeslots automatically allocated within this stream.
One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.
in_st0 (Deprecated)
The first stream from which input timeslots are to be automatically assigned.
in_st1 (Deprecated)
The second stream from which input timeslots are to be automatically assigned.
in_base_ts (Deprecated)
The lowest numbered timeslot to use for automatic assignment of input timeslots. This field is ignored.
out_type (Deprecated)
The data encoding used on timeslots automatically allocated within this stream.
One of these values:
kSMTimeslotTypeALaw
Signals encoded with A-law companding.
kSMTimeslotTypeMuLaw
Signals encoded with mu-law companding.
kSMTimeslotTypeData
Digital data - no companding used.

Returns

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


Prosody generic: API: sm_get_card_switch_id

This function is deprecated.

Prototype Definition

int sm_get_card_switch_id(tSMCardId card)

Parameters

card
The card whose associated switch driver index is to be determined.

Description

Given a Prosody carrier card, returns card ID for use in switch driver API calls such as sw_set_output.

Note that this function is deprecated. It is present only to permit certain backward compatibility functionality to be implemented, should not be used by applications, and shall eventually be withdrawn from the API.

Returns

Switch card ID if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_get_channel_ix

This function is deprecated.

Prototype Definition

int sm_get_channel_ix(tSMChannelId channel)

Parameters

channel
The channel whose index value is to be returned.

Description

Converts a channel identifier to a integer index unique to that channel.

Only on Prosody version 2 (TiNG): The index returned is in the range 0 <= index < (256*32) and is unique only between channels on the same card. Note that this function is provided solely to implement backward compatibility with the pre-V6 API, and will be removed when pre-V6 backward compatibility support is withdrawn.

Returns

Channel index value (greater than or equal to zero) if call completed successfully, otherwise a standard error such as:


Prosody generic: API: sm_get_channel_module_id

This function is deprecated.

Prototype Definition

int sm_get_channel_module_id(tSMChannelId channel)

Parameters

channel
The channel to locate.

Description

Given a channel returns the module on which the channel is located.

Note that this function no longer implemented, and shall eventually be withdrawn from the API.

Returns

Always returns the error ERR_SM_NOT_IMPLEMENTED .


Prosody generic: API: sm_get_firmware_info

This function is deprecated.

Prototype Definition

int sm_get_firmware_info(struct sm_fwinfo_parms *fp)

Parameters

*fp
a structure of the following type:
typedef struct sm_fwinfo_parms {
	tSMModuleId module;					/* in */
	tSM_UT32 position;					/* inout */
	tSM_UT32 tasktypecode;					/* out */
	tSM_UT32 version;					/* out */
} SM_FWINFO_PARMS;

Description

Obsolete function that is not supported on ProsodyX cards or with ProsodyS v3 servers.

Fields

module (Deprecated)
A value obtained from sm_open_module() which indicates the module to examine.
position (Deprecated)
The position to examine. Start this at zero and each successive call will advance it to consider the next position.
tasktypecode (Deprecated)
The task type code of the firmware module. This value is zero if this position is empty.
version (Deprecated)
The version code of the firmware module. This value is zero if this position is empty.

Returns

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


Prosody generic: API: sm_get_module_card_id

This function is deprecated.

Prototype Definition

int sm_get_module_card_id(tSMModuleId mod_id)

Parameters

mod_id
a value obtained from sm_open_module() which indicates the module to locate.

Description

Given a module returns the card on which the module is located.

Note that this function is deprecated. It is present only to permit certain backward compatibility functionality to be implemented, should not be used by applications, and shall eventually be withdrawn from the API.

Returns

tSMCardId if call completed successfully, otherwise a standard error.


Prosody generic: API: sm_reset_module

This function is deprecated.

Prototype Definition

int sm_reset_module(tSMModuleId module)

Parameters

module
A value obtained from sm_open_module() which indicates the module to be reset

Description

This function is deprecated. Since a module only needs to be reset when downloading a new kernel, the download program should be used to reset a module.

Performs hardware reset on given module, module, which will then require a new firmware download before it may be used for speech processing.

Any channels previously associated with the module must be released before invoking this call.

Returns

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


These functions constitute the Prosody generic API.