dagayr

Asterisk cisco FXO

How to connect a Cisco Router with FXO module to Asterisk

Cisco routers support FXO or FXS voice interface cards (aka VIC). Either SIP or H.323 can be used for call signalling. VICs are installed into low density voice modules (NM-1V, or NM-2V) in a Cisco 2600/3600/3700 router. Data Sheet.

  • REGISTER: Cisco gateway doesn't usually REGISTER with SIP servers, but later versions of IOS can (in order to register FXS ports, for instance)
  • Codecs: Cisco gateway do not support GSM, iLBC & Speex CODECs. Prior to Cisco IOS Software Release 12.0(5)T, VoIP gateways only supported the G.729 and G.711 codecs and only one voice call per DSP. Version 12.0(5)T has added support for G.723 and G.726, and now support up to four voice/fax-relay calls per DSP. More on Cisco DSPs.

Here are the codecs Cisco offers at the router:
clear-channel Clear Channel 64000 bps
g711alaw G.711 A Law 64000 bps
g711ulaw G.711 u Law 64000 bps
g723ar53 G.723.1 ANNEX-A 5300 bps
g723ar63 G.723.1 ANNEX-A 6300 bps
g723r53 G.723.1 5300 bps
g723r63 G.723.1 6300 bps
g726r16 G.726 16000 bps
g726r24 G.726 24000 bps
g726r32 G.726 32000 bps
g728 G.728 16000 bps
g729br8 G.729 ANNEX-B 8000 bps
g729r8 G.729 8000 bps
gsmefr GSMEFR 12200 bps
gsmfr GSMFR 13200 bps

Sample configuration

sip.conf
[general]
port=5060
bindaddr=0.0.0.0
videosupport=yes ; Gives an error
"process_sdp: Error in codec string 'ideo 0'"
disallow=all
allow=ulaw
context=bogon-calls

[y.y.y.y]
context=pstn-incoming
type=friend
host=y.y.y.y ; IP address of Cisco gateway
dtmfmode=rfc2833
disallow=all
allow=ulaw

[1001]
context=local-phones
type=friend
username=1001
secret=secret
host=dynamic
mailbox=1001

extensions.conf
[bogon-calls]
exten => _.,1,Congestion

[pstn-incoming]
include => lan-phones

[local-phones]
include => lan-phones
include => pstn-outbound

[pstn-outbound]
; Calls starting with 9 have the 9 stripped & are then routed out to the PSTN
exten => _9.,1,Dial(SIP/${EXTEN
1}@y.y.y.y) ; IP address of Cisco gateway
; 9 stripped by Cisco gateway
exten => _9XXXX,1,Dial,SIP/${EXTEN}@y.y.y.y ; IP address of Cisco gateway
exten => _9XXXX,2,Congestion

[lan-phones]
exten => 1001,1,Dial(SIP/1001,20)
exten => 1001,2,Voicemail(u1001)
exten => 1001,102,Voicemail(b1001)
exten => 1001,103,Hangup

Cisco config

SIP requires routers to be set to use GMT

clock timezone GMT 0

voice-port 1/0/0

We are in the UK

cptone GB
input gain 10
output attenuation 10
no comfort-noise

Route all calls into this FXO port on to extension 1001

connection plar 1001

PSTN gateway (PBX)

9 is stripped

dial-peer voice 100 pots
destination-pattern 9....

The above line will match anything passed from * to the Cisco starting with a 9, the dial peer then strips the 9 and passes it to the FXO port

If you want to match any dialed number from * starting with 9, use destination-pattern 9T

port 1/0/0
forward-digits 4

dial-peer voice 2 voip
description Route calls starting with 1 to the Asterisk PBX
destination-pattern 1...
session protocol sipv2

x.x.x.x = IP address of *

session target ipv4:x.x.x.x:5060
session transport udp
dtmf-relay rtp-nte
codec g711ulaw
no vad



sip-ua
retry invite 3
retry response 3
retry bye 3
retry cancel 3
timers trying 1000

x.x.x.x = IP address of *

sip-server ipv4:x.x.x.x

Caller ID

The VIC-2FXO voice interface card does not support Caller ID. In order to support that, you will need battery reversal support (in the US, VIC-2FXO-M1; in Europe, VIC-2FXO-M2, etc.). More on Cisco FXO interfaces: http://cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a00800b53c7.shtml

If you have a VIC-2FXO-M1 and wish to have Caller ID information passed through to Asterisk, you need to set up a null translation rule for that voice port. For example:

translation-rule 1
rule 1 null null
voice-port 1/0/0
translate calling 1
translate called 1
caller-id enable

This will permit Caller ID information to be passed through to the SIP connection.

See also



By abdisalaan Adem Hussein (dagayr)
from Dagayr International Communication Centre (DICC)
Asterisk cisco FXO

How to connect a Cisco Router with FXO module to Asterisk

