RasPBX (Apr 2018) getting calls with Google Voice and Bluetooth

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

pc-tecky

Active Member
May 1, 2013
202
26
28
The Hardware:
Raspberry Pi 3 Mobel B, RasPBX (raspbx-03-12-2017.zip) installed on an 8GB microSD card (or the close fitting Sandisk USB FIT flash drive), 10/100 or 10/100/1000 Ethernet switch, and a few new old stock xBlue Networks X-2020 10/100 VoIP phones, network cables, and a power strip.

Really, any Linux based PBX solution for ARM CPUs should work. I choose RasPBX. Maybe Incredible PBX is better? IDK, haven't tried it yet. (edit: I first got this working, then took some time to find my source and document my findings, did a rough check for errors all using the image contained within the raspbx-03-12-2017.zip file. I just barely saw a newer raspbx-04-04-2018.zip file is available (4-9-18). Thus, the need to further clarity. I will investigate further with my second deployment set.)

Visit Google to:
1) Register for GMail and claim a GMail email address, if you haven't already
2) Register for Google Voice and claim phone number, if you haven't already
3) Get your Google OAuth token for use with Google Voice

(primary source published Aug 2016 -- Google Voice with OAuth 2 Comes to Incredible PBX for XiVO – Nerd Vittles)

I wish there was an easier and more straight forward means to get this OAuth v2.0 Refresh Token from Google. This method does work and it is direct from Google, but it's clunky and therefore not easy or as straight forward as I think it could be.

Visit OAuth 2.0 Playground
Click on the Gear icon in upper right corner.
Check the box: Use your own OAuth credentials
Enter Incredible PBX OAuth Client ID:
466295438629-prpknsovs0b8gjfcrs0sn04s9hgn8j3d.apps.googleusercontent.com

Enter Incredible PBX OAuth Client secret:
4ewzJaCx275clcT4i4Hfxqo2

Click Close (the link at botton of the pop-up window you are currently working in)

To the left under "Step 1 Select & authorize APIs" section and just below the scroll box full of options is a text box. Enter:
https://www.googleapis.com/auth/googletalk

Then click the blue Authorize APIs button to the immediate right of the text box.
Step 1 section will fold up while the "Step 2 Exchange authorization code for tokens" expands.

Click the blue Exchange authorization code for tokens button

After the tokens are generated, Step 2 section will fold up and "Step 3 Configure request to API" section will expand. We want the Refresh Token that's just been generated and hiding in Step 2 section, so click on "Step 2 Exchange authorization code for tokens" to expand Step 2 again where you can then obtain your Refresh_Token.

Treat this Refresh Token with great care and store it securely, just like you would your user name and password to your online bank account. Authorization tokens NEVER expire! If you ever need to remove your authorization tokens, visit https://myaccount.google.com/permissions and delete Incredible PBX Google Voice OAUTH entry by clicking on it and choosing DELETE option.

Now that we have the needed Google OAuth token, we can continue with RasPBX or Incredible PBX.
Visit Sign in - Google Accounts and then click Sign-in & Security, near the bottom click on Allow less secure apps: OFF to toggle this ON. This is temporary while we get things tested and established.

Visit http://raspbx.local and login. (I presume this has been copied, installed, and somewhat configured. Google is your friend. Writing the image to an SD card will take some time - 10 to 30 minutes.)

