FreePBX | Register | Issues | Wiki | Portal | Support

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

Tags: #<Tag:0x00007fdf967e6e68> #<Tag:0x00007fdf967e6c88> #<Tag:0x00007fdf967e6b48>


On a fresh install of FreePBX the port configuration is

chansip 5160 / 5161
pjsip 5060 / 5061

If you leave it like that, and then log into the ATA device, leave the ATAs LOCAL sip port field set to 5060 and set it to register to xyz@IP:5160

It should then register as a chan_sip device, atleast both my HT802 and PAP2T work like this.

After changing those settings, you may have to actually power cycle the ATA devices, before they will behave with the new settings. Its either that or make sure the old connections completely expire so they will attempt to re-register, otherwise the stale connection to the old port hangs on and things dont work.

PJsip and chan_sip cannot both have 5060 AND have udp enabled, its the reason chan_sip was moved to 5160/5161 (the port is bound, atleast that was my understanding of bound ports, once you bind a port only one thing is using it.)

(Rob Thomas) #358

You didn’t restart Asterisk after changing the PJSIP ports. Disabling UDP had no effect apart from telling you to restart asterisk - which you did - which solved the problem 8)

The better solution is just to leave pjsip on 5060 and chansip on 5160.

(User permanently banned) #359

ohhh yes , I DID!

Although as I recall, technically with asterisk 14 you only need a reload for port changes. But I dont trust it.

(Ohaydel) #360

I got timed out on the forum. But xekon assisted me over email, and I was able to get everything working great.

Thanks to everyone!

(Dev Null) #361

Is this working still? It seems I am unable to resolve the IP for On some of my workstations it is cached but on others it is gone, reporting: server can’t find NXDOMAIN with nslookup. Even pointing nslookup to use cloudflare or google dns servers doesn’t work.

Using Dig:
On FreePBX server:
; <<>> DiG 9.11.3-1ubuntu1.1-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 33468
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 65494
; IN A

;; Query time: 0 msec
;; WHEN: Tue Jul 31 15:48:11 UTC 2018
;; MSG SIZE rcvd: 50

On another workstation:
; <<>> DiG 9.10.3-P4-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51396
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
; IN A


;; Query time: 0 msec
;; WHEN: Tue Jul 31 11:48:29 EDT 2018
;; MSG SIZE rcvd: 82

Ok, I replaced the nameserver with my router’s IP in /etc/resolv.conf and it seems to now resolve. It is weird because other domains would resolve and this one would not, not even once. I have no clue as I haven’t seen this before.


That is exactly how my dig info looks on my Freepbx box as well, and yet my google voice phone still works. I suspect its some sort of DNS cache built into the newer Ubuntu, and so DIG is not reporting correctly, your “other workstation” that shows the dig info, also shows an older version of DIG.

Just wanted to chime in letting you know that mine looks exactly like yours, and the phone still works :slight_smile:

If you are having any trouble with your phone, did your Public IP address change? I have not tested this in an environment where the connection has a dynamic IP. Our ISP only changes our IP if the home router’s mac address changes, or if they are replacing hardware at the ISP which has only happened once in the last 8 years


If you undo that change, then try this instead:


(Dev Null) #364

I prefer to stick with the change I made as I had expected FreePBX to use the DNS from my router and which it got from DHCP. Not sure what 18.04 is doing but it seems to have put in a local dns server to cache perhaps. Everything works now. Before I was able to get incoming but not do outgoing but now it all seems to work with using the router’s IP as the dns server.


Yeah, might have to look into what Ubuntu 18.04 is doing, maybe there is a way to disable the local dns server entirely.

EDIT: Ubuntu likely included it to cache DNS results and make lookups faster, but my PFsense server already does this for me.


It is not Ubuntu per se, but likely

systemctl stop dnsmasq
systemctl disable dnsmasq

will then honor /etc/resolv.conf without confusion

(Assembler) #367

This is my first post.
I get an error on this step:
sudo chown asterisk:asterisk /var/run/asterisk
chown: cannot access ‘/var/run/asterisk’: no such file or directory.

I checked and ‘/var/run’ directories are there but no ‘asterisk’


that file will only exist if asterisk is running (or was but crashed) it will always be owned by the user that started asterusk, if it isn’t asterisk, then you need to fix that, asterisk/freepbx requires that asterisk runs as asterisk:asterisk


As long as you are following the guide line for line, there is usually a
/var/run/asterisk when I install.

however as dicko pointed out if the directory does not yet exist, that is ok, just continue on to the next step.


the directory is generally always there, its a linux thing, any file in that directory will usually contain the pid ( process identification as reflected by ps -aux ) of the process that shares that name, and there might be more than one pid in it (not a good thing for asterisk though) the ownership of the file will reflect who initiated thay process and changing its ownership will NOT change that fact (wrong rabbit hole :slight_smile: )

(Assembler) #371

Do you know offhand which step makes the asterisk file (or directory) in /var/run/. Then I’ll check if I messed up.

Update: I continued on as suggested and after the ‘… asterisk stop’ command I checked if the /var/run/asterisk file existed. It did so I then ran the ‘chown asterisk:asterisk /var/run/asterisk’ with success.


you miss the point of that files existance, if you think you stopped asterisk and it is still there, you didnt, it crashed , changing its ownership is a red herring hiding in a rabbit hole.

(Assembler) #373

I’m in the freepbx screen trying to load the Superfecta and Phonebook and it whoops soon after I click on ‘confirm’. I tried two computers on the same LAN.


wrong rabbit, wrong fish, nothing to do with this thread. read and digest your own post


I can see on the left No such file or directory, which means the file maybe did not download, which would likely only happen if you have incorrect file/directory permissions.

Now that you have had some practice, I would stick the ubuntu thumb drive in again, format, and start over. If you follow the guide carefully those errors should not happen, I just setup a system for a friend only a couple days ago.

(Lorne Gaetz) #376

Hi @xekon:

If the intent of the above two lines in pjsip_custom_post.conf is that they be added to the existing FreePBX generated global section, then I recommend it be changed to:

; debug=true    ; uncomment for debug

Both will work, but this has a greater likelihood of surviving any future reorganization of the include files. Confirm the settings stick with ‘pjsip show settings’ after a reload.