# Asterisk 1.8 + Multiple Inbound Google Voice Accounts?

**URL:** <https://community.asterisk.org/t/asterisk-1-8-multiple-inbound-google-voice-accounts/33360>\
**Category:** Asterisk Support\
**Created:** [November 23, 2010, 5:00pm UTC](https://community.asterisk.org/t/asterisk-1-8-multiple-inbound-google-voice-accounts/33360 "2010-11-23T17:00:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 23, 2010, 5:00pm UTC](https://community.asterisk.org/t/asterisk-1-8-multiple-inbound-google-voice-accounts/33360/1 "2010-11-23T17:00:38Z")

</div>

Greetings all,

The “native” Google Voice support in Asterisk 1.8 is looking great so far! Using the information on the Calling Using Google wiki article, I was able to easily get both inbound and outbound connectivity.

My PBX serves myself and several others in my house. We all have Google Voice accounts.

I was able to get jabber sessions established for these three accounts, and use the dialplan configuration to route calls out any of the accounts; caller ID and call logging worked, so the outgoing calls were getting initiated on the proper account, etc.

But the inbound routing is proving trickier. Any ideas on how to set up gtalk.conf for multiple incoming GV accounts? I’d like each account to come in on it’s own context, which would allow for proper dialplan and call routing configuration.

I’m not sure if this is possible, and what the appropriate syntax would be. Did not see any docs on this; anyone have the recipe?

Thanks in advance! 😄

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [November 23, 2010, 10:58pm UTC](https://community.asterisk.org/t/asterisk-1-8-multiple-inbound-google-voice-accounts/33360/2 "2010-11-23T22:58:43Z")

</div>

Here’s one way I just figured out to make this happen; possibly not the only or best way, but seems to do the job. Relevant config sections follow. Idea here is two SIP clients (one PC and one Android device) with two google voice accounts, and enough configuration for both devices to place and receive calls on both lines.

\*\*\* jabber.conf  
[general]  
debug=yes  
autoprune=no  
autoregister=yes

[XXXXjabber]  
type=client  
[serverhost=talk.google.com](http://serverhost=talk.google.com)  
[username=XXXX@gmail.com](mailto:username=XXXX@gmail.com)/Asterisk  
secret=supersekret  
port=5222  
usetls=yes  
usesasl=yes  
statusmessage="Asterisk"  
timeout=100

[YYYYjabber]  
type=client  
[serverhost=talk.google.com](http://serverhost=talk.google.com)  
[username=YYYY@gmail.com](mailto:username=YYYY@gmail.com)/Asterisk  
secret=supersekret  
port=5222  
usetls=yes  
usesasl=yes  
statusmessage="Asterisk"  
timeout=100

\*\*\* sip.conf  
[androidXXXX]  
type=friend  
host=dynamic  
secret=sekret  
context=gvXXXX  
callerid=“AndroidXXXX” \<101\>  
nat=yes

[androidYYYY]  
type=friend  
host=dynamic  
secret=sekret  
context=gvYYYY  
callerid=“Android YYYY” \<101\>  
nat=yes

[pcXXXX]  
type=friend  
host=dynamic  
secret=sekret  
context=gvXXXX  
callerid=“pcXXXX” \<100\>  
nat=yes

[pcYYYY]  
type=friend  
host=dynamic  
secret=sekret  
context=gvYYYY  
callerid=“pcYYYY” \<100\>  
nat=yes

\*\*\* gtalk.conf  
[general]  
allowguests=yes  
bindaddr=x.x.x.x

[guest]  
disallow=all  
allow=ulaw  
context=gv-inbound  
connection=XXXXjabber

\*\*\* extensions.conf  
[users]  
exten =\> 100,1,Dial(SIP/pcXXXX,20)  
exten =\> 101,1,Dial(SIP/androidXXXX,20)  
exten =\> 200,1,Dial(SIP/pcYYYY,20)  
exten =\> 201,1,Dial(SIP/androidYYYY,20)

[gvXXXX]  
;append an area code if necessary  
exten =\> \_NXXXXXX,1,Set(CALLERID(dnid)=1239${CALLERID(dnid)})  
exten =\> \_NXXXXXX,n,Goto(1239${EXTEN},1)  
;append a 1 if necessary  
exten =\> \_NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})  
exten =\> \_NXXNXXXXXX,n,Goto(1${EXTEN},1)  
;do our real dialing  
exten =\> \_1NXXNXXXXXX,1,Dial(gtalk/XXXXjabber/${EXTEN}@voice.google.com)  
exten =\> \_+1NXXNXXXXXX,1,Dial(gtalk/XXXXjabber/${EXTEN}@voice.google.com)  
include =\> users

[gvYYYY]  
exten =\> \_NXXXXXX,1,Set(CALLERID(dnid)=1239${CALLERID(dnid)})  
exten =\> \_NXXXXXX,n,Goto(1239${EXTEN},1)  
exten =\> \_NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})  
exten =\> \_NXXNXXXXXX,n,Goto(1${EXTEN},1)  
exten =\> \_1NXXNXXXXXX,1,Dial(gtalk/YYYYjabber/${EXTEN}@voice.google.com)  
exten =\> \_+1NXXNXXXXXX,1,Dial(gtalk/YYYYjabber/${EXTEN}@voice.google.com)  
include =\> users

[gv-inbound]  
exten =\> [XXXX@gmail.com](mailto:XXXX@gmail.com),1,Answer()  
exten =\> [XXXX@gmail.com](mailto:XXXX@gmail.com),n,Wait(1)  
exten =\> [XXXX@gmail.com](mailto:XXXX@gmail.com),n,SendDTMF(1)  
exten =\> [XXXX@gmail.com](mailto:XXXX@gmail.com),n,Dial(SIP/androidXXXX&SIP/pcXXXX,20)

exten =\> [YYYY@gmail.com](mailto:YYYY@gmail.com),1,Answer()  
exten =\> [YYYY@gmail.com](mailto:YYYY@gmail.com),n,Wait(1)  
exten =\> [YYYY@gmail.com](mailto:YYYY@gmail.com),n,SendDTMF(1)  
exten =\> [YYYY@gmail.com](mailto:YYYY@gmail.com),n,Dial(SIP/androidYYYY&SIP/pcYYYY,20)

---

<div class="post-metadata">

**Author:** ![mrwxyz](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@mrwxyz](https://community.asterisk.org/u/mrwxyz)\
**Post date:** [March 29, 2011, 8:37pm UTC](https://community.asterisk.org/t/asterisk-1-8-multiple-inbound-google-voice-accounts/33360/3 "2011-03-29T20:37:08Z")

</div>

Hi  
\*\*\* gtalk.conf  
[general]  
allowguests=yes  
bindaddr=x.x.x.x

[guest]  
disallow=all  
allow=ulaw  
context=gv-inbound  
connection=XXXXjabber

Do we need one ore entry in gtalk.conf to support multiple inbound google voice.
