Asterisk won't bind to port 5060

Folks, I have not been hacking with Asterisk v.1.2.7.1 on my Ubuntu 6.06 Dapper drake. The result is still the same: Asterisk fails to bind to port 5060, neither on 127.0.0.1 nor my machine IP: 192.168.1.3. nmap shows the ports as closed. The Asterisk management port, 5038, binds fine, and I can make it use either 127.0.0.1 or 192.168.1.3.

I don’t get any error messages, apart from not having an mp3 player, and the Asterisk CLI seems to be working fine. It can reload, stop gracefully and restart seemingly without problems. It logs on to my SIP VoIP provider when I start it. It just wont open the SIP ports on my local computer.

What can possibly be wrong? Any help here would be greatly apreciated!

My configuration is kept to an absolute minimum:

sip.conf:

[general]
context=musimi_incoming
realm=kvols
bindport=5060
bindaddr=0.0.0.0
; bindaddr=127.0.0.1  ;Tried this
; bindaddr=192.168.1.3 ;Tried this - same result!

externip= 62.xx.xx.xx ; My external static IP adress
;
register => 46xxxxxx:*******@musimi.dk:5060/101
;
disallow=all                    ; First disallow all codecs
allow=ulaw                      ; Allow codecs in order of preference
allow=alaw
allow=gsm
;
; Nokia E70
[E70]
type=friend
;host=192.168.1.42
;port=5060
;port=5061
context=dialout ; default
username=101
secret=*******
callerid="E70" <101>
nat=no ; It's on the local network
domain=default
;
; Musimi - my VoIP provider
[musimi]
type=friend
host=musimi.dk
port=5060
dtmfmode=rfc2833
canreinvite=no
username=46xxxxxx
secret=******
context=musimi_incoming
nat=yes
fromuser=46xxxxxx
fromdomain=musimi.dk
insecure=very

extensions.conf

[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=yes

[globals]

[musimi_outgoing]
exten => _X.,1,Dial(Sip/musimi/${EXTEN},120)
exten => _X.,2,Congestion

[dialout]
include => musimi_outgoing

[musimi_incoming]
exten => 46xxxxxx,1,Dial(Sip/101,120)
exten => 46xxxxxx,2,Congestion 

sip show peers

hush*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status
musimi/46xxxxxx            212.130.58.214       N      5060     Unmonitored
E70/101                    192.168.1.42                5061     Unmonitored
2 sip peers [2 online , 0 offline]

nmap - Asterisk running… :cry:

kvols@hush:~$ sudo nmap 127.0.0.1 -p 5061

Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-06-29 13:55 CEST
Interesting ports on localhost (127.0.0.1):
PORT     STATE  SERVICE
5061/tcp closed unknown

Nmap finished: 1 IP address (1 host up) scanned in 0.056 seconds
kvols@hush:~$ sudo nmap 192.168.1.3 -p 5061

Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at 2006-06-29 13:55 CEST
Interesting ports on 192.168.1.3:
PORT     STATE  SERVICE
5061/tcp closed unknown

Nmap finished: 1 IP address (1 host up) scanned in 0.062 seconds

Try registering a softphone… I don’t have certainty if nmap can figure out which UDP ports are used. Maybe, nmap is showing only the TCP connections already established in your host but not UDP. Also, try with the 5060 port instead of 5061, as it is the port that you actually have configured in your sip.conf.

Regards,
IB

Thanks - I tried netstat instead:

kvols@hush:/etc/asterisk$ sudo netstat -a -n | grep udp
udp        0      0 0.0.0.0:2727            0.0.0.0:*
udp        0      0 0.0.0.0:4520            0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp        0      0 0.0.0.0:5061            0.0.0.0:*
udp        0      0 0.0.0.0:4569            0.0.0.0:*

…much better! :smiley:

Port 5061 was used in order to avoid port conflicts wuth Ekiga or KPhone. I can now connect with Ekiga, and I’ve successfully made a call through my Asterisk installation through the registrar to my cell phone. It worked.

Calling the other way doesn’t work, though. My Asterisk installation is placed behind a router, and even though I set nat=yes in the sip.conf, I cannot route calls to my computer. My VoIP registrar has a stun proxy - but I haven’t found a way to set this up with Asterisk…?

Again, thank you so much for your help!