1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Guides' started by pc-tecky, Apr 8, 2018.

  1. pc-tecky

    pc-tecky Member

    Joined:
    May 1, 2013
    Messages:
    148
    Likes Received:
    21
    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.
     
    #1
    Last edited: Apr 9, 2018
  2. pc-tecky

    pc-tecky Member

    Joined:
    May 1, 2013
    Messages:
    148
    Likes Received:
    21
    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!
     
    #2
  3. PigLover

    PigLover Moderator

    Joined:
    Jan 26, 2011
    Messages:
    2,635
    Likes Received:
    1,029
    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.

    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???).
     
    #3
    T_Minus likes this.
  4. T_Minus

    T_Minus Moderator

    Joined:
    Feb 15, 2015
    Messages:
    6,222
    Likes Received:
    1,247
    Awesome!
     
    #4
  5. ttabbal

    ttabbal Active Member

    Joined:
    Mar 10, 2016
    Messages:
    617
    Likes Received:
    175
    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. :)
     
    #5
  6. chilipepperz

    chilipepperz Active Member

    Joined:
    Mar 17, 2016
    Messages:
    147
    Likes Received:
    36
    @pc-tecky you should get this on the main site with Patrick.
     
    #6
  7. pc-tecky

    pc-tecky Member

    Joined:
    May 1, 2013
    Messages:
    148
    Likes Received:
    21
    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
     
    #7
    Last edited: Apr 15, 2018
    JustinH and Patrick like this.
  8. pc-tecky

    pc-tecky Member

    Joined:
    May 1, 2013
    Messages:
    148
    Likes Received:
    21
    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.
     
    #8
    Last edited: Apr 15, 2018

Share This Page