Creating VoIP phone extensions:
From Applications drop-down menu, click Extensions. HINT: The User Extension and Secret of [Asterisk] PBX will be the VoIP phone user name and password respectively. I choose to start with 101 for the extension and an easy to recall password. The random secret like "9934e0a3f9149441e0f5ce3c418e3987" using the alpha-numeric on the VoIP phone keypad looked laborious and error prone - no thanks! Might be just fine if the phone has a webGUI of sorts to work with. Click the floating Submit bottom near the bottom to save these new settings. Then click the red Apply Config button at the top. (From hereon out I'll simply refer to these steps as Submit and Apply.)

YMMV as VoIP phones will vary in how they are setup and configured. Do take note of the port being used with the protocol. RasPBX has Chan_SIP defaulting to Port 5160 and Chan_PJSIP defaulting to Port 5060. Of course, as both the administrator and the end user, you change these up if so desired (just be consistent and reasonable, maybe 10.

The Ring Group:
From Applications drop-down menu, click Ring Groups. I created a ring group so that all extensions will ring for income calls. In theory, Paging would be very similar. Assign a number to the ring group, I choose 85, and select all the phone extensions you want to ring for inbound calls. Submit and Apply.

The finesse to get Google Voice working (with RasPBX - it seems a bit broken).

Downgrade to Google Voice/Motif v12.0.4.2:
From Admin drop-down menu, click Updates, and then click the Modules Updates tab.
Click the light blue Check Online button.
Find and expand the Google Voice/Chan Motif module under the Connectivity Module section.
Click Previous button, then select version 12.0.4.2. Click the Rollback button next to [version] 12.04.2. Click the Confirm button on the next screen. Then click the red Apply Config button.

Using the lower security Google Voice/Motif credentials:
From Connectivity drop-down menu, click Google Voice (Motif).
Enter the required details: your Google GMail user account name (i.e., the "johndoe" from johndoe -at- gmail.com), Google password, and your claimed Google Voice number. Both Create Outbound Routes and Create Trunk should be ON/Checked/Toggled. Then click Submit and Apply.

Test your configuration and try making a few calls. Once satisfied, we will need to revert a few things.

Upgrade to Google Voice/Motif 13.0.3.2:
From Admin drop-down menu, click Updates, and then click the Modules Updates tab.
Click the Check Online light blue button.
Find and expand the Google Voice/Chan Motif module under the Connectivity Module section.
This time around click the Download and Upgrade to 13.0.3.2 button. Scroll down and click the Process button. Click the Confirm button on the next screen. Then Apply.


Using the higher security OAuth 2.0 with Google Voice/Motif:
From Connectivity drop-down menu, click Google Voice (Motif).
This time we will edit the Google Voice (Motif) settings.
Click OAuth 2 to use the Refresh_Token obtained earlier (above).
Enter your Google Voice Refresh Token in the text box.
Since we have already established the Trunk and Outbound Routes the first time around, let's turn them off to prevent problems the second time around (yep, had to do this three times myself).
Set Configure Trunk to No with the No button.
Set Configure Outbound Routes to No with the No button.
Then click Submit and Apply.

Test the phone(s) and line(s) once more. If issues arise and you can't dial out, then you will need to revert back to Google Voice/Motif version 12.0.4.2, test phone(s) and line(s) again, then upgrade to the latest version of Google Voice/Motif, then edit your Google Voice (Motif) settings and try again with using the Google Voice Refresh Token.

Happy with how things are working, visit Sign in - Google Accounts again, click Sign-in & Security, and near the bottom of the page click on Allow less secure apps: ON to toggle this OFF (reverting back to just how we found it).

Next, I want to try and tackle VoIP calls with my cell phone via Bluetooth.

PS - Some minor tweaks for clarity and a newer image apparently is now available.
 
Last edited:

pc-tecky

Active Member
May 1, 2013
202
26
28
Strange.. I know Raspberry Pi foundation did a whole write-up on how to enable the Raspberry Pi 3 B to boot via USB and how to also modify the SD card image so it could USB boot without hanging. The heavily modified write-up now simply states that all versions of Raspbian on or after 2017-04-10 can be written to a USB drive as is without further modification. Great, but ah, why take away the old write-up entirely? The information is still good to have. :confused: why not simply post the easier updated process as version 1.2, 1.5, or 2.0?!? o_O Since I can't find it at the moment, I'll post it here --

The original:
Code:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
The modification:
Code:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Now I know I'm still missing something, as the "/boot/" is the first partition using FAT32 effectively SDA1 and the rest of it "/ (i.e., root)" is in the second partiotion SD2 or subsequent partition(s) using EXT4. Now my error is that "/boot/" is effectively lost or misplaced to the system. Without making this tiny change, trying to boot RasPBX will hang and fail to completely boot when trying to use a USB drive. I think the issue would be mute if the latest Raspbian - Stretch Lite/Debian 9 dated on or after 2017-4-10 from the Raspberry Pi Foundation was used instead.

And here is the lastest from Raspbian Stretch:
Code:
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=1b41c278-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
Very interesting.. "root=PARTUUID=..." ..very interesting indeed!
 

PigLover

Moderator
Jan 26, 2011
3,184
1,545
113
Rather than booting from the USB drive, I prefer to just "boot" from an SD card, but set the rootfs to live on the USB drive. Its much easier and achieves the real goal of getting the file system itself - the part that sees writes and needs a tick more performance - off of the SD card. All you have to do is copy the rootfs and modify the "rootfs" boot argument. /boot stays happily on the SD card.

Its just a preference.

...
Very interesting.. "root=PARTUUID=..." ..very interesting indeed!
This part has little to do with the change to boot from USB. Its just the evolution of Linux in general. Setting the boot partition by UUID is considered more secure. The old device specifications still work if you want to use them (/dev/sd???).
 
  • Like
Reactions: T_Minus

ttabbal

Active Member
Mar 10, 2016
743
207
43
47
I have a couple of Pis booting with NFS root as well. Same setup, the standard kernel NFS root syntax works. Just in case you wanted yet another option. :)
 

pc-tecky

Active Member
May 1, 2013
202
26
28
Well... things looked good..until it got hung up on system check to /boot/ that it couldn't find and then freaked out. So...that's five steps back for every step forward, right? Now I've got a jumbled mess of SD cards. This RasPBX image is well under 250MB. Might just skip the SD and try going for the PXE boot from the SSD. Or just need to find more 1GB or 2GB microSD cards.

I'll have to look more into that 'root=PARTUUID=####' to see if will prevent hanging...

edit: I shouldn't be so eager to post-- after looking at things closer, RasPBX is well compressed, but it still needs at least a 4GB card just like Raspbian (Jessie or Stretch , full or lite). On that note
 
Last edited:
  • Like
Reactions: JustinH and Patrick

pc-tecky

Active Member
May 1, 2013
202
26
28
More steps backwards.. With a fresh install, I can get things working. Maybe I'm quickly throwing too many switches all at once in trying to keep things safe and secure - ATM, bottom line is within under 12 hours, things go from working well to things not connected.

Patrick can take it to the front page if he likes - it's a recipe of sorts. I just took a hunch, explored it, added my two cents complete with the end results from my findings, but frustrated and lost as to why things quickly go south after 12 hours.
 
Last edited:

pc-tecky

Active Member
May 1, 2013
202
26
28
Update.. I really liked RasPBX as it seemed to have a cleaner looking GUI, and using, I believe, the latest versions of Asterisk and FreePBX. But Google Voice would only work for 5 minutes at best using the degraded security state setting over at Google. So I took another look at Incredible PBX. While using the prior version of Asterisk and FreePBX, the image has been updated to be USB boot capable (yep, keep coming back to this root=PARTUUID="...". still unclear on FAT32 "/boot/" partition, but I suspect there is an entry in the /etc/fstab file to massage as well that I haven't tried, otherwise it panics and errors out) and Google's oAuth2.0 simply works with this platform right out of the ... box (hmm, but it didn't even come in a box..).

On the note of VoIP calls using Bluetooth on the cell phone... still looking... all the write-ups are old (plenty of things can happen even in 6-months, but things have changed even from 2015, and forget about 2012) and done completely without the GUI.. I have been able to pair my phone up, and that's where thing stop as the old write-ups talk about editing files, and when I go to edit those files, they are plastered with warnings about how they have been auto-generated..
 
Last edited:

mmo

Well-Known Member
Sep 17, 2016
558
357
63
44
i have been testing Raspbx and incredible pbx for past couple days. i did get inbound calls without any issues but outbound was not working at all, found out the newer version of GV/motif v13.0.4 fixed this issue and now it works perfectly. incredible pbx just comes with a lot of preloaded modules already, but Raspbx is much cleaner and more updated (incredible pbx comes with Asterisk 13.xx and Raspbx is updated to 14.xx).

Another interesting topic is SIP vs SCCP. i setup a Cisco 7961 with sccp firmware and found out it's a lot of better and very easy to change the phone interface by modifying the xml files. And it's quite cheap on eBay as well.
 

pc-tecky

Active Member
May 1, 2013
202
26
28
Update: It seems Google Voice only works the OBIHAI OBi200 SOHO hardware device or through specific interfaces (Apps or Sites under Google's control). So using Google Voice in this manner has been dead for a while now, maybe 6-months. It's been well documented, or rather the documented methods have all been removed, with the reason being something to the effect of Google said to do so or else...
 

marcoi

Well-Known Member
Apr 6, 2013
1,532
288
83
Gotha Florida
Update: It seems Google Voice only works the OBIHAI OBi200 SOHO hardware device or through specific interfaces (Apps or Sites under Google's control). So using Google Voice in this manner has been dead for a while now, maybe 6-months. It's been well documented, or rather the documented methods have all been removed, with the reason being something to the effect of Google said to do so or else...
yep that is true. I sunset my VOIP Server and moved to OBIHAI phone to continue using GV.