FreePBX | Register | Issues | Wiki | Portal | Support

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

Tags: #<Tag:0x00007fcd209c4fb0> #<Tag:0x00007fcd209c4ce0> #<Tag:0x00007fcd209c4ba0>

(GPz1100) #488

You need to set up different outbound routes for each gv trunk. Define a prefix in the dial pattern so you can specify which trunk to use for outbound when dialing from a single extension.

I have several gvsip trunks defined this way working quite well.

You can also take this a step further by defining unique inbound routes for each trunk instead of one route for any. Specify a DID and CID name prefix so you know which trunk the call is coming in on.

I’m not a fan of the gvsip1…n definition. I use “gv{10 digit gv #}” for the definition. Makes keeping track easier.


thanks. thats the part I was missing. just found that out a few ago. now if I can just get my android sip client to work when not on the same lan as my freepbx server. its not passing any audio when my android phone is not on same lan/wifi as the server. calls connects and the sip client registers just fine. just dont get any audio in/out of the sip client when placing a call. iv forwarded 5060 udp 5061 udp and 10000-20000 udp from outside (internet) to my internal lan (freepbx server).

iv been playing with nat settings and not having much luck. if it matters my freepbx server is behind 2 routers/firewalls so I guess that would be a double nat which I have setup correctly as I have other ports forwarded to the same server that are working just fine and ufw is turned off.

Update 1: Had to put both my LAN segments into NAT Settings/Lan Networks under General SIP Settings ( which is my ISP router that faces the internet and which is my router and faces the my isp router. In my case my freepbx server is on the lan.

Update 2 : Spoke too soon. im not sure what is going on. cant get audio when not on the lan. I thought I had it for a second there. must not have been fully disconnected my wifi.

Update 3 : Hopefully last update. So I used the build in call recorder of freepbx as a sort of diags tool. I found that even though I didn’t hear any audio on my android phone in or out while my phone was not on the same lan as my freepbx server a call was recorded and it had both sides of the audio. that lead me to look at settings inside my sip client. in this case it was zoiper (Can anyone recommend a better sip client for android?). I ended up enabling the stun server setting inside zoiper. after making a few test calls it looks like its working. Yay. I hope this info is of help to anyone else having similar issues as me.

More importantly thanks for all the hard work put into this project. I am finding it most fun to play with and learn from. Lots of info and posts from people having issues and learning as well. The more we share and read the more we learn.Fun stuff. :sunglasses:


(GPz1100) #490

Good to hear you got it sorted out. Which stun server did you use?


I used the the zoiper default stun server “ on port 3478”

For what its worth I had to use a stun server on both the freepbx server as well as my android sip client in order to pass audio when my android sip client was both on the same lan as the freepbx server and off. I didnt really test if it had to be the “same” stun server.


(GPz1100) #492

I don’t think STUN should be needed on the local lan. Unless you’re somehow blocking something, both devices should have full access to one another.

I have both openvpn and l2tp/ipsec vpn on the android phone. Audio works properly with openvpn with a stun server defined in the client. I suppose the server already has a stun server defined too for google.

No go with l2tp/ipsec vpn though. I think the cell provider is part of the issue. Cricket does weird things with connectivity. Different ports go out on different ip addresses which creates a mess with voip. At least openvpn works.

(GPz1100) #493

Decided to try a chansip extension for use with the (l2tp/ipsec) vpn. No more audio issues. It’s probably possibly to configure the pjsip extension to work as well, but it’s beyond my understanding to do so.

The voip server is blocked from external external connections unless through the vpn (openvpn or l2tp/ipsec).


Something has been broken recently. Today I found that my registration is being rejected.
I haven’t installed/updated anything new and everything has been working fine just last week.

freepbx*CLI> pjsip show registrations

<Registration/ServerURI…> <Auth…> <Status…>

gvsip1/ gvsip1 Rejected

Objects found: 1

when it attempts to register I get the following:

[2018-10-12 18:05:49] WARNING[11393]: pjproject:0 <?>: SSL SSL_ERROR_SSL (Handshake): Level: 0 err: <336151568> len: 0
[2018-10-12 18:05:49] WARNING[11549]: res_pjsip_outbound_registration.c:986 schedule_retry: No response received from ‘’ on registration attempt to ‘’, retrying in ‘60’

(Michael Neukam) #495

I’m trying to set this up and getting the same error

(GPz1100) #496

Known issue. It’s been reported on DSLR. Work in progress. Look at the last few posts.

(GPz1100) #497

Looks like a working solution has been posted:

Make the change in pjsip_custom_post.conf in /etc/asterisk. Each trunk has two places where this change is made.



sudo sed -i -e 's/' /etc/asterisk/pjsip_custom_post.conf

(Jamie Owens) #499

above fix worked for me, lets hope they stop changing things

(Tom Ray) #500

When in the history of Google Voice have they not changed something randomly and without warning? Never. Part of using this service in this capacity is that it changes without warning and there’s no guarantee it works.


At what point do the gvsip endpoints/devices show up as a device in gvoice weburl settings/phones?


This one worked for me as well.

(Kevin) #503

I’m using the latest rasbpx distro to tinker with the GV implementation. I’m not a linux expert by any means and this tutorial is awesome. The issue I’m having is as soon as I add the google voice motif, I get the error “Asterisk is not connected”. I’ve tried rebooting, etc with no luck. The terminal even says asterisk is already running when I use fwconsole start. The log files pile up when freepbx can’t communicate with asterisk and then it fills up the RPi card and I have to do a hard reboot to get any functionality again. It appears this is an issue, but I’m not sure if I’m just missing something.

The potential bug I’m referring to: FREEPBX-18280 on this site

Thanks all

(Tom Ray) #504

The Google Voice Motif is a module built on the old XMPP connectors Google Voice had. They no longer had those, at no point should this be installed to use GV going forward.

(Kevin) #505


Thanks for the quick reply.

Just to clarify, are you saying that using Google voice with freepbx (ie this tutorial) is no longer a supported function and I shouldn’t expect it to work in the future? Or are you saying that I just set it up wrong?

Thanks again.

(Andrew Nagy) #506

You need to read this thread you are replying to as everything you asked is already answered in this thread.

EG I don’t think this thread ever mentions using motif. Please read the first post. It was updated over time.

(Tom Ray) #507

No, I am not as this tutorial is how to use GV after the loss of XMPP connectors and Motif.