Using cisco router running sip as PSTN gateway


#1

All, I need some help!
I have installed and setup asterisk@home 2.7 and have been looking around for weeks trying to find an answer to this question?

Is it possible with asterisk to use a cisco router (running SIP)with a PRI connected to it with asterisk? I can NOT seem to get the cisco and asterisk to register together. I have a setup inplace working now using the same cisco connected to a PSTN ISDN span running SIP talking to a ONDO sip server and it works great with the following settings…

in the ONDO sip server I just add a username and password
in the cisco I have
sip-ua
authentication username sipusername password 142313450D0C2B797178
no redirection
set pstn-cause 44 sip-status 486
registrar ipv4:65.23.9.237 expires 3600
sip-server ipv4:65.23.9.237

I take that same cisco setup and try to point it to my asterisk@home ip and It will not register.

In AMP I have under trunks (sip) peer details

host=65.23.9.234
insecure=very
nat=no
secret=mypassword
type=peer
username=sipusername

I also have under registration ( ip is the cisco)
sipusername:password@65.23.9.234

I have tried every combo I can find in several postings at add or delete from the peer details and nothing seems to work.

I have also tried under user registration
sipusername:password@65.23.9.xxx/sipusername

and still can not get the cisco to register…
below is the debug I get from the cisco 2431…

test_dids_#show sip-ua register status
Line peer expires(sec) registered
============ ============= ============ ===========
.* 1 78 no
5132017005 2017005 78 no
debug…

Sent:
REGISTER sip:65.23.9.237:5060 SIP/2.0
Via: SIP/2.0/UDP 65.23.9.234:5060;branch=z9hG4bK17DA177D
From: “." sip:.*@65.23.9.237;tag=240C2964-231A
To: ".
sip:.*@65.23.9.237
Date: Thu, 07 Mar 2002 23:59:36 GMT
Call-ID: A7984878-315D11D6-80BDE70E-6EB18A80
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Timestamp: 1015545576
CSeq: 3 REGISTER
Contact: sip:.*@65.23.9.234:5060
Expires: 3600
Content-Length: 0

*Mar 7 23:59:36.762: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Sent:
REGISTER sip:65.23.9.237:5060 SIP/2.0
Via: SIP/2.0/UDP 65.23.9.234:5060;branch=z9hG4bK17DBE4E
From: “5132017005” sip:5132017005@65.23.9.237;tag=240C2964-4E8
To: “5132017005” sip:5132017005@65.23.9.237
Date: Thu, 07 Mar 2002 23:59:36 GMT
Call-ID: A798E4A0-315D11D6-80BEE70E-6EB18A80
User-Agent: Cisco-SIPGateway/IOS-12.x
Max-Forwards: 70
Timestamp: 1015545576
CSeq: 3 REGISTER
Contact: sip:5132017005@65.23.9.234:5060
Expires: 3600
Content-Length: 0

Mar 7 23:59:36.766: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
SIP/2.0 404 Not found
Via: SIP/2.0/UDP 65.23.9.234:5060;branch=z9hG4bK17DA177D;received=65.23.9.234
From: ".
" sip:.*@65.23.9.237;tag=240C2964-231A
To: “.*” sip:.*@65.23.9.237;tag=as28357555
Call-ID: A7984878-315D11D6-80BDE70E-6EB18A80
CSeq: 3 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:.*@65.23.9.237
Content-Length: 0

*Mar 7 23:59:36.766: //-1/xxxxxxxxxxxx/SIP/Msg/ccsipDisplayMsg:
Received:
SIP/2.0 404 Not found
Via: SIP/2.0/UDP 65.23.9.234:5060;branch=z9hG4bK17DBE4E;received=65.23.9.234
From: “5132017005” sip:5132017005@65.23.9.237;tag=240C2964-4E8
To: “5132017005” sip:5132017005@65.23.9.237;tag=as3cdd55b8
Call-ID: A798E4A0-315D11D6-80BEE70E-6EB18A80
CSeq: 3 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: sip:5132017005@65.23.9.237
Content-Length: 0

Any idea’s???
I have double checked all usernames and passwords match in the cisco and in AMP.

If someone out there has a cisco used as a gatekeeper for PSTN trunks could you please send me your config of both the cisco and the Asterisk?


#2

I use Asterisk talking SIP to a Cisco GW. I have made it work with Asterisk registering to the registrar function on IOS GW, but this is problematic if you have multiple users behind the Asterisk server and want to pass on the correct ANI.

It works most simply with no registration, just treating it as a sip peer:

mysql> select name,type,ipaddr,host from asterisk.sip_peers; +---------------------------+--------+-----------------+-----------------+ | name | type | ipaddr | host | +---------------------------+--------+-----------------+-----------------+ | sj-pbx-gw1 | peer | 192.168.238.196 | 192.168.238.196 | +---------------------------+--------+-----------------+-----------------+

I think I had problems when I first set only the ipaddr statically, and it started working after I also set the host field to the ip addr. Don’t remember clearly though.

Of course you have to have your dialplan set up correctly on Asterisk side and all your dial peers set correctly on the IOS GW, which will take more than a quick forum response except for simplest casest.


#3

Thanks, That worked! I am able to make asterisk calls out to the PSTN network.
I still can not make inbound calls to the asterisk server… any idea’s?

I have a DID comming in to the cisco and I see it send the call out toward asterisk, but it fails to a cause code of channel/ckt not avib.

under sip trunks I have…
outgoing settings…
allow=all
context=from-internal
host=65.23.9.236
ipaddr=65.23.9.236
type=peer

incoming settings…

context=from-sip-external&from-internal
host=65.23.9.236
insecure=very
ipaddr=65.23.9.236
type=friend

on the asterisk side under inbound routing I have…

the did number 5132017005
and it poins to a voicemail box.


#4

I am also having this issue. Basically, all calls from the CCME are being considered “from-sip-external” which is incorrect. They should be “from-asterisk”.

My sip.conf has:

[from-asterisk]
type=friend
nat=no
insecure=very
host=192.168.100.1 ; the CCME IP
context=from-internal

[asterisk]
type=peer
qualify=yes
nat=no
insecure=very
host=192.168.100.1 ; the CCME IP
dtmfmode=inband
dtmf=inband
allow=ulaw

There is a way around it but I don’t like it - basically, changing the default context from

context = from-sip-external

to

context = from-internal

But this opens a security hole to the Internet allowing anyone to have access to the SIP trunk. Any ideas on how to avoid this?