New Multi-Tenant PIAF Purple w/ ALL latest Gtalk fixes! 12/10/2010

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,208
Reaction score
5,237
Patched version is available now. You'll have to wait until tomorrow for instructions on fixing existing installs, but if you want to begin again...

Load PIAF Purple 1.7.5.5.3 then...

cd /root
wget http://incrediblepbx.com/incrediblepbx.x
chmod +x incrediblepbx.x
./incrediblepbx.x

Holler if it smokes. :sifone:
 

titodj

Member
Joined
Oct 22, 2007
Messages
120
Reaction score
7
Patched version is available now. You'll have to wait until tomorrow for instructions on fixing existing installs....

Holler if it smokes. :sifone:


Woow, nice....
I will have to wait, but, this is great !!!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,208
Reaction score
5,237
Paradise Lost… and Found Again: Incredible PBX Returns


paradise.gif
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,208
Reaction score
5,237
The riddle of outbound calls failing with Asterisk 1.8 has been solved. Thanks, Doktur! Here's the answer.
 

johnnypuffs

New Member
Joined
Nov 2, 2010
Messages
50
Reaction score
0
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...
 
Last edited by a moderator:

johnnypuffs

New Member
Joined
Nov 2, 2010
Messages
50
Reaction score
0
continued from above..


A.Go to Setup, Outbound Routes. Click on Default. In the section “Trunk Sequence for Matched Routes” you should see gvoice in the 0 pulldown. In the 1 pulldown choose gvoice2 for a second outbound trunk.. Click Submit Changes

Create a new trunk called Default2 that is an exact copy of Default. Click Submit Changes.

Click Toll Free and it should have gvoice in 0 trunk sequence (if not choose it), then in 1 choose gvoice2. Click Submit Changes.

Do the same thing for the GooleVoice trunk.

Submit Changes, Apply Configuration Changes, Continue with Reload



Go to Setup, Custom Contexts. Add Context. Use the following settings:

Context: googlevoiceout
Description: googlevoiceout
Set All To: Allow (from pull down)

Now go through the first two sections options and set ONLY the following to Deny:

In first section: Default Internal Context

ENTIRE Basic Internal Dialplan set to Deny

In 2nd section: Internal Dialplan

at bottom set “ALL OUTBOUND ROUTES” to Deny.

Now in 3rd section called “Outbound Routes” set all to Deny except the option ending with Default (should be called “outrt-005-Default”). Set this to Allow.

Click Submit.



Click Add Context again. Use the following settings:

Context: googlevoice2out
Description: googlevoice2out
Set All To: Allow (from pull down)

Now go through the first two sections options and set ONLY the following to Deny:

In first section: Default Internal Context

ENTIRE Basic Internal Dialplan set to Deny

In 2nd section: Internal Dialplan

at bottom set “ALL OUTBOUND ROUTES” to Deny.

Now in 3rd section called “Outbound Routes” set all to Deny except the option called with Default2. Set this to Allow.

Submit Changes, Apply Configuration Changes, Continue with Reload.

Do an amportal restart.



Now you can set an extension or multiple extensions with a custom context so it always calls out the correct trunk and shows the correct caller ID.

For example:

Set ext. 701 Custom Context to googlevoiceout and submit, apply, continue. Now extension 701 will always call out with your account1 Google Voice number.

Set ext. 702 Custom Context to googlevoice2out and submit, apply, continue. Now extension 702 will always call out with your account2 Google Voice number.

Set any other extensions with a the custom context for the number you want them to call out on.

I personally did a server reboot after all this.. Can’t hurt...



Now you have a Gtalk direct outbound calling PBX with correct caller ID for each line/account, incoming notification of what line is being called and the ability to have different lines go to different destinations..

You can of course repeat the above steps for as many lines as you need.


Hopefully this saves some people some time.. I can’t get mine back.. ;)

- JP
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
So on the first part -
Code:
exten => s,n,Set([email protected])

   ***MAKE SURE THE ALERTNAME ON LINES 3 AND 11 ARE THE SAME AS THE ACCOUNT IN THAT SECTION.***
How does that differentiate from the two accounts? Do I need to change that?
 

ohrass

Member
Joined
Nov 13, 2010
Messages
92
Reaction score
0
Thank you thank you thank you all

Thank you thank you thank you all...I WILL be donating shortly
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
Tonight I found a bug in my [googlein] context (which was partly inspired by this thread) so I thought maybe I'd just post my two suggested [googlein] contexts, in case anyone here would want to use them. The bug is the way we've been doing caller ID number and name. If you go back a couple months in this thread someone asked why it was done that way and kind of got jumped on for his troubles, but maybe it wasn't such a dumb question, because the way it's done now, if an anonymous call comes in (someone dialed using *67 to hide their Caller ID) or, presumably, if it's a call from outside of country code "1" it's not going to display properly (anonymous calls come up as “onymous@vo”).

