Now that we’ve got SIP configured in Asterisk, there are two more things we need to configure before we get to the dial plan: Voicemail (voicemail.conf) and Call Parking (features.conf)
voicemail.conf
Asterisk’s built-in voicemail system is quite possibly the easiest piece of this puzzle for us to configure.
- Create
/etc/asterisk/voicemail.confin the text editor of your choice. - Add the following block to the new file:
[general][default]
1000 => 1234,Your Name
This creates voicemail box 1000 in the default context with a PIN of 1234. The name set here can be used for the dial-by-name directory functionality available in Asterisk. - Reload the voicemail configuration from the Asterisk CLI
asterisk*CLI> voicemail reload
That’s it. All there is to it.
features.conf
Call parking is a means of putting calls on hold so they can be transferred to other extensions. We’re going to use call parking to help us make outgoing calls with Google Voice, but first we need to setup our “Parking Lot”.
- Create
/etc/asterisk/features.confin the text editor of your choice. - Add the following block to the new file:
[general]
parkext => 7000
parkpos => 7001-7100
context => parkedcalls
findslot => first
This sets up a parking lot over extensions 7001 through 7100, putting them into theparkedcallscontext. - Reload the features configuration from the Asterisk CLI
asterisk*CLI> features reload
Dialplan Planning
Before we go ahead with configuring our dialplan, we need to decide exactly what we will do in the dialplan.
- Dialing 1000-1008 connects to an internal phone
- Dialing 1009 connects to voicemail
- Dialing 1010-1019 performs a special action, like a speed dial
- Dialing 3000-3010 performs a test action
- Dialing 911 plays an error message
- Dialing a 7-digit telephone number makes an outbound call, using a pre-defined area code
- Dialing a 10- or 11-digit telephone number makes an outbound call
Outbound Calling
You’re probably still wondering how we are going to be able to make outbound calls when our sipgate account only gives us free incoming calls. The solution is to turn an outbound call into an incoming call, at least as far as sipgate sees things. When you make an outbound call, this is what really happens:
- Asterisk recognizes that a 7-, 10-, or 11-digit number has been dialed and starts processing it as an external call.
- The call is parked on a designated extension.
- PyGoogleVoice is used to originate a Google Voice call to the dialed number
- Google Voice sets up the call and connects it to our sipgate phone number
- Asterisk sees that the incoming call is a ringback from Google Voice and connects the incoming call to the previously parked call
Now we’ll go ahead and configure our dialplan… (continue)