Sean’s Obsessions

  • Archives

19 Apr

Asterisk and an AS5350 SIP peer

I’ve been playing with Asterisk lately, and needed to get out to the PSTN. Since I had a Cisco AS5350 with a PRI attached for incoming RAS, I figured I could use that. I also had some DIDs on the line that I could use to separate voice and data calls.

Googling around, I couldn’t find a good example of anyone who has done it, so I was on my own.

My goals here were simple:

  1. People dialing 555-1111 should be picked up by the AS5350’s internal modems
  2. People dialing 555-222X should be forwarded to my Asterisk box for handling
  3. The Asterisk box should be able to dial out using the PRI

Already the DIDs were assigned to this PRI, so that wasn’t a problem.

The configuration on the AS5350 is fairly straightforward once you get it working:

voice service voip
 sip
  ! Bind the SIP and RTP sessions to a known interface
  bind control source-interface FastEthernet0/0
  bind media source-interface FastEthernet0/0
! Normal T1-PRI configuration using all channels
controller T1 3/0
 framing esf
 linecode b8zs
 cablelength short 133
 pri-group timeslots 1-24
! Anything not picked up by a dial peer defaults to a modem call
interface Serial3/0:23
 isdn incoming-voice modem
! Use a data dial-peer to answer anything to 555-1111 with a modem
dial-peer data 10 pots
 incoming called-number 5551111
! Match inbound calls to the voice DIDs
dial-peer voice 100 pots
 incoming called-number 555222.
 ! All digits are collected and sent along
 direct-inward-dial
 forward-digits extra
! The IP leg of the call… send to the sip server defined below
dial-peer voice 200 voip
 destination-pattern 555222.
 session protocol sipv2
 session target sip-server
 ! Any digits collected after the call has been answers get forwarded
 dtmf-relay sip-notify rtp-nte
 ! I want g711 ulaw for a codec
 codec g711ulaw
! Anything else gets sent out the PSTN
! Note you need the data dial-peer above to accept modem calls, otherwise
! this dial-peer will give dialtone to anyone who calls!
dial-peer voice 1000 pots
 application session
 destination-pattern .T
 port 3/0:D
 forward-digits all
! define your SIP server
sip-ua
 authentication username USERNAME password PASSWORD
 ! xxx.xxx.xxx.xxx represents the Asterisk box
 registrar ipv4:xxx.xxx.xxx.xxx expires 3600
 sip-server ipv4:xxx.xxx.xxx.xxx

After that, it’s just a matter of configuring a sip peer in /etc/asterisk/sip.conf

