- About VoIP
- What is VoIP and what it can do for you
- Introduction to VoIP (video)
- Why should you switch to VoIP services?
- Analog Telephony
- Digital Telephony
- What is SIP?
- How to start with VoIP telephony
- Web based VoIP
- How to choose a right VoIP provider?
- Wi-Fi network and VoIP
- VoIP Codecs
- Free sip account
- Confidential calls
- VPN: UDP or TCP?
- Mobile VoIP
- VoIP on your mobile
- Asterisk IP-PBX
- Who we are?
- How to start
- Free SIP account
- Configs
Asterisk and Google Voice
Asterisk: How to make calls using Google
Prerequisites
Asterisk can communicate with Google Voice and Google Talk using the chan_gtalk Channel Driver and the res_jabber Resource module. Please ensure that both are compiled and part of your installation prior following the configuration guide below. Compilation of res_jabber and chan_gtalk for use with Google Talk / Voice are dependant on the iksemel library files as
well as the OpenSSL development libraries presence on your system. Calling using Google Voice or via the Google Talk web client requires the use of Asterisk 1.8.1.1 or greater. The 1.6.x versions of Asterisk only support calls made using the legacy GoogleTalk external client.
For basic calling between Google Talk web clients, you need a Google Mail account.
For calling to and from the PSTN, you will need a Google Voice account.
In your Google account, you’ll want to change the Chat setting from the default of “Automatically allow people that I communicate with often to chat with me and see when I’m online” to the second option of “Only allow people that I’ve explicitly approved to chat with me and see when I’m online.”
IPv6 is currently not supported. Use of IPv4 is required.
Google Voice can now be used with Google Apps accounts.
Google Talk configuration
The chan_gtalk Channel Driver is configured with the gtalk.conf configuration file, typically located in /etc/asterisk. What follows is the minimum required configuration for successful operation.
Minimum Gtalk Configuration
[general]
context=local
allowguests=yes
bindaddr=0.0.0.0
externip=216.208.246.1
[guest]
disallow=all
allow=ulaw
context=local
connection=asterisk
This general section of this configuration specifies several items.
- That calls will terminate to or originate from the local context; context=local
- That guest calls are allowd; allowguests=yes
- That RTP sessions will be bound to a local address (an IPv4 address must be present); bindaddr=0.0.0.0
- (optional) That your external (the one outside of your NAT) IP address is defined; externip=216.208.246.1
The guest section of this configuration specifies several items.
- That no codecs are allowed; disallow=all
- That the ulaw codec is explicitly allowed; allow=ulaw
- That calls received by the guest user will be terminated into the local context; context=local
- That the Jabber connection used for guest calls is called “asterisk;” connection=asterisk
Jabber Configuration
The res_jabber Resource is configured with the jabber.conf configuration file, typically located in /etc/asterisk. What follows is the minimum required configuration for successful operation.
Minimum Jabber Configuration
[general]
autoregister=yes
[asterisk]
type=client
serverhost=talk.google.com
username=your_google_username@gmail.com/Talk
secret=your_google_password
port=5222
usetls=yes
usesasl=yes
statusmessage="I am an Asterisk Server"
timeout=100
The general section of this configuration specifies several items.
- Debug mode is enabled, so that XMPP messages can be seen on the Asterisk CLI; debug=yes
- Automated buddy pruning is disabled, otherwise buddies will be automatically removed from your list; autoprune=no
- Automated registration of users from the buddy list is enabled; autoregister=yes
The asterisk section of this configuration specifies several items.
- The type is set to client, as we’re connecting to Google as a service; type=client
- The serverhost is Google’s talk server; serverhost=talk.google.com
- Our username is configured as your_google_username@gmail.com/resource, where our resource is “Talk;” username=your_google_username@gmail.com/Talk
- Our password is configured using the secret option; secret=your_google_password
- Google’s talk service operates on port 5222; port=5222
- TLS encryption is required by Google; usetls=yes
- Simple Authentication and Security Layer (SASL) is used by Google; usesasl=yes
- We set a status message so other Google chat users can see that we’re an Asterisk server; statusmessage=”I am an Asterisk Server”
- We set a timeout for receiving message from Google that allows for plenty of time in the event of network delay; timeout=100
Phone configuration
Now, let’s place a phone into the same context as the Google calls. The configuration of a SIP device for this purpose would, in sip.conf, typically located in /etc/asterisk, look something like:
[malcolm]
type=peer
secret=my_secure_password
host=dynamic
context=local
Dialplan configuration
Incoming calls
Next, let’s configure our dialplan to receive an incoming call from Google and route it to the SIP phone we created. To do this, our dialplan, extensions.conf, typically located in /etc/asterisk, would look like:
exten => s,1,Answer()
exten => s,n,Wait(2)
exten => s,n,SendDTMF(1)
exten => s,n,Dial(SIP/malcolm,20)
! Note that you might have to adjust the “Wait” time from 2 (in seconds) to something larger, like 8, depending on the current mood of Google. Otherwise, your incoming calls might not be successfully picked up.
This example uses the “s” unmatched extension, because Google does not forward any DID when it sends the call to Asterisk.
In this example, we’re Answering the call, Waiting 2 seconds, sending the DTMF “1″ back to Google, and then dialing the call.
We do this, because inbound calls from Google enable, even if it’s disabled in your Google Voice control panel, call screening.
Without this SendDTMF event, you’ll have to confirm with Google whether or not you want to answer the call.
| Using Google’s voicemail Another method for accomplishing the sending of the DTMF event is to use the D dial option. The D option tells Asterisk to send a specified DTMF string after the called party has answered. DTMF events specified before a colon are sent to the called party. DTMF events specified after a colon are sent to the calling party. In this example then, one does not need to actually answer the call first. This means that if the called party doesn’t answer, Google will resort to sending the call to one’s Google Voice voicemail box, instead of leaving it at Asterisk. exten => s,1,Dial(SIP/malcolm,20,D(:1)) |
|
| Filtering Caller ID The inbound CallerID from Google is going to look a bit nasty, e.g.: +15555551212@voice.google.com/srvres-MTAuMjE4LjIuMTk3Ojk4MzM= Your VoIP client (SIPDroid) might not like this, so let’s simplify that Caller ID a bit, and make it more presentable for your phone’s display. Here’s the example that we’ll step through: exten => s,1,Set(crazygooglecid=${CALLERID(name)})
exten => s,n,Set(stripcrazysuffix=${CUT(crazygooglecid,@,1)})
exten => s,n,Set(CALLERID(all)=${stripcrazysuffix})
exten => s,n,Dial(SIP/malcolm,20,D(:1)) First, we set a variable called crazygooglecid to be equal to the name field of the CALLERID function. Next, we use the CUT function to grab everything that’s before the @ symbol, and save it in a new variable called stripcrazysuffix. We’ll set this new variable to the CALLERID that we’re going to use for our Dial. Finally, we’ll actually Dial our internal destination. |
Outgoing calls
Outgoing calls to Google Talk users take the form of:
exten => 100,1,Dial(gtalk/asterisk/mybuddy@gmail.com)
Where the technology is “gtalk,” the dialing peer is “asterisk” as defined in jabber.conf, and the dial string is the Google account name.
Outgoing calls made to Google Voice take the form of:
exten => _1XXXXXXXXXX,1,Dial(gtalk/asterisk/+${EXTEN}@voice.google.com)
Where the technology is “gtalk,” the dialing peer is “asterisk” as defined in jabber.conf, and the dial string is a full E.164 number (plus character followed by country code, followed by the rest of the digits).
Interactive Voice with Text Response (IVTR)
Because the Google Talk web client provides both audio and text interface, you can use it to provide a text-based way of traversing Interactive Voice Response (IVR) menus. This is necessary since the client does not have any DTMF inputs.
In the following dialplan example, we will answer the call, wait a bit, send some text that will show up in the caller’s Google Talk client, play back a prompt, capture the caller’s text-based response, and then dial the appropriate SIP device.
exten => s,1,Answer()
exten => s,n,SendText("If you know the extension of the party you wish to reach, dial it now.")
exten => s,n,Background(if-u-know-ext-dial)
exten => s,n,Set(OPTION=${JABBER_RECEIVE(asterisk,${CALLERID(name)::15},5)})
exten => s,n,Dial(SIP/${OPTION},20)
Note that with the JABBER_RECEIVE function, we’re receiving the text from asterisk which we defined earlier in this page as our connection to Google. We’re also specifying with ${CALLERID(name)::15} that we want to strip off the last 15 characters from the CallerID name string – which is the number of characters that Google is appending, as of this writing, to represent an internal call ID number, and that we want to wait 5 seconds for a response.
Source of the information: A Webinar was conducted on Tuesday, March 24, 2011 detailing Asterisk configuration for calling using Google as well as several usage cases. A copy of the slides, in PDF format, is available here.
Tagged with: asterisk and google integration • chan_gtalk • google • google talk • google voice • how to asterisk • res_jabber
Recent articles
- Plain explain: IP-phone
- Plain explain: What is SIP termination and what is SIP origination?
- US fixed VoIP market to see steady growth
- Save money with VoIP and unified communications
- IP telephony can help level the playing field for small businesses
- The loss of a landline means big change in communications
- Ubuntu (Linux) on your phone? Yes! And now officially!
- QoS For FaceTime, bandwidth requirements and Firewall config
- Merry Christmas and Happy New Year!
- How to Configure Axvoice Equipment?
- Cloud VoIP vs. on-premise VoIP: Choosing the right one for your business
- 26 terabits per second data transmission achieved
- A fully functional VoIP Client (SIP) finally released (free download)
- Fundamentals of SIP from Cisco :-)
- WebRTC from Google: making real-time communication free to implement
- What is VoIP termination
- Introduction to Voice over IP (VoIP)
- Linux: how to check OS version installed
- Hey!
- How to configure Internet tel. and SIP settings on Nokia phone (E52)
- TCP vs UDP – you must know this
- Google voice / Google talk and Asterisk configuration
- VoIP or IP Telephony?
- Asterisk 10.0.0-rc1 Now Available!
- SIP based VoIP behind NAT
- VoIP Quick start guide
- History: Kellogg Field Phone (World War I)
- Running VoIP via VPN (SSL) – voice quality
- Skype App directory
- G.711: u-law or a-law?
- Wi-Fi access point/router optimization for VoIP and other real time apps
- Agri-Cube grows mass quantities of vegetables in a one-car parking spot
- Quick Comparison of freeware IP-PBX platforms: Asterisk vs Open SER
- Microsoft enabling the ability to eavesdrop on VoIP conversations
- Nimbuzz growing even without Skype
- Skype protocol hack
- Call DSN number
- How to make your VoIP calls private and confidential
- Think on solutions: VoIP phone system
- Asterisk and Google Voice
- VoIP Codec: Payload size
- Nokia SIP settings
- The QoS Dilemma
- VoIP calls over satellite links
- VoIP for Facebook!
- VoIP client behind a VPN with DD-WRT
- Digital Telephony
- Analog Telephony
- Mobile VoIP – the future of mobile communications
- Sip on Android
VoIP SIP IP telephony tags
android Asterisk bandwidth bandwidth requirements best effort cellular codec delay encryption options facebook free calls g273 g726 g729 google gsm high latency How it works ilbc IPsec issues jitter listen to voip mobile Nimbuzz nokia order packet payload. g711 privacy protocol analyzer pstn QoS - Quality of Service QoS protocols real-time applications record voip calls satellite link sipdroid SIP protocol Skype speex TLS voice quality voip voip becomes socialQuick navigation
- Android (6)
- Apple (1)
- Asterisk (22)
- Cloud VoIP (1)
- FaceTime (1)
- Google Voice (6)
- History (2)
- IT news (2)
- Mobile VoIP (16)
- Symbian (1)
- Non VoIP news (2)
- Open source (10)
- Prioritization and traffic shaping (9)
- QoS – Quality of Service (11)
- SIP protocol (32)
- Cisco (2)
- SIP termination (2)
- SMS to email (1)
- Softphone VoIP (1)
- Ubuntu (1)
- Uncategorized (1)
- VoIP calls quality (24)
- VoIP industry news (4)
- VoIP over SSL VPN (1)
- VoIP over VPN (8)
- VoIP service (2)
- VoIP via VPN (1)
More to read on VoIP
- About
- About Mark Spencer
- Asterisk SIP Media NAT
- Browser-based VoIP: web page code to call over IP (to your VoIP account)
- Choosing the right provider
- Cisco ATA186 notes
- Free sip account
- Grandstream Budgetone configuration manual
- How to start with VoIP telephony
- Multiplexing RTP Data and Control Packets on a Single Port
- On-line payments
- VoIP Codecs
- VPN: UDP or TCP?
- What is VoIP and what it can do for you
- Why should you switch to VoIP services?
Blogroll
- Asterisk™: The Definitive Guide (new window) “Asterisk has been emblematic of the way that open source software has changed business—and changed the world”
- Blog Jon FreeSWITCH VOIP SIP Asterisk Linux Open Source
- Business.com Business.com is one of the Web’s largest directories for business products and services
- Ubuntu how-to www.ubuntuka.com Miscellaneous Ubuntu Tips, Tricks and Hints
Our Twitter – latest
- Introduction to Voice over IP (VoIP) - One important step into adopting VoIP is... voip-sip.org/introduction-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago
- Hey! - To all people who has an experience with Asterisk and Linux - quote of the day: "I have not failed.... voip-sip.org/hey/ 5 months ago
- What is VoIP termination - Many people keep asking me - what is VoIP Termination?... voip-sip.org/what-is-voip-t… 5 months ago
- How to configure Internet tel. and SIP... voip-sip.org/how-to-configu… 5 months ago





