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

A fairly minor point, not intended to change your mind, but you can connect to the service just as well using proxy voice.telephony.goog:5061 and registrar voice.sip.google.com. There are minor differences in behavior but it works fine.

(Minor differences include: dial strings must be E.164-formatted, starting with +; OPUS codec is required)

You have to change the lawyers mind. That’s the hard part :slight_smile:

2 Likes

To be frank/honest here. Come 15 it’ll have an API and eventually these Asterisk settings will be in mainline asterisk so people will be able to setup “Google Voice” trunks as they would setup any standard pjsip trunk through the GUI. We just won’t provide a module that fills in the strings.

@xekon

in trying to follow the guide in the first post I get an error when trying to add the repository pap:ondrej/php

“Error: could not find a distribution template for Raspbian/stretch”

The latest RasBPX distribution upgraded from jesse to stretch, I’m assuming that I might need to fall back to jesse?

thanks

One idea in the meantime. Is there a way you can put a place for custom values in the GUI? Similar to how you would add general sip.conf values in Asterisk SIP Settings. But instead it would be part of the PJSIP Trunk config. (Maybe an advanced option that reveals Custom Identity Settings, Custom Endpoint Settings, Custom Registration Settings, Custom AOR Settings)

(edit - Not Custom Transport settings as that wouldn’t belong here)

This guide was written for Ubuntu 18.04. The reason for adding the ppa:ondrej/php is to get the php5.6 packages that are no longer in the official Ubuntu repositories that have now moved on to php 7.

I would try to find a PPA that has the php5.6 packages for Raspbian/stretch. If you CANNOT find one for stretch, then you can actually forcefully add the PPA and the packages would likely still install just fine. (atleast that has been my experience when I need to use a PPA that is not yet supporting the latest version of whatever distro I am using.)

sudo apt-get install -y git curl apt-transport-https net-tools mpg123 sox \
default-libmysqlclient-dev default-mysql-client default-mysql-client-core \
default-mysql-server default-mysql-server-core apache2 libapache2-mod-php5.6 \
libapache2-mod-security2 php-pear php5.6 php5.6-cgi php5.6-cli php5.6-curl \
php5.6-fpm php5.6-gd php5.6-mbstring php5.6-mysql php5.6-odbc php5.6-xml \
unixodbc rename ffmpeg lame mailutils fail2ban mongodb

If the above php packages install without the PPA then your distro already has the php5.6 packages and you dont even need to worry about adding a PPA.

Also, yes the first post is the latest guide by me, I always update my changes in the first post after I have tested them.

in FreePBX you can have a device configured as PJsip and have the device still use the chan_sip port and it should function, atleast that has been my experience.

I have my PAP2T and HT802 configured to use port 5160 which is the chan_sip port, PJsip is port 5060/5061

I have configured my extensions for those two devices as PJsip extensions, but I configured the devices to use the chan_sip port, and this appears to function without a problem.

GVsip trunk must use PJsip(which is what the details in the _custom file does), but extensions should be able to be configured as either PJsip or chan_sip.

I realize that everyone wants this but the answer is no. I also realize that this will end up causing anger/confusion/annoyance in the more advanced users but the issue(s) are this/these:

  • in sip.conf you can add settings that are inherited into all other contexts from the [general] context, this is why there is a place in Asterisk SIP settings that allows one to add custom settings into sip. This does not exist for PJSIP. There is no [general] context and if you put anything that is not valid into [global] PJSIP will not load upon Asterisk restart. PJSIP’s [global] is not a dumping group that is inherited by other contexts the way it is in sip.conf. The only want to do this is to utilize inherited contexts which FreePBX does not (currently) support

    Text from sip.conf:

      ;sip_general_custom.conf is the proper file location for placing any sip general
     ;options that you might need set. For example: enable and force the sip jitterbuffer.
      ;If these settings are desired they should be set the sip_general_custom.conf file.
      ;
      ; jbenable=yes
      ; jbforce=yes
      ;
      ;It is also the proper place to add the lines needed for sip nat'ing when going
      ;through a firewall.  For nat'ing you'd need to add the following lines:
      ; nat=yes , externip= , localhost= , and optionally fromdomain= .
    
  • Secondly allowing people to add any setting to PJSIP has bad consequences. chan_pjsip is the first module (that I know of) where as if you type ANY invalid setting keyword it will refuse to load itself entirely. It will not just break that context, PJSIP will just not load. So if you go into any pjsip file and type randomness “sdfdsf=asdasd” and asterisk restart, pjsip will be broken. This is intentional. Read it straight from Asterisk. Home - Asterisk Documentation


    Imagine allowing users to enter values in here. Sure for you advanced guys it’s fine. But the average user goes to google and searches “how do I configure isp to connect to freepbx”. Then they see a chan_sip article. They don’t know any better so they just take all of those values and enter them into the free form boxes into pjsip. Then they reload. Nothing happens. Then they restart and now all of PJSIP is down. Nothing connects. Then they come to our issue tracker or our support team saying there’s a bug. After hours of back and forth you find out it’s because they found an article from 2009 that says doing from_user_external_domain_2009_sip=true allows registration for random ISP. It’s important to note here that “from_user_external_domain_2009_sip” is not a valid parameter in chan_sip. But if you enter it into a chan_sip configuration file (sip.conf) chan_sip will still function. If you put “from_user_external_domain_2009_sip” into PJSIP it will break outright.

