Prosody RTP processing: API: sm_vmprx_create

Prototype Definition

int sm_vmprx_create(struct sm_vmprx_create_parms *vmprxp)

Parameters

*vmprxp
a structure of the following type:
typedef struct sm_vmprx_create_parms {
	tSMVMPrxId vmprx;					/* out */
	tSMModuleId module;					/* in */
	enum kSMVMPrxType {
		kSMVMPrxTypeIPv4,
		kSMVMPrxTypeIPv6,
	} type;							/* in */
	struct in_addr address;					/* in */
	struct in6_addr ipv6_address;				/* in */
	tSM_INT mux_rtcp;					/* in */
} SM_VMPRX_CREATE_PARMS;

Description

Allocates, on a specific module, a new VMP[rx] to receive incoming RTP data. If the call completes successfully, the parameter vmprx will be set to the identifier for that vmprx.

A VMP[rx] is automatically allocated an even numbered port number for incoming RTP data, this information may be obtained by waiting for sm_vmprx_status() to return the port information. Any RTP data arriving at the VMP[rx] will be interpreted based on the codec configuration. The VMP[rx] will discard any incoming packets that do not match it's current configuration settings.

This requires the module vmprx to have been downloaded.

Fields

vmprx
The newly created VMP[rx].
module
A value obtained from sm_open_module() which indicates the module where the VMP[rx] is to be allocated.
type
One of these values:
kSMVMPrxTypeIPv4
The VMP[rx] is to receive IPv4 packets
kSMVMPrxTypeIPv6
The VMP[rx] is to receive IPv6 packets
address
The address on which this VMP[rx] is to listen if type is kSMVMPrxTypeIPv4.
ipv6_address
The address on which this VMP[rx] is to listen if type is kSMVMPrxTypeIPv6.
mux_rtcp
If this field is non-zero, indicates any RTCP packets are expected to arrive on same port as incoming RTP data rather than the usual convention of arriving on next odd numbered port. In this case, as per RFC5761, use of RTP payload types 64..95 should not be configured for this VMP[rx].

Returns

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


This function is part of the Prosody RTP processing API.