问题
In my project I want my Raspberry PI to dial an outbound PSTN number.
I have a SIP account with an assigned regular phone number and I can make the mentioned outbound calls on OSX using Telephone.app:
Now I tried to achieve the same on my raspberry PI using linphonec
First I register my SIP Provider with linphone with seems to succeed:
$ 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 attempt to call 004100000018
with results in an error.
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
rather than 0041
but this did not work either.
The PI is connected to the internet but I am not sure if this is some Proxy or firewall problem or if I am not using linphone properly.
Note: Generally I don't necessarily have to use linphone. So if there is another non-UI sip client that would do the job and that I could somehow tap into using scripts or an API then I would be more than happy to do that too.
Troubleshooting
I did bring up the log level and encountered:
ortp-error-eXosip_dnsutils_naptr_lookup: res_query failed ('free4.voipgateway.org NAPTR')
I then found the following remark on this thread
Your version of exosip may be old and buggy. You may try to update exosip and recompile your version of linphone. Or better, clone linphone from git and new sip stack belle-sip.
So I checked the version of linphonec and I currently got 3.5.2 while on the website they advertise 3.8. So I will attempt to upgrade to version 3.7 using this guide. this guide
Update:
Similar questions on SO:
- Installing the "ring.cx SIP client" on a Raspberry PI
- SIP-Client for Raspberry Pi that works from command line?
回答1:
I am also working with raspberry pi's and VoIP and also tried out linphone. I had many troubles and switched to PJSIP, which is way better. It has a good documentation and much more functionalitys.
The problem it the setup, because you have to install it by source. I installed it on raspbian jessy like this (run as root or use 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
Important to say that this is the minimal installation, for video support or more codecs you should visit this getting started guide.
If your problem is really the firewall all this won't help you. What i did is setup my own VoIP-Server called Asterisk. It takes some afford and time but afterwards you will have a nice system which does not depends on online-services. Another solution would be to configure your router right, so he bypasses the calls from free4.voipgateway.org to your raspberry.
来源:https://stackoverflow.com/questions/29637142/raspberrypi-making-sip-outbound-calls-using-linphonec-or-an-alternative-sip-sof