SIP Channels unable to register internal or external

Hi there,

The Problem:

  • No SIP devices (Linksys SPA941 phones and a WM6.1 softphone) all on the 192.168.16.0 network can register.
  • No SIP Trunks can register (2 Trunks with WorldXchange VXF service, 1 Trunk with 2Talk)

Asterisk Info Reports:

Sip Registry

Host dnsmgr Username Refresh State Reg.Time
2talk.co.nz:5060 N 028nnnnnnnn 120 Unregistered
pan.wxnz.net:5060 N 6825nnnn 120 Request Sent
pan.wxnz.net:5060 N 6825nnnn 120 Request Sent
3 SIP registrations.

Sip Peers

Name/username Host Dyn Nat ACL Port Status
201 (Unspecified) D N A 5060 UNKNOWN
221 (Unspecified) D N A 5060 UNKNOWN
230 (Unspecified) D N A 5060 UNKNOWN
2Talk/028nnnnnnnn 202.180.76.166 N 5060 Unmonitored
6825nnnn/MyUsernamexxxxxx 58.28.20.150 N 5060 Unmonitored
6825nnnn/MyUsername2xxxxx 58.28.20.150 N 5060 Unmonitored
6 sip peers [Monitored: 0 online, 3 offline Unmonitored: 3 online, 0 offline]

The Environment:
I have just done a complete rebuild of my Asterisk box using the
AsteriskNow 1.7.0 iso distro from: http://www.asterisk.org/downloads/asterisknow/i386/asterisknow32.iso).
This installs Centos 5.5 and Asterisk 1.6x.

After install I updated FreePBX to the latest builds:
Asterisk 1.6.2.7
Core 2.7.0.7 FreePBX
DAHDi Config 2.7.0
Feature Code Admin 2.7.0.0
FreePBX Framework 2.7.0.2
System Dashboard 2.7.0.2
Voicemail 2.7.0.1
Info Services 2.7.0.0
Music on Hold 2.7.0.5
Recordings 3.3.9.4
Asterisk Info 2.7.0.0
Backup & Restore 2.7.0.7
Custom Applications 2.7.0.0

The hardware is:
P4 2.8Mhz box with 1Gb RAM
Dual NIC’s
OpenVox card with 4 FXO’s installed (actually no longer needed)

The Network:
eth0:
IP 192.168.16.0
Subnet 255.255.255.0
Static IP
no default Gateway
attached to my fully internal network and this is where my SIP phones live.

eth1:
IP 10.1.1.5
Subnet 255.255.255.0
Configured by DHCP but assigned a fixed address based on the MAC address.
Default GW 10.1.1.1
This is in my “quazi-DMZ” zone talking to a DLink DSL-502T Router.

Also on the network is a Win2003 SBS machine which does among other things routing to the Internet between the the two Zones.

The D-Link Router has Ports 5000-6000 UDP/TCP opened and pointing to IP 10.1.1.5
And Ports 10000-20000 also pointing to IP 10.1.1.5 (the Asterisk box)

What have I tried:
Following some of the posts I have the following in /etc/asterisk/sip_general_custom.conf:

registersip=yes
nat=yes
externhost=10.1.1.5
localnet=192.168.16.0/255.255.255.0
externrefresh=10

Internet and routing appears to be working correctly:
Internal network -
[root@PBX01 ~]# traceroute 192.168.16.10
traceroute to 192.168.16.10 (192.168.16.10), 30 hops max, 40 byte packets
1 pbx01.avs.local (192.168.16.200) 3000.994 ms !H 3000.980 ms !H 3000.965 ms !H

Internet addresses:

[root@PBX01 ~]# traceroute 58.28.20.150
traceroute to 58.28.20.150 (58.28.20.150), 30 hops max, 40 byte packets
1 mygateway1.ar7 (10.1.1.1) 0.800 ms 1.286 ms 1.553 ms
2 ip-58-28-15-31.wxnz.net (58.28.15.31) 95.126 ms 96.276 ms 98.468 ms
3 ip-58-28-13-83.wxnz.net (58.28.13.83) 54.891 ms 55.868 ms 56.734 ms
4 ge-0-0-0-akl-core3.wxnz.net (58.28.8.7) 57.999 ms 58.882 ms 60.767 ms
5 * * *
6 * * *
7 * * *
8 * * *
9 * * *

SELinux and IPTables are both disabled.

When I tried checking for ports however I couldn’t connect on 5060 (though this may also be my own ineptitude as my Linux knowledge is rusty and limited).

VXF Trunk settings as entered through FreePBX:

==============================================================
Trunk Description: AVSVXFLine

Outbound CID: 06825nnnn

CID Options: Any

Max Channels: 2

Trunk Name: 06825nnnn

Peer Details:
useragent=Asterisk PBX
regseconds=180
registertimeout=20
register=6825nnnn:MySecretxxxxxxxxx:[email protected]/6825nnnn
port=5060
language=en
dtmfmode=rfc2833
disallow=all
context=default
bindport=5060
bindaddr=0.0.0.0
allowoverlap=no
allow=g729&ulaw&alaw
nat=yes

