I know this topic has been touched on several times, but I thought I would create a tutorial on how to do this, if not for my own recollection and reference in the future. I hope this will help other if they are trying to do the same thing.
My setup:
VMware whitebox host (built myself)
Comcast voice,Cable Internet 7Mb upload/22Mb download
Piaf x86_64 1.8.3.2 Purple (Incredible PBX)
Avantfax 3.3.3
Hylafax 6.0.5 Client x86_64 --needed
Hylafax 6.0.5 Server x86_64
*I used iaxmodem because my OS is virtual and pass through of a PSTN card might be too much for me to take on, if it is even possible.
I modified a script from Piaf for the install and I will add it this post for anyone who wants to try/do this. I also pooled info from other threads on the forum for this
Modify the script as needed with your editor (can be done if needed although the script can be run as is)
I have done things different with the Google voice contexts which we will go into first to create the proper routes and trunks for our Google voice system.
Contexts:
In your Freepbx dashboard click on tools and config edit
Find extensions_custom.conf and click to edit it.
Comment out the entire [ext-fax], [sendfax], [faxit] and [googlein] contexts.
Add these to the bottom of the file:
*I use travelin man, but this context can still be used without it. This custom gvoice context has the waits removed and passes the inbound call to the [from-google-voice] context where the call is routed based on username of the gvoice account.
Replace username and gvoice number with the appropriate values of your environment
This context matches a username to the Google voice number which in turn will be used for a alias or CID lookup by asterisk to the correct extension. I used the CID lookup via number for my box.
The first gvoice context should be there already, so you really just need to add the second and third contexts. Make sure that asterisk in the context is stepped up by one for each new context you add. I believe this has to do with channels. It should look like this:
continued on next post
My setup:
VMware whitebox host (built myself)
Comcast voice,Cable Internet 7Mb upload/22Mb download
Piaf x86_64 1.8.3.2 Purple (Incredible PBX)
Avantfax 3.3.3
Hylafax 6.0.5 Client x86_64 --needed
Hylafax 6.0.5 Server x86_64
*I used iaxmodem because my OS is virtual and pass through of a PSTN card might be too much for me to take on, if it is even possible.
I modified a script from Piaf for the install and I will add it this post for anyone who wants to try/do this. I also pooled info from other threads on the forum for this
Modify the script as needed with your editor (can be done if needed although the script can be run as is)
I have done things different with the Google voice contexts which we will go into first to create the proper routes and trunks for our Google voice system.
Contexts:
In your Freepbx dashboard click on tools and config edit
Find extensions_custom.conf and click to edit it.
Comment out the entire [ext-fax], [sendfax], [faxit] and [googlein] contexts.
Add these to the bottom of the file:
Code:
[from-fax]
exten => _x.,1,Dial(local/${EXTEN}@[B][COLOR=red]username1faxout[/COLOR][/B])
exten => _x.,n,Hangup()
[from-fax1]
exten => _x.,1,Dial(local/${EXTEN}@[B][COLOR=red]username2faxout[/COLOR][/B])
exten => _x.,n,Hangup()
[googlein]
;Allows anonymous calls through travelin man and replaces onymous@vo with anonymous. Waits removed
exten => _[0-9a-z].,1,Noop(Incoming Google Voice call for ${EXTEN})
exten => _[0-9a-z].,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => _[0-9a-z].,n,GotoIf($["${CALLERID(name):0:2}" != "+1"]?notrim)
exten => _[0-9a-z].,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _[0-9a-z].,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => _[0-9a-z].,n,Answer
exten => _[0-9a-z].,n,Wait(10)
exten => _[0-9a-z].,n,SendDTMF(1)
exten => _[0-9a-z].,n,Goto(from-google-voice,${CUT(EXTEN,@,1)},1)
exten => h,1,Macro(hangupcall,)
Replace username and gvoice number with the appropriate values of your environment
Code:
[from-google-voice]
;Allows multiple gvoice accounts. Waits removed.
exten => [B][COLOR=red]username1[/COLOR][/B],1,Goto(from-trunk,[B][COLOR=red]gvoice Number1[/COLOR][/B],1)
exten => [B][COLOR=red]username2[/COLOR][/B],1,Goto(from-trunk,[B][COLOR=red]gvoice Number2[/COLOR][/B],1)
exten => [B][COLOR=red]username3[/COLOR][/B],1,Goto(from-trunk,[B][COLOR=red]gvoice Number3[/COLOR][/B],1)
;exten => [B][COLOR=red]username4[/COLOR][/B],1,Goto(from-trunk,[B][COLOR=red]gvoice Number4[/COLOR][/B],1)
exten => h,1,Macro(hangupcall,)
The first gvoice context should be there already, so you really just need to add the second and third contexts. Make sure that asterisk in the context is stepped up by one for each new context you add. I believe this has to do with channels. It should look like this:
Code:
[gvoice]
exten => _X.,1,Wait(1)
exten => _X.,n,Set(ALERTNAME=[B][COLOR=red]username1[/COLOR][/B]@gmail.com)
;exten => _X.,n,Set(STATUS=${JABBER_STATUS([B][COLOR=red]asterisk[/COLOR][/B],${ALERTNAME})});
;exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})
exten => _X.,n,JABBERSend([B][COLOR=red]asterisk[/COLOR][/B],${ALERTNAME},Placing GVoice Call: ${EXTEN})
exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"="10"]?us:other)
exten => _X.,n(us),Dial(Gtalk/[B][COLOR=red]asterisk[/COLOR][/B]/+1${EXTEN}@voice.google.com)
exten => _X.,n,Goto(done)
exten => _X.,n(other),Dial(Gtalk/[B][COLOR=red]asterisk[/COLOR][/B]/+${EXTEN}@voice.google.com)
exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)
[FONT=Calibri][gvoice1][/FONT]
[FONT=Calibri]exten => _X.,1,Wait(1)[/FONT]
[FONT=Calibri]exten => _X.,n,Set(ALERTNAME=[B][COLOR=red]username2[/COLOR][/B]@gmail.com)[/FONT]
[FONT=Calibri];exten => _X.,n,Set(STATUS=${JABBER_STATUS([B][COLOR=red]asterisk1[/COLOR][/B],${ALERTNAME})});[/FONT]
[FONT=Calibri];exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})[/FONT]
[FONT=Calibri]exten => _X.,n,JABBERSend([B][COLOR=red]asterisk1[/COLOR][/B],${ALERTNAME},Placing GVoice Call: ${EXTEN})[/FONT]
[FONT=Calibri]exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"="10"]?us:other)[/FONT]
[FONT=Calibri]exten => _X.,n(us),Dial(Gtalk/[B][COLOR=red]asterisk1[/COLOR][/B]/+1${EXTEN}@voice.google.com)[/FONT]
[FONT=Calibri]exten => _X.,n,Goto(done)[/FONT]
[FONT=Calibri]exten => _X.,n(other),Dial(Gtalk/[B][COLOR=red]asterisk1[/COLOR][/B]/+${EXTEN}@voice.google.com)[/FONT]
[FONT=Calibri]exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed)[/FONT]
[FONT=Calibri][gvoice2][/FONT]
[FONT=Calibri]exten => _X.,1,Wait(1)[/FONT]
[FONT=Calibri]exten => _X.,n,Set(ALERTNAME=[B][COLOR=red]username3[/COLOR][/B]@gmail.com)[/FONT]
[FONT=Calibri];exten => _X.,n,Set(STATUS=${JABBER_STATUS([B][COLOR=red]asterisk2[/COLOR][/B],${ALERTNAME})});[/FONT]
[FONT=Calibri];exten => _X.,n,NoOp(Gvoice/Jabber Status: ${STATUS})[/FONT]
[FONT=Calibri]exten => _X.,n,JABBERSend([B][COLOR=red]asterisk2[/COLOR][/B],${ALERTNAME},Placing GVoice Call: ${EXTEN})[/FONT]
[FONT=Calibri]exten => _X.,n,GotoIf($["${LEN(${EXTEN})}"="10"]?us:other)[/FONT]
[FONT=Calibri]exten => _X.,n(us),Dial(Gtalk/[B][COLOR=red]asterisk2[/COLOR][/B]/+1${EXTEN}@voice.google.com)[/FONT]
[FONT=Calibri]exten => _X.,n,Goto(done)[/FONT]
[FONT=Calibri]exten => _X.,n(other),Dial(Gtalk/[B][COLOR=red]asterisk2[/COLOR][/B]/+${EXTEN}@voice.google.com)[/FONT]
[FONT=Calibri]exten => _X.,n(done),NoOp(GVoice Call to ${EXTEN} failed) [/FONT]