It’s been a crazy few weeks since the initial Purple release with Gtalk. So many changes. It’s only been a month and a half since I personally got sucked into this.. I’ve been working with Linux for years, but total NEWB to any PBX/VOIP.. Take that for what it’s worth. I’ve been trying to keep up with the changes and customizations I PERSONALLY needed and it’s been a huge time sucker..
These are my instructions for setting up PIAF Purple with multiple Google Voice accounts. I have certain requirements that are 100% needed for me to use this system since I have multiple businesses running though the same PBX..
Use these instructions (AT YOUR OWN RISK) If you want certain features with your multi-tenant system, namely:
1. You need different DIDs (GVoice #s) to go to different destinations; IVRs, extensions, etc..
2. You want to be able to easily recognize what number/business is being called.
3. You want outbound Caller ID to reflect the correct number for each line/business when calling out.
There are so many sets of instructions, forum posts, etc. about installing purple, bug fixes, multiple-tenant, etc and many seem to contradict each other with all the recent changes. So with bits and pieces from different posts, NV articles and help from some kind forum members like Dave (rxcomm).. I finally have come up with a solution that seems to be working 100% for me (at least for now).
By all means the credit goes to everyone at PIAF, NV and the posters who came up with these solutions.. I just kept pulling bits and pieces from everywhere to try and find a combination that works.. There certainly could be an easier way.. Mods, of course, feel free to change anything that would help or make it easier..
This assumes you have an install of PIAF Purple with Incredible script installed.
I have been following all the updates so some of these steps might not be needed, as the new updates will fix them... but I did them all and it’s working..
I ran the fixit.sh script and instructions from
http://nerdvittles.com/?p=710
*(I assume that this whole step is unnecessary now, since the latest update changes all this)
Run the latest (12/10/10) Asterisk Gtalk patch for direct outbound calling (NO CALLBACK. From this post..
http://pbxinaflash.com/community/threads/bleeding-edge-gtalk-cdr-patches.8932/?t=8932
HEED THE WARNINGS!
From
http://nerdvittles.com/?p=710 I used certain steps to add a second account. The rest are not needed as the patch on step 2 and latter steps in this post would overwrite those. The steps to follow:
A. Log into your server as root and edit /etc/asterisk/jabber.conf. Copy the entire [asterisk] context and name it [asterisk2]. Then replace the username and secret in [asterisk2] with your new Google Voice name and password for your second account.
Edit /etc/asterisk/extensions_custom.conf. Find the [googlein] context and make a duplicate copy of the top section of code which includes all lines beginning with exten =>
[email protected]. In the duplicate section, replace
[email protected] with your second account Google Voice Email, replace both gv_dialout_account1 entries using your second account Google Voice Name (well call it account2).
It should look like this when you are done: *From Ward’s NV article above but modified so ALERTNAME MUST BE your account email address..
Code:
[googlein]
exten => [email protected],1,Wait(1)
exten => [email protected],n,Set([email protected])
exten => [email protected],n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => [email protected],n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => [email protected],n,Set(CALLERID(name)=${CALLERID(number)})
exten => [email protected],n,GotoIf(${DB_EXISTS(gv_dialout_account1/channel)}?bridged)
exten => [email protected],n,Goto(s,regcall)
exten => [email protected],n(bridged),Bridge(${DB_DELETE(gv_dialout_account1/channel)})
exten => [email protected],1,Wait(1)
exten => [email protected],n,Set([email protected])
exten => [email protected],n,JABBERSend(asterisk2,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => [email protected],n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => [email protected],n,Set(CALLERID(name)=${CALLERID(number)})
exten => [email protected],n,GotoIf(${DB_EXISTS(gv_dialout_account2/channel)}?bridged)
exten => [email protected],n,Goto(s,regcall)
exten => [email protected],n(bridged),Bridge(${DB_DELETE(gv_dialout_account2/channel)})
exten => s,1,Wait(1)
exten => s,n,Set([email protected])
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk,${ALERTNAME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => s,n,JABBERSend(asterisk,${ALERTNAME},Incoming Google Voice Call: ${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(number)=${CALLERID(name):2:10})
exten => s,n,Set(CALLERID(name)=${CALLERID(number)})
exten => s,n(regcall),Answer
exten => s,n,SendDTMF(1)
exten => s,n,Goto(from-trunk,gv-incoming1,1)
***MAKE SURE THE ALERTNAME ON LINES 3 AND 11 ARE THE SAME AS THE ACCOUNT IN THAT SECTION.***
Replace the last line above:
Code:
exten => s,n,Goto(from-trunk,gv-incoming1,1)
with
Code:
exten => s,n,Goto(from-trunk,gv-incoming-${CUT(ALERTNAME,@,1)},1)
*Thanks to rxcomm and LostTrunk.. Dave (rxcomm) slightly modified LostTrunks earlier fix in response to my question.
Do an amportal restart.
We will now use most of the parts of rentpbx’s solution for multi-tenant GVoice.
In the same file (entensions_custom.conf) you will see a section [gvoice] .. First make sure the ALERTNAME is the same as your first account email. If not change it to that. Then copy the entire section and paste it just below.
Rename the section [gvoice2]
Then change the ALERTNAME to the email address of your account2 Gvoice. Also change all references to asterisk to asterisk2. Your final section should look like this:
Code:
[gvoice]
exten => _X.,1,Wait(1)
exten => _X.,n,Set([email protected])
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk,${ALERTNAME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => _X.,n,JABBERSend(asterisk,${ALERTNAME},Placing GVoice Call: ${EXTEN})
exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"="10"]?us:other)
exten => _X.,n(us),Dial(Gtalk/asterisk/+1${EXTEN}@voice.google.com)
exten => _X.,n,Goto(done)
exten => _X.,n(other),Dial(Gtalk/asterisk/+${EXTEN}@voice.google.com)
exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)
[gvoice2]
exten => _X.,1,Wait(1)
exten => _X.,n,Set([email protected])
;exten => _X.,n,Set(STATUS=${JABBER_STATUS(asterisk2,${ALERTNAME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => _X.,n,JABBERSend(asterisk2,${ALERTNAME},Placing GVoice Call: ${EXTEN})
exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"="10"]?us:other)
exten => _X.,n(us),Dial(Gtalk/asterisk2/+1${EXTEN}@voice.google.com)
exten => _X.,n,Goto(done)
exten => _X.,n(other),Dial(Gtalk/asterisk2/+${EXTEN}@voice.google.com)
exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)
Save the modifications and reload.
Go to setup, Inbound Routes and add a route (or modify if it exists).
Description: gvoice
DID number: gv-incoming-account1
CID name prefix: anything that will give you a hint as to what business is being called. This will show up right before the caller ID number on incoming calls
Source: Caller ID Superfecta
Destination: Anything you want. An extension, IVR, etc.
Click Submit.
Make a second inbound route:
Description: gvoice2
DID number: gv-incoming-account2
CID name prefix: anything that will give you a hint as to what business is being called. This will show up right before the caller ID number on incoming calls
Source: Caller ID Superfecta
Destination: Anything you want. An extension, IVR, etc.
Click Submit, Apply Configuration Changes, Continue with Reload.
Go to Setup, Trunks.
There should already be a trunk name gvoice with the only other option set being Custom Dial String: local/$OUTNUM$@gvoice
Click Add Trunk, Add Custom Trunk. Settings as follows:
Trunk Name: gvoice2
Custom Dial String: local/$OUTNUM$@gvoice2
Click Submit, Apply Configuration Changes, Continue with Reload
continued in next reply...