Registrar
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?
- Start Wireshark with capture filter "udp port 5060".
- Register to our own SIP server
- pjsua --id=sip:111321___@sip.ncnu.net
--registrar=sip:sip.ncnu.net
- Assume 111321___ is your student ID.
- In Wireshark you should observe a pair of SIP messages:
- Observe the "Contact" header field in the 200 OK. It should
contain the IP address of your SIP UA.
- The parameter "ob" stands for "Outbound". You may check
RFC 6314
for more details.
- 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.
- Pay attention to the "Expires: 0" header field in the REGISTER
request, and the absence of "Contact" header field in the 200 OK.
Make calls through our own SIP server
- Start PJSUA with the options mentioned above.
- Make a call to your partner.
- Observe the SIP signaling.
- Pay attention to the facts that there are two "Via" header
fields in the INVITE request.
- Write down the corresponding IP addresses, and discuss with
your partners about
which hosts possess these IP addresses, respectively.
- Compare the INVITE message sent from the caller, and the
INVITE message received by the callee. The values of
"Max-Forwards" header field are different. Discuss with your
partner about the meaning of the difference.
- Here is a sample pcap file.
RTP (Real-time Transport Protocol)
- Inspect the SDP contents of INVITE and 200 OK. Discuss with
your partner and try to understand the "c" and "m" fields.
- "c" stands for "connection". You will see the IP address
of your UA.
- "m" stands for "media". You will see the UDP port number
to transport audio in RTP.
- Suppose the RTP port is 4002.
- Start another Wireshark to capture UDP packets at that port
by specifying the capture filter "udp port 4002".
You may wish to limit Wireshark to capture only 500 packets,
otherwise you may get a huge number of packets
(50 packets per second in each direction).
- If Wireshark does not recognize these packets, you may teach
it. Select "Analyze - Decode As", add a rule for "UDP port 4002" as
"RTP". Now Wireshark will parse the packets correctly.
Codecs
- 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.