Prosody RTP processing: API: sm_vmprx_status

This function is only in Prosody version 2 (TiNG).

Prototype Definition

int sm_vmprx_status(struct sm_vmprx_status_parms *statusp)

Parameters

*statusp
a structure of the following type:
typedef struct sm_vmprx_status_parms {
	tSMVMPrxId vmprx;					/* in */
	enum kSMVMPrxStatus {
		kSMVMPrxStatusRunning,
		kSMVMPrxStatusStopped,
		kSMVMPrxStatusDetectTone,
		kSMVMPrxStatusEndTone,
		kSMVMPrxStatusGotPorts,
		kSMVMPrxStatusNewSSRC,
	} status;						/* out */
	union {
		struct {
			tSM_INT id;				/* out */
			double volume;				/* out */
			unsigned duration;			/* out */
		} tone;						/* out */
		struct {
			int RTP_Port;				/* out */
			int RTCP_Port;				/* out */
			struct in_addr address;			/* out */
		} ports;					/* out */
		struct {
			tSM_INT no_data;			/* out */
		} run;						/* out */
		struct {
			struct in_addr address;			/* out */
			int port;				/* out */
			int ssrc;				/* out */
		} ssrc;						/* out */
	} u;							/* out */
} SM_VMPRX_STATUS_PARMS;

Description

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

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

Fields

vmprx (Only in Prosody version 2 (TiNG))
The VMP[rx] to interrogate
status (Only in Prosody version 2 (TiNG))
One of these values:
kSMVMPrxStatusRunning
The VMP[rx] is running normally.
kSMVMPrxStatusStopped
Indicates that the VMP[rx] has stopped processing RTP and that it is safe to destroy
kSMVMPrxStatusDetectTone
Indicates that a tone has been received by the vmprx
kSMVMPrxStatusEndTone
Indicates that the tone being received by the vmprx has ended
kSMVMPrxStatusGotPorts
Indicates that port information is available. In addition to being reported with this status, this information can be retrieved with sm_vmprx_get_ports() at any time until the VMP[x] is stopped.
kSMVMPrxStatusNewSSRC
Indicates that a new SSRC value is being used.
u (Only in Prosody version 2 (TiNG))
Additional information relating to the current status of the VMP[rx]
tone
This field is only valid if the status is kSMVMPrxStatusDetectTone or kSMVMPrxStatusEndTone.
id
The RFC2833 identifier for the recognised tone
volume
The volume of the tone expressed in dBm0
duration
The duration of the tone.
ports
This field is only valid if the status is kSMVMPrxStatusGotPorts.
RTP_Port
The UDP port number on which this VMP[rx] is listening for RTP
RTCP_Port
The UDP port number on which this VMP[rx] is listening for RTCP
address
The address on which this VMP[rx] is listening.
run
This field is only valid if the status is kSMVMPrxStatusRunning.
no_data
Non zero when the VMP[rx] is experiencing a loss of data that has reached the threshold set by sm_vmprx_config_dataloss()
ssrc
This field is only valid if the status is kSMVMPrxStatusNewSSRC.
address
The address from which the SSRC was received.
port
The UDP port number from which the SSRC was received.
ssrc
The new SSRC value.

Returns

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


This function is part of the Prosody RTP processing API.