Configuring Asterisk to talk to a Cisco Router with an FXO port

in extensions.conf:

(Comments are at end of lines)

[trunklocal]

exten => _9.,1,Dial,sip/BYEXTENSION@209.X.X.Z ; ip address of router

[default]

include => trunklocal ; allows extensions in the [default] context to access trunklocal

assuming your local extensions are in [default]

26x0 Configuration:

First the FXO port config, set gain/attenuation/comfort noise as you wish, or omit entirely. The PLAR line determines what extensions inbound calls are routed too.

Note: the vic-2fxo, which is what I have, does not support CallerID, you apparently need the vic-2fxo-m1 for that.

voice-port 1/1/0
input gain 10
output attenuation 10
no comfort-noise
connection plar 8100

Now for the dial-peers

701 defines what to do when the router receives a request to dial a number that begins with 9, followed by any 7 digits, you could change this, but 701 will stop any LD call from being made... I have this that way so anyone who cuts and pastes will not arbitrarily allow long distance :) The forward digits helps enforce this.

dial-peer voice 701 pots
destination-pattern 9.......
port 1/1/0
forward-digits 7

Dial-peer 400 tells the router how to handle the PLAR extension that is defined on the voice port above

dial-peer voice 400 voip
destination-pattern 8100
session protocol sipv2
session target sip-server
codec g711ulaw

The Sip-UA defines where to send the calls for the sip-server, which is Asterisk, so set the IP to match your asterisk servers IP.

sip-ua
sip-server ipv4:209.X.X.Y

Since 9/17/03