Configuring Asterisk@Home to use BroadVoice's VoIP Services

INTRODUCTION & HELPFUL LINKS SUMMARY & PURPOSE OF THIS DOCUMENT
    Why did I put this together? After getting extited by the prospect of what Asterisk and VoIP in general was (and could do for me) I decided to try out Asterisk@Home with BroadVoice. I found plenty of bits and pieces on how to get Asterisk and BroadVoice to "talk" to each other, but there was no comprehensive guide that I could find to tie it all together.

    I spent hours tinkering in Asterisk's configuration files with a text editor through SSH. I managed to get a single extension working and inbound and outbound calling with BroadVoice working. In the process I had knocked out almost all of the customizations that the Asterisk@Home creators had provided. I decided to start from scratch and figure out how to get BroadVoice integrated into the package using AMP and staying out of the configuration files as much as possible.

    Since this was fairly time comsuming for me (and I have quite a lot of system and telephony experience in general), I figured there were probably a lot of other people struggling with these same issues; hence this guide!

    If you find it beneficial, I would appreciate you dropping me an email message at jmc@cazz.org letting me know!

GETTING STARTED & CONFIGURATION OF AAH
    First things first - get Asterisk@Home installed (if you haven't already done so). It will take a few minutes depending on the speed of your machine.

    Once Asterisk@Home (from now on referred to as AAH in this document) is installed make sure you're set with a permanent IP address. If you know how to do this, skip down a bit. Otherwise here's how:

    1. From secure shell or the local console, connect to your AAH machine as root (you did change the password from "password" right?).

    2. Type cd /etc/sysconfig/network-scripts and in your favorite editor (vi anyone?) edit the file ifcfg-eth0

    3. Add the following lines, substituting your network settings as appropriate:
      DEVICE=eth0
      IPADDR=192.168.0.5
      NETMASK=255.255.255.0
      NETWORK=192.168.0.0
      BROADCAST=192.168.0.255
      GATEWAY=192.168.0.1
      ONBOOT=yes
      BOOTPROTO=none
      TYPE=Ethernet

    4. To make these network changes you need to bring your interface down and back up. If you're connected to the AAH machine's console, type ifdown eth0, this will bring down your network. Type ifup eth0 and the network will come back up with the settings you specified above. If you don't have access to the AAH machine's console you can just reboot the machine via SSH and the IP will be changed when the machine comes back online.

    5. Fire up a web browser and point it to the IP specified above; http://192.168.0.5. Click the link: "Asterisk Management Portal". You will be prompted for a username and password - the default username is maint and the default password is password. You should now see the main AMP screen.

    6. Click on the Setup link in the upper-right area of the main AMP screen.

    7. Start by setting up your SIP/BroadVoice trunk by clicking on the Trunks link in the left-hand menu. Click Add SIP Trunk.

    8. You will need to fill out the main items on the SIP/Trunk screens. Add a default prefix to dial - this will be the number you need to prefix outbound numbers with to use this trunk. If this is your default trunk (and it should be if this is the only outbound source you have) then you don't need to dial this prefix number.

      I named my outgoing trunk BroadVoice and set the PEER Details to the following. Replace the fields authuser, fromuser and username with your ten-digit phone number that was provided by BroadVoice when you signed up. Replace the field secret with the password provided by BroadVoice.

      disallow=all
      allow=ulaw
      callerid="BroadVoice VoIP"
      host=sip.broadvoice.com
      fromdomain=sip.broadvoice.com
      fromuser=3175551212
      authuser=3175551212
      username=3175551212
      secret=**********
      dtmfmode= inband
      insecure=very
      qualify= yes
      type=peer

      I set my USER Context to be my BroadVoice phone number. For USER Details, enter the following information (replacing your BroadVoice phone number for callerid, user and username below):

      callerid=3175551212
      context=from-pstn
      dtmfmode=rfc2283
      fromdomain=sip.broadvoice.com
      host=sip.broadvoice.com
      insecure=very
      nat=yes
      secret=**********
      type=user
      user=3175551212
      username=3175551212

      The format of the Register String is: username:password:phone_number@provider_domain. For BroadVoice this is what you will want to use (replacing with your BroadVoice phone number & password):

      3175551212@sip.broadvoice.com:*********:3175551212@sip.broadvoice.com

      Once all of this information is entered, you can click the Submit button. Once you do, a red line will appear at the top of the page. To "apply" your changes you must click this red line (this will cause AAH to tell the Asterisk engine to reload its config files).

    9. Now we need to setup some extensions to use with the system. Click Extensions in the left-hand navigation. Click the Add Extension link in the upper-right area of the AMP interface. Fill out the details you need to add at least one extension to your AAH system.

      When you're finished adding the extension, you can see the details of the extension by clicking on its name on the right-hand side of the AMP interface.

    10. You can now hook up your SIP phone and see if it will connect to the system. If it does, congratulations! You've finished all of the hard stuff! Now we'll add some nice touches and then perform the final "needed tweaks" to the config files.

    11. We are now going to setup a calling group so we can easily get a group of extensions to ring all at the same time. Click the Call Groups link on the left-hand menu.

      Click the Add Call Group in the upper-right area. You should be editing call group #700. In the extension list, enter all the extensions you want to ring in this call group. Each extension should be seperated by a pipe ( | ) character. Under the if no answer click on the drop-down "Voice Menu #1" and the radio button will fill itself in. Click the Submit button (don't forget to click the red link at the top of the page when you're done).

    12. I recommend setting up a menu for the digital receptionist. Click on the Digital Receptionist link on the left-hand menu. You'll see instructions telling you to dial "*77" to record your message. Record something like the following:

      Thank you for calling. If you know your party's extension you can dial it now. To reach the first available person, dial 1. For a directory dial the # sign. To repeat this menu, dial 9.

      Give this greeting a name (like Introductory Greeting) and if you like, give it a description. When you're finished, click Continue

      Chose the number of options you want to give your caller(s). In the example above we provided them with one option (the first available person). So choose "1" and click the Continue button.


      We're going to have our "option 1" dial a call group. This call group is setup to ring all extensions connected to your AAH system. This will let anyone who happens to be near a ringing extension pick up the call and speak with the caller. Under the Dialed Option # enter a "1" and under the Action setting select the "Group #700" drop-down and the radio button will automatically fill itself in. When you have your Digital Receptionist screen set to the same as the image on the right, click Continue.

      Once all of this information is entered, don't forget to "apply" your changes by clicking on the red line at the top of the AMP interface.

    13. If you've made it this far you should be able to dial "7777" on your SIP phone - this will simulate an incoming phone call - and you should hear your greeting. At this point the system should have enough functionality to dial out through the BroadVoice account.

      Go ahead and call a number and it should ring at the other end. If it does then pat yourself on the back! Only a few more steps are needed to get incoming calls to work (you can try to call your BroadVoice number, but it won't work yet).

    14. So far we've done everything through the AMP web GUI. Now we have to drop into editing text files. Fortunately you can do this through the AMP web GUI! Click the Maintenance link at the top of the AMP page and then click the Config Edit link in the left-hand menu.

    15. We need to edit the extensions.conf file. Scroll down in the file until you find the line that starts: [from-sip-external]. By default, AAH sends all incoming SIP calls to a congestion status. This means that all incoming calls will ring fast-busy to the caller and they will never make it into our AAH system.

      There are four lines under the [from-sip-external] section. One is already commented out with a semi-colon (;). Comment out the remaning three lines by adding semi-colons. Now we need to add two new "exten" lines.

      The first is exten => _.,1,Wait(1) which tells AAH to wait for 1 second once a call has been detected from an external SIP device. This makes sure we don't clip off the first part of our greeting message. The second line we need to add is exten => _.,2,Goto(from-pstn,s,1). When we're done the section should look like this:

      [from-sip-external]
      ;give external sip users congestion and hangup
      ;exten => _.,1,AbsoluteTimeout(15)
      ;exten => _.,2,Congestion
      ;exten => _.,3,Hangup
      exten => _.,1,Wait(1)
      exten => _.,2,Goto(from-pstn,s,1)

      When you're finished and you've saved your changes, you need to click the link at the top of the config edit screen labled Re-Read Configs. This will cause Asterisk to reload its configuration files and make any changes take effect.

    16. Now is the moment of truth. If everything went smoothly, you should now be ready to test an inbound call to your AAH system! Grab yourself a phone (POTS or cell, either will do) and dial your BroadVoice number. You should hear your greeting! At this point you'll probably be giddy that it's all working. Go ahead and listen to your greeting a few times (dial 9 to repeat it). Then either dial "1" or your extension and your SIP phone should start ringing. You now have Asterisk@Home configured and working with your BroadVoice account!
WHAT NEXT?
    The AAH people have provided you with a ton of pre-configured features. You can start reading through the main configuration files to see some of the cool things you can do with AAH and your BroadVoice account.

    You can make a backup of your configuration files by backing up the files in the /etc/asterisk directory of your AAH server. Read through the extensions.conf and see what all is already configured for you to test and work with.

COPYRIGHT
    This material is copyright © 2005 by jmc@cazz.org. This information may be freely shared and the images may be used to help others setup and configure their Asterisk@Home systems with a BroadVoice account as long as credit and this copyright notice is included. All other trademarks, servicemarks and copyrights are the property of their respective owners.
<< Return to Cazz.Org's VoIP Page >>