Using a Cisco Analog Voice Gateway with FreePBX


Here's how to use the Cisco VG202 / VG204 / VG224 with FreePBX.

Materials list:
  • Cisco VG202 / VG204 / VG224
  • a server running FreePBX (physical or virtual)
  • a network connection between FreePBX server and port FE0 on the Cisco Voice Gateway
  • a PC or laptop that has a DB9 serial port or USB to DB9 serial adapter
  • PuTTY ssh and telnnet client
  • WinImage
  • CF card reader
  • 64MB or larger Compact Flash card (for Cisco IOS)
  • a Cisco Console cable
  • 66 block with female Amphenol connector
  • CAT3 Telco cable with 90° male to male Amphenol ends
  • a telephone test set OR an RJ-11 duckbill jumper cable + regular phone
Here is a quick overview of what we will do:
  • Configure the Voice Gateway to receive calls from FreePBX
  • Configure the Voice Gateway dialplan to match and forward to FreePBX
  • Configure FreePBX with a SIP Trunk and Outbound Route to the Voice Gateway
First, you will need to acquire a Cisco IOS image like this one HERE. Copy the image onto the CF card with your computer, then move the CF card to the Voice Gateway. Connect the Cisco Console cable from your computer to the Voice Gateway console port (upper is console, lower is AUX) and open up PuTTY. Select the serial port radio button in settings and click the "Open" button. Switch on the power to the Voice Gateway and you should be greeted with a Cisco IOS console screen.

Remember, there is a problem with flow control between the switch and the terminal emulator. Please follow the recommended copy/paste page breaks I have listed on the config, or change config
  • enter "enable"
  • enter "write erase" and Enter to confirm
  • enter "reload" and Enter to confirm
  • during the reload, it will ask to enter the initial configuration setup, press "n" for no
  • after reloaded enter "enable"
  • enter "show running-config" - should show a relatively empty configuration
  • enter "configure terminal" - should show something like "Enter configuration commands, one per line.  End with CNTL/Z."
  • paste the config into the terminal window
  • enter "copy running-config startup-config"
  • issue the "reload" command
Here is my commented production config file that works with Asterisk, please save a copy and customize for your needs. Anything that is placed to the right of exclamation marks will disappear from the configuration:

VG224_config_msr-vg01

Also, the telnet password is !@34QWer, please change it to something more secure!!!

Some of the options you might want to change for your FreePBX distribution. For more info on a command just search for VG224 + command name. For example, Google "VG224 session target"
  • clock timezone PST -8 0     < set to your timezone offset
  • clock summer-time PDT recurring     < remove if daylight savings time isn't observed
  • ip address dhcp     < change to static ip (requires static route) ip address 10.0.0.2 255.255.252.0
  • ip route profile      < change to static route (RTP fails without)   ip route 0.0.0.0 0.0.0.0 10.0.0.1
  • station-id name     < CallerID name shown for this analog line
  • station-id number < CallerID number shown for this analog line
  • dial-peer voice 11 voip < change the period "." count to alter number of digits in extensions
  • session target session ipv4 < change all of these to match your FreePBX IP address
Lots of other things to play with here, but this should be enough to get you where you're going. For further instruction on how to use dial patterns on the VG224, please consult the Cisco Dial Peer Configuration on Voice Gateway Routers guide found here:

vd-12-4t-book

Now, after configuring the Voice Gateway, onto the Asterisk / FreePBX side. Only two things to configure here: A SIP Trunk and an Outbound Route!

