Asterisk is on a server behind a firewall. Calls made from extensions that are also behind the firewall have audio. Extensions outside the firewall will ring the number called but when answered there is no audio.
Initial thoughts were a firewall problem, but opening all ports with: iptables -I INPUT -j ACCEPT
didn’t help.
UFW ports 5060, 10000-60000 are open for tcp and udp.
Can it be some setting in sip.conf?
Here are some of the values I tried.
sip.conf:
externip=132.129.77.130
localnet=192.168.1.0/255.255.255.0
nat=yes
udpbindaddr=0.0.0.0:5060
bindaddr=0.0.0.0
tos_audio=ef
cos_audio=5
rtp_engine=asterisk
directmedia=no
If you get debugging with “sip set debug on”, are the correct IP addresses in the c lines, and the correct ports in the m lines, in the SDP from both sides.
nat=yes probably still works, but has been superseded by the combination of the two component settings: nat=force_rport,comedia, and is only relevant if the peer is sending the wrong addresses or ports.
You are missing type=peer.
Unless your system cannot make PSTN calls, having no authentication on internal devices is a really bad idea.
You should note that chan_sip is deprecated, unsupported, and scheduled for removal.
Some of the problems you spotted are just my bad typing. But everything you pointed out has been corrected.
The log of the failed call is about 70,000 characters. Messages here have a limit of about 33,000 characters. I don’t see any way to add an attachment.
While it still isn’t working, I feel like I’m getting closer to a solution.
You are using an unsupported version of Asterisk. Please reproduce with 16.24.1 or 18.10.1. 13.1.0 is over seven years old, and even security fixes ended for Asterisk 13 last year.
The log show that Asterisk is ignoring the external IP address. Please use CLI commands to verify whether it has actually read it, although it may be because it isn’t a valid synonym for externaddr, although it does look like current versions recognize it, even though it isn’t documented. Did you put it in the general section?
(The peer doesn’t seem to need nat=, as it seems to be correctly presenting its public addresses, although force_rport may get it a little way in coping with the problem at the Asterisk end.)
How time passes. Didn’t realize how old my version of Asterisk is.
But I can’t upgrade Asterisk! Do I need to reinstall from scratch?
$ apt-get install asterisk
Reading package lists… Done
Building dependency tree
Reading state information… Done
asterisk is already the newest version (1:13.1.0~dfsg-1.1ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Just upgraded ubuntu and again got the same message for Asterisk.
Working! Changing settings in sip.conf was the answer. Unfortunately, I was using “trial and error” and have no idea what got it working. I lost track of what I changed.
Now, apt-get won’t upgrade my version of Asterisk. Keeps saying I have the latest version. To get the latest, go to Asterisk and download the file.
Thank you everyone for your patience and knowledge that kept got me closer to the solution.