PJSIP

Compile PJSUA

  1. Let's utilize an open source software (OSS) PJSIP as our SIP user agent (SIP UA).
  2. Read the installation guide on how to build the project.
  3. Download PJSIP 2.6 for Windows.
    Its MD5 checksum must be bfab4bd35f8e8e1ff40b2292c6f7a621.
  4. Uncompress the ZIP file.
  5. Create a config_site.h under pjlib\include\pj according to Build Preparation. Use the sample at the end of the article.
  6. 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.
    1. This is essentially a multi-project solution.
    2. In "Solution Explorer", right-click "pjsua" and "Set as StartUp Project".
  7. Press F7 to build the project. Compiled applications will be placed under pjsip-apps\bin.
    1. pjsua-i386-Win32-vc14-Debug.exe
    2. pjsystest-i386-Win32-vc14-Debug.exe
    3. sample-debug-i386-Win32-vc14-Debug.exe

Compile PJSUA with Visual Studio 2017

  1. Download PJSIP 2.9 for Windows. Its MD5 checksum must be e4ec23a6bfa06fb53c313aa7fed81236.
  2. Uncompress the ZIP file.
  3. Under pjproject-2.9\pjlib\include\pj, copy config_site_sample.h config_site.h
  4. Open the solution file pjproject-vs14.sln.
    1. 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).
    2. If it asks you to "Install Missing Features", just skip it.
  5. This is essentially a multi-project solution. In "Solution Explorer", right-click "pjsua" and "Set as StartUp Project".
  6. All projects are labeled as "(Visual Studio 2015)". Right-click on each of them and choose "Re-target Project".
  7. Press F7 to build the project. Compiled applications will be placed under pjsip-apps\bin.

Call Establishment

  1. Take a look at the SIP protocol (PPT).
  2. Read the manual of PJSUA.
  3. Every student calls the intructor's UA - sip:10.35.21.200:5060 (Auto-Answer).
  4. Partition students into groups so that each group consists of 2 members. Each one starts their PJSUA programs. Assume they are UA1, UA2.
  5. Start Wireshark. Set the Capture Filter to be "udp port 5060".
  6. Let UA1 call UA2.
  7. Observe the INVITE sent by the caller and the INVITE received by the callee. Are they the same?
  8. Inspect the SDP contents and pay attention to the "c=" and "m=" field.
  9. Try the following scenarios:

Multi-Party Calls

  1. Re-partition students into 3-person groups.
  2. Let UA1 calls UA3. Keep Wireshark running. While they are talking, let UA2 calls UA3.
  3. What do you observe?
  4. Use [ and ] to switch between calls. Do you observe any signaling while a UA switches?
  5. Hang up all calls.

Call Transfer

  1. Let UA1 call UA2.
  2. UA2 use the 'x' command to transfer the call to UA3.
  3. What signaling do you observe?

Register to our own SIP Server

  1. Start Wireshark with capture filter "udp port 5060".
  2. Register to our own SIP server
  3. Quit PJSUA. This will un-register your UA from the server.
  4. 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

  1. Start PJSUA with the options mentioned above.
  2. Make a call to your partner.

Register to NCNU SIP Server

  1. Start Wireshark with capture filter "udp port 5060".
  2. Register to NCNU SIP server
  3. Quit PJSUA. This will un-register your UA from the server.
  4. Observe the SIP signaling and discuss with your partner about what you observed. Compare your observation with this example.

Make calls to NCNU

  1. Start PJSUA with the options mentioned above.
  2. Make a call to "sip:94300000@sip.ntrc.edu.tw".
  3. Make a call to your partner.
  4. Make a call to an extension number, e.g., 4763.
  5. You may also try to call the phone number of TC-208: sip:94334492@sip.ntrc.edu.tw
  6. 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".
  7. More schools can be found at http://voip.tanet.edu.tw/. For example, my primary school is "sip:923414000@sip.ntrc.edu.tw"