Asterisk ignoring REGISTER messages

Good evening, I will be cheeky and copy-paste what I wrote in the IRC yesterday:

I am configuring a very simple PBX (one trunk, one phone) and I can’t for the life of me get the phone to register. The trunk gets an outbound registration just fine and I can call in and out, but for reasons unknown the REGISTERs of the phone don’t get picked up by Asterisk at all. I can see the SIP packets arriving in sngrep/tcpdump but when I turn on the pjsip SIP logger they do not appear. I have already tried it with another phone (Linphone), same result.

kharwell helped me yesterday and we checked these things already:

  • Check if the actual IP and port matches the one in the REGISTER message
  • Check if source and destination IP are correct
  • Check if is loaded
  • Check if Asterisk is listening via lsof

Some more information about the running system:
Debian 11 (bullseye)
Asterisk 16.16.1~dfsg-1+deb11u1
Asterisk was installed via apt

Has anyone experienced something like this before or has any pointers for further troubleshooting this? Thanks in advance

Check the Asterisk firewall isn’t blocking it.

Checked iptables and all policies are set to accept. Also INVITEs from the trunk arrive just fine on the same IP and port so that speaks against the firewall blocking anything

I would setup the phone to register using a different port (like 5080) and use UDP.

Just set up a separate transport on UDP 5080, same result unfortunately

Do you have the auth password setup in pjsip (and in the phone)?

I could be wrong here, but I feel like the cause of this resides somewhere outside of Asterisk as the SIP trace logging occurs very early upon reception of a message. Meaning if the message is not logged then it never made into Asterisk. For example, the logging when enabled should be occurring before things like ACLs, security logging (e.g. fail2ban), authentication, or other things that might allow/disallow the message.

Are you running a clean build of Asterisk? Meaning no custom patches have been applied, or some other third party module has been installed.

Has Asterisk been configured and built with pjproject-bundled?

Is chan_sip disabled and/or not installed? (doubt it’s this but not ruling anything out)

Enable debugging and also double check the Asterisk log for any kind of error, warnings or notices. Even check for something that might have occurred at initial load time.

Things to consider external to Asterisk (although I think some have already been ruled out):

Is there a proxy involved?

Is NAT involved?

Is DNS involved?

Is ipv6 enabled? If so maybe firewalled there?

Is Asterisk, and/or the endpoint executing in a container or virtual machine?

Could some other packet filtering program be running on the system you may be unaware of?

The Asterisk build is the one straight from the Debian package repository using apt install asterisk so I’m not sure about patches, third party modules and pjproject. I’ll have to take a look at that.

chan_sip is installed but not enabled.

I’ll try running with debugging enabled tomorrow. I just checked the logs via journalctl again but nothing sticks out to me.

No proxy, NAT only towards the trunk, no DNS, IPv6 is enabled but it connects over IPv4 explicitly.

It does run in a virtual machine.

The machine is entirely bare but I can’t completely rule this out, I will have to ask the person who provided me the machine about this.

try enable SIP tracing in asterisk
to see if Asterisk is receiving the messages

pjsip set history on

After I compiled and installed Asterisk 18 and it still didn’t work it dawned upon me. I took a closer look and talked to the person who set the VM up for me and there were more firewall rules managed using ferm in iptables-legacy which dropped all incoming packets. After adjusting the ferm rules, it works now. Thank you all for the help with tracking down this issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.