User Context: 6825nnnn

User Details:
username=MyUsernamexxxxxxx
type=peer
secret=MySecretxxxxxxxx
nat=yes
insecure=invite,port
host=pan.wxnz.net
fromuser=6825nnnn
fromdomain=pan.wxnz.net
canreinvite=no

Register String:
6825nnnn:MySecretxxxxxxxxxx:[email protected]/6825nnnn

================================================

SIP Extensions:

================================================
This device uses sip technology.

secret MySecret
dtmfmode rfc2833
canreinvite no
context from-internal
host dynamic
type friend
nat yes
port 5060
qualify yes
callgroup
pickupgroup
disallow
allow
dial SIP/201
accountcode
mailbox 201@default
deny 0.0.0.0/0.0.0.0
permit 0.0.0.0/0.0.0.0

==================================================

I have istalled Asterisk a number of times without having trouble in the past. The difference this time is using the dual NIC scenario as I wanted to delete the PAPT devices that were previously in the DMZ zone and were used to connect to WorldxChange which was at the time my only VoIP provider.

What suggestions / tests / configuration changes can you offer? Please be specific with your instructions, since although I know my way around a keyboard my Linux is limited.

Thanks a heap,
Andrew

Sounds like you’ve got a routng problem. Can you ping the tnternal phones/devices from the phone server?

Yes, also can ping the remote servers no problem, whether by ip address or name.

Just to be sure here is the output:

Pinging SIP Phones from Asterisk Box:

ping 192.168.16.204
PING 192.168.16.204 (192.168.16.204) 56(84) bytes of data.
64 bytes from 192.168.16.204: icmp_seq=1 ttl=250 time=1.98 ms
64 bytes from 192.168.16.204: icmp_seq=2 ttl=250 time=0.770 ms
64 bytes from 192.168.16.204: icmp_seq=3 ttl=250 time=0.768 ms

— 192.168.16.204 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.768/1.173/1.981/0.571 ms

Pinging WxC server from Aterisk Box:

ping pan.wxnz.net
PING pan.wxnz.net (58.28.20.150) 56(84) bytes of data.
64 bytes from pan.wxnz.net (58.28.20.150): icmp_seq=1 ttl=60 time=51.9 ms
64 bytes from pan.wxnz.net (58.28.20.150): icmp_seq=2 ttl=60 time=50.3 ms
64 bytes from pan.wxnz.net (58.28.20.150): icmp_seq=3 ttl=60 time=51.0 ms
64 bytes from pan.wxnz.net (58.28.20.150): icmp_seq=4 ttl=60 time=52.0 ms

pan.wxnz.net ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 4971ms
rtt min/avg/max/mdev = 50.327/51.362/52.086/0.731 ms

Traceroute to WxC

traceroute pan.wxnz.net -p 5060 -I
traceroute to pan.wxnz.net (58.28.20.150), 30 hops max, 40 byte packets
1 mygateway1.ar7 (10.1.1.1) 2.090 ms 2.402 ms 2.684 ms
2 ip-58-28-15-31.wxnz.net (58.28.15.31) 56.222 ms 57.592 ms 58.015 ms
3 ip-58-28-13-83.wxnz.net (58.28.13.83) 61.096 ms 62.626 ms *
4 mygateway1.ar7 (10.1.1.1) 4.659 ms 4.832 ms 4.999 ms

Traceroute to one of SIP Phones

traceroute 192.168.16.204 -p 5060 -I
traceroute to 192.168.16.204 (192.168.16.204), 30 hops max, 40 byte packets
1 (192.168.16.204) 2.124 ms 2.320 ms 2.506 ms

Hopefully this can tell you someting useful.

I’m at a complete loss as where the problem lies.

Thanks again for helping.
Andrew

This is probably a networking issue that you will have to look at closer.

In addition, your external trunks are not going to work with:

externhost=10.1.1.5
localnet=192.168.16.0/255.255.255.0
externrefresh=10

That is telling Asterisk to masquerade as 10.1.1.5 for anything not on the 192.168.16.0 subnet. (And if this is what you really want, you should be using externip anyhow, and no need for externrefresh).

The fact that your internal extensions are having problems also points to more networking issues, plus you are “trying too hard” putting all these sip settings. On a properly configured setup everything should “just work” without all these settings besides the the externip/externhost/localnet that is sometimes needed for external trunks. (And … you should use the Asterisk SIP Settings module in the tools tab to configure any of these sip settings.)

Thanks for the feedback.

I have reconfigured the network cards by making eth0 be in the dmz zone and eth1 internal.

Also I have added Asterisk SIP Settings module. Not sure why I missed that one…

After a reset on my accounts at WxC. I’m in business in terms of active registrations etc.

Thanks for the help.
Andrew