Prosody FMP processing: API

The following functions are provided by the Prosody FMP processing API:

API call W Description
sm_fmprx_create() P Create a FMP[rx] endpoint
sm_fmprx_destroy() P Destroy a previously allocated FMP[rx]
sm_fmprx_get_datafeed() P Obtain a data feed from a FMP[rx]
sm_fmprx_get_event() P Obtain an event for a FMP[rx]
sm_fmprx_status() P Determine FMP[rx] status
sm_fmprx_stop() P Instructs a FMP[rx] to stop processing T.38
sm_fmptx_config() P Configure the basic options for a FMP[tx]
sm_fmptx_create() P Create a FMP[tx] endpoint
sm_fmptx_datafeed_connect() P Connect a FMP[tx] to a datafeed
sm_fmptx_destroy() P Destroy a previously allocated FMP[tx]
sm_fmptx_get_event() P Obtain an event for a FMP[tx]
sm_fmptx_status() P Determine FMP[tx] status
sm_fmptx_stop() P Instructs a FMP[tx] to stop sending T.38

Key to W column:

P Preliminary documentation - this functionality is under development. It could be changed or withdrawn, and may not be implemented in this release

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


Prosody FMP processing: API: sm_fmprx_create

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_create(struct sm_fmprx_create_parms *fmprxp)

Parameters

*fmprxp
a structure of the following type:
typedef struct sm_fmprx_create_parms {
	tSMFMPrxId fmprx;					/* out */
	tSMModuleId module;					/* in */
	struct in_addr address;					/* in */
} SM_FMPRX_CREATE_PARMS;

Description

Allocates, on a specific module, a new FMP[rx] to receive incoming T.38 data. If the call completes successfully, the parameter fmprx will be set to the identifier for that fmprx.

A FMP[rx] is automatically allocated a port number for incoming RTP data, this information may be obtained by waiting for sm_fmprx_status() to return the port information. The FMP[rx] will discard any incoming packets that do not match it's current configuration settings.

Fields

fmprx (Only in Preliminary Documentation)
The newly created FMP[rx].
module (Only in Preliminary Documentation)
A value obtained from sm_open_module() which indicates the module where the FMP[rx] is to be allocated.
address (Only in Preliminary Documentation)
The address on which this FMP[rx] is to listen.

Returns

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


Prosody FMP processing: API: sm_fmprx_destroy

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_destroy(tSMFMPrxId fmprx)

Parameters

fmprx
A tSMFMPrxId that has been prevously created by a call to sm_fmprx_create().

Description

Destroys fmprx and invalidates the tSMFMPrxId.

Returns

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


Prosody FMP processing: API: sm_fmprx_get_datafeed

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_get_datafeed(struct sm_fmprx_datafeed_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_fmprx_datafeed_parms {
	tSMFMPrxId fmprx;					/* in */
	tSMDatafeedId datafeed;					/* out */
} SM_FMPRX_DATAFEED_PARMS;

Description

Request a datafeed identifier from a FMP[rx]. This identifer can subsequently be used in a call to sm_channel_datafeed_connect() or sm_fmptx_datafeed_connect() to connect a FMP[rx] to a speech channel (tSMChannelId) or a FMP[tx] respectively. Datafeed connections can only be made between objects allocated on the same tSMModuleId.

Requires the module datafeed to have been downloaded.

Fields

fmprx (Only in Preliminary Documentation)
The fmp[rx] from which to obtain a datafeed
datafeed (Only in Preliminary Documentation)
The datafeed object associated with the FMP[rx]

Returns

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


Prosody FMP processing: API: sm_fmprx_get_event

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_get_event(struct sm_fmprx_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_fmprx_event_parms {
	tSMFMPrxId fmprx;					/* in */
	tSMEventId event;					/* out */
} SM_FMPRX_EVENT_PARMS;

Description

If the call completes successfully event will hold a pointer to the tSMEventId belonging to fmprx. The tSMEventId is valid until the FMP[rx] is destroyed using sm_fmprx_destroy(). This event will be signalled when a status change occurs on the FMP[rx]. When the event is signalled the user must call sm_fmprx_status() to discover the nature of the status change.

Fields

fmprx (Only in Preliminary Documentation)
The FMP[rx]
event (Only in Preliminary Documentation)
The event identifier

Returns

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


Prosody FMP processing: API: sm_fmprx_status

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_status(struct sm_fmprx_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_fmprx_status_parms {
	tSMFMPrxId fmprx;					/* in */
	enum kSMFMPrxStatus {
		kSMFMPrxStatusRunning,
		kSMFMPrxStatusStopped,
		kSMFMPrxStatusGotPorts,
		kSMFMPrxStatusSource,
	} status;						/* out */
	union {
		struct {
			int T38_port;				/* out */
			struct in_addr address;			/* out */
		} port;						/* out */
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
		} source;					/* out */
	} u;							/* out */
} SM_FMPRX_STATUS_PARMS;

Description

Returns the current status of the FMP[rx] or an error to indicate that an error has occurred.

When the event, obtained from sm_fmprx_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 FMP[rx].

Fields

fmprx (Only in Preliminary Documentation)
The FMP[rx] to interrogate
status (Only in Preliminary Documentation)
One of these values:
kSMFMPrxStatusRunning
Indicates that there is nothing significant to report
kSMFMPrxStatusStopped
Indicates that the FMP[rx] has stopped processing T.38 and that it can be safely destroyed
kSMFMPrxStatusGotPorts
Indicates that port information is available.
kSMFMPrxStatusSource
Indicates that source address and port information is available.
u (Only in Preliminary Documentation)
port
This field is only valid if the status is kSMFMPrxStatusGotPorts.
T38_port
The UDP port number on which this FMP[rx] is listening for T.38 packets
address
The address on which this FMP[rx] is listening
source
This field is only valid if the status is kSMFMPrxStatusSource.
address
The address from which the T.38 data is being received.
port
The UDP port number from which the T.38 data is being received.

Returns

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


Prosody FMP processing: API: sm_fmprx_stop

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmprx_stop(struct sm_fmprx_stop_parms *stopp)

Parameters

*stopp
a structure of the following type:
typedef struct sm_fmprx_stop_parms {
	tSMFMPrxId fmprx;					/* in */
} SM_FMPRX_STOP_PARMS;

Description

Requests that a FMP[rx] stops executing. The user will be notified that a FMP[rx] has terminated by a final status event. Once the final status notification has been received the FMP[rx] can be destroyed using sm_fmprx_destroy().

Once the FMP[rx] has stopped the event should no longer be used to wait for status notifications as it will be signalled permanently. The event is invalidated when sm_fmprx_destroy() is called.

Fields

fmprx (Only in Preliminary Documentation)
A tSMFMPrxId that has been previously created by a call to sm_fmprx_create().

Returns

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


Prosody FMP processing: API: sm_fmptx_config

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_config(struct sm_fmptx_config_parms *configp)

Parameters

*configp
a structure of the following type:
typedef struct sm_fmptx_config_parms {
	tSMFMPtxId fmptx;					/* in */
	SOCKADDR_IN destination;				/* in */
	SOCKADDR_IN source;					/* in */
	enum kSMFMPRecoveryType {
		kSMFMPRecoveryTypeRED,
		kSMFMPRecoveryTypeFEC,
		kSMFMPRecoveryTypeRTP,
	} Recovery;						/* in */
	tSM_UT32 RecoveryLevel;					/* in */
} SM_FMPTX_CONFIG_PARMS;

Description

Configures a VMP[tx] to send T.38 data to a device with the specified IP address.

Fields

fmptx (Only in Preliminary Documentation)
The fmp[tx] to configure
destination (Only in Preliminary Documentation)
The SOCKADDR_IN structure specifying the destination IP address and port for the T38 data. 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.
source (Only in Preliminary Documentation)
The SOCKADDR_IN structure allows you to specify the source IP address and port for the T.38 data. 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.
Recovery (Only in Preliminary Documentation)
The type of error protection to use
One of these values:
kSMFMPRecoveryTypeRED
Indicates that Redundancy is to be used
kSMFMPRecoveryTypeFEC
Indicates that Forward Error Correction is to be used, (not currently supported)
kSMFMPRecoveryTypeRTP
Indicates the Redundancy over RTP is to be used, (not currently supported)
RecoveryLevel (Only in Preliminary Documentation)
Indicates the level of Redundancy to apply to packets. This is the number of secondaries to include in each packet.

Returns

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


Prosody FMP processing: API: sm_fmptx_create

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_create(struct sm_fmptx_create_parms *fmptxp)

Parameters

*fmptxp
a structure of the following type:
typedef struct sm_fmptx_create_parms {
	tSMFMPtxId fmptx;					/* out */
	tSMModuleId module;					/* in */
} SM_FMPTX_CREATE_PARMS;

Description

Allocates, on a specific module, a new FMP[tx] to transmit T.38 data to a remote device.

If the call completes successfully, the parameter fmptx will be set to the identifier for that FMP[tx].

Fields

fmptx (Only in Preliminary Documentation)
The newly created FMP[tx].
module (Only in Preliminary Documentation)
A value obtained from sm_open_module() which indicates the module where the FMP[tx] is to be allocated.

Returns

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


Prosody FMP processing: API: sm_fmptx_datafeed_connect

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_datafeed_connect(struct sm_fmptx_datafeed_connect_parms *datafeedp)

Parameters

*datafeedp
a structure of the following type:
typedef struct sm_fmptx_datafeed_connect_parms {
	tSMDatafeedId data_source;				/* in */
	tSMFMPtxId data_dest;					/* in */
} SM_FMPTX_DATAFEED_CONNECT_PARMS;

Description

Connects a datafeed to a FMP[tx]. The data_source must be a datafeed obtained from sm_channel_get_datafeed() or sm_fmprx_get_datafeed(). The channel data_dest will recieve any data that is generated by the output task from which data_source was derived.

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

Fields

data_source (Only in Preliminary Documentation)
The datafeed acting as a source of data
data_dest (Only in Preliminary Documentation)
The FMP[tx] that will receive the data

Returns

0 if call completed successfully, otherwise a standard error.


Prosody FMP processing: API: sm_fmptx_destroy

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_destroy(tSMFMPtxId fmptx)

Parameters

fmptx
A tSMFMPtxId that has been prevously created by a call to sm_fmptx_create().

Description

Destroys fmptx and invalidates the tSMFMPtxId.

Returns

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


Prosody FMP processing: API: sm_fmptx_get_event

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_get_event(struct sm_fmptx_event_parms *eventp)

Parameters

*eventp
a structure of the following type:
typedef struct sm_fmptx_event_parms {
	tSMFMPtxId fmptx;					/* in */
	tSMEventId event;					/* out */
} SM_FMPTX_EVENT_PARMS;

Description

If the call completes successfully event will hold a pointer to the tSMEventId belonging to fmptx. The tSMEventId is valid until the FMP[tx] is destroyed using sm_fmptx_destroy(). This event will be signalled when a status change occurs on the FMP[tx]. When the event is signalled the user must call sm_fmptx_status() to discover the nature of the status change.

Fields

fmptx (Only in Preliminary Documentation)
The FMP[tx]
event (Only in Preliminary Documentation)
The event identifier

Returns

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


Prosody FMP processing: API: sm_fmptx_status

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_status(struct sm_fmptx_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_fmptx_status_parms {
	tSMFMPtxId fmptx;					/* in */
	enum kSMFMPtxStatus {
		kSMFMPtxStatusRunning,
		kSMFMPtxStatusStopped,
	} status;						/* out */
} SM_FMPTX_STATUS_PARMS;

Description

Returns the current status of the FMP[tx] or an error to indicate that a problem occurred during start-up.

Fields

fmptx (Only in Preliminary Documentation)
The FMP[tx] to interrogate
status (Only in Preliminary Documentation)
One of these values:
kSMFMPtxStatusRunning
Indicates that there is nothing significant to report
kSMFMPtxStatusStopped
Indicates that the FMP[tx] has stopped transmitting T.38 and that it is safe to destroy

Returns

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


Prosody FMP processing: API: sm_fmptx_stop

This function is only in Preliminary Documentation.

Prototype Definition

int sm_fmptx_stop(struct sm_fmptx_stop_parms *stopp)

Parameters

*stopp
a structure of the following type:
typedef struct sm_fmptx_stop_parms {
	tSMFMPtxId fmptx;					/* in */
} SM_FMPTX_STOP_PARMS;

Description

Requests that a FMP[tx] stops executing. The user will be notified that a FMP[tx] has terminated by a final status event. Once the final status notification has been received the FMP[tx] can be destroyed using sm_fmptx_destroy().

Once the FMP[tx] has stopped the event should no longer be used to wait for status notifications as it will be signalled permanently. The event is invalidated when sm_fmptx_destroy() is called.

Fields

fmptx (Only in Preliminary Documentation)
A tSMFMPtxId that has been previously created by a call to sm_fmptx_create().

Returns

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


These functions constitute the Prosody FMP processing API.