Sip client for raspberry Pi, which works from the command line?

I want to use my raspberry pi as a SIP / VOIP phone, just controlling the RPI via SSH.

I found some tutorials and it seems that Twinkle is one of the most useful apps for this.

So, I have successfully installed flicker on my RPI, one SPI client on my Android phone, and I know that I can send text messages from one to another.

The thing is, I have to use the Twinkel GUI with X-Server forwarding (currently using MacOS with X11 and iTerm).

But I kind of want to automate the whole process, for example, using flicker from the command line, manage its scripts, etc.

So, obviously, no flicker is created for this. (there’s not even documentation for the account-config file, so I had to deal with this x11-forwarding file)

So my last question is: Is there a comparable SIP client for RPI that can be controlled through the CLI?

any hint is much appreciated. While googling this question, I just found projects working with asterisk server on RPI or attaching displays to it, but this is not what I am looking for ...

greetings and thanks

+9
source share
6 answers

I am doing the same thing and I came across additional options:

  1. Linphone : easy to install but I am unable to call
    RaspberryPI: outgoing SIP calls using linphonec or an alternative SIP softphone

  2. Call (formerly SFLphone): It looks promising, but you need to install it from the source
    Install the ring.cx SIP client on the Raspberry PI .
    Update : also check @aberaud answer below

  3. PJSIP (C library)

Twinkle CLI

From the SFLphone mailing list, I got this review that can help you:

I am interested to know if the project will write anything for this. By the way, I used the Twinkle SIP client, which allows you to send a command to an already running process, which, for example, allows you to answer an incoming call. It was really cool and allowed me to map some keyboard shortcuts to control the phone without switching the desktop and looking for good windows.

After some searching, I found some old scripts that allow you to manage older versions of sflphone using its DBUS API. Inspired by these scenarios, I wrote my own, compatible with the version of sflphone that I used (1.4.1 in Debian Wheezy):

https://gitlab.com/brenard/sflphone-ctl

It works weel, and I use it every day. Call forwarding does not work on my desktop, but it seems to be a bug in sflphone version 1.4.1.

BR

By the way: twinkle --help shows the following:

 --cmd <cli command> Instruct Twinkle to execute the CLI command. You can run all commands from the command line interface mode. When Twinkle is already running, this will instruct the running process to execute the CLI command. Examples: twinkle --cmd answer twinkle --cmd mute twinkle --cmd 'transfer 12345' 

So far I have not been lucky, but I really want it to work too.

+10
source

The best VOIP client for Raspbery Pi in my experience is Twinkle.

  sudo apt-get install twinkle 

Use the application to create a profile (i.e. set up an account) and name it flickering (all lowercase letters). This is saved in

  /home/pi/.twinkle/twinkle.conf 

The command below will lead you to the Twinkles command prompt.

  $ twinkle -c 
  Twinkle> call +17601234567

 Twinkle> bye

 Twinkle> quit 

 $

Here is a python script that should help you execute the command line:

  import sys
 from subprocess import Popen, PIPE

 proc = Popen (["twinkle", "-c"], stdin = PIPE, stdout = PIPE, bufsize = 1)

 for line in iter (proc.stdout.readline, b``):
     print line
     if (line.find ("registration succeeded")> 0):
         proc.stdin.write ("call +17601234567 \ n")
     #do whatever you want by adding code ...
     if (line.find ("far end answered call")> 0):
         proc.stdin.write ("bye \ n")
         proc.stdin.write ("quit \ n")
 proc.communicate ()
+3
source

Managing the Ring daemon (formerly SFLPhone) using a Python script:

  • Create the Ring daemon:

  • Run the Ring daemon: ./bin/dring -c -d . You should see that Ring works with some magazines. The first option, -c will print logs to the console (stdout / stderr) and -d will include debug logs.

  • Run the python3 D-Bus controller:

    • Open a new terminal before ring/tools/dringctrl until it starts.
    • Try to list the configured accounts: ./dringctrl.py --gara . If everything worked, you should at least see β€œIP2IP,” the default account that handles direct IP SIP IP calls.
    • Try calling another SIP endpoint with ./dringctrl.py --call someIP .
    • Run ./dringctrl.py --help to view the currently implemented commands in the python script.
  • Customize Ring and modify python script to suit your needs

    • Unfortunately, adding / configuring accounts from a python script has not yet been implemented (perhaps this will be possible). Account configuration is stored in /home/$USER/.config/ring/dring.yml . If you are planning a static configuration, you can edit the configuration file once manually or using one of the available graphical interfaces, possibly from another computer, and then copy the file (on the desktop just install the official packages: http://ring.cx/ en / documentation / gnulinux-installation ).
+2
source

What I get so far:

I am using RasPi B + with the Raspbian OS.

What I have tried so far: Twinkle (install using sudo apt-get install twinkle)

When it is configured, you can use it through the CLI, but unfortunately I could not configure Twinkle through the command line. I had to configure X-Forwarding for my Mac. I installed X11 (respectively XQuartz) for Mac. Therefore, I was able to see the graphical interface and configure Twinkle.

What worked: I could send messages, but when the call came in, Twinkle crashed. I have to say, there are currently no sound devices installed (no microphone, no speakers).

After that I searched for an SFL phone. This is not related to the CLI. Therefore, it is not worth checking.

I also read about Linphone. I have not tried this at this time, because some people report difficulties using it in their own applications.

The last thing I found is PJSIP.

I installed it like this:

 sudo su - apt-get install subversion svn checkout http://svn.pjsip.org/repos/pjproject/trunk apt-get install build-essential automake autoconf libtool libasound2-dev libpulse-dev libssl-dev libsamplerate0-dev libcommoncpp2-dev libccrtp-dev libzrtpcpp-dev libdbus-1-dev libdbus-c++-dev libyaml-dev libpcre3-dev libgsm1-dev libspeex-dev libspeexdsp-dev libcelt-dev cd trunk ./configure && make dep && make clean && make && make install 

It took some time and has a decent CLI. I was able to send and receive calls. While I wait for my USB sound card, microphone and some speakers to conduct a full test.

+1
source

Do you want to "use your raspberry pi as a SIP / VOIP phone just by controlling the RPI via SSH"?

IMHO's best and easiest solution:

just use the asterisk and its ingenious console interface + USB headset (e.g. Logitech H800 Headset) for this!

H800 is displayed as a normal sound card, to which the channel module of the asterisk "chan_alsa" is directly connected. What is it!

This gives me great sound quality and a clean console interface with unmatched sprocket capabilities. Completely lacking the annoyance of any GUI. Everyone runs around raspberries. Asterisk and chan_alsa (or even chan_oss) are an integral part of all major distributions.

Optionally, you can fully use the wireless network using the WLAN key on the remaining USB port.

+1
source

I have had success with the Simple SIP SDK. I was looking for something with OPUS support.

https://sipsimpleclient.org/

It is a bit of work to build. After assembly and installation

 sip-settings -a add 6010@172.31.0.1 1234678 <--password sip-settings -a default 6010@172.31.0.1 sip-settings -a set 6010@172.31.0.1 sip.outbound_proxy=172.31.0.1 sip-register <-- seems optional sip-audio-session sip: 5101@172.31.0.1 
0
source

Source: https://habr.com/ru/post/984658/


All Articles