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

ah, you might have luck monkeyin around with the order of adding entries, I know I got through everything with the way I did it, I will fire up a blank install incase I am forgetting a step.

I am currently filling this bug right now on the tracker.

@xrobau filled it here: https://issues.freepbx.org/browse/FREEPBX-17916 feel free to edit it, if I missed anything, first time reporting a bug here.

I did, they asked for a lot of stuff which I really don’t know how to get. Mostly a noob to all this.

Mine is #17908 in case it can be combined or something. Yours probably has all the info they need though. :slight_smile:

1 Like

@dolfin I was pretty sure you needed the second blank entry when adding options/menus, however after talking with a friend (we worked through this the other day)

I had figured out adding the system recording and setting the initial IVR, and my friend figured out setting the return to “YES”

What you have to try is every time you add an entry, you must set the Return to YES, Only then will the entry save without breaking.

This might not be desirable for your setup, but try it out for me and let me know if it then saves for you.

@xekon I really appreciate all your hard work.
I followed the guide and managed to get FreePBX running as it should. However registration won’t go through.
I’m getting a “WARNING[1139]: pjproject:0 <?>: SSL 6 [SSL_ERROR_ZERO_RETURN]” in asterisk logs. And I only see one way traffic in wireshark.
Do I need to forward ports on the router for this setup to work? (I’m behind two routers. double nat?!)

Thanks again.

Did you set the Stun address, chances are with double NAT you will need it.

Settings -> Asterisk SIP Settings
 "General SIP Settings"-Tab
   NAT Settings, External Address, click detect network settings
   Stun Server Address: stun.l.google.com:19302   (Optional, usually)

Then try a reboot or two and test it out.

If that dont work you can goto Settings → Asterisk Sip Settings, then PJSIP tab, and at the bottom, these settings could help possibly, but I have not tried them:

Forwarding something might also fix it, but I have not yet tried setting this up behind a double NAT, good luck, hope you get your google voice working :slight_smile:

@xekon Thanks for your swift reply. It did not resolve the issue so far. Will have to play with forwarding ports. Will report on success.

1 Like

This worked and I got my IVR set up. Now I can block those pesky scam calls.

Another question, my CDR report is blank. Where do I begin fixing this?


Strike that, reverse it… I followed the Configure ODBC in the wiki and got it up and running.
https://wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+Ubuntu+Server+14.04.2+LTS#InstallingFreePBX13onUbuntuServer14.04.2LTS-ConfigureODBC

time to run a backup. :slight_smile:

1 Like

cool, glad that worked for you, and yeah the ODBC is required for the CDR, glad you got that squared away too.

Good, glad you got your caller ID working, The Google voice Trunk DOES provide Names when they are available, so make sure to use it as a Data Source in your CID Superfecta, atleast it has been in my testing.

Also for frequently contacted people you can go to Admin → Asterisk Phonebook
and enter your important contacts, family, friends etc, and use the Phonebook as a lookup source, like I do.

The Location data such as (Houston, TX), comes from the Telco Data lookup source, you would want to make that the last lookup source in your CID superfecta, First match wins, here is how mine is currently setup:

Admin → CID Superfecta:

@AronEinhorn are you able to test this on a different machine that is not behind a double NAT, that way you could rule out other possible issues being the culprit.

Then once you have that setup, you could try the double NAT again, and if it does not work then you can be fairly confident that the double NAT is the reason for it not working.

@xekon Will test it later, and report findings. Thanks again.

I went through How-To Guide for Creating Oauth credentials for Google Voice gvsip to get the Oauth tokens and got them into my conf file.

I’m not sure if this is the right place to ask, but I’m getting Fatal response '403' when asterisk tries to register:

From: <sip:[email protected]>;tag=********-****-****-************
To: <sip:[email protected]>
Call-ID: ********-****-****-****-************
CSeq: 33131 REGISTER
Authorization: Bearer token="****.*****************l-************************_******************************************-******************-*********_**_*****", username="gv7777777777", realm=""
Contact: <sip:[email protected]:5161;transport=TLS;line=bywksbx>;obn=gvsiptest
Expires: 3600
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: path, outbound
Max-Forwards: 70
User-Agent: FPBX-14.0.3.6(15)
Content-Length:  0


[2018-07-25 14:13:21] VERBOSE[831] res_pjsip_logger.c: <--- Received SIP response (392 bytes) from TLS:64.9.243.172:5061 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/TLS 192.168.64.92:5161;rport=34779;branch=*****************7-****-****-****-********f68;received=164.23.22.17;alias
To: <sip:[email protected]>;tag=05073732
From: <sip:[email protected]>;tag=********-****-****-************
Call-ID: ********-****-****-****-************
CSeq: 33131 REGISTER
Content-Length: 0


[2018-07-25 14:13:21] WARNING[832] res_pjsip_outbound_registration.c: Fatal response '403' received from 'sip:obihai.sip.google.com' on registration attempt to 'sip:[email protected]', stopping outbound registration
[2018-07-25 14:13:21] WARNING[831] pjproject:                      SSL 6 [SSL_ERROR_ZERO_RETURN] (Read) ret: 0 len: 32000