So to prevent support nightmare we refuse to allow custom additions of PJSIP parameters in the GUI. You can do it in the conf files all day long. We don’t block that and you can even edit the conf files from the GUI (in Config Edit). If you want custom PJSIP settings they have to be submitted to our issue tracker and be valid in asterisk. If you want them before they are valid in Asterisk then you can make/write/create a custom FreePBX module that adds them for you.

1 Like

I added the steps for getting Naf’s latest changes and rebuilding to the bottom of the guide.

1 Like

Understood. Makes a lot of sense. My only counter on this is that you could bury a toggle switch somewhere deep in Advanced Settings to enable custom PJSIP, and make it pop up scary warnings when enabled. But you’d probably still get support problems from people who blindly follow web tutorials that read “go to advanced settings and toggle this; ignore the warnings; proceed to enter this (easily-typoed-set-of-values) into your PJSIP trunk…”

But in the “google voice” sense that doesn’t help you because of the first point. Extensions would have to support custom settings and they never have. An entirely new interface would have to be written to support that. Writing the custom settings you need for PJSIP into Asterisk SIP Settings would only get you into a non-working PJSIP (as you could only written them into [global]). Again to support what you want FreePBX would either have to allow freeform in extensions (we’ve never supported this even for chan sip) or write out inherited contexts for PJSIP (again something FreePBX has never supported).

It’s not as simple as “go add an advanced setting and then show the text box”.

It’s simpler to write a freepbx module to do this. Unfortunately I can not do that, but it can be done.

2 Likes

I don’t know if you have ever looked at the FusionPBX project but it is way too much free-form, to the point that almost every screen invites error. I’m glad for the way FreePBX does things and don’t want to imply otherwise. Thanks for the good explanation.

Can we stop beating this dead horse please? This is never going to happen while Asterisk shuts down if something is wrong in pjsip. Both @tm1000 and I are adamant about this.

If you want to edit custom stuff, and make your own changes, that’s what the pjsip*custom files are for - explicitly that. FreePBX covers the 99% of use cases. For the 1% that want to do custom stuff, you’re more than welcome to do custom stuff in the custom files.

Or, if there’s an option or param missing, submit a patch with it!

Edit; Sorry. I didn’t want to appear to be grumpy, but - in rereading - I was. It’s just that this has dragged on for sooooo long. Sorry. Not grumpy. Remember, I’m a bastard 8)

Well, I only wrote two posts about it. Your horses are weak if they die so easily!

1 Like

Yep. I was grumpy. Sorry. I edited my post to say that. It’s not YOU that’s asked, it’s been a bunch of other people. You just happened to be in the crosshairs when I snapped. Apologies!

1 Like

It definitely sounds like a module would be the goto route, I wonder how difficult the module would be to write. I might try making one if I get some free time.

Sorry my fault partially. I was telling Rob over our internal messaging system that you are about the 3-4 request I’ve gotten about this this week. One of the ‘awfully’ nice comments I got was about how ‘really stupid IMHO’ it is we don’t have that, and that’s one of the mildest responses, I got bashed pretty hard by another FreePBX user for explaining the same things I just explained earlier in the week…(gotta love open source).

Of course these users didn’t know WHY we don’t provide these freeform options, but now you do and so do they and so do others… :slight_smile:

I’ve even thought about writing a Macro for what I just said.

2 Likes

https://wiki.freepbx.org/display/FOP/FreePBX+Development

Edit: I just noticed that page is a bit out of date. There’s now a Module Generator, which builds all the framework for you. See Sangoma Documentation for the actual stuff.

1 Like

Thank you, I appreciate it.

Unrelated, but I think this wiki article also needs updated: https://wiki.freepbx.org/display/FOP/Installing+FreePBX+14+on+Debian+8.8

After some debate about the sample config files I attempted to follow that guide, I installed Debian 8.8 to a spare dell machine I have. I got stuck on “Install Required Dependencies” pretty much right off the bat, packages listed there were no longer available in the repositories.

I could probably add ppas or install newer versions of some of the packages, but I thought it was worth pointing it out to somebody atleast once. If the Debian wiki gets updated I would love to try installing to a Debian system.

For some reason you didn’t have Edit permissions to the Wiki. Fixed now!

1 Like