- Aug 24, 2000
- 4,153
- 4
- 81
I'm not the first and many people have been using the Obi devices to do this already, but I thought I'd do it differently and use Asterisk instead. This saved me the cost of buying the Obi box and I can do a ton of cool features as well so I just wanted to share incase anyone else was interested in the process.
Here's what you need:
1) A spare PC, laptop, whatever OR you can virtualize if you choose. (Virtualbox is free)
2) The latest version of Elastix. I like Elastix because it is the simplest way to get Asterisk up and going. It is easier and faster to install than PIAF and has everything I like about Trixbox without any of the commercialized bloatware.
http://www.elastix.org/index.php/en/downloads.html (I used version 2.3.0 Stable)
3) The Google Voice addon for Asterisk. http://www.freedoh.net/googlevoice.html
Download and save the tarball to the machine you will use to access the Elastix web GUI. Ok if it's a Windows machine (more on this later)
4) PuTTY (remote terminal needed to access your Elastix box)
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
5) A Google Voice account if you don't already have one. When it asks, tell it you want a new number.
http://www.google.com/voice
To get it all set up:
1) Once you have the Elastix .iso downloaded and burned onto a CD begin by installing Elastix on a spare machine. This basically involves booting from CD, pressing 'Enter' at the boot> prompt from the startup screen and following the on screen instructions. If you've ever done an install of RedHat or Fedora before this should seem very familiar.
NOTE: I used the same password for all of the different admin functions for simplicity sake, (root, mysql, elastix GUI). You can do otherwise for added security, just remember what's what. I also assigned it a Static IP address.. I recommend doing this to make setting up SIP clients easier (more on this later)
2) While Elastix is installing we need to modify the settings in Google Voice so go ahead and log into your Google Voice account from your favorite browser. Once inside, click on your number in the left hand pane. Then under the phones tab check the box next to Google chat and uncheck everything else.
Next click on the Calls tab:
Call Screening = off
Caller ID (incoming) = Display Caller's ID
Caller ID (outgoing) = Don't change anything
Do Not Disturb = Leave unchecked
Missed Calls = Leave unchecked
Call Options = Leave unchecked
Global Spam Filtering = Check the box
Save the settings and you're done, you can sign out of Google Voice
3) Modifying Elastix to use Google Voice:
Once Elastix is done installing, remove the CD and reboot the system.
Before we can modify the Elastix box to accept the Google Voice addon we must be able to grant ourselves access to run FreePBX in Unembedded mode (more on this later). In order to be able to grant ourselves this access we must first enable the Advanced Security features in the Elastix web-gui. Here is how to do it:
From a separate machine launch PuTTY. Enter the IP address you assigned the Elastix machine in the address space and select SSH then click "Open". When prompted accept the RSA keys and login as username:root, password: whatever you assigned to root at install. Alternatively you can just log in locally.
One you're in perform the following command:
#yum install -y elastix-security
Once that is finished enter the following commands:
#amportal stop
#amportal start
One that is finished log out of Elastix.
#exit
From a separate machine using your favorite web browser type the IP of the Elastix box into the address bar to bring up the Elastix GUI. Login with username:admin, password: whatever you assigned. If you get a security certificate warning, it's OK, just proceed anyway.
Once you are logged into the web-gui, across the top row of tabs on the most right hand side is a down arrow (v). Click that to open a drop down box and select "Security".
From there on the second row (the gray bar) there is a tab called "Advanced Settings", click that..
Next to "Enable direct access (Non-embedded) to FreePBX:" click the switch to turn access ON and then click the save button in the upper left.
From here click "PBX" on the top row of tabs and then scroll all the way to the bottom. On the left hand side there should be an option "Unembedded freePBX"; click it..
This should launch a new login screen for which the username will be Admin with a capitol "A" and the password should be the same admin password for the Elastix gui.
On the left right above the blue bar that says 'basic' there is an option for Module Admin; click it..
Once on this screen click the 'Upload Module' option. On the next screen choose the "Choose file" option and browse to the location where you saved the googlevoice-0.6.0.tgz file you downloaded in step 3 of the preparation. Select this file and and click "open". Once the window disappears and you verify the correct filename is shown in the corresponding text box, click "upload"
Once the upload completes, on the left hand pane click the "Module Admin" option again and scroll all the way to the bottom. You will see a new feature under 3rd Party Addons called Googlevoice. Click it and it should expand with the option to Install. Select 'Install" and then click on the "process" button in the lower right hand corner. On the next page click "confirm". This will install all of the extensions you need to interact directly with Googlevoice from within Asterisk.
Still working within Unembedded freePBX mode, on the left hand pane all the way at the bottom will now be an option named 'Google Voice', click it. It should bring up a window asking for the credentials you used to create your Google Voice account with:
Under Phone Number: enter the 10 digit Google Voice number you were assigned
Username: is going to be the first half of your Google ID you signed up with for you Google Voice account WITHOUT the @gmail.com part.
Password: is going to be the password to your Google Voice account.
Tick the 3 boxes and the GUI will automatically create all of the correct trunks and routes to allow Asterisk to start using your Google Voice line directly. You must also agree to the TOS. Once you have completed these steps click on "Submit Changes". After which there will be a orange bar across the top of the webpage that says "Apply Configuration Changes". Click that to commit the changes you have just made and reload the Asterisk back end.
IMPORTANT NOTE: Unlike most changes you make to Asterisk, the Google Voice trunks will not come on line with a simple back end reload from the web gui.. You must restart Asterisk manually. Here it goes...
Using PuTTY or the local machine, log back into the Elastix box as root. Issue the following commands:
#amportal stop
#amportal start
ANOTHER IMPORTANT NOTE: Installing the Google Voice module breaks the Elastix gui embedded PBX features. Here is how we fix that:
still logged in as root, issue the following commands:
#cd /var/www/html/admin/modules/googlevoice/
#cp functions.inc.php functions.inc.php.bak
(just incase we royally F up and need to revert back to an unmolested copy..
)
#nano functions.inc.php
Arrow down until you find :
global $amp_conf;
Comment out the following lines like so:
// Do we run FreePBX 2.8?
//if(file_exists($amp_conf['AMPWEBROOT']."/admin/extensions.class.php"))
//{
// Yes, then include these files
//I need to know if we really need these files. Questionable.
//require_once("functions.inc.php");
//require_once("extensions.class.php");
//}
Once finished hit <CTRL> + <x> to exit.
At the prompt hit <y> to save.
Again time to manually restart Asterisk
#amportal stop
#amportal start
Now we're all set for smooth sailing from here on in. You can logout of the Elastix box.
#exit.
Back to the unembedded freePBX gui window (assuming it's still open). We not longer need to work in unembedded freePBX.
NOTE: If you decide you would like to add additional Google Voice lines you can ONLY do that using unembedded freePBX mode but aside form that plus adding the 3rd party GV plugin there is no reason to use Elastix this way.. Everything else can be done from embedded mode once you fix what the plugin breaks in the gui (which we just finished doing).
ANOTHER NOTE: When you add additional GV lines you have to check the add trunks and TOS boxes. Dont add any more routes doing this.. One already exists from the first GV number and adding additional ones can get funky. We only have to edit the original one start making use of the additional trunks/GV lines.
Ok where were we...
Elastix installed - check
GV account - check
3rd party plugin installed - check
gui bug fixed - check
GV trunks added - check
manual asterisk reload done - check
Time for the fun stuff.
From here all you need is an extension to use with your new GV line. It can be SIP, it can be an IAXy device, it can be Zap (if you have an FXO card installed).
You can use a softphone like X-Lite or SJ Phone on your computer, you can use an ATA and plug in a POTS phone, you can do a SIP client on your smartphone. Basically anything Asterisk can make an extension for you can use.
I used an old Sangoma ATA and hooked it to a cordless phone base I have and just for fun I also installed Media-5 SIP Fone on my Droid to use over my WiFi connection. I put both extensions in a ring group so when someone calls my GV line it rings the regular phone and my cell phone SIP client at the same time (pretty cool!).
Creating SIP extensions in Elastix is easy. From the Elastix web gui, click the PBX tab. In the left hand pane will be an option for extensions. Click it.. On this screen, select generic SIP device and click 'Submit".
The next screen has a whole ton of fields asking for information but only 3 of them really matter. You need a Display Name for your extension (this can be anything but I just used the number I used for the extension as the display name for simplicity). Then you need to assign an extension number. I used 1001 for my ATA. The only other thing that matters here is you have to assign a 'secret'.. This is basically a password your SIP device will use to authenticate with Asterisk. I kept is simple and used "gv1001" for extension 1001. That's all you need! Scroll to the bottom and click "submit". Don't forget to scroll back up to the top and click the orange bar to apply changes. You should now see your newly created extension listed over on the right side of the page.
OK, the next step is to configure your SIP client to talk to Asterisk. This is going to depend on your SIP device for the exact setup but the meat and potatoes of it is your username is going to be the extension number (e.g.1001) and the password is going to be your secret (e.g. gv1001) and your domain/server/whatever-it-calls-it is going to be the IP address if your Elastix box. Once you enter that information and save it your device should indicate it has successfully registered with your provider or something to that effect.
If all has gone according to plan so far you can actually start making outbound calls right now using 10 digit dialing (no need to dial a '1').
So assuming we are so far so good, the last order of business is to be able to answer inbound calls. This is done by creating and Inbound Route.
This is done by selecting the Inbound Route option on the left hand pane.. click it...
This should bring up the 'Add Incoming Route' page... This is much easier than it looks:
In the DID Number box goes your 10 digit Google Voice number you were assigned. Leave everything else as-is and scroll down to the very bottom to 'set destination'. Under this heading, click the drop down box and select "Extensions". A new drop down box should appear containing any extensions you've created. Select the one you want to use to answer your Google Voice line and click submit. As always scroll back to the top and click the orange bar to commit changes and reload the back end.
Now when anyone calls your Google Voice line it will ring directly to that extension and you can answer it.
Congratulations!! Free Land Line via Google Voice with inbound and outbound calling!!!
Now you can have fun experimenting and learning all the other cool tricks Asterisk can do!
For Instance, I signed up 4 GV lines, Set up my routing to dedicate one to handling only inbound calls and route outbounds out the other three. I set up a ring group to ring all extensions including my cell phone when someone calls in, I assigned one of the other three lines as a direct in dial for my daughter so she can have her own line again using a SIP client on my old Droid that I don't use anymore, I set up a follow me so Asterisk will connect an inbound call not answered at the house and forward it to my cell phone number when I'm away.. Just all kinds of cool stuff you can geek out on.
Hope someone finds this writeup useful and most of all HAVE FUN WITH IT!!!
-JR
Here's what you need:
1) A spare PC, laptop, whatever OR you can virtualize if you choose. (Virtualbox is free)
2) The latest version of Elastix. I like Elastix because it is the simplest way to get Asterisk up and going. It is easier and faster to install than PIAF and has everything I like about Trixbox without any of the commercialized bloatware.
http://www.elastix.org/index.php/en/downloads.html (I used version 2.3.0 Stable)
3) The Google Voice addon for Asterisk. http://www.freedoh.net/googlevoice.html
Download and save the tarball to the machine you will use to access the Elastix web GUI. Ok if it's a Windows machine (more on this later)
4) PuTTY (remote terminal needed to access your Elastix box)
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
5) A Google Voice account if you don't already have one. When it asks, tell it you want a new number.
http://www.google.com/voice
To get it all set up:
1) Once you have the Elastix .iso downloaded and burned onto a CD begin by installing Elastix on a spare machine. This basically involves booting from CD, pressing 'Enter' at the boot> prompt from the startup screen and following the on screen instructions. If you've ever done an install of RedHat or Fedora before this should seem very familiar.
NOTE: I used the same password for all of the different admin functions for simplicity sake, (root, mysql, elastix GUI). You can do otherwise for added security, just remember what's what. I also assigned it a Static IP address.. I recommend doing this to make setting up SIP clients easier (more on this later)
2) While Elastix is installing we need to modify the settings in Google Voice so go ahead and log into your Google Voice account from your favorite browser. Once inside, click on your number in the left hand pane. Then under the phones tab check the box next to Google chat and uncheck everything else.
Next click on the Calls tab:
Call Screening = off
Caller ID (incoming) = Display Caller's ID
Caller ID (outgoing) = Don't change anything
Do Not Disturb = Leave unchecked
Missed Calls = Leave unchecked
Call Options = Leave unchecked
Global Spam Filtering = Check the box
Save the settings and you're done, you can sign out of Google Voice
3) Modifying Elastix to use Google Voice:
Once Elastix is done installing, remove the CD and reboot the system.
Before we can modify the Elastix box to accept the Google Voice addon we must be able to grant ourselves access to run FreePBX in Unembedded mode (more on this later). In order to be able to grant ourselves this access we must first enable the Advanced Security features in the Elastix web-gui. Here is how to do it:
From a separate machine launch PuTTY. Enter the IP address you assigned the Elastix machine in the address space and select SSH then click "Open". When prompted accept the RSA keys and login as username:root, password: whatever you assigned to root at install. Alternatively you can just log in locally.
One you're in perform the following command:
#yum install -y elastix-security
Once that is finished enter the following commands:
#amportal stop
#amportal start
One that is finished log out of Elastix.
#exit
From a separate machine using your favorite web browser type the IP of the Elastix box into the address bar to bring up the Elastix GUI. Login with username:admin, password: whatever you assigned. If you get a security certificate warning, it's OK, just proceed anyway.
Once you are logged into the web-gui, across the top row of tabs on the most right hand side is a down arrow (v). Click that to open a drop down box and select "Security".
From there on the second row (the gray bar) there is a tab called "Advanced Settings", click that..
Next to "Enable direct access (Non-embedded) to FreePBX:" click the switch to turn access ON and then click the save button in the upper left.
From here click "PBX" on the top row of tabs and then scroll all the way to the bottom. On the left hand side there should be an option "Unembedded freePBX"; click it..
This should launch a new login screen for which the username will be Admin with a capitol "A" and the password should be the same admin password for the Elastix gui.
On the left right above the blue bar that says 'basic' there is an option for Module Admin; click it..
Once on this screen click the 'Upload Module' option. On the next screen choose the "Choose file" option and browse to the location where you saved the googlevoice-0.6.0.tgz file you downloaded in step 3 of the preparation. Select this file and and click "open". Once the window disappears and you verify the correct filename is shown in the corresponding text box, click "upload"
Once the upload completes, on the left hand pane click the "Module Admin" option again and scroll all the way to the bottom. You will see a new feature under 3rd Party Addons called Googlevoice. Click it and it should expand with the option to Install. Select 'Install" and then click on the "process" button in the lower right hand corner. On the next page click "confirm". This will install all of the extensions you need to interact directly with Googlevoice from within Asterisk.
Still working within Unembedded freePBX mode, on the left hand pane all the way at the bottom will now be an option named 'Google Voice', click it. It should bring up a window asking for the credentials you used to create your Google Voice account with:
Under Phone Number: enter the 10 digit Google Voice number you were assigned
Username: is going to be the first half of your Google ID you signed up with for you Google Voice account WITHOUT the @gmail.com part.
Password: is going to be the password to your Google Voice account.
Tick the 3 boxes and the GUI will automatically create all of the correct trunks and routes to allow Asterisk to start using your Google Voice line directly. You must also agree to the TOS. Once you have completed these steps click on "Submit Changes". After which there will be a orange bar across the top of the webpage that says "Apply Configuration Changes". Click that to commit the changes you have just made and reload the Asterisk back end.
IMPORTANT NOTE: Unlike most changes you make to Asterisk, the Google Voice trunks will not come on line with a simple back end reload from the web gui.. You must restart Asterisk manually. Here it goes...
Using PuTTY or the local machine, log back into the Elastix box as root. Issue the following commands:
#amportal stop
#amportal start
ANOTHER IMPORTANT NOTE: Installing the Google Voice module breaks the Elastix gui embedded PBX features. Here is how we fix that:
still logged in as root, issue the following commands:
#cd /var/www/html/admin/modules/googlevoice/
#cp functions.inc.php functions.inc.php.bak
(just incase we royally F up and need to revert back to an unmolested copy..
#nano functions.inc.php
Arrow down until you find :
global $amp_conf;
Comment out the following lines like so:
// Do we run FreePBX 2.8?
//if(file_exists($amp_conf['AMPWEBROOT']."/admin/extensions.class.php"))
//{
// Yes, then include these files
//I need to know if we really need these files. Questionable.
//require_once("functions.inc.php");
//require_once("extensions.class.php");
//}
Once finished hit <CTRL> + <x> to exit.
At the prompt hit <y> to save.
Again time to manually restart Asterisk
#amportal stop
#amportal start
Now we're all set for smooth sailing from here on in. You can logout of the Elastix box.
#exit.
Back to the unembedded freePBX gui window (assuming it's still open). We not longer need to work in unembedded freePBX.
NOTE: If you decide you would like to add additional Google Voice lines you can ONLY do that using unembedded freePBX mode but aside form that plus adding the 3rd party GV plugin there is no reason to use Elastix this way.. Everything else can be done from embedded mode once you fix what the plugin breaks in the gui (which we just finished doing).
ANOTHER NOTE: When you add additional GV lines you have to check the add trunks and TOS boxes. Dont add any more routes doing this.. One already exists from the first GV number and adding additional ones can get funky. We only have to edit the original one start making use of the additional trunks/GV lines.
Ok where were we...
Elastix installed - check
GV account - check
3rd party plugin installed - check
gui bug fixed - check
GV trunks added - check
manual asterisk reload done - check
Time for the fun stuff.
From here all you need is an extension to use with your new GV line. It can be SIP, it can be an IAXy device, it can be Zap (if you have an FXO card installed).
You can use a softphone like X-Lite or SJ Phone on your computer, you can use an ATA and plug in a POTS phone, you can do a SIP client on your smartphone. Basically anything Asterisk can make an extension for you can use.
I used an old Sangoma ATA and hooked it to a cordless phone base I have and just for fun I also installed Media-5 SIP Fone on my Droid to use over my WiFi connection. I put both extensions in a ring group so when someone calls my GV line it rings the regular phone and my cell phone SIP client at the same time (pretty cool!).
Creating SIP extensions in Elastix is easy. From the Elastix web gui, click the PBX tab. In the left hand pane will be an option for extensions. Click it.. On this screen, select generic SIP device and click 'Submit".
The next screen has a whole ton of fields asking for information but only 3 of them really matter. You need a Display Name for your extension (this can be anything but I just used the number I used for the extension as the display name for simplicity). Then you need to assign an extension number. I used 1001 for my ATA. The only other thing that matters here is you have to assign a 'secret'.. This is basically a password your SIP device will use to authenticate with Asterisk. I kept is simple and used "gv1001" for extension 1001. That's all you need! Scroll to the bottom and click "submit". Don't forget to scroll back up to the top and click the orange bar to apply changes. You should now see your newly created extension listed over on the right side of the page.
OK, the next step is to configure your SIP client to talk to Asterisk. This is going to depend on your SIP device for the exact setup but the meat and potatoes of it is your username is going to be the extension number (e.g.1001) and the password is going to be your secret (e.g. gv1001) and your domain/server/whatever-it-calls-it is going to be the IP address if your Elastix box. Once you enter that information and save it your device should indicate it has successfully registered with your provider or something to that effect.
If all has gone according to plan so far you can actually start making outbound calls right now using 10 digit dialing (no need to dial a '1').
So assuming we are so far so good, the last order of business is to be able to answer inbound calls. This is done by creating and Inbound Route.
This is done by selecting the Inbound Route option on the left hand pane.. click it...
This should bring up the 'Add Incoming Route' page... This is much easier than it looks:
In the DID Number box goes your 10 digit Google Voice number you were assigned. Leave everything else as-is and scroll down to the very bottom to 'set destination'. Under this heading, click the drop down box and select "Extensions". A new drop down box should appear containing any extensions you've created. Select the one you want to use to answer your Google Voice line and click submit. As always scroll back to the top and click the orange bar to commit changes and reload the back end.
Now when anyone calls your Google Voice line it will ring directly to that extension and you can answer it.
Congratulations!! Free Land Line via Google Voice with inbound and outbound calling!!!
Now you can have fun experimenting and learning all the other cool tricks Asterisk can do!
For Instance, I signed up 4 GV lines, Set up my routing to dedicate one to handling only inbound calls and route outbounds out the other three. I set up a ring group to ring all extensions including my cell phone when someone calls in, I assigned one of the other three lines as a direct in dial for my daughter so she can have her own line again using a SIP client on my old Droid that I don't use anymore, I set up a follow me so Asterisk will connect an inbound call not answered at the house and forward it to my cell phone number when I'm away.. Just all kinds of cool stuff you can geek out on.
Hope someone finds this writeup useful and most of all HAVE FUN WITH IT!!!
-JR
Last edited by a moderator: