PJSIP
Compile PJSUA
- Let's utilize an open source software (OSS) PJSIP as our SIP user agent (SIP UA).
- Read the installation
guide on how to build the project.
- Download PJSIP 2.6 for Windows.
Its MD5 checksum must be
bfab4bd35f8e8e1ff40b2292c6f7a621.
- Uncompress the ZIP file.
- Create a config_site.h under pjlib\include\pj according to
Build
Preparation. Use the sample at the end of the article.
- If you are running Visual Studio 2015, open the solution file pjproject-vs14.sln.
If you are running older version of Visual Studio, open
pjproject-vs8.sln.
- This is essentially a multi-project
solution.
- In "Solution Explorer", right-click "pjsua" and "Set as StartUp
Project".
- Press F7 to build the project. Compiled applications will be
placed under pjsip-apps\bin.
- pjsua-i386-Win32-vc14-Debug.exe
- pjsystest-i386-Win32-vc14-Debug.exe
- sample-debug-i386-Win32-vc14-Debug.exe
Compile PJSUA with Visual Studio 2017
- Download
PJSIP
2.9 for Windows.
Its MD5 checksum must be e4ec23a6bfa06fb53c313aa7fed81236.
- Uncompress the ZIP file.
- Under pjproject-2.9\pjlib\include\pj,
copy config_site_sample.h config_site.h
- Open the solution file pjproject-vs14.sln.
- If it complains that you do not have written permission on M:,
"Tools - Options - Text Editor - C/C++ - Advanced - Fallback
Location" to choose a local directory (e.g., C:\Waste\Fallback).
- If it asks you to "Install Missing Features", just skip it.
- This is essentially a multi-project
solution.
In "Solution Explorer", right-click "pjsua" and "Set as StartUp
Project".
- All projects are labeled as "(Visual Studio 2015)".
Right-click on each of them and choose "Re-target Project".
- Press F7 to build the project. Compiled applications will be
placed under pjsip-apps\bin.
- pjsua-i386-Win32-vc14-Debug.exe
Call Establishment
- Take a look at the SIP protocol (PPT).
- Read the manual of
PJSUA.
- Every student calls the intructor's UA -
sip:10.35.21.200:5060
(Auto-Answer).
- Partition students into groups so that each group consists of 2
members. Each one starts their PJSUA programs.
Assume they are UA1, UA2.
- Start Wireshark. Set the Capture Filter to be "udp port 5060".
- Let UA1 call UA2.
- Observe the INVITE sent by the caller and the INVITE received
by the
callee. Are they the same?
- Inspect the SDP contents and pay attention to the "c=" and "m="
field.
- Try the following scenarios:
- three-way handshaking process of
INVITE - 200 OK - ACK.
- INVITE - Reject - ACK
- INVITE - CANCEL - 200 OK - 486 Busy Here - Ack
- INVITE - 200 OK - ACK.
Hold - Unhold.
Multi-Party Calls
- Re-partition students into 3-person groups.
- Let UA1 calls UA3. Keep Wireshark running.
While they are talking, let UA2 calls UA3.
- What do you observe?
- Use [ and ] to switch between calls. Do you observe any signaling
while a UA switches?
- Hang up all calls.
Call Transfer
- Let UA1 call UA2.
- UA2 use the 'x' command to transfer the call to UA3.
- What signaling do you observe?
Register to our own SIP Server
- Start Wireshark with capture filter "udp port 5060".
- Register to our own SIP server
- pjsua --id=sip:10@ALPHA.ipv6.club.tw
--registrar=sip:ALPHA.ipv6.club.tw
- Quit PJSUA. This will un-register your UA from the server.
- Observe the SIP signaling and discuss with your partner about what
you observed. Compare your observation with
this example.
Make calls to our own SIP server
- Start PJSUA with the options mentioned above.
- Make a call to your partner.
- Observe the SIP signaling.
- Compare with this example.
- Inspect the SDP contents of INVITE and 200 OK. Discuss with
your partner and try to understand the "c" and "m" fields.
- When starting PJSUA, add an option "--add-codec=pcmu" or
"--dis-codec=speex/16000 --dis-codec=speex/8000". Observe whether you are talking with different
codec.
Register to NCNU SIP Server
- Start Wireshark with capture filter "udp port 5060".
- Register to NCNU SIP server
- pjsua --id=sip:94303798@sip.ntrc.edu.tw
--registrar=sip:sip.ntrc.edu.tw --realm=sip.ntrc.edu.tw
--username=94303798 --password=xxxxxx
- Quit PJSUA. This will un-register your UA from the server.
- Observe the SIP signaling and discuss with your partner about what
you observed. Compare your observation with
this example.
Make calls to NCNU
- Start PJSUA with the options mentioned above.
- Make a call to "sip:94300000@sip.ntrc.edu.tw".
- Hang up with "h".
- Observe the SIP signaling.
- Make a call to your partner.
- Observe the SIP signaling.
- Compare with this example.
- Inspect the SDP contents of INVITE and 200 OK. Discuss with
your partner and try to understand the "c" and "m" fields.
- Make a call to an extension number, e.g., 4763.
- You may also try to call the phone number of TC-208:
sip:94334492@sip.ntrc.edu.tw
- You may call Feng Chia University
at "sip:93180000@sip.ntrc.edu.tw",
National Chiao Tung University at
"sip:92988888@sip.ntrc.edu.tw",
or
National Tsing Hua University at
"sip:93050000@sip.ntrc.edu.tw".
- More schools can be found at
http://voip.tanet.edu.tw/.
For example, my primary school is "sip:923414000@sip.ntrc.edu.tw"