Strange Asterisk/SIP + NAT problem?


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 + DAHDI 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 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.

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

This is the message in the logfile:

[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.

[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.

<— Transmitting (NAT) to —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP;branch=z9hG4bK188075dc;received=
From: sip:190@;tag=001a2fcb80b1001e5ffa3417-202d436a
To: sip:190@;tag=as175ff051
Call-ID: 001a2fcb-80b10002-3d78688d-25765f35@
User-Agent: Asterisk PBX
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 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,

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: