FreePBX | Register | Issues | Wiki | Portal | Support

How-To Guide for Google Voice with Freepbx 14 & asterisk gvsip, Ubuntu 18.04

asterisk
pjsip
freepbx
Tags: #<Tag:0x00007fdf9a8b9878> #<Tag:0x00007fdf9a8b9580> #<Tag:0x00007fdf9a8b9350>

#400

possibly not, goto the section that says “Clone Naf’s gvsip branch:”

cd /usr/src/asterisk
sudo sed -i 's/MAINLINE_BRANCH=.*/MAINLINE_BRANCH=15/' build_tools/make_version
sudo contrib/scripts/install_prereq install
sudo contrib/scripts/get_mp3_source.sh
sudo reboot

do it like above and continue the guide from there.

If the install fails you can just start from square 1 again.


(Rob Thomas) #401

None of those things actually require sudo. Unless you ran a git clone as root too. See why I’m saying don’t use it? Just don’t. (install_prereq does, of course, as that’s installing system packages)


(Andrew Nagy) #405

This is because asterisk is running as root. This is not something you want.


(Rob Thomas) #407

I’ve had to go through and delete a bunch of posts, because people aren’t listening, and are doing REALLY SILLY things.

If you’re running ‘sudo’ then the odds are, you’re doing it wrong.

This documentation should probably be in a Wiki page somewhere, so there’s a single source of information, without conflicting ‘do this’ and then ‘no, do that’ instructions.


#409

It’s working and I don’t mind getting into into Asterisk CLI with sudo command. I can make google voice calls and everything is working just fine.


(Rob Thomas) #410

And this is why I’m deleting all your posts. You must NEVER run asterisk as root. It provides a trivial way to attack your machine if it gets even SLIGHTLY compromised.

Please. Listen to us. If we say you’re doing it wrong, it’s not because we have something against you. It’s because you’re doing it wrong.


(Rob Thomas) #411

So, @xekon I think it’s going to be better for you to move this to a Wiki page.

Unfortunately, there’s a bunch of legal stuff that makes us SUPER WARY of hosting this on our Wiki (sorry, but we REALLY don’t want to annoy Google!) - but if you were to put it on a GitHub Wiki Page, you can just direct people to the normal ‘Install FreePBX on whatever’ documentation, and then ‘After you’ve installed FreePBX, this is how to rebuild asterisk’.

As you’ve done all the hard work to figure out the Ubuntu 18 install, that should probably go https://wiki.freepbx.org/display/FOP/Version+14.0+Installation on its own page.

I also did check the Debian (well, RPi) Asterisk builds, and they didn’t need to be rebuilt, so you can skip that on the Ubuntu documentation, but put a disclaimer about ‘You will be rebuilding Asterisk later, after you have tested this with a local SIP client’ or something like this.

Edit: If someone ELSE wants to document this, and doesn’t have edit permissions on the wiki, just send me a PM here and I’ll fix your account.

Edit 2: Google scares us, so the instructions will have to go somewhere else.


#412

Thanks @xrobau, this thread, although well meant, went of the rails a very long time ago.

It really is very easy to use any flavor of asterisk with FreePBX, that wheel has already been invented and is quite round :slight_smile:

Edit, As to the versioning, I would look at :-

asterisk/include/asterisk/ast_version.h

you could likely ‘sed out’ main/version.c

If you guys ever “git” this thing, then the minor version can be critical. I would suggest some sort of agreement on what exact “minor” version you are building to on major version 13 (or 14 or 15) as you haphazardly build from on the fly scripting currently, if you don’t you will likely be in all kinds of finger pointing trouble when a particular build breaks other sh!t

JM2CWAE


(Rob Thomas) #413

I believe that if you just ‘git checkout 15’ to switch to the 15 branch, there’s no need to mess around hacking on the files. Again, that just emphasizes my point that there needs to be a wiki where the CORRECT instructions are 8-\


#414

I agree, you would get the current major.minor.build but the minor is indicative, any patches should indicate that it is no longer that same minor beast.

Perhaps NAF’s patches will be accepted and this would all become moot :wink: in the interim , anyone who did an

asterisk -V

would have some expectation that her asterisk is NOT the current release but a variant.

static const char asterisk_version[] = “15.5.0”;

versus

static const char asterisk_version[] = “15.5.NAF(variant)”;


#415

I’ve quietly followed this topic in amazement at how overly complex a relatively simple task can be turned into.

Starting with a vanilla working FreePBX + Asterisk (compiled from source) system, it’s a pretty trivial task to install naf’s gvsip:

https://www.dslreports.com/forum/r32037680-PBX-GVSIP-for-FreePBX

The provided script might need a minor tweak for a particular environment, but if so, it should be terribly obvious as there’s next to nothing involved.


#416

My Asterisk is running as group and user Asterisk

ps aux | grep asterisk
asterisk   652  0.4  5.4 2061836 108032 ?      Ssl  Aug05   3:12 /usr/sbin/asterisk -U asterisk -G asterisk
asterisk   919  0.0  3.1 464072 63188 ?        S    Aug05   0:02 /usr/sbin/apache2 -k start
asterisk  1005  0.0  3.1 464056 63100 ?        S    Aug05   0:07 /usr/sbin/apache2 -k start
asterisk  1006  0.0  3.1 464452 62024 ?        S    Aug05   0:00 /usr/sbin/apache2 -k start
asterisk  1019  0.0  3.0 464544 60448 ?        S    Aug05   0:03 /usr/sbin/apache2 -k start
asterisk  1022  0.0  3.1 464028 62980 ?        S    Aug05   0:01 /usr/sbin/apache2 -k start
asterisk  1259  0.0  0.8 243396 16676 ?        Ss   Aug05   0:00 dirmngr --daemon --homedir /var/lib/asterisk/.gnupg
asterisk  6759  0.0  2.9 463188 58864 ?        S    Aug05   0:00 /usr/sbin/apache2 -k start
asterisk  7209  0.0  3.0 464280 60496 ?        S    Aug05   0:01 /usr/sbin/apache2 -k start
asterisk  7945  0.0  2.6 463180 53180 ?        S    Aug05   0:00 /usr/sbin/apache2 -k start
asterisk  8920  0.0  2.8 460164 55964 ?        S    Aug05   0:00 /usr/sbin/apache2 -k start
asterisk 11345  0.0  1.7 456060 34920 ?        S    Aug05   0:00 /usr/sbin/apache2 -k start

The reason they are having to use SUDO as to access the Asterisk CLI, is NOT because its running as root, or atleast if they followed this guide it would not be, it would be running as user asterisk.

The reason SUDO is required is actually because asterisk is running as user and group asterisk, but when they installed Ubuntu they would have likely used a different user name for the user account such as schalykh, and in my case xekon.

user ‘xekon’ is not user ‘asterisk’ and so if you use sudo then you can access the asterisk CLI regardless. (even though you are not user asterisk) If you are accessing your SSH connection as user root then of coarse your not going to have to use sudo, you already have root privileges. (and in my opinion doing all things as user root can pose a security concern in itself, if you only use root for setup and then lock the root user account down afterwards, I would consider that acceptable, but prefer to use sudo)


#417

This is actually very true, but many people following this guide are looking to get google voice working, and they prefer to have a GUI such as Freepbx. Many of them may not even have much linux experience, and so they are bound to run into problems, which is why I have been trying to be helpful, and improving the guide to spell out steps further where I have seen users run into trouble.

You strike me as somebody that really knows what they are doing, and so following a simple guide that does not spell everything out would work for you because you can read between the lines and see what to do regardless. For a novice that has never touched linux, they need everything spelled out if they are going to succeed at first.


#418

I understand your point of view, if its your wish I can move this to someplace else. I would not think that google would go after a company because of a tutorial that a ‘user’ posted in a forum post.

Also I do not think there would be any reason to fear google, there has been no posted information suggesting that they dont want people using their service with asterisk, it seems harmless to me and further promotes google / google voice.


(United States) #419

Naf has changed the make_version and it now requires 2 edits,

  1. your sed command needs to be an insert as that original line was removed.
  2. line 103 needs commented out to allow the BRANCH to stay 15
    –> add “#” MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)

Please don’t remove this thread move it to a place that fits better… It’s the only one I have found to allow one to use GV with FreePBX after they removed XMPP… PBXIAF has built a system that is impossible to modify in many areas … thank xekon!


#420

@redoxrd Removing the original line is the intent here, otherwise the version reports as "master"

I already changed the line from:

sudo sed -i 's/^MAINLINE_BRANCH=master/MAINLINE_BRANCH=15/' build_tools/make_version

to

sudo sed -i 's/MAINLINE_BRANCH=.*/MAINLINE_BRANCH=15/' build_tools/make_version

this corrected the problem for me, after running the line you can verify that it worked:

grep MAINLINE_BRANCH= build_tools/make_version

should show: MAINLINE_BRANCH=15

and from the asterisk CLI you can check the version as well

core show version
Asterisk GIT-15-6457379f74M built by root @ ubuntu on a x86_64 running Linux on 2018-08-05 18:32:30 UTC


(Rob Thomas) #421

10 posts were split to a new topic: Security Theater - sudo vs root


(Andrew Nagy) #424

No they probably wouldn’t. But it’s happened in the past. When the MPAA threatened DIGG. https://en.wikipedia.org/wiki/AACS_encryption_key_controversy#DMCA_notices_and_Digg

Not for you sure. For Sangoma Technologies, Inc. A profitable company, there would be implications and risks.

Please think of this situation. The google voice work was reverse engineered from Obihai devices. Google did not authorize it. In fact they once said it was based on standards and have now completely removed that comment. Doesn’t that make you think for a second that maybe they don’t want people connecting to this service in this way?

Obihai has a private agreement with Google that no one has seen. Do you know what is in that agreement? Does it say “anyone can use this connection”. I doubt it does. Sangoma did not sign that agreement. Polycom now owns Obihai. If Sangoma implemented or supported Google Voice implementations through either a supported wiki or a supported module then we are encouraging and supporting reverse engineering the standard and breaking the contract that was proposed between Obihai and Google. Meaning Sangoma would be liable for damages from Polycom, the owner of Obihai and the legal entity between Google and Obihai.

Of course the RIAA and MPAA won’t come after you (anymore) for stealing music and movies. It’s not worth it for them to fight the individual battle because you don’t have the money or resources, so instead they sue ISPs and hosting providers, therefore, It is worth it for a company to sue another company.

and finally. When Asterisk approves the Naf patches into the GUI we will fully make the settings available. Because the settings themselves are standards of the SIP protocol. But there won’t be a “this is how you connect (illegally) to Google Voice” wiki or guide from us nor will there be a module. You’ll just setup a PJSIP trunk the same way you set it up for SIPStation, VoIP.ms, Vitelity… etc the list goes on.

The bigger Sangoma Technologies gets the more we are prone to frivolous American lawsuits. It is the way software and software patents work in America.

We also aren’t stopping this thread or telling you to remove it. Rob just wants a central source for your work. Like how @reraikes has his on dslreports and he always goes back and updates the main post with new updates.


(Rob Thomas) #425

And one of the reasons I suggested GitHub and GitHub’s Wiki is that it’s super easy for people to go back and see the changes, and the reasons FOR the changes.


(Ted Mittelstaedt) #426

Can we just back the truck up for a second?

What is stopping anyone from taking a “Google blessed” Obihai device (OBi200) and plugging it into a FXO port on a voip gateway that you have configured as a trunk into a FreePBX system? OBi200s are $50 on Amazon. I can pick up 4 port FXO cards on Ebay for next to nothing or old Linksys gateways and break into them and set them up. Yes someone reverse engineered it but Obihai is the one that would lose something, they would lose $50 a device. Google is going to see the exact same traffic on their service either doing it this way or doing it the reverse-engineered way so why would they care?

Because Sangoma supports their OWN hardware gateway cards THEY ARE ALREADY encouraging and supporting interconnections to GV or Vonage or any of those other proprietary wanna-give-you-a-hardware-box jokers out there. I think this is like the idiot municipalities with ants in their pants over the guy who’s making plans for a “plastic gun” available for download.