Cisco routers support FXO or FXS voice interface cards (aka VIC). Either SIP or H.323 can be used for call signalling. VICs are installed into low density voice modules (NM-1V, or NM-2V) in a Cisco 2600/3600/3700 router. Data Sheet.

  • REGISTER: Cisco gateway doesn't usually REGISTER with SIP servers, but later versions of IOS can (in order to register FXS ports, for instance)
  • Codecs: Cisco gateway do not support GSM, iLBC & Speex CODECs. Prior to Cisco IOS Software Release 12.0(5)T, VoIP gateways only supported the G.729 and G.711 codecs and only one voice call per DSP. Version 12.0(5)T has added support for G.723 and G.726, and now support up to four voice/fax-relay calls per DSP. More on Cisco DSPs.

Here are the codecs Cisco offers at the router:
clear-channel Clear Channel 64000 bps
g711alaw G.711 A Law 64000 bps
g711ulaw G.711 u Law 64000 bps
g723ar53 G.723.1 ANNEX-A 5300 bps
g723ar63 G.723.1 ANNEX-A 6300 bps
g723r53 G.723.1 5300 bps
g723r63 G.723.1 6300 bps
g726r16 G.726 16000 bps
g726r24 G.726 24000 bps
g726r32 G.726 32000 bps
g728 G.728 16000 bps
g729br8 G.729 ANNEX-B 8000 bps
g729r8 G.729 8000 bps
gsmefr GSMEFR 12200 bps
gsmfr GSMFR 13200 bps

Sample configuration

sip.conf
[general]
port=5060
bindaddr=0.0.0.0
videosupport=yes ; Gives an error
"process_sdp: Error in codec string 'ideo 0'"
disallow=all
allow=ulaw
context=bogon-calls

[y.y.y.y]
context=pstn-incoming
type=friend
host=y.y.y.y ; IP address of Cisco gateway
dtmfmode=rfc2833
disallow=all
allow=ulaw

[1001]
context=local-phones
type=friend
username=1001
secret=secret
host=dynamic
mailbox=1001

extensions.conf
[bogon-calls]
exten => _.,1,Congestion

[pstn-incoming]
include => lan-phones

[local-phones]
include => lan-phones
include => pstn-outbound

[pstn-outbound]
; Calls starting with 9 have the 9 stripped & are then routed out to the PSTN
exten => _9.,1,Dial(SIP/${EXTEN
1}@y.y.y.y) ; IP address of Cisco gateway
; 9 stripped by Cisco gateway
exten => _9XXXX,1,Dial,SIP/${EXTEN}@y.y.y.y ; IP address of Cisco gateway
exten => _9XXXX,2,Congestion

[lan-phones]
exten => 1001,1,Dial(SIP/1001,20)
exten => 1001,2,Voicemail(u1001)
exten => 1001,102,Voicemail(b1001)
exten => 1001,103,Hangup

Cisco config

SIP requires routers to be set to use GMT

clock timezone GMT 0

voice-port 1/0/0

We are in the UK

cptone GB
input gain 10
output attenuation 10
no comfort-noise

Route all calls into this FXO port on to extension 1001

connection plar 1001

PSTN gateway (PBX)

9 is stripped

dial-peer voice 100 pots
destination-pattern 9....

The above line will match anything passed from * to the Cisco starting with a 9, the dial peer then strips the 9 and passes it to the FXO port

If you want to match any dialed number from * starting with 9, use destination-pattern 9T

port 1/0/0
forward-digits 4

dial-peer voice 2 voip
description Route calls starting with 1 to the Asterisk PBX
destination-pattern 1...
session protocol sipv2

x.x.x.x = IP address of *

session target ipv4:x.x.x.x:5060
session transport udp
dtmf-relay rtp-nte
codec g711ulaw
no vad



sip-ua
retry invite 3
retry response 3
retry bye 3
retry cancel 3
timers trying 1000

x.x.x.x = IP address of *

sip-server ipv4:x.x.x.x

Caller ID

The VIC-2FXO voice interface card does not support Caller ID. In order to support that, you will need battery reversal support (in the US, VIC-2FXO-M1; in Europe, VIC-2FXO-M2, etc.). More on Cisco FXO interfaces: http://cisco.com/en/US/products/hw/routers/ps274/products_tech_note09186a00800b53c7.shtml

If you have a VIC-2FXO-M1 and wish to have Caller ID information passed through to Asterisk, you need to set up a null translation rule for that voice port. For example:

translation-rule 1
rule 1 null null
voice-port 1/0/0
translate calling 1
translate called 1
caller-id enable

This will permit Caller ID information to be passed through to the SIP connection.

See also



By abdisalaan Adem Hussein (dagayr)
from Dagayr International Communication Centre (DICC)
Created by: dagayr, Last modification: Thu 24 of Nov, 2005 (15:32 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+