RaspberryPI: Make SIP outgoing calls using linphonec or an alternative SIP phone

In my project, I want my raspberry PI to dial the outgoing PSTN.

I have a SIP account with a regular phone number assigned and I can make the mentioned outgoing calls on OSX using Telephone.app :

call-ok

Now I tried to achieve the same thing on my raspberry PI using linphonec

First, I will register my SIP provider with linphone, which seems successful:

 $ sudo apt-get install linphone $ linphonec linphonec> register sip: 4100000004@free4.voipgateway.org free4.voipgateway.org <PASSWORD> Registration on sip:free4.voipgateway.org successful. 

Then I try to call 004100000018 with the error results.

 linphonec> call 0041000000018 Establishing call id to <sip: 0041000000018@free4.voipgateway.org >, assigned id 1 Contacting <sip: 0041000000018@free4.voipgateway.org > Call 1 to <sip: 0041000000018@free4.voipgateway.org > in progress. Remote ringing. Early media. Call 1 with <sip: 0041000000018@free4.voipgateway.org > early media. Call declined. Call 1 with <sip: 0041000000018@free4.voipgateway.org > ended (Call declined). 

I also tried +41 , not 0041 , but that didn't work either. PI is connected to the Internet, but I'm not sure if this is a problem with a proxy server or a firewall, or if I use linphone incorrectly.

Note: Usually I do not have to use linphone. Therefore, if there is another client that does not use the UI that would do the job and that I could use scripts or APIs in some way, then I would be more than happy to do this too.

Troubleshooting

I raised the level of the log and ran into:

 ortp-error-eXosip_dnsutils_naptr_lookup: res_query failed ('free4.voipgateway.org NAPTR') 

Then I found the following remark about this thread

Your exosip version may be old and buggy. You can try updating exosip and recompiling your version of linphone. Or better, the git clone phone and the new sip-stop cartridge.

So, I checked the linphonec version, and currently I got 3.5.2, while they advertise 3.8 on the site. So I will try to upgrade to version 3.7 with of this. this manual

Update

Similar questions on SO:

+2
source share
1 answer

I also work with raspberry pi and VoIP, and have also tried linphone. I had a lot of trouble and switched to PJSIP , which is much better. It has good documentation and much more functionality.

The problem is tuning because you need to install it by source. I installed it on raspbian jessy like this (runs as root or uses sudo):

 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 /home/pi wget http://www.pjsip.org/release/2.4.5/pjproject −2.4.5.tar.bz2 tar −xvjf pjproject −2.4.5.tar.bz2 cd pjproject −2.4.5.tar.bz2 ./configure && make dep && make 

It is important to note that this is a minimal installation, in order to support video or more codecs you should visit this getting started guide .

If your problem is really a firewall, all this will not help you. What I did was set up my own VoIP server called Asterisk . This takes some time, but then you will have a good system that is independent of online services. Another solution would be to configure your router correctly, so it bypasses the calls from free4.voipgateway.org to your raspberries.

+1
source

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


All Articles