To keep things simple, I name the Trunk and Outbound Route the same name as the hostname of the Cisco Voice Gateway. Click on the Add Trunk button, then select "Add SIP (chan sip) Trunk." The trunk settings for my Voice Gateway in FreePBX are:
General : Trunk Name
msr-vg01
General : CallerID 
7602516000
Sip Settings : Outgoing : Trunk Name
msr-vg01
Sip Settings : Outgoing : PEER Details
host=msr-vg01
type=peer
qualify=yes
insecure=port,invite
dtmfmode=rfc2833
disallow=all
allow=ulaw
context=from-internal
    No need to set the inbound sip route, as the Voice Gateway knows to send traffic to FreePBX from its IOS configuration.

    The Outbound Route settings that match my Voice Gateway in FreePBX are:
    Route Settings : Route Name
    msr-vg01
    Route Settings : Route CID
    7602516000
    Route Settings : Route Type
    Intra-Company
    Dial Patterns :
    710[1-9]
    711[0-9]
    712[0-4]
    Additional Settings :
    If this tab exists, calls cannot be made from sip extensions listed here unless moved to the Allowed Extensions side. Usually, just click the left-facing (top) arrow pointing to the empty box to move all numbers into "allowed" status.

    Now, we can look at all the outbound routes listed for FreePBX. Be sure to move the newly created Voice Gateway Outbound Route below the E911 Outbound Route, and you should be good to go. Also, disabling "Intra-Company Route" makes all the analog lines show the outbound CallerID instead of the extension CallerID, so it's best left enabled for interal CallerID to display correctly.

    Outbound routes can cause headaches when not specific with dial pattern matching. For example, if an outbound route matches 7101 because 7XXX was specified in the outbound route for trunk A, but 7101 is really on trunk B, then the call will not reach its destination. Because of this, be sure to match only the dial patterns that will actually reside on that specific trunk. In our case 7101-7124 are matched with 710[1-9], 711[0-9], and 712[0-4]

    And thats it! You can verify that Asterisk is communicating with the Voice Gateway by logging into the FreePBX console as root and running "tshark -R 'sip && ip.addr == x.x.x.x' -i any" to watch the sip traffic between FreePBX and the Voice Gateway. Just substitute whatever IP address you have assigned to your Voice Gateway in place of x.x.x.x

    Troubleshooting:

    Q: The previous owner of the Voice Gateway locked down the config, and I can't access it from the console with the console cable.
    A: When using a locally connected console cable and the Voice Gateway is booting up, press Ctrl+ Pause/Break key on the keyboard. at the ROMMON 1> prompt enter "confreg 0x2142" and press enter, it should say something like you need to reset the device after making changes. On the next line, enter "reset" to reboot the Voice Gateway. say "no" to the initial configuration dialog, then at the prompt enter "enable" followed by "configure terminal" then enter "config-register 0x2102" to set the configuration register to boot normally. After that, you can blow away the config you are locked out of. At the enable prompt, issue a "erase nvram:" to blow away all stored settings followed by "reload" to reboot.

    Q: It says the interface FastEthernet 0/0 is down, why wont it go back up?
    A: It's configured as down, and its easy to bring back up. With a locally connected console cable and at the enable prompt, enter "configure terminal" to edit the config. Enter these lines:
    • interface FastEthernet 0/0
    • no shutdown
    • end
    and that should bring it back online. Follow up with a "copy running-config startup-config" to apply the changes permanently.

    Q: I cant copy the IOS image to the CF card - the Voice Gateway says "No CF card found"
    A: This one is a little tricky, as you need a Voice Gateway already running IOS. Eject the CF you booted from, and plug in the CF your having issues with. At the enable prompt, issue "erase slot0:" and press enter at the prompts to write out the CF card. Next, issue "format slot0:" to format the card for IOS. Now the CF card can be plugged into your computer and the IOS image can be copied to it successfully.

    Q: I can't manage the Voice Gateway remotely via telnet, it says no enable password configured.
    A: When locally connected with a console cable, go ahead and run the initial configuration dialog and plug in enable and terminal passwords. When done, from the enable prompt run "show running config" and pay attention to the "enable secret" and "enable password" lines in the config. Copy/paste those items into your config to enable remote management of the Voice Gateway.

    Q: The Voice Gateway only seems to be passing 4 digits to FreePBX, and I can't dial out.
    A: This is probably caused by a pattern matching error in your Voice Gateway configuration. Check the "dial-peer voice xx voip section in your config and make sure the patterns don't match something you are trying to dial. For example, if one pattern for local calling is 760[2-9]...... and you have another pattern for 4 digit extension dialing that looks like [2-9]... then the four digit dialing will take precedence because it matched 4 digits first. To correct this, you need to make sure that the two patterns don't conflict. For example, my solution for 4 digit dialing that doesn't conflict with my local calling with area code 760 is to use the pattern [2-8][1-5,7-9].. for 4 digit extension dialing. If you need to send 911, 611, or 411 to another FreePBX server, then you will have to get creative. The old method was to use an "outbound dial digit code" like the number 9 to prevent phone systems from matching undesirable number patterns. This is where "dial 9 to reach an outside line" comes from.

    Questions or comments? Ask below!

    Comments

    1. Hi thank you for the tutorial unfortunately i have not seen the part where you configure the analog fxs extension in the vg224 if you can throw that i will appreciate

      ReplyDelete
      Replies
      1. Using A Cisco Analog Voice Gateway With Pbx >>>>> Download Now

        >>>>> Download Full

        Using A Cisco Analog Voice Gateway With Pbx >>>>> Download LINK

        >>>>> Download Now

        Using A Cisco Analog Voice Gateway With Pbx >>>>> Download Full

        >>>>> Download LINK Cx

        Delete
    2. Hello I followed the steps but it doesn't work can you help me? I downloaded the link but I can not install it on my laptop I really need your expertise I have a vg224 and a cisco pi 7940 series phone that I would like to configure to receive and make calls j I already have my sip trunk I have already downloaded the freepbx I need your help please

      ReplyDelete
    3. Using A Cisco Analog Voice Gateway With Pbx >>>>> Download Now

      >>>>> Download Full

      Using A Cisco Analog Voice Gateway With Pbx >>>>> Download LINK

      >>>>> Download Now

      Using A Cisco Analog Voice Gateway With Pbx >>>>> Download Full

      >>>>> Download LINK eI

      ReplyDelete
    4. Is there for sure no way to format the CF card or acquire a CF card that is formatted correctly without having another cisco device?

      ReplyDelete

    Post a Comment

    Popular posts from this blog

    Reset a Cisco VG224 Analog Voice Gateway or 1800 series router

    Chinese IP camera backdoors