100 likes | 339 Vues
PJSUA – A Command Line SIP User Agent. Speaker: Li-Wen Chen Advisor: Quincy Wu Date: 2010/01/07. Outline. Install PJSUA Sample: Remote Streaming Options Function Calls Demo Reference. Install PJSUA. Download Source Code
E N D
PJSUA–A Command Line SIP User Agent Speaker: Li-Wen Chen Advisor: Quincy Wu Date: 2010/01/07
Outline • Install PJSUA • Sample: Remote Streaming • Options • Function Calls • Demo • Reference
Install PJSUA • Download Source Code • http://www.pjsip.org/release/1.5/pjproject-1.5.tar.bz2 // newest version is 1.5 • Install (Linux) • # tar –vxf pjproject-1.5.tar.bz2 • # cd pjproject-1.5 • # ./configure • # make • # make install (need superuser privilege)
Sample: Remote Streaming • This example mainly demonstrates how to stream media to remote peer using RTP. • $cd pjproject-1.5/pjsip-apps/bin/samples/i686-pc-linux-gnu • $./streamutil [option]
Options • --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) • --play-file=WAV • Send audio from the WAV file instead of from the sound device.
Function Calls • pj_init( void ) • Initialize the PJ Library. • pjmedia_stream_create( pjmedia_endpt * endpt,pj_pool_t * pool,const pjmedia_stream_info * info,pjmedia_transport * tp,void * user_data,pjmedia_stream ** p_stream ) • Create a media stream.
Function Calls (cont.) • pjmedia_stream_get_port( pjmedia_stream* stream, pjmedia_port ** p_port ) • Get the media port interface of the stream. • pjmedia_stream_start( pjmedia_stream* stream ) • Start the media stream.
Function Calls (cont.) • pjmedia_stream_destroy( pjmedia_stream* stream ) • Destroy the media stream. • pjmedia_port_destroy( pjmedia_port * port ) • Destroy port. • pj_shutdown( void ) • Shutdown PJLIB.
Demo • Receiver:./streamutil • Sender:./streamutil --remote=10.10.59.91:4000 --play-file=t2.wav
Reference • PJSIP • http://www.pjsip.org • Source code of streamutil.c • http://www.pjsip.org/pjmedia/docs/html/page_pjmedia_samples_streamutil_c.htm