Is it possible to use an Android phone as a simple GSM gateway?
The phone would receive a VoiP call using (preferably) Android built-in SIP stack, initiate a GSM call, and bridge audio both ways. After one call is terminated, the other one ends, too.
How could I approach the problem? My earlier attempts failed at bridging audio between connections. Is there a SDK supported way of doing this, that I missed? Or do I need to implement some sort of a workaround?
VoIP call forwarding works using Voice over Internet Protocol (VoIP). A VoIP phone system handles phone calls over the internet and can direct them to any number that is desired. Users can forward phone calls all within the VoIP phone system.
Call forwarding settings can be updated in the Admin Portal, the User Portal, or from a VoIP Phone. This feature overrides device settings and makes it easy to forward calls to a cell phone or landline when users are not able to use their primary device.
There are two problems with what you are asking:
Recording Cellular Audio
Check out this link for some details on how it can be done on some devices. The API they use is the MediaRecorder api. Once you have the audio stream you can then encode it and send it down the SIP call side.
Playing Audio To A Cellular Call
This is most likely the most tricky bit as there is no Google API to get at the outgoing audio stream directly. I can only think of two possible ways to do this.
I personally don't think any of these suggests are worth pursuing and you are better off following the commenters advise and go with something like a VOIP PABX like Asterix with a PTSN/GSM gateway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With