Basic setup from freepbx to cisco 28XX as voicegateway with PRI

This is the setup for a SIP trunk between freepbx and cisco 28XX using PRI.
Some legend info to help decipher these configs:

  1. All extensions to be used are 5XXX (covers 5000 to 5999)

  2. The telco provider passes only 4 digits to us so if someone calls one of our DIDs at 777-777-5555 we only see 5555 out of the PRI (This will be important in the dial-peer voice 1000 entry below in the cisco config)

  3. IOS version on cisco router is c2800nm-spservicesk9-mz.124-3f.bin

  4. There is no NATing in this setup, just inter VLAN routing on a layer 3 switch (cisco 4510) between FreePBX ( and the Cisco (

  5. This is entirely internal, no external net access so it is lacking security configuration

  6. To keep in accordance with default outgoing dial numbers cisco uses and cut down on end user re-education we dial 8 for outgoing number.

EndUser <-------> FreePBX <------> Cisco28XX <-----PRI-----> TelcoProvider

[size=14]1. The cisco config…[/size]


clock timezone GMT 0
network-clock-participate wic 3
network-clock-select 1 T1 0/3/0
voice-card 0
voice rtp send-recv
voice service voip
allow-connections h323 to h323
allow-connections h323 to sip
allow-connections sip to h323
allow-connections sip to sip
redirect ip2ip
signaling forward unconditional
bind control source-interface GigabitEthernet0/1
bind media source-interface GigabitEthernet0/1
!If you are moving from Call Manager you must remove mgcp from the pri-group line !below
controller T1 0/3/0
framing esf
linecode b8zs
cablelength short 133
pri-group timeslots 1-24
interface GigabitEthernet0/1
ip address
duplex auto
speed auto
interface Serial0/3/0:23
no ip address
isdn switch-type primary-ni
isdn incoming-voice voice
no cdp enable
voice-port 0/3/0:23
no mgcp package-capability res-package
no mgcp package-capability fxr-package
no mgcp timer receive-rtcp
no mgcp explicit hookstate
dial-peer voice 100 pots
numbering-type unknown
destination-pattern .T
incoming called-number .
port 0/3/0:23
dial-peer voice 1000 voip
numbering-type unknown
destination-pattern 5…
session protocol sipv2
session target ipv4:
session transport udp
dtmf-relay rtp-nte
codec g711ulaw
timer receive-rtp 1200
retry invite 3
retry response 3
retry bye 3
retry cancel 3
timers trying 1000
sip-server ipv4:



[size=14]2. Click on Trunks and add trunk. Choose Sip Trunk.[/size]

Trunk Name: Cisco2821 (Can be whatever you want)
Outbound CallerID: 7777775555 (This will be used if the phone does not pass one)
CID Options: Allow any CID
No Dial Manipulation rules used here.

The Important Section
Very Very IMPORTANT. If default freepbx install context must be from-internal, dont make your own up

Outgoing Settings -
Trunk Name: cisco2811
Peer Details:

Incoming Settings -
User Context: from-internal
User Details:

Click Submit Changes.

[size=14]3. Click on Outbound routes and add route on right[/size]

Route Name: WhateverYouWant

Dial Patterns that will use this Route

() + 8 | [1NXXNXXXXXX / ]
() + 8 | [NXXNXXXXXX / ]
() + 8 | [NXXXXXX / ]

Trunk Sequence for Matched Routes

Select your cisco trunk from the drop down in position 0.

Click on Submit

[size=14]4. Create your inbound routes accordingly based on incoming DID dialed and what extension to send to[/size]

We have a DID for each phone so the 4 that is passed from telco is our extension.
Example 777-777-5555 routes to extension 5555

For that Destination is set to phonebook directory and everything else is blank. I believe this was a default setup in freepbx called Any DID / Any CID

I need assistance on something similar however mine is as follows;

a) SIP Trunk to DAHDI Trunk
b) SIP Trunk to Cisco AS5400


I realize this is an old post, but are you using “transformations” inside of your Call Manager to do this?


A transformation is just a term for digit translations.