Asterisk and Cisco Router FXO Incoming Call

Cisco routers can be used as a voice gateway for your Asterisk PBX. In this lesson I’ll show you how to configure your Cisco’s FXO port so that it will forward PSTN calls to Asterisk.

Cisco Router

The first thing to do is configure our Cisco router so that it will forward calls from the PSTN to Asterisk through SIP. Let’s start with the voice port:

voice-port 0/3/0
connection plar 500

Now we will create a dial-peer so that the calls are forwarded to Asterisk:

dial-peer voice 500 voip
 destination-pattern 500
 session protocol sipv2
 session target ipv4:<ip of asterisk>
 codec g711alaw
 no vad

This is all you have to do on your Cisco router. Let’s move on to Asterisk…

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 722 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

510 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!


Forum Replies

  1. Thank you for sharing. Is it possible to configure the Cisco UC500 to connect to a VOIP GSM gateway (e.g. Portech MV-374)? How to configure it on the Cisco side such that you have four (4) trunks created each presenting a SIM card? If you any idea I will grateful if you can share it.


  2. Hello Jorge,

    You can use a Cisco access-list for this. By default Asterisk uses SIP on port 5060 and I believe UDP port 10000 - 20000 for RTP traffic. An access-list outbound to the Asterisk server could look something like this:

    Router(config)#ip access-list extended ASTERISK
    Router(config-ext-nacl)#permit udp host eq 5060
    Router(config-ext-nacl)#permit udp host range 10000 20000

    In this example, 192.168

    ... Continue reading in our forum

  3. Hi Doug,

    It’s been awhile since I configured this. I’m running Asterisk 1.8, here’s my config:



    And extensions.conf:

    ; my-trunk
    exten =&gt; 104,1,Answer
    exten =&gt; 104,n,MusicOnHold(mp3)

    This works for me.


  4. Right now, my cisco uses plar 100 to get to the sip session and destination pattern 100 and session target to poing to asterisk (debian7 apt default version). My dial plan has exten => 100,1,Answer ()

    This works as long as I use clid strip in my cisco dial peer voice voip. As soon as I remove it calls go nowhere.

    This may be just a very poorly documented sip mangling by cisco that is causing this (not sending clid info in the correct setup message) or it is how asterisk deals with clid’s.

    By the way, this site has helped me understand more

    ... Continue reading in our forum

  5. Hello,
    I’m having problems with my outgoing settings.

    Here are my settings of a Cisco 2811 router:

    voice-port 0/1/0
    trunk-group 1 1
    supervisory disconnect dualtone pre-connect
    supervisory answer dualtone
    input gain 10
    output attenuation -1
    no vad
    no comfort-noise
    cptone AR
    connection plar 400
    description (54) 11-4922-5216
    caller-id enable
    dial-peer voice 1 pots
    description Linea 541149225216
    preference 1
    destination-pattern 9T
    port 0/1/0
    forward-digits 8
    dial-peer voice 400 voip
    numbering-type unknown
    destination-pattern .T
    session protocol sipv2
    session ta
    ... Continue reading in our forum

14 more replies! Ask a question or join the discussion by visiting our Community Forum