I’ve gone through the pjsip_custom_post.conf file several times and re-aquired the refresh token. I’m somewhat at a loss as to where to look next. I feel like I’m missing something obvious.

make sure all 3 match in the pjsip_custom_post.conf file.
In the below example I use “gvsip7775551234” replace the digits with your phone number or a random string of numbers, so long as all 3 match and are very unique, so that nobody else would be using the same thing.

client_uri=sip:[email protected]

contact_additional_params=obn=gvsip7775551234

username=gvsip7775551234

See what that does for you. If that does not work then the only thing I can guess is that its an issue with the oauth Tokens, you made sure that you generated the tokens for the correct account that has the google voice number right? being logged into more than one account in the top right corner can goof things up if your not careful. (When generating tokens I log out of all accounts and log into only the account I am trying to generate the tokens for.)

Added my second gvsip account with 702 extension and moved everything in the instructions stating 1 to 2 but getting this:

[2018-07-26 04:39:23] ERROR[8837] res_pjsip_endpoint_identifier_ip.c: Identify '701-identify' is not configured to match anything.
[2018-07-26 04:39:23] ERROR[8837] res_sorcery_config.c: Could not create an object of type 'identify' with id '701-identify' from configuration file 'pjsip.conf'
[2018-07-26 04:39:23] ERROR[8837] res_pjsip_endpoint_identifier_ip.c: Identify '702-identify' is not configured to match anything.
[2018-07-26 04:39:23] ERROR[8837] res_sorcery_config.c: Could not create an object of type 'identify' with id '702-identify' from configuration file 'pjsip.conf'

I’m still getting the same response. Thank you for your help.

I’ll try rebuilding the box from the ground up. I may have missed something critical in the original build.

Another issue. Had storms, lost internet…it came back with a new IP and now I get this and busy tone:

[2018-07-26 18:48:18] ERROR[32285] res_pjsip.c: Endpoint 'gvsip1': Could not create dialog to invalid URI 'gvsip1'. Is endpoint registered and reachable?
[2018-07-26 18:48:18] ERROR[32285] chan_pjsip.c: Failed to create outgoing session to endpoint 'gvsip1'
[2018-07-26 18:48:18] WARNING[23979][C-00000016] app_dial.c: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
[2018-07-26 18:48:18] WARNING[23979][C-00000016] app_macro.c: No such context 'macro-outisbusy' for macro 'outisbusy'. Was called by 8887777777@from-internal

EDIT:
So a reboot restored it to working status. I think there may be some work yet to be done as the implementation seems to be stateful and not recreating the registrations when the network changes. Upon the reboot, I notice these but didn’t see them when the the new IP should have been detected.

[2018-07-26 19:02:02] DEBUG[1743] res_pjsip_outbound_registration.c: Stored service-route: <sip:...
[2018-07-26 19:02:02] DEBUG[1743] res_pjsip_outbound_registration.c: Stored service-route: <sip:...
[2018-07-26 19:02:02] DEBUG[1743] res_pjsip_outbound_registration.c: Stored associated uri: <sip:...

@2devnull under Settings -> Asterisk Sip Settings, under the section labled “NAT” part of the install guide is to hit "Detect Network Settings, this fills in your External IP address, as well as your Subnet settings.

If either of these things are things that would change for you after reboots or power outages then you may be better off leaving those fields blank and instead using the google stun address as outlined in the guide.

My Public IP never changes, and I have the asterisk machine setup as a static IP in my router, so I do not have to worry about things changing.

It is also possible you found a new issue, but I cannot say for sure, if after further testing you think that you might have found a new issue, you can report the relevant info to Naf’s thread, along with logs so that he can try to determine whats happening. I would try to get a very good sense of what is causing it though, because if you or he cannot reproduce it then its hard to say exactly what the cause is.

For example, you could try unplugging your cable modem for 10 minutes, plug it back in, wait a few minutes then see if the phone still works or not, try things like this to figure out what triggers the problem, then you can also get the relevant sections of the logs that Naf would need.

I’ll try it without the External Address set (although I have Dynamic IP set on the Chan SIP Settings tab with a Dynamic Host address that is updated when my IP changes).

What confuses me is that since I don’t need any ports opened to the outside world from the FreePBX server, why is the external address necessary, i.e. all connections are created from FreePBX outward (and the other side of the connection, e.g. google therefore would already know my external address).

I haven’t had to deal with NAT issues when I was using PBXinaflash, IncrediblePBX and Wazo so not sure why it is relevant now. I know if you have extensions externally then they obviously would need to know how to get to your FreePBX but why is it necessary in the regular “everything is in-home” case?

I apologize, this issue may not be applicable to this thread and probably one in the regular pbx support thread.

I had the same thought about that 2devnull, I am not sure either, this setup is just what has worked for me.

For those particular errors you might be able to ignore them. I have those same errors for my endpoints, and I am not sure what they are about, but my phone has been working without issue.

@billsimon do you know what would cause this particular error? It happens for the configured pjsip extensions.