41 thoughts on “Asterisk 11 + Google Voice

  1. Jeff

    Very good read, enjoyed the whole article. Wish I had enough time in my day to “fiddle” with something like this! Very well put together also. Found this browsing for Michigan numbers in Google Voice, sadly no Michigan numbers seem to be available.

    1. dantheman2865 Post author

      Thanks Jeff! I remember searching for Flint numbers a little while ago and it was slim pickings. Do they let you search across the whole state or do you have to search area code by area code?

      By the way, be sure to check out some of the other articles on my blog; I think you would enjoy them as well.

      1. Jeff

        I was doing a Michigan search, but only came up with a town called Michigan something in CA. Anyway, I found some with my area code but not specific enough to my area. Not a big deal, really only want it for digital copies of voice mails.

  2. William

    Ok, so I would set up multiple entries in Montif, for multipe GV accounts. I take it the label would have to be something like [google_1] [google_2] ect. ect. ect. How would that affect the incoming and outgoing routes?

    1. dantheman2865 Post author

      I am planning a post to this effect, but the basic idea is to duplicate all of the XMPP and Motif configurations and then set up different dial plans based on how you want to choose the outgoing line.

  3. Pingback: Asterisk 11 + Google Voice: Multiple Lines » Dantheman2865

  4. David

    Hello, I have been trying these instructions but am not getting anywhere after two days of work. I have read and configured based on this example/wiki.asterisk.org and am getting no luck here. Outgoing calls give the error as if I did not enable icesupport but in rtp.conf but I assure you I have.

    The message reads:
    “Unable to add Google ICE candidates as ICE support not available or no candidates available”

    Incoming calls give the error:
    “Received Google transport information on session ‘SIPXXXXXXXX@XX.XXX.XX.XX’ but ICE support not available”

    I have forwarded the ports from my NAT device (ubuntu server) to my device running asterisk, I also tried setting a stun server in rtp.conf and that did not help either…

    The only difference is I grabbed the latest release using subversion. Its late, I will try a tarball after work tomorrow if anything thinks it will make a difference.


    1. dantheman2865 Post author

      Do you want to post/send me your rtp.conf? You’re definitely right, it’s like Asterisk doesn’t think the option is enabled.

      1. David


        I downloaded the -current tarball instead of using the svn and recompiled today, I am ssh’d in and working on it remotely at this time from my work office, so I will check for sure later, but modifying the dial plan to give me an echo sounded fine when calling the GV number. When I get home I will attempt to call out through it to verify.

        1. dantheman2865 Post author

          Great! I just compiled Asterisk 11.4.0 from source a couple of weeks ago and it worked like a charm. Do you know if you had any build errors?

          1. David

            I can’t say the first go-around I paid huge attention to compile time warnings, etc, but if there was a compile time error, it wasn’t one that had aborted the build part way through.

            Also, just confirmed all features work at home now, my cisco 7905 desk phone + soft phones can receive/place calls through. Despite my initial issues I am now happy. Thanks for the write up!

          2. dantheman2865 Post author

            Congratulations, and thanks for sharing your success. Hopefully soon Asterisk 11 will be in the Ubuntu Repositories to avoid this whole compiling mess.

          3. Dan

            I have exact same issue as you originally had. I’m on Asterisk 11.6.0 and tried enabling icesupport in rtp.conf but still get “Unable to add Google ICE candidates as ICE support not available or no candidates available”.
            I’ve tried recompiling asterisk couple of times and it seems to compile fine. Can you share the exact steps you took to resolve it?

            BTW, this is a great tutorial. Thanks!

          4. dantheman2865 Post author

            Thanks for the note Dan. Would you mind posting your (edited) sip.conf on Pastebin? I may be able to spot an issue. What is your connection to the internet? Do you have an internet IP address or are you in a private Subnet because of your ISP?

          5. Dan

            I’m running it on Amazon EC2. I followed instructions for that setup on xda website (I can post the link if you don’t mind)
            sip.conf: http://pastebin.com/gWSjs3wG
            I beleive I have the ELASTIPIP, NAME, PASS set correctly.
            I aslo have the ports TCP: 22, 1723, 5060. UDP: 5060, 10000-20000) open on EC2 instance.

          6. dantheman2865 Post author

            I think I see the issue, you also need port 5222 open for XMPP communication between your server and Google Voice. Also, I have read that you should also open ports 5060-5082. Let me know if this works!

  5. vasanthtcs

    Hi .. first thanks to the great writeup. I was able to setup GV with asterisk successfully. I am running asterisk on a pogoplug E02 box where I am also a host of other apps. For the ATA I picked up a Linksys PAP2 for $9 on ebay and then unlocked it. Everything works great. There is one nuance .

    When someone calls my google voice number , I am able to recieve the call to my landline. But if I try to ignore the call by dicsonnecting, nothing happens. My phone keeps ringing. Only if the caller disconnects the call, the phone stops ringing .

    But after I pickup the call, I am able to hangup immediatly.

    I believe its got to be something in the way my extensions.conf is setup for incoming calls. Any help is appreciated.

    Here is my extensions.conf . I have also try to include the Wait(1) and the Answer() commands before Dial. But that doesn’t help.

    exten => s,1,NoOp()
    same => n,Set(CALLERID(num)=${CUT(CALLERID(name),@,1)})
    same => n,Set(CALLERID(name)=External)
    same => n,Set(CALLERID(num)=${IF($[${LEN(${CALLERID(num)})}=1]?:${CALLERID(num)})})
    same => n,Set(CALLERID(name)=${IF($[${LEN(${CALLERID(num)})}=0]?Anonymous:${CALLERID(name)})})
    same => n,Dial(SIP/127356,20,D(:1))

    1. dantheman2865 Post author

      Thanks! That sounds like a good solution. I think your problem is related to your voicemail settings in Asterisk. Do you use Google Voice for Voicemail?

          1. vasanthtcs

            Yes if I dont attend the call for 20 seconds it goes to google voicemail.

            But if I try to Ignore the call , by pressing the disconnect button on the handset before 20 seconds , the handset keeps ringing until 20 seconds , or the caller hangs up, whichever is earlier.

            Not a big deal, but keeps bugging me what could be wrong.

          2. dantheman2865 Post author

            One thing I don’t understand is the function of the “disconnect” button. Is this built in to the landline phone? I wonder if that would trigger something to Asterisk through the ATA and I also wonder if this is an unsupported feature on the PAP2?

  6. vasanthtcs

    Apologize didn’t login for a couple of days ….. Yes I’m thinking the same too. I would assume the ‘Green’ phone button is to pickup a call, and the ‘Red’ one is to ignore a call in any handset. Just like a cell phone. Probably it does not sed signal back to the PAP2 until the call is answered.

  7. vasanthtcs

    Someone might find this useful. To get a proper caller name we could lookup a free CNAM provider. Google forum says they are not going to provide this funationality anytime now. Below is my extensions.conf and it works great for most numbers.

    [incoming-motif] exten => s,1,NoOp()
    same => n,Set(CALLERID(name)=${CURL(https://api.opencnam.com/v2/phone/${CALLERID(num)}?format=pbx)})
    same => n,Set(CALLERID(num)=${CUT(CALLERID(num),+,2)})
    same => n,Dial(SIP/127356,20,D(:1))

    1. dantheman2865 Post author

      I briefly tried out a couple of numbers but it said they weren’t supported at the Hobbyist level. This would definitely be interesting for a small business use, though! Now it has me thinking, does Google have a contacts API that could be used in a similar fashion?

  8. vasanthtcs

    That is correct. Its mentioned the hpbbyist level uses a cached DB Vs the realtime DB for the Professional. So far the numbers I have tried out comes up fine.

    When I call home from work it correctly reflects my company name. When I call from mobile it shows Minneapolis MN .

    Definitely good for something that is free 🙂

  9. SDRGuy


    Thank you for this tutorial.

    Everytime when I call from the Asterisk command line, through to google Voice to a USA Telephone #,
    +1-202-XXX-XXXX. whoever is answering can only hear continual ringing.

    Is this is Google Voice Issue?

    My dial string has ringing, ( r ) removed and despite any USA telephone that gets called, all the answering party hears is ringing upon answering their telephones.

    Any ideas would be greatly appreciated and the instruction above works other the Google Voice ” ringing upon answer issue “.

    1. dantheman2865 Post author

      Have you tried it in other configurations? For example, have you tried calling from a SIP phone? Have you tried calling the GV number directly from a POTS phone?

      At first blush, it sounds like a network port issue, but I don’t have many ideas. Can you check your NAT?

  10. ThanXDanTheMan2865


    Since Asterisk 1.8.something, and per your guide listed above, though I still, from dialing
    191912345678 at the Asterisk command prompt, upon answering the call, all I or any callee hears
    is ringing, though the call is going through Google’s Voice network.

    So I hooked up a SDR device to the the laptop, ran OpenBTS whcih created the GSM (Um)interface, to a unlocked GSM phone which was able, upon dialing a USA telephone #, to get the call to ring through cleanly Asterisk to Google Voice with ZERO ringing issues to the called party.

    DanTheMan2865’s reputation lives on!

      1. ThanXDanTheMan2865

        I’m still stuck on why, from the Asterisk command line, upon dialing any USA/Canada telephone # through Google Voice, upon answering the call, the ” Called Party ” hears ringing. Yet from OpenBTS through Asterisk to Google Voice, ZERO issues.

        So there is a mishap between my OpenBTS config files & Asterisk config files, but I can honestly say it is far more important for GSM to Google Voice calls then ” Command Line ” telephony ringing cleanly through Google Voice.

        Though being able to make a telephone call through from a Linux Command line has PLENTY of uses too !


        1. dantheman2865 Post author

          What syntax are you using to Dial? I briefly looked into it, but intuitively the command line would just connect one Asterisk endpoint to another. Can you post an example? I’ll try it out on my setup.

  11. Martin


    Just dial by the following:

    console dial 13122222222

    console dial 1(and whatever USA/Canada #)

    And it’s not true dialing as you CAN dial OUT from the Asterisk Command Line to any properly configured VOIP provider successfully as I use to do all the time in Asterisk versions 1.8

    This might be a Asterisk 11.5 / Google Modules issue but I am more than satisfied at least in being able to make GSM to Asterisk to Google Voice calls successfully.

    Which for my situation, for the moment is most important.

    Thanks Dan!

  12. vasanthtcs

    The world needs DantheMan …
    With google announcing it will end xmpp support on May 2014 , My guess is this setup wont work after that. Are there other alternative ways to setup GV with asterisk ? There are lots of discussions going around in OBI forums . I guess our setup is similar to OBI too …

    1. dantheman2865 Post author

      Thank you for sharing this sad news. I will definitely update my post and we can both hope that Google opens up another API that could be used. Unfortunately, I wouldn’t count on it….

      1. shabbir92

        hello dear , is google stoping xmpp support for both ( google voice and google talk web based) or only google voice ; is it possible io use google talk to connect asterisk after 15 may 2014 ?????

        1. dantheman2865 Post author

          I believe the issue is that Google is rolling Google Talk and Google Voice into one application: Google Hangouts. They have notified the community that they will end support for XMPP when this happens. We can still hope that they bring in a replacement, though!

  13. Thank you

    Hi. I was just wondering if you had found a new way to do this?
    I heard this may still be possible without xmpp?


Leave a Reply