**`sip-session`** command line script is a show-case for the powerful features of SIP SIMPLE Client SDK related to establishing, modifying and terminating SIP sessions with multiple media types like VoIP, Instant Messaging and File Transfer and support for multi-party conferencing.
The script has the following features:
# Registers with a SIP registrar and is available for incoming sessions
# Switches between multiple sessions and provides in-call controls like Hold and Mute
# Handles outgoing SIP sessions with combinations of media types based on RTP and MSRP protocols
# Performs NAT traversal using ICE and MSRP relay extension
# Provides control for the input, output and alert audio devices
# Records the RTP audio streams (input, output or combined)
# Handle ZRTP encryption (status, validation)
# Handle OTR encryption (status, validation)
# Performs blind Call Transfer
# Adds and removes participants to a conference
# Enable text input and output for Instant Messaging sessions
# Provides File Transfer capability with progress indicator
# Gives access to real-time traces of involved protocols (DNS, SIP, ICE and MSRP)
(NOTE) This script is available in the [[sip_clients]] package which must be installed separately from the SIP SIMPLE client SDK package.
= Example =
```
adigeo@ag-imac3:~$sip-session
Using account adi@umts.ro
adi@umts.ro> /help
General commands:
/call {user[@domain]}: call the specified user using audio and chat
/audio {user[@domain]} [+chat]: call the specified user using audio and possibly chat
/chat {user[@domain]} [+audio]: call the specified user using chat and possibly audio
/send {user[@domain]} {file}: initiate a file transfer with the specified user
/next: select the next connected session
/prev: select the previous connected session
/sessions: show the list of connected sessions
/trace [[+|-]sip] [[+|-]msrp] [[+|-]pjsip] [[+|-]notifications]: toggle/set tracing on the console (ctrl-x s | ctrl-x m | ctrl-x j | ctrl-x n)
/rtp [on|off]: toggle/set printing RTP statistics and ICE negotiation results on the console (ctrl-x p)
/mute [on|off]: mute the microphone (ctrl-x u)
/input [device]: change audio input device (ctrl-x i)
/output [device]: change audio output device (ctrl-x o)
/alert [device]: change audio alert device (ctrl-x a)
/quit: quit the program (ctrl-x q)
/help: display this help message (ctrl-x ?)
In call commands:
/hangup: hang-up the active session (ctrl-x h)
/dtmf {0-9|*|#|A-D}...: send DTMF tones (ctrl-x 0-9|*|#|A-D)
/record [on|off]: toggle/set audio recording (ctrl-x r)
/hold [on|off]: hold/unhold (ctrl-x SPACE)
/zrtp_verified: toggle verified flag for ZRTP peer (both parties must do it)
/zrtp_name name: set name for ZRTP peer
/otr: toggle OTR encryption for the chat stream
/otr_answer answer: Answer OTR verification question using SMP protocol
/otr_secret [secret]: show or set OTR secret
/otr_question question: Ask OTR verification question using SMP protocol
/add {chat|audio}: add a stream to the current session
/remove {chat|audio}: remove a stream from the current session
/add_participant {user@domain}: add the specified user to the conference
/remove_participant {user@domain}: remove the specified user from the conference
/transfer {user@domain}: transfer (using blind transfer) callee to the specified destination
/nickname nick: set the user nickname whithin a conference
Available audio input devices: None, system_default, Built-in Input, Built-in Microphone
Available audio output devices: None, system_default, Built-in Output
Using audio input device: Built-in Microphone (system default device)
Using audio output device: Built-in Output (system default device)
Using audio alert device: Built-in Output
Type /help to see a list of available commands.
2009-10-29 22:42:14 Registered contact "sip:puioxbqy@192.168.1.124:50150" (expires in 600 seconds).
Other registered contacts:
sip:jiozqyud@192.168.1.124:49569 (expires in 423 seconds)
Detected NAT type: Port Restricted
adi@umts.ro>
```
ICE connectivity checks results:
```
adi@umts.ro> /rtp
Output of RTP statistics and ICE negotiation results on console is now activated
adi@umts.ro> /audio ag@sip2sip.info
Initiating SIP session from 'sip:adi@umts.ro' to 'sip:ag@sip2sip.info' via sip:81.23.228.150:5060;transport=udp...
ICE negotiation succeeded in 0s:644
Local ICE candidates:
(RTP) 95.97.50.27:55656 type srflx
(RTP) 192.168.1.122:55656 type host
(RTP) 10.211.55.2:55656 type host
(RTP) 10.37.129.2:55656 type host
(RTCP) 95.97.50.27:55890 type srflx
(RTCP) 192.168.1.122:55890 type host
(RTCP) 10.211.55.2:55890 type host
(RTCP) 10.37.129.2:55890 type host
(RTP) 81.23.228.150:51782 type prflx
(RTCP) 81.23.228.150:51783 type prflx
Remote ICE candidates:
(RTP) 81.23.228.150:51780 type relay
(RTCP) 81.23.228.150:51781 type relay
(RTP) 95.97.50.27:55876 type srflx
(RTP) 192.168.1.122:55876 type host
(RTP) 10.211.55.2:55876 type host
(RTP) 10.37.129.2:55876 type host
(RTCP) 95.97.50.27:54037 type srflx
(RTCP) 192.168.1.122:54037 type host
(RTCP) 10.211.55.2:54037 type host
(RTCP) 10.37.129.2:54037 type host
ICE connectivity check results:
(RTP) 192.168.1.122:55656 <--> 192.168.1.122:55876 Succeeded
(RTP) 10.211.55.2:55656 <--> 10.211.55.2:55876 Succeeded
(RTP) 10.37.129.2:55656 <--> 10.37.129.2:55876 Succeeded
(RTCP) 192.168.1.122:55890 <--> 192.168.1.122:54037 Succeeded
(RTCP) 10.211.55.2:55890 <--> 10.211.55.2:54037 Succeeded
(RTCP) 10.37.129.2:55890 <--> 10.37.129.2:54037 Succeeded
(RTP) 95.97.50.27:55656 <--> 95.97.50.27:55876 Succeeded
(RTCP) 95.97.50.27:55890 <--> 95.97.50.27:54037 Succeeded
(RTP) 81.23.228.150:51782 <--> 81.23.228.150:51780 Succeeded
(RTCP) 81.23.228.150:51783 <--> 81.23.228.150:51781 Succeeded
Audio session established using "G722" codec at 16000Hz
Audio RTP endpoints 192.168.1.122:55656 (ICE type host) <-> 192.168.1.122:55876 (ICE type host)
```