How to make and receive calls using Google Voice without XMPP (May 2018 Revision)

Note:  Due to the recent changes in Google Voice implementation, the call back approach may not working reliably.  I am looking into its alternatives and will present them on this blog site.

I.    Introduction

In Spring 2014, I wrote the original blog post “How to make and receive calls using Google Voice without XMPP” as it was likely Google was going to drop XMPP protocol in May 2014.   The post attracted a lot of interest at that time.  It received over 5000 visits.  However, since Google eventually did not abandon XMPP, the blog was not very useful anymore.

Recently, it was announced that Google is going to drop XMPP from Google Voice on June 17, 2018 and it looks more likely to happen this time.  People have started looking into the possibility of using Google Voice without XMPP again [1][2].

Due to the renewed interest, I tried the method described in my previous blog.  It was found that the original approach still works after some necessary updates based on what described in [1].  The difference between my installation and that described in [1] and [2] is that mine is based on plain Debian/Ubuntu while theirs are build on top of Freepbx.  The approach implemented in plain Linux may be less flexible and versatile than the ones based on Freepbx.  However, it should function fine.  Moreover, the description in this revised blog uses a steps-by-step approach, which should be easier to follow if you want to try it out from ground zero.

The platform of my implementation utilizes Linux (Debian/Ubuntu) operating system.  You can use a stand-alone small ARM based box, such as Raspberry Pi or a similar one, or on an online virtual personal server (VPS).  I tried both.  and they all work pretty well.  The ARM box I used is an Orange Pi PC, although the procedure described below should be valid without modification for any similar ARM Debian box.  It also works on a VPS with some minor changes that I will state later.

To keep the implementation effort to be minimal, only the basic system with call-out and incoming call functionalities are implemented.  With some knowledge of Asterisk, the system functionalities can be expanded as much as you like.

Now, let us begin!

II.    The step-by-step guide of setting up an Asterisk PBX with GV callback.

A.    Get a DID number

To make Google Voice work without XMPP, you will need a telephone number to receive calls, i.e. a DID (Direct Inward Dialing) route.   There may be different ways to obtain DID numbers.  However, the most viable solution is to apply a free DID number from  What you need to do are as follows:

  1. Register an account on the CallCentric website.  It is straight forward and free.
  2. Once you confirmed on your email and the account is active, you will be assigned a Callcentric number in the form of 1777XXXXXXX.  You can find the number once you login under the Dashboard subtab.   Note: This number is your SIP user name to be denoted as [sipusername] but is different from your Callcentric website login user name.
  3. Under the Receive Calls Tab, request a free phone number by clicking the “get a number” button.
  4. In the left most column, filling the necessary information and click the Lookup button to go to next page.
  5. Select an area code, click “Order Now” button, and continue on next a few steps, an number will be assigned to you.  Once this step is done, you can find the number under Dashboard/DID number section.  Note that all of the DID number have the area codes in the NY state.  However, any of these will work for this purpose with no difference.  We will denote the 10 digit DID number by [didnumber] below.
  6. Click the edit button at the left of the item “Reference/Phone Password (SIP Password)” to specify the SIP Password, denoted as [sippassword] below.

Now you have all the DID information that you need to continue.

B.    Setup Asterisk and preliminary configuration

In your platform, either it be a Debian box or a VPS running Debian or Ubuntu, you need first to install Asterisk.  You can do so by different methods although the easiest way is probably using the Asterisk package come with the Linux distribution.  To install it use this approach, you simply SSH into your Linux box or VPS and do the following under the Linux # prompt:

apt-get update
apt-get upgrade
apt-get install asterisk

After Asterisk is installed, replacing two default Asterisk conf files, sip.conf and extensions.conf in the /etc/asterisk/ directory with the examples of the files given in the appendices.  You will need to insert your own DID and SIP credentials into the proper place inside these two files.  The Asterisk PBX is set as to have three extensions: 201, 202 and 203.  Any SIP phone, which can be a softphone or a hardware ATA (Analog Telephone Adapter) connected with a regular phone, registered with one of the extensions can make or receive calls.  If there are incoming calls to your GV number or the DID number, the SIP phones registered will ring until one of them is picked up.