These are my suggested modifications to the [googlein] context and if anyone wants to try one or both, great. They fix the above issue AND remove some unnecessary waits. Both of these contexts are good for multiple accounts, provided you add the short additional context shown underneath.

The first one is if you want to answer the call as soon as it arrives on your system. The advantage of doing that is that Google Voice will not snatch it back in 20 seconds or so and send it to their voicemail. This is the most similar to what you've been using:

Code:
[googlein]
exten => _[@Xa-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[@Xa-z].,n,GotoIf($["${CALLERID(name):0:2}" != "+1"]?notrim)
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[@Xa-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[@Xa-z].,n,Answer
exten => _[@Xa-z].,n,Wait(1)
exten => _[@Xa-z].,n,SendDTMF(1)
exten => _[@Xa-z].,n,Goto(from-google-voice,${CUT(EXTEN,@,1)},1)
exten => h,1,Macro(hangupcall,)

The second is for those who don't want to answer the call until the called extension answers. Mainly this is used if you want to use Google Voice's voicemail rather than Asterisk's:

Code:
[googlein]
exten => _[@Xa-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[@Xa-z].,n,GotoIf($["${CALLERID(name):0:2}" != "+1"]?notrim)
exten => _[@Xa-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[@Xa-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[@Xa-z].,n,Set(DIAL_OPTIONS=${DIAL_OPTIONS}aD(:1))
exten => _[@Xa-z].,n,Goto(from-google-voice,${CUT(EXTEN,@,1)},1)
exten => h,1,Macro(hangupcall,)

Whichever of the above you use (pick one or the other, not both), follow it up with this:

Code:
[from-google-voice]
exten => username1,1,Goto(from-trunk,gvnumber1,1)
exten => username2,1,Goto(from-trunk,gvnumber2,1)
exten => username3,1,Goto(from-trunk,gvnumber3,1)
exten => h,1,Macro(hangupcall,)

That example shows three accounts, and for each what you do is replace usernamex with the part of the gmail address associated with the account that comes before the @gmail.com, and then replace gvnumberx with the ten digit Google Voice number assigned to the account. You can use more or fewer lines as needed. Whatever you replace gvnumberx with is what you use as your DID in your inbound route. This serves two purposes: it gives you a handy list of account usernames associated with DID numbers, and it stops FreePBX from complaining that you used a non-numeric DID in your inbound route (if you were using a non-numeric DID before).

And really, guys, you only need the single one-second wait if you use the first context. It's not cool to make callers wait extra seconds just because someone thought it would be a good idea to toss in a few extra waits. Just in case anyone decides they want to flame me for saying that, I'l just say that if you do, whatever you may say about me is probably exactly what I think of people who impose unneeded waits on callers. :rolleyes:

Anyway, have at 'em. Or, ignore 'em. Or whatever. :cool: And if you want a little insight into what the changes actually do, go here.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
I know I'm being lazy... but I can't believe no one has made all of this into a script just as before to make this go way smoother.....:rolleyes:
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
I know I'm being lazy... but I can't believe no one has made all of this into a script just as before to make this go way smoother.....:rolleyes:

What would be better yet is if a suggestion in the FreePBX forum was implemented - create a new trunk type specifically for Google Voice. Putting the search terms "FreePBX Google Voice Trunk" into Google (without the quotes) brings up these as the top two results:

Envisioning a FreePBX Google Voice trunk module | FreePBX

#4712 (Would like Google Voice trunk module, here's how I envision ...

(Hmmm, I see that the article linked from the first link references one of my how-to articles. :blush5:)

So apparently some thought has been given to this but AFAIK no one has actually started work on it. Possibly part of the reason for that is that I think that trunk functionality is built into the FreePBX core module, and I don't know if they give sufficient (and documented) "hooks" in that module to allow the creation of a third-party add-on that would provide an additional trunk type.

I suppose it could be done either way (script or additional trunk type), but I guess the real trick is finding someone with the knowledge and motivation to code it. If that person were part of the existing FreePBX team it would probably be better integrated into FreePBX, but I don't think any of those guys have the slightest interest, at least none they've indicated so far.
 
Joined
Apr 17, 2009
Messages
829
Reaction score
9
I was more referring to the actual inputting of the correct contexts, etc.. to make things go smother. creating a actual trunk is not that hard, but keeping up with all of the contexts in this thread alone on making multiple Google Voice accounts work is sometimes a little confusing.

Again... I know I am being lazy, but with the fact of moving everything over from the "old way" to this on a new server, plus all of the extensions and everything else that needs to be moved from the old server to the new one.

just a thought. Or am I missing something.... well I guess I will play around more when I get some more time and see.... maybe the lack of sleep and the 20 hour days for the past few weeks are catching up to me.. to much work sometimes gets to us all I guess:crazy:
 

eCase

New Member
Joined
Jan 26, 2011
Messages
161
Reaction score
0
Latest PIAF IncrediblePBX GVoice Integration Instructions?

just a thought. Or am I missing something.... well I guess I will play around more when I get some more time and see.... maybe the lack of sleep and the 20 hour days for the past few weeks are catching up to me.. to much work sometimes gets to us all I guess:crazy:

I know how you feel! I began my VoIP setup project on 01/11/2011 - and when I say "began," I really mean began :banghead:
I started with zero Linux experience 21 days ago...
I think I finally know enough to be able to ask for help :smile5: but I think this thread should stay on topic for the gurus and near-gurus.
I hate to post a new thread in the forums, because I imagine Misters Ward, Philippe, Ben and the MichiganTelephone guy (who are my new idols) not to mention everyone else (except me) get tired of re-explaining How-To-VoIP over and over.
With that in mind, I sincerely believe this forum needs a sticky dedicated to the most current installation instructions for beginners trying to set up the latest PIAF & IncrediblePBX to use with Google Voice.
This is my first forum post, so I am pretty sure I won't be able to post a sticky yet :wink5: but I will try to create a new thread so a moderator can decide if it should be a sticky or not. Look for a thread titled: "Latest PIAF IncrediblePBX GVoice How-To?"
~Best Regards to all~
Ethan
 

eCase

New Member
Joined
Jan 26, 2011
Messages
161
Reaction score
0
One quick thought I wanted to add - 1 year of Google Sites (domain registration, email, docs, etc...) for 50 users is $10.
That's $10 for 50 users (not a typo)
I have had success linking my Google Sites email address & Google Voice phone number using PIAF Purple and Incrediblepbx.
I only configured one of my domain email/voice accounts for PIAF because I was just testing and I am a beginner, but the important thing I discovered is that it is not necessary to use a "@gmail.com" email address.
Hopefully someone here smarter and more experienced than I can use this and figure out what to do with it :D
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,208
Reaction score
5,237
Read the latest Nerd Vittles article on Incredible PBX and you'll have the latest instructions. Simple as that.
 

eCase

New Member
Joined
Jan 26, 2011
Messages
161
Reaction score
0
You saved me!! I've been hunting for this solution for weeks it seems. I've FINALLY implemented more than one Google Voice account with the most current version of PIAF (as of 03.02.2011)
I am also using freepbx version 2.9.0beta1.6 all updates current (as of 03.01.2011)

TIP for other beginners: freepbx v 2.9 may not be "stable" but it has some features that make it easier to figure stuff out with :)
Of course, most of the devs and other smart-than-I people have not favored this version because it changes certain fundamentally established methods - but if you are mostly new to all this, and are having some trouble getting your system up - give 2.9 a try!
Worked for me :D
 
Joined
Jun 29, 2009
Messages
258
Reaction score
0
I know I'm being lazy... but I can't believe no one has made all of this into a script just as before to make this go way smoother.....:rolleyes:

I can't believe I never posted this in here...

A BASH script to assist Asterisk 1.8+/FreePBX 2.8+ users in adding new Google Voice accounts

Might not be completely what you are looking for, but does help avoid certain types of errors, assuming you can copy-and-paste (the script does NOT make any changes to your configurations, it just shows you what you need to do). BUT be sure you understand that the method used in that script may not be 100% compatible with whatever existing method you are using, so unless you are willing to resolve any differences between the two, that script is best used with brand-new installations, or by those adventurous enough to rip out the current Google Voice configuration and start over (and if you do that, bear in mind that there's no guarantee that the script will work for you — it's still very much beta!).
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,208
Reaction score
5,237
I only configured one of my domain email/voice accounts for PIAF because I was just testing and I am a beginner, but the important thing I discovered is that it is not necessary to use a "@gmail.com" email address.

That is only true for Google Apps-enabled domains. Google Sites is actually part of Google Apps.

We hope to have a multi-tenant script for Incredible PBX shortly.
 

eCase

New Member
Joined
Jan 26, 2011
Messages
161
Reaction score
0
That is only true for Google Apps-enabled domains. Google Sites is actually part of Google Apps.
Thanks for the clarification on that, Ward - you teach me at least three new things every time I tune in!!!
~Many thanks~
Ethan

We hope to have a multi-tenant script for Incredible PBX shortly.
Holy smokes! :beta1b: That's the best news I've heard since... since I found out Google will continue offering free US & CAN calls for 2011!
Need a tester? I'm willing to do full reinstall, share/send any dev-related info - whatever you need!!

Seriously, I would be honored to help those who have given me so much.
 

eCase

New Member
Joined
Jan 26, 2011
Messages
161
Reaction score
0
Might not be completely what you are looking for, but does help avoid certain types of errors, assuming you can copy-and-paste
MT thanks for sharing that! You've been added to my list of people I owe favors to... :grouphug:

I will start over with a fresh install on my extra computer to test this today!

I'll post back here to report results :)

Thanks MT,
Ethan
 

Members online

No members online now.

Forum statistics

Threads
25,838
Messages
167,924
Members
19,260
Latest member
lucky
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top