Linux command line:
linphone includes a scriptable
linphonec command-line version. Starting
linphonec with the
--pipe option will create a socket in
/tmp that one can write to and read from.
It fulfills all your requirements and I've tested (for my own uses) all of them successfully:
- Calling via SIP,
- transmitting DTMF sequences,
- recording a call to file, and
- via parsing its output, you can see when the call finishes and quit the program.
You'd do a loop like this:
linphonec --pipe 2>&1 |
while read -r line
case $line in
echo ">>> initializing"
for command in "soundcard use files" "record $filename" "call $number"
echo -n $command | nc -q 5 -U $socket
*Call\ *\ with\ *\ connected. )
echo ">>> sending pass"
echo -n "play $passfile" | nc -q 5 -U $socket
*Call\ *\ ended. )
echo ">>> quitting"
while echo -n quit | nc -q 5 -U $socket 2&>-
i=$(expr $i + 1)
if test $i -ge 5
echo $(basename $0): could not shut down linphonec &>2
echo ">>> END"
This is not yet on optimal solution. Note that under
>>> sending pass, I'm playing a wav file instead of sending a DTMF sequence.
linphone is capable of the latter, but during my cursory fiddling I haven't yet found the right way to do so while sound in- and output is on file basis to allow recording.
Sadly, linphone documentation is sparse. I've had best results just starting
linphonec interactively and using the builtin