wiki:3rd_Party_Media

Version 1 (modified by bennylp, 16 years ago) (diff)

--

Integrating Third Party Media Stack with PJSIP

Introduction

PJSIP consists of several libraries which mostly are independent from one another. The library architecture diagram below shows how libraries are interacting with each other.

SIP and Media Interaction

Pseudo-code when creating a call (same flow for caller and callee):

create_call()
{

Create the dialog
dlg = pjsip_dlg_create_uac/uas();

Create media transport (pair of RTP/RTCP socket) for
transmitting/receiving the media from remote endpoint
media_transport = pjmedia_transport_udp_create();

Get the socket address info of the media transport
These are needed to create a complete SDP descriptor
media_sock_info = pjmedia_transport_get_info(media_transport);

Create local SDP to be given to invite session
sdp = pjmedia_endpt_create_sdp(media_sock_info);

Create the invite session, giving it both the dialog
and local SDP to be negotiated
inv = pjsip_inv_create_uac/uas();

}

pjsip_endpt_create_sdp(media_sock_info)
{

Query list of codecs that we support
codec_list[] = pjmedia_codec_mgr_enum_codecs();

Put each codec information in the SDP
...

Put media socket address info in SDP c= and m= line
...

return sdp;

}

Attachments (1)

Download all attachments as: .zip