We have an issue with SIP packets through our Mikrotik hAP ac Lite. We have a VoIP-device in the network, but it is not receiving incoming calls.
When we make some traces we see that the VoIP-PBX is sending SIP INVITES, they are reaching the router. But not forwarded to the VoIP-device in the network.
What can be the problem and how to solve this?
I’ve attached a packet sniff on the Mirkotik.
Best regards,
Joost Lauwen
Is the phone registered with the PBX? If there is no connection (under IP > Firewall > Connections) the incoming packets have nowhere to go and will be dropped.
There is little point setting 1000M-half,1000M-full on ether1 as the device only supports fast, not gigabit, ethernet.
The Drop External Acces to DNS and Block External Acces to Ports input rules are unnecessary due to the defconf: drop all not coming from LAN rule.
We’ve already disabled SIP ALG/Helper in the config. Without any success.
I’ve also tried to create a NAT-rule to forward all the SIP-traffic to the IP-address of the VoIP-device.
The device is not a standard VoIP-phone, like Cisco, Gigaset. But an AnyNode SBC.
Yes, the Anynode-device is registered to our PBX. And it is registering every 3 minutes.
Have you tried to increase the udp-stream-timeout to 5m in /ip/firewall/connection/tracking ?
The default value is 3m (minutes), same as your phone’s register interval. Maybe the connection times on small interval delays.
Sometimes the best way to discover a voip problem is run the syslog on the Anynode-device and after reboot watch the entry… this way help me the most in my scenario. VoIP devices generally not have logs but a syslog they are almost all (in Poland market).
Since you haven’t shown the filter condition you used when sniffing the traffic on the Mikrotik, it is not clear whether the Mikrotik indeed doesn’t forward the INVITEs to the AnyNode or whether it does but they got somehow lost on their way there.
If the SIP helper is disabled, Mikrotik doesn’t inspect the SIP payload, so it treats the INVITEs just like any other UDP packets, i.e. the L4 contents of the packets should play no role.
If the IP of the registrar is the same like the source IP of the INVITEs, which should be the case, you do not need a dst-nat rule for the INVITEs to be redirected from the WAN IP of the Mikrotik to the LAN IP of the AnyNode, as the UDP packets carrying those INVITEs are considered response packets in the connection created by the first REGISTER.
So first, I’d like to see what /tool sniffer quick ip-address=5…101 (the address of the PBX, not writing it in full as you took the effort to hide it in the OP) shows when you make the incoming call attempt (INVITEs from the PBX address towards your WAN). Normally, you should see the packet on the WAN interface with the 217… as destination address, and then once again on the LAN interface, with the IP address of the AnyNode as the destination one. If this is not the case, something is rotten with the routing on the Mikrotik, but according to the configuration export you’ve posted, the only external causes I can imagine are a failure to obtain the MAC address of the AnyNode, or some MTU issue on the LAN if the INVITE is huge and the MTU of the LAN on the Mikrotik is higher than the actual one of the AnyNode. Which reminds me of a case where a default configuration of some Mikrotik model/CPU architecture had a MTU of 1600 or so on the bridge, and the symptoms were similar, except that the INVITE was coming encrypted in an IPsec transport packet as it was a VoWiFi scenario.
Also, your configuration export doesn’t match the connection state - the connection you have shown is fasttracked but there is no action=fasttrack rule in the export. Not that it would change anything as such, but maybe you have removed also some other “unrelated” configuration before posting the export?
My sniffer was configured like this:
I’ve used your sniffer-rule, but I have the same result. Only SIP INVITES to ourpublic-ip, and not to the anynode.
Our firewall has the default config loaded for now, with some extra rules. We’ve used the basic config for this routerboard.
The reason why I’ve suggested to filter on the PBX IP address rather that on SIP port was that if the router was eventually sending some ICMP feedback, your filter would not capture it.
When you let the sniffer run for more than 3 minutes, so that a re-registration could take place, can you see the registrar responses (200 and possibly 401/407) to be sent to the anynode address?
what is the Ethernet size of the received INVITEs, and what is the actual-mtu value of the bridge interface of the Mikrotik?
Maybe overly simplifying it, but if the device can register, but cannot receive calls, sounds like the PBX cannot reach the endpoint device on port 5060. Open that port up to the device and I’ll bet it works.
The trace shows that the router does not just drop the INVITEs but it notifies the sender about an issue with them. To confirm that, look inside the ICMP “deatination unreachable” packets, you should see the beginning of the INVITE packets there, at least the IP and UDP headers.
It seems as if their destination address was not the router’s WAN address but nevertheless they did arrive to it. Could it be that the AnyNode determines some other public IP using e.g. STUN, sends the determined public IP in the Contact field of the register, and the PBX uses that other public address from Contact rather than the one from which the REGISTER has actually arrived to it? The Mikrotik configuration doesn’t suggest that, but maybe there are some more routers there?
I would have to see the actual capture file to say more, with both the REGISTER exchange and the INVITE, to say something more specific.