3

I want to control the Raspberry using my phone.

I want to be able to call a phone number, the Raspberry Pi should answer, play me an .mp3, or a .wav, then interpret Dual Tone Multi Frequency (DTMF) codes that I dial.

Is this feasible? Has someone made it work?

Greenonline
  • 2,740
  • 4
  • 23
  • 36
opc0de
  • 644
  • 5
  • 11
  • 18

2 Answers2

3

This is one case Asterisk was created for. So yes, it's feasible, no I haven't tried on a Pi, but Asterisk isn't very resource hungry so it shouldn't be a problem. Also there is a whole project dedicated to it. There are also tutorials for using Asterisk as an answering machine.

Greenonline
  • 2,740
  • 4
  • 23
  • 36
Max
  • 217
  • 2
  • 10
2

uElastix is designed for this to run on your Pi.

enter image description here

But you still need a PSTN Gateway- You can't (and please do not) connect PSTN directly to your Pi or any custom made device. A cheap and good one is Linksys PAP2T and lots on ebay. I would recommend SPA3102 and that is what I used at home.

enter image description here

Then you configure the SPA3102 to forward calls to uElastix and you can write custom scripts in Asterisk to execute PHP files, Bash Scripts or anything you want!

TIPS

  • You could not use the SPA gateway and redirected your home number to a virtual sip number / provider that will connect yo your pi over the internet. But you have to make sure your internet is always on. Then you can also use an wireless IP phone at home that just needs to be connected to your Wifi.
  • Performance of Asterisk on the Pi depends if you are going to transcode audio. If you enable pass through it will reduce CPU use but possibly require more bandwidth. Transcoding will use less bandwidth, more CPU. Essentially Each user will use a bit of CPU. SO pass thought users could use 10% meaning you can have 10 simultaneous calls. Transcoded users could fall to 2 or 3 simultaneous calls.
  • Some Telecom providers already provide you with SIP alternatives, where you can use that in Asterisk to dial out and you will get billed to your Telecom. For example BT in the UK, and also you can use IP phones on other shared BT networks or private WiFi to place and receive calls via your account or asterisk.

The provided guide for answering machines. Skip all the installing bits and just use uElastix. Then just use the extensions and configuration they show there as that is pretty basic Asterisk stuff. uElastix works really well on the Pi

Good luck though. Scripting in Asterisk is not easy and learning is even worse! But once you got it working you will be proud!

Piotr Kula
  • 17,307
  • 6
  • 65
  • 104