ESP32 suiteable as a VoIP phone?
Posted: Fri May 04, 2018 5:53 pm
Hi guys,
I'm new to microcontrollers but a software engineer and I was wondering if the ESP32 was suitable as a VoIP phone / gateway. My idea was to:
* Buy a cheap phone that connects to POTS landline (provided to me free of charge by my cable modem provider)
* Wire up the ESP32 to the Headset of the phone, e.g. connect the Mic and Speaker to the ESP32
* Connect the hook to a GPIO of the ESP32
* Connect the ringer of the phone to another GPIO
Then in software I would like to:
* Detect the ringing and initiate a SIP call to my Asterisk PBX
* On pickup on the SIP side, toggle the hook GPIO so that the phone signals to the landline that the call should be established.
* Sample the audio from the phones speaker as input for a RTP stream to Asterisk (PCM)
* Provide the RTP stream from Asterisk to the Mic input of the phone
I'm familiar with SIP and RTP, I know a bit of C programming (from University) - these days I'm almost exclusively Java and JavaScript, but hey challenge accepted! My weak point is the microcontroller part of the project as well as the electronics.
For the microcontroller stuff I already made some experiments with RTP streams, which worked kind of OK given I only spent an hour with my ESP32 until now. I was thinking about using FreeRTOS to have multiple tasks for listening to SIP and relaying the audio / RTP streams. Do you think the ESP32 has the power to do that?
However I'm not so sure about the electronics part. I saw sample projects of people using the ESP32 to record audio or to playback audio. I'm not sure if they are doing it "manually" or using the I2S bus which as far as I understand can be connected directly to GPIOs to have analog audio with very limited CPU involvement. Audio quality is of course an issue, so I tend to think buying some kind of amplifier which does all the filtering and stuff for me, any suggestions for hardware?
What do you think about it, is the ESP32 suitable for this job, or should I rather give it a try with e.g. a Raspbery Zero (which sadly also doesn't have a standard audio Jack, but at least is a lot faster).
Thanks - feedback is highly appreciated!
I'm new to microcontrollers but a software engineer and I was wondering if the ESP32 was suitable as a VoIP phone / gateway. My idea was to:
* Buy a cheap phone that connects to POTS landline (provided to me free of charge by my cable modem provider)
* Wire up the ESP32 to the Headset of the phone, e.g. connect the Mic and Speaker to the ESP32
* Connect the hook to a GPIO of the ESP32
* Connect the ringer of the phone to another GPIO
Then in software I would like to:
* Detect the ringing and initiate a SIP call to my Asterisk PBX
* On pickup on the SIP side, toggle the hook GPIO so that the phone signals to the landline that the call should be established.
* Sample the audio from the phones speaker as input for a RTP stream to Asterisk (PCM)
* Provide the RTP stream from Asterisk to the Mic input of the phone
I'm familiar with SIP and RTP, I know a bit of C programming (from University) - these days I'm almost exclusively Java and JavaScript, but hey challenge accepted! My weak point is the microcontroller part of the project as well as the electronics.
For the microcontroller stuff I already made some experiments with RTP streams, which worked kind of OK given I only spent an hour with my ESP32 until now. I was thinking about using FreeRTOS to have multiple tasks for listening to SIP and relaying the audio / RTP streams. Do you think the ESP32 has the power to do that?
However I'm not so sure about the electronics part. I saw sample projects of people using the ESP32 to record audio or to playback audio. I'm not sure if they are doing it "manually" or using the I2S bus which as far as I understand can be connected directly to GPIOs to have analog audio with very limited CPU involvement. Audio quality is of course an issue, so I tend to think buying some kind of amplifier which does all the filtering and stuff for me, any suggestions for hardware?
What do you think about it, is the ESP32 suitable for this job, or should I rather give it a try with e.g. a Raspbery Zero (which sadly also doesn't have a standard audio Jack, but at least is a lot faster).
Thanks - feedback is highly appreciated!