README.md
October 5, 2018 ยท View on GitHub
sipcmd2 - simple SIP command line softphone
Introduction
Updated sipcmd command line soft phone that makes phone calls, accepts calls, enters DTMF digits, plays back WAV files and records them. A useful testing tool for VoIP systems. Runs on Linux.
Install
Dependencies
Amazon Linux 2 / RHEL 7 / CentOS 7
yum install opal-devel ptlib-devel && yum groupinstall 'Development Tools'
Ubuntu
apt-get install opal-dev ptlib-dev
Ubuntu 14.10
apt-get install libopal-dev
Ubuntu 12.10
apt-get install libpt-dev libopal-dev
Debian
apt-get install libopal-dev libpt-dev
Download
git clone https://github.com/guisousanunes/sipcmd2.git
Compile
make
(To disable debug messages, comment out DEBUG flag from Makefile)
Environment
If you compile the dependencies from source, make sure that libpt and libopal are in your LD_LIBRARY_PATH. The default installation location is /usr/local/lib.
Run
Run options:-u--user username (required) -c --password password for registration -a --alias username alias -l --localaddress local address to listen on -o --opallog enable extra opal library logging to file -p --listenport the port to listen on -P --protocol sip/h323/rtp (required) -r --remoteparty the party to call to -x --execute program to follow -d --audio-prefix recorded audio filename prefix -f --file the name of played sound file -g --gatekeeper gatekeeper to use -w --gateway gateway to use
-l or -p without -x assumes answer mode. Additional -r forces caller id checking. -r without -l, -p or -x assumes call mode.
To register to a gateaway, specify -c, -g and -w
Example:
./sipcmd -P sip -u [username] -c [password] -w [server] -x "c
WAV file requirements:
- mono
- 8 kHz sampling rate
- 16 bits sample size
The EBNF definition of the program syntax:
prog := cmd ';'| cmd := call | answer | hangup | dtmf | voice | record | wait | setlabel | loop call := 'c' remoteparty answer := 'a' [ expectedremoteparty ] hangup := 'h' dtmf := 'd' digits voice := 'v' audiofile record := 'r' [ append ] [ silence ] [ iter ] millis audiofile append := 'a' silence := 's' closed := 'c' iter := 'i' activity:= 'a' wait := 'w' [ activity | silence ] [ closed ] millis setlabel:= 'l' label loop := 'j' [ how-many-times ] [ 'l' label ]
Examples:
"l4;c333;ws3000;d123;w200;lthrice;ws1000;vaudio;rsi4000f.out;j3lthrice;h;w2000;j4"
Parses to the following:
- do this four times:
- call to 333
- wait until silent (max 3000 ms)
- send dtmf digits 123
- wait 200 ms
- do this three times:
- wait until silent (max 1000 ms)
- send sound file 'audio'
- record until silent (max 4000 ms) to files 'f-[0-3]-[0-2].out'
- hangup
- wait 2000 ms
"lstart;a;lwai;w1000;j10lwai;d5;lafterwai;w1000;j10lafterwai;h;j0lstart"
Parses to the following:
- do this infinity times:
- wait for a call and answer
- wait 10 s (using label and jump)
- send dtmf 5
- wait 10 s (using label and jump)
- do this three times:
- hangup
Credits for sipcmd creator tmakkonen in project sipcmd.