[Lab] Instant Messaging

  1. Start Wireshark, and capture with the filter "udp port 5060 and udp[4:2] > 10".
  2. Start PJSUA as "pjsua.exe --no-tcp --id=sip:111321___@sip.ncnu.net --registrar=sip:sip.ncnu.net".
  3. You will see a command menu of PJSUA.
    +=============================================================================+
    |       Call Commands:         |   Buddy, IM & Presence:  |     Account:      |
    |                              |                          |                   |
    |  m  Make new call            | +b  Add new buddy        | +a  Add new accnt.|
    |  M  Make multiple calls      | -b  Delete buddy         | -a  Delete accnt. |
    |  a  Answer call              |  i  Send IM              | !a  Modify accnt. |
    |  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr  (Re-)register |
    |  H  Hold call                |  u  Unsubscribe presence | ru  Unregister    |
    |  v  re-inVite (release hold) |  t  Toggle online status |  >  Cycle next ac.|
    |  U  send UPDATE              |  T  Set online status    |  <  Cycle prev ac.|
    | ],[ Select next/prev call    +--------------------------+-------------------+
    |  x  Xfer call                |      Media Commands:     |  Status & Config: |
    |  X  Xfer with Replaces       |                          |                   |
    |  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump status   |
    |  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump detailed |
    | dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump config   |
    |                              |  V  Adjust audio Volume  |  f  Save config   |
    |  S  Send arbitrary REQUEST   | Cp  Codec priorities     |                   |
    +-----------------------------------------------------------------------------+
    |  q  QUIT      L  ReLoad       I  IP change     n  detect NAT type           |
    |  sleep MS     echo [0|1|txt]                                                |
    +=============================================================================+ 
  4. Type the command "i" and press ENTER.
  5. It will ask you to input the SIP URI of your partner (e.g., "sip:111321xxx@sip.ncnu.net".
  6. Your partner will now receive the "Message Composing Indication", among some debugging messages of PJSUA.
  7. Type the message you want to send to your partner and press ENTER. Now he/she will see the 1-line message.
  8. Observe the MESSAGE requests in Wireshark.
    1. On the receiver side, there are two "Via" header fields because this message is routed via a SIP proxy server. The value of "Max-Forwards" header fields is decremented from 70 to 69.
    2. The "Content-Type" header field is "text/plain".
    3. The message which you typed is in the message body.