Strange Asterisk/SIP + NAT problem?

Aloha,

I am setting up our second Asterisk server, and trying to get it working and I am running into a strange problem.

This is running 1.4.22.2 + DAHDI 2.1.0.4 and the server has 2 ethernet ports. Eth0 with a real IP address, and then eth1 which is just connected to a switch and the IP phones with addresses in the 192.168.2.0 subnet.

This unit has a Digium AEX400 installed, and I can place calls out no problem. When I try and dial in, the system just rings and never picks up. I just want it to play the Demo message.

[mainmenu]
exten => s,1,Answer
exten => s,2,Background(demo-thanks)
exten => s,3,Hangup
include => default

This is the message in the logfile:

[quote]
[Mar 12 17:07:37] WARNING[22475]: channel.c:720 ast_channel_alloc: Channel allocation failed: Refusing due to active shutdown
[Mar 12 17:07:37] WARNING[22475]: chan_dahdi.c:6819 handle_init_event: Cannot allocate new structure on channel 1 [/quote]

And when I try and dial a SIP phone I get a similar message.

[quote]
[Mar 12 17:13:40] WARNING[22476]: channel.c:720 ast_channel_alloc: Channel allocation failed: Refusing due to active shutdown [/quote]

To complicate things even further, if I don’t set nat=no in the peer section of sip.conf, Asterisk refuses to register the phone. Cisco 7960’s with SIP firmware 3-08-8.

[quote]
<— Transmitting (NAT) to 192.168.2.2:50576 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.2.2:5060;branch=z9hG4bK188075dc;received=192.168.2.2
From: sip:190@192.168.2.100;tag=001a2fcb80b1001e5ffa3417-202d436a
To: sip:190@192.168.2.100;tag=as175ff051
Call-ID: 001a2fcb-80b10002-3d78688d-25765f35@192.168.2.2
CSeq: 118 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="1db4fcec"
Content-Length: 0 [/quote]

I have our original server running just fine, the only difference is that I’m not using two separate nics. I have setup eth0:0 with the real IP address and eth0:1 with the 192.168.1.0 subnet and things work fine.

I have localnet and externip both set correctly in my sip.conf and have tried all 4 nat= settings under [general].

I have a feeling that I am missing something in my NAT setup, or maybe I’m don’t have the forwarding setup correctly between the 2 nics on my new server.

Any help would be greatly appreciated!
Thanks in advance,
Herb

Well, I just restarted the whole server, and things are working normally again.

Never doubt the ability of a complete reboot to solve weird quirks :smile: