The following functions are provided by the Prosody FMP processing API:
| API call | W | Description |
|---|---|---|
| sm_fmprx_create() | Create a FMP[rx] endpoint | |
| sm_fmprx_destroy() | Destroy a previously allocated FMP[rx] | |
| sm_fmprx_get_datafeed() | Obtain a data feed from a FMP[rx] | |
| sm_fmprx_get_event() | Obtain an event for a FMP[rx] | |
| sm_fmprx_status() | Determine FMP[rx] status | |
| sm_fmprx_stop() | Instructs a FMP[rx] to stop processing T.38 | |
| sm_fmptx_config() | Configure the basic options for FMP[tx] to use IPv4 | |
| sm_fmptx_config_ipv6() | Configure the basic options for a FMP[tx] to use IPv6 | |
| sm_fmptx_create() | Create a FMP[tx] endpoint | |
| sm_fmptx_datafeed_connect() | Connect a datafeed to an FMP[tx] | |
| sm_fmptx_destroy() | Destroy a previously allocated FMP[tx] | |
| sm_fmptx_get_event() | Obtain an event for a FMP[tx] | |
| sm_fmptx_status() | Determine FMP[tx] status | |
| sm_fmptx_stop() | Instructs a FMP[tx] to stop sending T.38 |
This document is also available as separate pages for each function.
int sm_fmprx_create(struct sm_fmprx_create_parms *fmprxp)
typedef struct sm_fmprx_create_parms {
tSMFMPrxId fmprx; /* out */
tSMModuleId module; /* in */
enum kSMFMPrxType {
kSMFMPrxTypeIPv4,
kSMFMPrxTypeIPv6,
} type; /* in */
struct in_addr address; /* in */
struct in6_addr ipv6_address; /* in */
} SM_FMPRX_CREATE_PARMS;
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.
Requires the module fmprx to have been downloaded.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmprx_destroy(tSMFMPrxId fmprx)
Destroys fmprx and invalidates the tSMFMPrxId.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmprx_get_datafeed(struct sm_fmprx_datafeed_parms *datafeedp)
typedef struct sm_fmprx_datafeed_parms {
tSMFMPrxId fmprx; /* in */
tSMDatafeedId datafeed; /* out */
} SM_FMPRX_DATAFEED_PARMS;
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 modules datafeed fmprx to have been downloaded.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmprx_get_event(struct sm_fmprx_event_parms *eventp)
typedef struct sm_fmprx_event_parms {
tSMFMPrxId fmprx; /* in */
tSMEventId event; /* out */
} SM_FMPRX_EVENT_PARMS;
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.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmprx_status(struct sm_fmprx_status_parms *statusp)
typedef struct sm_fmprx_status_parms {
tSMFMPrxId fmprx; /* in */
enum kSMFMPrxStatus {
kSMFMPrxStatusRunning,
kSMFMPrxStatusStopped,
kSMFMPrxStatusGotPorts,
kSMFMPrxStatusSource,
kSMFMPrxStatusGotPortsIPv6,
kSMFMPrxStatusSourceIPv6,
} 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 */
struct {
int T38_port; /* out */
struct in6_addr address; /* out */
} port_ipv6; /* out */
struct {
struct in6_addr address; /* out */
int port; /* out */
} source_ipv6; /* out */
} u; /* out */
} SM_FMPRX_STATUS_PARMS;
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].
0 if call completed successfully, otherwise a standard error such as:
int sm_fmprx_stop(struct sm_fmprx_stop_parms *stopp)
typedef struct sm_fmprx_stop_parms {
tSMFMPrxId fmprx; /* in */
} SM_FMPRX_STOP_PARMS;
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.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_config(struct sm_fmptx_config_parms *configp)
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;
Configures a FMP[tx] to send T.38 data to a device with the specified IPv4 address.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_config_ipv6(struct sm_fmptx_config_ipv6_parms *configp)
typedef struct sm_fmptx_config_ipv6_parms {
tSMFMPtxId fmptx; /* in */
SOCKADDR_IN6 destination; /* in */
SOCKADDR_IN6 source; /* in */
enum kSMFMPRecoveryType {
kSMFMPRecoveryTypeRED,
kSMFMPRecoveryTypeFEC,
kSMFMPRecoveryTypeRTP,
} Recovery; /* in */
tSM_UT32 RecoveryLevel; /* in */
} SM_FMPTX_CONFIG_IPV6_PARMS;
Configures a FMP[tx] to send T.38 data to a device with the specified IPv6 address.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_create(struct sm_fmptx_create_parms *fmptxp)
typedef struct sm_fmptx_create_parms {
tSMFMPtxId fmptx; /* out */
tSMModuleId module; /* in */
} SM_FMPTX_CREATE_PARMS;
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].
Requires the module fmptx to have been downloaded.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_datafeed_connect(struct sm_fmptx_datafeed_connect_parms *datafeedp)
typedef struct sm_fmptx_datafeed_connect_parms {
tSMDatafeedId data_source; /* in */
tSMFMPtxId data_dest; /* in */
} SM_FMPTX_DATAFEED_CONNECT_PARMS;
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.
Requires the modules datafeed fmptx to have been downloaded.
0 if call completed successfully, otherwise a standard error.
int sm_fmptx_destroy(tSMFMPtxId fmptx)
Destroys fmptx and invalidates the tSMFMPtxId.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_get_event(struct sm_fmptx_event_parms *eventp)
typedef struct sm_fmptx_event_parms {
tSMFMPtxId fmptx; /* in */
tSMEventId event; /* out */
} SM_FMPTX_EVENT_PARMS;
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.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_status(struct sm_fmptx_status_parms *statusp)
typedef struct sm_fmptx_status_parms {
tSMFMPtxId fmptx; /* in */
enum kSMFMPtxStatus {
kSMFMPtxStatusRunning,
kSMFMPtxStatusStopped,
} status; /* out */
} SM_FMPTX_STATUS_PARMS;
Returns the current status of the FMP[tx] or an error to indicate that a problem occurred during start-up.
0 if call completed successfully, otherwise a standard error such as:
int sm_fmptx_stop(struct sm_fmptx_stop_parms *stopp)
typedef struct sm_fmptx_stop_parms {
tSMFMPtxId fmptx; /* in */
} SM_FMPTX_STOP_PARMS;
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.
0 if call completed successfully, otherwise a standard error such as:
These functions constitute the Prosody FMP processing API.