In the sip.conf file, there is a register statement and a section [DID] related to the DID.  It is necessary to make sure the DID/SIP credentials obtained from is filled into the proper places in the register statement and the DID section.

Once all these are done, restart the Asterisk by doing a “service asterisk restart” in an SSH terminal connected to the Debian box.  Then, type “asterisk –rvvv” to get to its CLI interface.  Inside the CLI interface, type “sip show registry” and hit return.  It should show you that your SIP service is registered.  You can also do a “sip show peers” to see if the SIP phone is properly registered.

If everything looks normal, you can make a call from another phone to CallCentric’s DID.  Your SIP phone registered to Asterisk should ring and can be picked up to talk to the caller’s phone.

C.    Set up Google Voice (GV) and callback number.

  1. Go to and create a gmail account with gvusername and gvpassword.
  2.  Once the gmail account is established, go to and apply for a new GV number (gvnumber), if you don’t have one already.
  3. In webpage click the three vertical dots on the upper left corner and then click Legacy Google Voice.
  4. Click at the gear symbol on the right and select settings.
  5. In the Settings menu, disable call screening in the Calls submenu.  Note that you need enable voicemail in order to have call screening disabled.
  6.  In the Phone submenu click on “add a phone” botton and use the [didnumber] that you got from Callcentric as this number.  Google will try to verify that you have this number.  Request them to call this DID number instead of sending SMS, and you will need to have a SIP phone connected to the Asterisk server as described above to receive the call.  Verify the number with GV.  The DID number [didnumber] is your GV call back number.
  7. Make a call to the assigned gvnumber, your SIP phone connected to Asterisk server should ring and can receive the call.

D.    Install Python and pygooglevoice

Based on the information given in [1], you can do the following to install pygooglevoice under the Linux prompt on the terminal connected to the Debian box:

cd /root
apt-get -y install mercurial
apt-get -y install python-pip
pip install distribute --upgrade
easy_install -U setuptools
easy_install simplejson
tar xfz /root/pygooglevoice.tar.gz
cd /root/pygooglevoice
python install
cp /root/pygooglevoice/bin/gvoice /usr/bin/
cd /root

After pygooglevoice is installed, it can used to make a test phone call by entering:

gvoice -b -e [gvusername] -p [gvpassword]call ${EXTEN} +1[didnumber] 1 

Note it is done at the Linux prompt, not the Asterisk CLI.   If successful, you can use the SIP phone connected to the Asterisk server picking up the call.

In a number of cases, I found that the first attempt for making such a call may not work.  It is because GV may determined that the call is from an unknown device and would reject it.   In such cases, you need to first check the security setting of the gmail account used to make sure that login from less secure devices is allowed.  Secondly, using your PC browser to open the link

with the same gmail account logged in, and click the “Continue” button to allow access.

After performing these two steps, you should be able to make phone call using the gvoice command.  However, sometimes, you may need to repeat the second step until you can make the call successfully.

E.    Final Steps

Once the call using pygooglevoice from Debian is successful, you only need to fill [gvusername], [gvpassword] and [didnumber] the proper credentials in the lines of

System(gvoice -b -e [gvusername] -p [gvpassword] call ${EXTEN} +1[didnumber] 1 &)


System(gvoice -b -e [gvusername] -p [gvpassword] cancel &)

in file extensions.conf.  Then, you can make a call from the SIP phone connected to the Asterisk server and it should work.

A final note, if you decided to install the Asterisk on an VPS, you need to add two lines:

