PJSUA A Command Line SIP User Agent Speaker

  • Slides: 10
Download presentation
PJSUA – A Command Line SIP User Agent Speaker: Li-Wen Chen Advisor: Quincy Wu

PJSUA – A Command Line SIP User Agent Speaker: Li-Wen Chen Advisor: Quincy Wu Date: 2010/01/07 1

Outline l Install PJSUA l Sample: Remote Streaming l Options l Function Calls l

Outline l Install PJSUA l Sample: Remote Streaming l Options l Function Calls l Demo l Reference 2

Install PJSUA l Download Source Code ¡ http: //www. pjsip. org/release/1. 5/pjproject 1. 5.

Install PJSUA l Download Source Code ¡ http: //www. pjsip. org/release/1. 5/pjproject 1. 5. tar. bz 2 // newest version is 1. 5 l Install (Linux) ¡ # tar –vxf pjproject-1. 5. tar. bz 2 ¡ # cd pjproject-1. 5 ¡ #. /configure ¡ # make install (need superuser privilege) 3

Sample: Remote Streaming l This example mainly demonstrates how to stream media to remote

Sample: Remote Streaming l This example mainly demonstrates how to stream media to remote peer using RTP. l $cd pjproject-1. 5/pjsip- apps/bin/samples/i 686 -pc-linux-gnu l $. /streamutil [option] 4

Options l --remote=IP: PORT ¡ Set the remote peer. If this option is set,

Options l --remote=IP: PORT ¡ Set the remote peer. If this option is set, the program will transmit RTP audio to the specified address. (default: recv only) l --play-file=WAV ¡ Send audio from the WAV file instead of from the sound device. 5

Function Calls l pj_init( void ) ¡ Initialize the PJ Library. l pjmedia_stream_create( pjmedia_endpt

Function Calls l pj_init( void ) ¡ Initialize the PJ Library. l pjmedia_stream_create( pjmedia_endpt * pj_pool_t * const pjmedia_stream_info * pjmedia_transport * void * pjmedia_stream ** endpt, pool, info, tp, user_data, p_stream ) ¡ Create a media stream. 6

Function Calls (cont. ) l pjmedia_stream_get_port( pjmedia_stream* stream, pjmedia_port ** p_port ) ¡ Get

Function Calls (cont. ) l pjmedia_stream_get_port( pjmedia_stream* stream, pjmedia_port ** p_port ) ¡ Get the media port interface of the stream. l pjmedia_stream_start( pjmedia_stream* stream ) ¡ Start the media stream. 7

Function Calls (cont. ) l pjmedia_stream_destroy( pjmedia_stream* stream ) ¡ Destroy the media stream.

Function Calls (cont. ) l pjmedia_stream_destroy( pjmedia_stream* stream ) ¡ Destroy the media stream. l pjmedia_port_destroy( pjmedia_port * port ) ¡ Destroy port. l pj_shutdown( void ) ¡ Shutdown PJLIB. 8

Demo l Receiver: . /streamutil l Sender: . /streamutil --remote=10. 59. 91: 4000 --play-file=t

Demo l Receiver: . /streamutil l Sender: . /streamutil --remote=10. 59. 91: 4000 --play-file=t 2. wav 9

Reference l PJSIP ¡ http: //www. pjsip. org l Source code of streamutil. c

Reference l PJSIP ¡ http: //www. pjsip. org l Source code of streamutil. c ¡ http: //www. pjsip. org/pjmedia/docs/html/page_pj media_samples_streamutil_c. htm 10