What opens port 5060?

OK, so, after about 3 days of struggle, I finally got Asterisk partly running. netstat -na shows port 5038 open.

However, it doesn’t show port 5060 open, which means that nothing SIP-related works at all.

What part of Asterisk has to be running to open port 5060?

What do I have to do to run it?

I see from another thread that “sip show peers” is a command (OK, “sip” is the command, the rest are arguments). On my system, “sip” is an unknown command. “find / -name sip” finds a null file in /var/www/html/admin, and nothing else, so there’s no shell script file called “sip” on my system (I don’t know whether there should be).

Note that this is intended to be an internal-only SIP PABX - there are no trunks and will never be any trunks.

(Installed from AsteriskNOW-1.5.0-i386-1of1.iso downloaded on 2009 November 2.)

If you open up a shell to your system and type

asterisk -r

What do you get?

If you type in a shell

ps aux |grep asterisk

What do you get?

[root@localhost admin]# ps aux |grep asterisk
root 6303 0.0 0.1 4480 632 ? S Dec18 0:00 /bin/sh /usr/sbin/safe_asterisk
root 6309 0.0 1.3 15560 6820 ? Sl Dec18 0:00 /usr/sbin/asterisk -f -vvvg -c
root 16490 0.0 0.1 3916 688 pts/1 S+ 09:16 0:00 grep asterisk

Well, then asterisk is running.
What is your problem?

Can you access FreePBX from http://your-ip-address/admin

Port 5060 isn’t open. There is no SIP communication between the extensions and Asterisk. (Sorry, I thought I had stated this clearly enough in the original posting.)

To perhaps clarify further: the extensions are Pingtel Expressa SIP phones, and Ekiga on a Linux box, i.e. all extensions are SIP. There are no conventional phones; there is no PSTN or conventional telephone hardware; there are no trunks of any sort (analogue, ISDN, or SIP).

I can run tcpdump on the Asterisk box, which confirms that I can get the extensions to send SIP commands to Asterisk, but there is no response whatsoever from Asterisk because port 5060 is not open.

It’s NOT a firewall issue; no firewall is enabled on the Asterisk box. The whole system is inside a good corporate firewall, which is our solution to security issues.

*** Edit - Oops, sorry, only half answered ***

Yes, I can connect with Firefox to the Asterisk box, and I see the control panel.

There is still a message “Could not reload FOP server”, which I guess should be the subject of a separate thread.

I can’t see any means of starting Asterisk’s SIP server.

I have only done the basic installation, so there are very few modules loaded, listed here:

Core
Feature Code Admin
FreePBX Framework
System Dashboard
Voicemail
Info Services
Music On Hold
Recordings
Custom Applications

Am I expected to load more modules before I have a usable PABX? I don’t want to load more stuff without good reason. This is the second time I’ve installed AsteriskNOW; I gave up with the first one, thinking that the upgrades and extras that I downloaded might have caused all the trouble I had. (This second installation seems to be even less functional, though.)

Ok, what if you do:

netstat -na |grep 5060

Does that display

udp        0      0 0.0.0.0:5060                0.0.0.0:*

Also check if the firewall is running:

service iptables status

If it is, stop it with service iptables stop and try again to connect.

netstat -na |grep 5060 returns nothing. Like I said, port 5060 is not open.

[root@localhost ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

[root@localhost ~]#

Like I said, it’s not a firewall issue.

Have you set up any extensions? If you look at /etc/asterisk/sip_additional.conf, do you have lines there that says port=5060?

Just to make things clear, you are running FreePBX to configure Asterisk?

If you type in an Asterisk CLI the following module show like sipdo you get

chan_sip.so                    Session Initiation Protocol (SIP)        0

Here are the lines from one of the two extensions:

[171]
type=friend
secret=
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=171@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/171
context=from-internal
canreinvite=no
callgroup=
callerid=device <171>
accountcode=
call-limit=50

Extension 172 has an almost identical set of lines.

/etc/asterisk/sip.conf has the line:

#include sip_additional.conf

The web pages that I use to monitor and configure it are entitles “FreePBX Administration”, so I must be running FreePBX.

Note, from my list of modules in a previous posting “Do I have to add more modules?”, that the Asterisk CLI module is NOT loaded. It doesn’t appear to be loaded by the default installation process. That’s why I asked the question earlier. “module show like sip” gives “-bash: module: command not found”

OK, in the bash shell, type asterisk -r and in there you type module show like sip

When I do “asterisk -r”, I get the following 5 lines, repeating every few seconds:

== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1

Yes, that is normal, it is because FreePBX is on the System Status page. Just click Extensions in FreePBX to stop getting those line. Then type the text module show like sip.

[root@localhost ~]# asterisk -r
Asterisk 1.4.24, Copyright © 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 1.4.24 currently running on localhost (pid = 6309)
Verbosity is at least 3
localhostCLI> module show like sip
Module Description Use Count
app_adsiprog.so Asterisk ADSI Programming Application 0
chan_sip.so Session Initiation Protocol (SIP) 0
2 modules loaded
localhost
CLI>

Stop your firewall with service iptables stop just to make sure.
I am downloading the iso from Asterisk right now and will install it just to see what the install is doing.

OK, I have just installed AsteriskNOW. After restarting it I could not register my sip client, nor could I type ‘sip show peers’.
I then did an ‘amportal stop’ followed by 'amportal start’
After that it was working.

Thanks, Mikael, it runs now. It wasn’t iptables, of course - I just had to stop and start amportal.

Interesting, isn’t it… the cure is so simple, but it’s so hard to find.

It puzzled me for a couple of minutes, but I found the error in the Asterisk log file, error was something like “no sip.conf”.

Take care,

But how does a non-developer make the logical leap from “no sip.conf” to “restart amportal”?

I have not tested it, but I suspect that a restart of the system would have done the same thing. I think that it should be added to the install doc for AsteriskNOW.