externhost=[VPS' dynamic IP address]
localnet=[VPS' locanet address (]/

in the [general] section of sip.conf to avoid the one way audio problem.

Good Luck!

III.    Acknowledgements and Disclaimers

First the acknowledgement: I am not a network/software/VOIP person.  All of what I did are based the knowledge that I gained from Googling and exchanging with other more experienced people.  Thus, nothing described in this note is invented by myself.  All the credit should go to the people who proposed this approach and worked out the details, specifically, the authors, commenters and contributors of the references [1,2] of this blog.  What I did is just to make sure all of details that I described are correct and to verify it indeed works.  I would appreciate to have your feedback and comments.  If you have any questions, please let me know also.  I will try to answer them as much as I can.

Now the disclaimer: As stated above, what I did is simply trying the GV callback approach designed and described by others.  It is experimental to say the most.  As we all know, whenever one goes online including performing VOIP activities, there are always security risks.  Thus, if you decide to follow what described in this blog, you should know the risks involved and you will be responsible for whatever action you are taken.  You will be responsible for any consequences of your actions. Another point is that we don’t know what Google is going to do after June 17.  Even though the set-up following the above descriptions works today, there’s no guarantee it will work at that time.  We just have to hope it will.

[1] RonR’s post in “Google Voice XMPP support will go away in June” on DSLReport Forum (

[2] How to use Google Voice with FreePBX and Asterisk without using XMPP or buying new hardware, TechNotes. (

IV.    Appendix

The configure files: sip.conf (source)
context=phone ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
udpbindaddr=; IP address to bind to ( binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
dtmfmode = rfc2833
register = [sipusername]:[sippassword][sipusername]

callerid="user1 "

callerid="user2 "

callerid="user3 "

trustrpid = yes
sendrpid = yes
canreinvite = no

extensions.conf (source)


gtimeout=50 ; timeout value
; initialize

exten = _[sipusername],1,ExecIf($[${gvuser}!=10000]?Bridge(${gvuser}):Dial(SIP/201&SIP/202&SIP/203,60,D(:1)))
exten = _[sipusername],n, Set(GLOBAL(gvuser)=10000)
exten = _[sipusername], n, Hangup()
include = sip
include = gv-outbound
exten = _NXXNXXXXXX,1,GoTo(1${EXTEN},1)
exten = _1NXXNXXXXXX,1,Answer
exten = _1NXXNXXXXXX,n,Set(GLOBAL(gvuser)=${CHANNEL})
exten = _1NXXNXXXXXX,n,System(gvoice -b -e [gvusername] -p [gvpassword] call ${EXTEN} +1[didnumber] 1 &)
exten = _1NXXNXXXXXX,n,Ringing
exten = _1NXXNXXXXXX,n,Wait(30)
exten = _X.,n,Noop(Never received callback from Google Voice on channel ${gvuser} . exiting)
exten = h,1,GotoIf($["${CHANNEL(state)}" = "Ring"]?:bridged)
exten = h,n,Noop(Hangup on channel ${gvuser})
exten = h,n,System(gvoice -b -e [gvusername] -p [gvpassword] cancel &)
exten = h,n, Set(GLOBAL(gvuser)=10000)
exten = h,n,Hangup()
exten = h,n(bridged),Noop(The channel has been bridged successfully)
exten = h,n, Set(GLOBAL(gvuser)=10000)

13 thoughts on “How to make and receive calls using Google Voice without XMPP (May 2018 Revision)

  1. Pingback: How to use Google Voice with FreePBX and Asterisk without using XMPP or buying new hardware | TechNotes

  2. Hi, i am trying to follow these instructions on Fedora 28. I noticed there is no `sip.conf` but there are plenty of other conf files. Is there some modification to get going on fedora? perhaps there is a docker image for all of this somewhere?

    • In the Appendix section above, there are two files: sip.conf and extensions.conf. Please take another look and let me know if you have found it.

    • Thank you for pointing out. The address is still correct. Somehow, it now requires https:// instead of http://
      I have revised the post so please try to see if it works now.
      Good Luck!

  3. Hello,
    I installed Asterisk v15 and it comes with pjsip.conf instead of sip.conf. I сonverted pjsip->sip using the script ( in the Asterisk’s /src directory, However pjsip.conf created by the script does not work. 😦 The problem is to make callcentric’s DID work. I cannot reach my sip phone calling DID number.
    Could you help me to create pjsip.conf for google voice?
    Best regards

  4. pjsip and sip both still exist and can be used in Asterisk v15. pjsip just supplements not replacing sip. However, I am not sure the dial back approach still works. I am looking into other alternatives.

    • Every company may need slightly different setup. You need to ask your DID provider for specific instructions. I only know ones that I used before but don’t know what to do if the DID is from a company I have not worked with before.

Comments are closed.