WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

UDP Media Transport

Implementation of media transport with UDP sockets. More...

Enumerations

enum  pjmedia_transport_udp_options { PJMEDIA_UDP_NO_SRC_ADDR_CHECKING = 1 }
 

Functions

pj_status_t pjmedia_transport_udp_create (pjmedia_endpt *endpt, const char *name, int port, unsigned options, pjmedia_transport **p_tp)
 
pj_status_t pjmedia_transport_udp_create2 (pjmedia_endpt *endpt, const char *name, const pj_str_t *addr, int port, unsigned options, pjmedia_transport **p_tp)
 
pj_status_t pjmedia_transport_udp_create3 (pjmedia_endpt *endpt, int af, const char *name, const pj_str_t *addr, int port, unsigned options, pjmedia_transport **p_tp)
 
pj_status_t pjmedia_transport_udp_attach (pjmedia_endpt *endpt, const char *name, const pjmedia_sock_info *si, unsigned options, pjmedia_transport **p_tp)
 

Detailed Description

The UDP media transport is the standard based media transport as described by RFC 3550/3551. It can be used to facilitate RTP/RTCP unicast or multicast communication.

Enumeration Type Documentation

◆ pjmedia_transport_udp_options

Options that can be specified when creating UDP transport.

Enumerator
PJMEDIA_UDP_NO_SRC_ADDR_CHECKING 

Normally the UDP transport will continuously check the source address of incoming packets to see if it is different than the configured remote address, and switch the remote address to the source address of the packet if they are different after several packets are received. Specifying this option will disable this feature.

Function Documentation

◆ pjmedia_transport_udp_create()

pj_status_t pjmedia_transport_udp_create ( pjmedia_endpt endpt,
const char *  name,
int  port,
unsigned  options,
pjmedia_transport **  p_tp 
)

Create an RTP and RTCP sockets and bind the sockets to the specified port to create media transport.

Parameters
endptThe media endpoint instance.
nameOptional name to be assigned to the transport.
portUDP port number for the RTP socket. The RTCP port number will be set to one above RTP port.
optionsOptions, bitmask of pjmedia_transport_udp_options.
p_tpPointer to receive the transport instance.
Returns
PJ_SUCCESS on success.

◆ pjmedia_transport_udp_create2()

pj_status_t pjmedia_transport_udp_create2 ( pjmedia_endpt endpt,
const char *  name,
const pj_str_t addr,
int  port,
unsigned  options,
pjmedia_transport **  p_tp 
)

Create an RTP and RTCP sockets and bind the sockets to the specified address and port to create media transport.

Parameters
endptThe media endpoint instance.
nameOptional name to be assigned to the transport.
addrOptional local address to bind the sockets to. If this argument is NULL or empty, the sockets will be bound to all interface.
portUDP port number for the RTP socket. The RTCP port number will be set to one above RTP port.
optionsOptions, bitmask of pjmedia_transport_udp_options.
p_tpPointer to receive the transport instance.
Returns
PJ_SUCCESS on success.

◆ pjmedia_transport_udp_create3()

pj_status_t pjmedia_transport_udp_create3 ( pjmedia_endpt endpt,
int  af,
const char *  name,
const pj_str_t addr,
int  port,
unsigned  options,
pjmedia_transport **  p_tp 
)

Another variant of pjmedia_transport_udp_create() which allows the creation of IPv6 transport.

Parameters
endptThe media endpoint instance.
afAddress family, which can be pj_AF_INET() for IPv4 or pj_AF_INET6() for IPv6.
nameOptional name to be assigned to the transport.
addrOptional local address to bind the sockets to. If this argument is NULL or empty, the sockets will be bound to all interface.
portUDP port number for the RTP socket. The RTCP port number will be set to one above RTP port.
optionsOptions, bitmask of pjmedia_transport_udp_options.
p_tpPointer to receive the transport instance.
Returns
PJ_SUCCESS on success.

◆ pjmedia_transport_udp_attach()

pj_status_t pjmedia_transport_udp_attach ( pjmedia_endpt endpt,
const char *  name,
const pjmedia_sock_info si,
unsigned  options,
pjmedia_transport **  p_tp 
)

Create UDP stream transport from existing sockets. Use this function when the sockets have previously been created.

Parameters
endptThe media endpoint instance.
nameOptional name to be assigned to the transport.
siMedia socket info containing the RTP and RTCP sockets.
optionsOptions, bitmask of pjmedia_transport_udp_options.
p_tpPointer to receive the transport instance.
Returns
PJ_SUCCESS on success.

References PJ_END_DECL.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.