PJSUA – A Command Line SIP User Agent

Download Report

Transcript PJSUA – A Command Line SIP User Agent

PJSUA
– A Command Line SIP User Agent
Speaker: Li-Wen Chen
Advisor: Quincy Wu
Date: 2010/01/07
1
Outline
Install PJSUA
Sample: Remote Streaming
Options
Function Calls
Demo
Reference
2
Install PJSUA
Download Source Code
http://www.pjsip.org/release/1.5/pjproject1.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)
3
Sample: Remote Streaming
This example mainly demonstrates how to
stream media to remote peer using RTP.
$cd pjproject-1.5/pjsipapps/bin/samples/i686-pc-linux-gnu
$./streamutil [option]
4
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.
5
Function Calls
pj_init( void )
Initialize the PJ Library.
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.)
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.
7
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.
8
Demo
Receiver:
./streamutil
Sender:
./streamutil --remote=10.10.59.91:4000
--play-file=t2.wav
9
Reference
PJSIP
http://www.pjsip.org
Source code of streamutil.c
http://www.pjsip.org/pjmedia/docs/html/page_pj
media_samples_streamutil_c.htm
10