23 Responses to “Asterisk and an AS5350 SIP peer”

  1. 1
    Robert Almeida Says:

    I have a AS5300 used for RAS only.

    Please, you could tell me if I need any Voice Feature Card in AS5300? or, maybe, special IOS version?

  2. 2
    Sean Says:

    I didn’t need any special hardware or software…

    c5350-ik9s-mz.123-11.T.bin
    2 FastEthernet interfaces
    47 Serial interfaces
    60 terminal lines
    2 Channelized T1/PRI ports

    Sean

  3. 3
    Asterisk and an AS5350 SIP peer Says:

    Asterisk and an AS5350 SIP peer

    Asterisk and an AS5350…

  4. 4
    Matt Says:

    Sean,

    I found a mailing from you on regarding the uBR924. Did you ever get this working reliably? I think we have gone down a similar road with this sucker. First with MGCP and now I’m hung up on h323. I’m wondering if its my IOS (12.2.12l). Asterisk reports call setup H225 msg stating “connection refused” on the uBR, so the call clears. I will grab some captures to see what I can find, but I was hoping you could share some insight. — Kind Regards.

  5. 5
    Anonymous Says:

    Yea, it works great.voice-rtr

    >show ver

    Cisco Internetwork Operating System SoftwareIOS ™ 920 Software (UBR920-K8O3V6Y5-M), Version 12.2(19c), RELEASE
    SOFTWARE (fc2)

    The image name is ubr920-k8o3v6y5-mz.122-19c.bin

    Config below.

    Do you get dialtone on the FXS side? Voice doesn’t work properly untilyou do the “cable-modem voip clock-internal” on the cable modem interface.
    Also ISTR that you need a different load for MGCP andH.323…

    Sean

    interface Ethernet0
    ip address 192.168.1.95 255.255.255.0
    !
    interface cable-modem0
    shutdown
    no cable-modem compliant bridge
    cable-modem voip clock-internal
    !
    ip classless
    no ip http server
    no ip http cable-monitor
    !
    voice-port 0
    input gain -2
    output attenuation 0
    !
    voice-port 1
    input gain -2
    output attenuation 0
    !
    dial-peer voice 1 pots
    destination-pattern 2001
    port 0
    !
    dial-peer voice 100 voip
    destination-pattern T
    session target ipv4:192.168.1.10
    dtmf-relay h245-alphanumeric
    codec g711ulaw
    !
    dial-peer voice 2 pots
    destination-pattern 2002
    port 1

  6. 6
    Matt Says:

    Sean,

    The uBR is now working pretty solid; minus a bit of echo that I’ll troubleshoot another day. I ended up changing images. I’m now running ubr920-k1o3sv4y556i-mz.121-27a.bin. Its an older release, than the 12.2.19 release you’re running. It seems 12.2.19 has been deferred on CCO so I couldn’t download it.

    I see now why you have specified the timer (T) character in your destination-pattern. It could just be this release, but the destination-pattern wildcard string syntax seems to differ from other IOS. I ended up creating, as you did, a default route with ‘destination-pattern .T’

    I also added ‘timeouts interdigit 3′ to voice-port 0-1. This improved upon the 10sec delay upon dialing as a result of the timer string.

    I probably blew 16 hours on this. I suppose its worth it considering that the uBR was free. Many thanks for your help.

  7. 7
    sebastian Says:

    please note that if you set any DTMF-RELAY using ULAW/ALAW, you will not get any dtmf digit entered, because you need INBAND, and setting dtmf-relay put it in OUT OF BAND… greetings.

  8. 8
    Manish Pramanik Says:

    Sean,

    Your posting was of great help, I hope you can answer few of my queries. I am using AS5350 for other hosted PBX solution, now I want to use the same gateway for Asterisk also. In sip-ua it points to my other server, is it necessary to specify asterisk in sip-ua.

    Regards,
    Manish Pramanik

  9. 9
    Boss Says:

    I have a an as5350 that i wanted to install asterisk on for call loging or cdr.

    MY as5350 is connected to 5 pri lines and i have multiple customers terminating calls from different ip addresses.

    I am very new to this. Can someone please help?

  10. 10
    Sean Says:

    Heya,

    I suspect you’d need to get your customers to terminate on the asterisk
    box which would make the calls out the AS5350. The way it is now, the
    outbound dial-peers will get matched and never hit the asterisk box.

    If all you want is CDR recording, look into “gw-accounting” using either
    syslog or RADIUS.

    http://www.cisco.com/en/US/products/sw/iosswrel/ps1839/products_command_reference_chapter09186a00800b3507.html

    Sean

  11. 11
    Jamuel Says:

    Hi Sean,

    Any chance you can publish the Asterisk side of this configuration. Specifically, the relevant sip.conf and extensions.conf

    Thanks,

    JPS

  12. 12
    Robert Says:

    Hi ill like to know if you can help me to get the oldest 12.0 IOS version for the ubr924 cablemodem? thanx :D

  13. 13
    Shane@Doretel Says:

    We are a Cisco Partner and provide New and Factory Refurb AS5350, AS5350XM, AS5400, AS5400XM, AS5400HPX, AS5850 and much more. Visit us online or contact us today for a quote. We also have a Asterisk enigeer that is very good with the Cisco AS5XXX Gateways.

    Shane Breen
    Doretel Communications, Inc.
    Director Of Sales & Marketing
    Cisco Registered Partner
    Office: 404.755.5721
    Fax: 404.521.4639
    sbreen@doretel.com
    AIM: shanebreen2003
    www.doretel.com

  14. 14
    Michael Says:

    I have a problem with dtmf coming from Asterics to AS5300.
    dtmf-relay rtp-nte is my setting at the Cisco side.
    Sometimes it works, sometimes it not.
    Sometimes Cisco recognise DTMF if I dial slow.
    “Sometimes” means that during 15 min testing
    it could work and not work many times.

    dial-peer voice 107718 voip
    incoming called-number 107……….
    voice-class codec 999
    session protocol sipv2
    session transport udp
    dtmf-relay rtp-nte
    playout-delay mode adapt
    playout-delay nominal 120
    playout-delay maximum 1000
    playout-delay minimum high
    playout-delay fax 700
    fax rate 7200
    fax protocol t38 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711ulaw
    no vad

    Please help,
    Michael

  15. 15
    low_eve Says:

    hello,
    anybody could give me a hand ??. I want to configure a Cisco AS5350 as voice gateway for a IP Telephony solution. A PRI is connected to the AS5350 and in the LAN I have IP Phones and Asterisk. Where do I can find info on how to make the whole thing work ???

    Thanks
    low_eve

  16. 16
    Adam Dickson Says:

    low_eve. Give me a call (I know it’s bad but I don’t check my email any more) and I’ll give you a step by step on how to get your asterisk/Cisco working. I’ve just put together a project like that so I can save you tons of time (705)878-0997

  17. 17
    todd Says:

    Anyone have a template on how to get a cisco 2431 running sip to register with Asterisk? I have it working fine using another sip server, but can not get the cisco to register with asterisk. Basically the cisco will be the gateway to the PSTN.

  18. 18
    Webmaster tumujer.com Says:

    Configure in the Cisco site:

    voice-port 2/0
    vad
    cptone VE
    timing percentbreak 60
    !
    dial-peer voice 15 voip
    destination-pattern 2803
    session protocol sipv2
    session target ipv4:XXX.XXX.XXX.XXX
    !
    sip-ua
    sip-server ipv4:XXX.XXX.XXX.XXX

  19. 19
    James Says:

    Is there anyway to use the AS5350 as a telephony bridge to use in conferencing instead of pushing the calls out of the other side (i.e. put the calls into a container on the server as one conference call)? Any help would be appreciated.

  20. 20
    Nikolay Says:

    I have AS5350. I configured it to work with faxes using T.37. It receives faxes from PSTN and send as an email attachment. But it refuses to send faxes from e-mail TIFF attachments to PSTN. But if I take an attachment I received from AS5350 and send it in e-mail – fax transmission to PSTN is O.K. Please, give me advice – what to do to make faxes work in both directions ?

  21. 21
    Tassali Bakhsh Says:

    Hi Sean!
    You configured the cisco as5350 for outbound sip calls. What i want is to accept sip calls on as5350 and route them to a PRI (ISDN PBX).
    Any advise please.

    Please leave me a number where i can reach you.

  22. 22
    Eusebio López Says:

    Hi,

    I am using a Cisco AS5350 as VOIP gateway and I have a problem. 80% of incoming calls come up with the number of head, and not with the telephone number assigned to each customer in our Asterisk. Where can be the problem? I am sure that problem is configuration AS, but not it can be.

    Thanks.

    AS configuration is as follows:

    Current configuration : 10675 bytes
    !
    version 12.3
    service timestamps debug datetime msec
    service timestamps log datetime msec
    service password-encryption
    !
    boot-start-marker
    boot system flash c5350-is-mz.123-11.T9.bin
    no boot startup-test
    boot-end-marker
    !
    !
    !
    resource-pool disable
    spe default-firmware spe-firmware-1
    no aaa new-model
    ip subnet-zero
    !
    !
    no ip cef
    !
    !
    isdn switch-type primary-net5
    !
    !
    voice service voip
    fax protocol t38 ls-redundancy 0 hs-redundancy 0 fallback cisco
    modem passthrough nse codec g711alaw
    sip
    !
    !
    voice class codec 1
    codec preference 1 g729r8
    codec preference 2 g711alaw
    !
    !
    !
    !
    controller E1 3/0
    framing NO-CRC4
    pri-group timeslots 1-31
    !
    controller E1 3/1
    framing NO-CRC4
    pri-group timeslots 1-31
    !
    controller E1 3/2
    !
    controller E1 3/3
    !
    controller E1 3/4
    !
    controller E1 3/5
    !
    controller E1 3/6
    !
    controller E1 3/7
    !
    !
    interface FastEthernet0/0
    ip address 192.168.100.253 255.255.255.0 secondary
    ip address 192.168.100.2 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/0
    no ip address
    shutdown
    clockrate 2000000
    !
    interface Serial3/0
    no ip address
    shutdown
    !
    interface Serial0/1
    no ip address
    shutdown
    clockrate 2000000
    !
    interface Serial3/0:15
    no ip address
    isdn switch-type primary-net5
    isdn incoming-voice modem
    no cdp enable
    !
    interface Serial3/1:15
    no ip address
    isdn switch-type primary-net5
    isdn incoming-voice modem
    no cdp enable
    !
    interface Async1/00
    no ip address
    !
    interface Async1/01
    no ip address
    !
    (…)
    !
    interface Async2/106
    no ip address
    !
    interface Async2/107
    no ip address
    !
    interface Group-Async0
    no ip address
    no group-range
    !
    !
    ip classless
    ip route 0.0.0.0 0.0.0.0 192.168.100.3
    no ip http server
    !
    !
    !
    control-plane
    !
    !
    !
    voice-port 3/0:D
    !
    voice-port 3/1:D
    !
    !
    !
    dial-peer voice 200 voip
    destination-pattern .
    voice-class codec 1
    session protocol sipv2
    session target sip-server
    dtmf-relay rtp-nte
    no vad
    !
    dial-peer voice 1000 pots
    application session
    destination-pattern .
    translate-outgoing called 1
    direct-inward-dial
    port 3/0:D
    forward-digits all
    !
    dial-peer voice 1001 pots
    application session
    destination-pattern .
    translate-outgoing called 1
    direct-inward-dial
    port 3/1:D
    forward-digits all
    !
    !
    sip-ua
    sip-server ipv4:10.10.0.54
    !
    ss7 mtp2-variant Bellcore 0
    ss7 mtp2-variant Bellcore 1
    ss7 mtp2-variant Bellcore 2
    ss7 mtp2-variant Bellcore 3
    !
    line con 0
    line aux 0
    line vty 0 4
    login local
    line 1/00 2/107
    modem InOut
    !
    scheduler allocate 10000 400
    ntp clock-period 17179943
    ntp server 202.182.192.94
    end

  23. 23
    Ketema Says:

    This post is very similar to what I am trying to accomplish with an AS5300. THe problem I have though is that inbound calls from the PSTN when trying to be sent to sip-server they are rejected with SIP/2.0 488 Not acceptable here

    Aterisk 1.2.12.1
    IOS ™ 5300 Software (C5300-JS-M), Version 12.3(23), RELEASE SOFTWARE (fc5)

    I know this thread is old but has anyone see this issue ? Outbound calls from PBX to cisco work fine.

Leave a Reply

Protected by the thorough-paced and flagrant Hash-cash!

© 2008 Sean’s Obsessions | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4Sudoku, based on Pinkline byGPS Gazette