Prosody RTP processing: API: sm_vmprx_config_forwarding
Prototype Definition
int sm_vmprx_config_forwarding(struct sm_vmprx_config_forwarding_parms *configp)
Parameters
- *configp
-
a structure of the following type:
typedef struct sm_vmprx_config_forwarding_parms {
tSMVMPrxId vmprx; /* in */
enum kVMPrxFwdMode {
kVMPrxFwdModeNone,
kVMPrxFwdModeAll,
kVMPrxFwdModeTypes,
} mode; /* in */
enum kSMVMPrxFwdDestType {
kSMVMPrxFwdDestTypeIPv4,
kSMVMPrxFwdDestTypeIPv6,
} dest_type; /* in */
union {
struct {
SOCKADDR_IN destination; /* in */
SOCKADDR_IN source; /* in */
int TOS; /* in */
} ipv4; /* in */
struct {
SOCKADDR_IN6 destination; /* in */
SOCKADDR_IN6 source; /* in */
} ipv6; /* in */
} u; /* in */
int num_types; /* in */
struct sm_vmprx_forward_types {
int incoming_pt; /* in */
int outgoing_pt; /* in */
enum kVMPrxFwdTranscoding {
kVMPrxFwdTranscodingNone,
kVMPrxFwdTranscodingAlawToMulaw,
kVMPrxFwdTranscodingMulawToAlaw,
} transcoding;
} types[kVMPrxFwdMaxTypes]; /* in */
} SM_VMPRX_CONFIG_FORWARDING_PARMS;
Description
Configure a VMP[rx] to forward packet payloads to another endpoint
Fields
- vmprx
- The VMP[rx] to forward packet payloads
- mode
- The payload forwarding mode
One of these values:
- kVMPrxFwdModeNone
- Forward no packet payloads
- kVMPrxFwdModeAll
- Forward all packet payloads
- kVMPrxFwdModeTypes
- Forward only payloads that match the types specified
- dest_type
-
One of these values:
- kSMVMPrxFwdDestTypeIPv4
- The packet payloads are to be forwarded to an IPv4 destination
- kSMVMPrxFwdDestTypeIPv6
- The packet payloads are to be forwarded to an IPv6 destination
- u
-
- ipv4
- This field is only used if
dest_type
is
kSMVMPrxFwdDestTypeIPv4.
- destination
- The SOCKADDR_IN structure specifying the destination IP address
and port for the forwarded packet payloads. 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
- The SOCKADDR_IN structure allows you to specify the source IP
address and port for the forwarded packets. 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.
- TOS
- The Type Of Service (TOS) indicator to be sent with payloads
- ipv6
- This field is only used if
dest_type
is
kSMVMPrxFwdDestTypeIPv6.
- destination
- The SOCKADDR_IN6 structure specifying the destination IP address
and port for the forwarded packet payloads. A struct SOCKADDR_IN6
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.
- source
- The SOCKADDR_IN6 structure allows you to specify the source IP
address and port for the forwarded packets. A struct SOCKADDR_IN6 must
be configured with an address family. The IP address may be
specified, or a value equivalent to in6addr_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.
- num_types
-
- types
- The payload types to be forwarded
- incoming_pt
- The incoming payload type identifier
- outgoing_pt
- The outgoing payload type identifier to map this payload to
- transcoding
- The payload data transcoding
One of these values:
- kVMPrxFwdTranscodingNone
- No transcoding
- kVMPrxFwdTranscodingAlawToMulaw
- Transcode payload data from A-law to Mu-law
- kVMPrxFwdTranscodingMulawToAlaw
- Transcode payload data from Mu-law to A-law
Returns
0
if call completed successfully, otherwise a standard error such as:
- ERR_SM_DEVERR - device error
This function is part of the Prosody RTP processing API.