wireshark "incorrect timestamp" on very specific condition (incoming call, first 1-4 seconds, problem on just one way only.

Hello,
I apologize for bad english. I’ve just installed freePBX and I have a problem in a very specific condition only:

  • extern call, caller hears disturbed voice only for the first 2-6 seconds then everything is ok.
  • after 1-16 seconds everything is fine
  • If the call is internal to external number everything is fine
  • if the call is internal to internal everything is fine

This is my setup:

  • freePBX installed in the same VLAN of VoIP terminals
  • freePBX: 192.168.172.50
  • terminal: 192.168.172.200
  • sip Trunk gateway on public 5.178.95.246
  • freePBX and terminals for alaw codec only (location is italy).
  • FFTH internet connection, measured 700Mbit download, 300 Mbit upload. Jitter very low.

I switched off all devices but the VoiP, there should not be bandwidth or jitter problems. I have a Mikrotik RB4011 router, QoS configured for RTP, SIP.
Here below I report the wireshark analysis showing the problerm and the router configuration.

Somebody can help me solving the issue? Thanks in advance.

“Packet”,“Sequence”,“Delta (ms)”,“Jitter (ms)”,“Skew”,“Bandwidth”,“Marker”,“Status”
“192.168.172.50:17900 → 5.178.95.245:10148 (0x3588f93e)”
7,57849,0,0,0,1.6,“”,“OK”
------------ REMOVED PACKETS
302,58138,1022.5839999999989,0.20648176350956307,-48.82299999999941,1.6,“SET”,“OK”
303,58139,17.085000000000946,0.3757641532901562,-45.90800000000036,3.2,“”,“OK”
------------ PROBLEM STARTS HERE
306,58140,33.082000000000335,427.54490389370955,-6880.990000000001,4.8,“SET”,“Incorrect timestamp”
307,58141,33.40599999999904,826.7862224003527,-13696.396,6.4,“”,“Incorrect timestamp”
308,58142,33.8799999999992,1199.8545835003306,-20492.275999999998,8,“”,“Incorrect timestamp”
309,58143,34.159999999999854,1548.3736720315599,-27268.435999999998,9.6,“”,“Incorrect timestamp”
310,58144,34.45999999999913,9487178,-2060349.8680000002,80,“”,“Incorrect timestamp”
------------ REMOVED PACKETS
933,58479,6005.735999999999,6027.663245192294,-2066377.6040000003,80,“”,“Incorrect timestamp”
935,58480,6025.7029999999995,6027.665729867776,-2072405.3070000003,80,“”,“Incorrect timestamp”
937,58481,6045.706,6027.66824675104,-2078433.0130000003,81.6,“”,“Wrong sequence number”
------------ PROBLEM FINISH HERE, FROM NOW ON EVERYTHING IS OK
939,58482,20.16699999999946,5650.9494188291,-2078433.1800000002,80,“”,“OK”
941,58483,19.597999999999956,5297.7902051522815,-2078432.7780000004,81.6,“”,“OK”
------------ REMOVED PACKETS

ROUTER CONFIGURATION:
/interface bridge
add name=bridge-trunk port-cost-mode=short protocol-mode=none vlan-filtering=
yes
/interface ethernet
set [ find default-name=ether1 ] comment=WAN
set [ find default-name=sfp-sfpplus1 ] comment=SW-UFFICIO
/interface vlan
add interface=bridge-trunk name=VLAN170-LAN vlan-id=170
add interface=bridge-trunk name=VLAN172-VOIP vlan-id=172
add interface=bridge-trunk name=VLAN175-MNGT vlan-id=175
/interface list
add name=VLAN-MNGT
add name=VLAN-LAN
add name=VLAN-VOIP
add name=WAN
/ip pool
add name=VPN170_POOL ranges=192.168.170.128-192.168.170.199
add name=VPN172_POOL ranges=192.168.172.128-192.168.172.199
add name=VPN175_POOL ranges=192.168.175.128-192.168.175.199
/ip dhcp-server
add address-pool=VPN170_POOL interface=VLAN170-LAN name=DHCP-VLAN170-LAN
add address-pool=VPN172_POOL interface=VLAN172-VOIP name=DHCP-VLAN172-VOIP
add address-pool=VPN175_POOL interface=VLAN175-MNGT name=DHCP-VLAN175-MNGT
/ppp profile
/queue tree
add limit-at=300M max-limit=300M name=upload parent=ether1 priority=1 queue=
default
add limit-at=740M max-limit=740M name=download parent=bridge-trunk priority=1
queue=default
add comment=RTP_88K_PER_TERMINALE limit-at=360k max-limit=360k name=
upload_pri_1_rtp packet-mark=rtp-packet parent=upload priority=1 queue=
default
add comment=SIP_65K_PER_TERMINALE limit-at=200k max-limit=200k name=
upload_pri_1_sip packet-mark=sip-packet parent=upload priority=1 queue=
default
add limit-at=299M max-limit=299M name=upload_pri_8 packet-mark=no-mark
parent=upload queue=default
add comment=RTP_88K_PER_TERMINALE limit-at=360k max-limit=360k name=
download_pri_1_rtp packet-mark=rtp-packet parent=download priority=1
queue=default
add comment=SIP_65K_PER_TERMINALE limit-at=200k max-limit=200k name=
download_pri_1_sip packet-mark=sip-packet parent=download priority=1
queue=default
add limit-at=739M max-limit=739M name=download_pri_8 packet-mark=no-mark
parent=download queue=default
/interface bridge port
add bridge=bridge-trunk frame-types=admit-only-vlan-tagged interface=
sfp-sfpplus1 internal-path-cost=10 path-cost=10
/interface bridge vlan
add bridge=bridge-trunk tagged=sfp-sfpplus1 vlan-ids=170
add bridge=bridge-trunk tagged=sfp-sfpplus1 vlan-ids=172
add bridge=bridge-trunk tagged=sfp-sfpplus1,bridge-trunk vlan-ids=175
/interface list member
add interface=ether1 list=WAN
add interface=VLAN175-MNGT list=VLAN-MNGT
add interface=VLAN170-LAN list=VLAN-LAN
add interface=VLAN172-VOIP list=VLAN-VOIP
add address=192.168.172.1/24 interface=VLAN172-VOIP network=192.168.172.0
add address=192.168.175.1/24 interface=VLAN175-MNGT network=192.168.175.0
add address=192.168.170.1/24 interface=VLAN170-LAN network=192.168.170.0
add address=192.168.1.2/30 comment=WAN interface=ether1 network=192.168.1.0
/ip dhcp-server network
add address=192.168.170.0/24 dns-server=192.168.170.240,192.168.170.241
gateway=192.168.170.1
add address=192.168.172.0/24 dns-server=192.168.172.1 gateway=192.168.172.1
add address=192.168.175.0/24 dns-server=192.168.175.1 gateway=192.168.175.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip firewall address-list
add address=192.168.170.0/24 comment=LAN list=CAMPEGGIO_170
add address=192.168.175.0/24 comment=MNGT list=CAMPEGGIO_175
add address=192.168.172.0/24 comment=VOIP list=CAMPEGGIO_172
add address=192.168.170.0/24 list=VLAN
add address=192.168.172.0/24 list=VLAN
add address=192.168.175.0/24 list=VLAN
/ip firewall filter
add action=accept chain=forward comment=“FORWARD Allow Estab & Related”
connection-state=established,related
add action=accept chain=input comment=“INPUT Allow Estab & Related”
connection-state=established,related
add action=drop chain=forward comment=“FORWARD DROP INVALID”
connection-state=invalid log=yes log-prefix=forward-drop-invalid
add action=drop chain=input comment=“INPUT DROP INVALID” connection-state=
invalid log=yes log-prefix=input-drop-invalid
add action=accept chain=input comment=“INPUT Allow MANAGEMENT VLAN”
connection-state=new in-interface-list=VLAN-MNGT
add action=accept chain=forward comment=“FORWARD ALLOW MANAGEMENT VLAN”
connection-state=new dst-address-list=VLAN in-interface=VLAN175-MNGT
add action=accept chain=forward comment=“ABILITA INTERNET SU VLANS”
connection-state=new out-interface-list=WAN src-address-list=VLAN
add action=accept chain=input comment=“INPUT ALLOW DNS IN VLAN”
connection-state=new src-address-list=VLAN
add action=drop chain=forward comment=“FORWARD DROP ALL” log=yes log-prefix=
forward-drop-all
add action=drop chain=input comment=“INPUT DROP ALL” log-prefix=
input-drop-all
/ip firewall mangle
add action=mark-connection chain=forward comment=SIP connection-state=new
disabled=yes dst-address=192.168.172.50 dst-port=5060
new-connection-mark=sip-connection protocol=udp
add action=mark-connection chain=forward comment=SIP connection-state=new
dst-port=5060 new-connection-mark=sip-connection protocol=udp
src-address=192.168.172.50
add action=mark-packet chain=forward comment=SIP connection-mark=
sip-connection log=yes log-prefix=sip-packet new-packet-mark=sip-packet
add action=mark-connection chain=forward comment=RTP connection-state=new
disabled=yes dst-address=192.168.172.50 log-prefix=RTP-Conn
new-connection-mark=rtp-connection port=10000-20000 protocol=udp
add action=mark-connection chain=forward comment=RTP connection-state=new
log-prefix=RTP-Conn new-connection-mark=rtp-connection port=10000-20000
protocol=udp src-address=192.168.172.50
add action=mark-packet chain=forward comment=RTP connection-mark=
rtp-connection log=yes log-prefix=rtp-packet new-packet-mark=rtp-packet
add action=change-dscp chain=postrouting comment=DSCP log=yes log-prefix=
change-dscp new-dscp=46 out-interface=VLAN172-VOIP packet-mark=rtp-packet
/ip firewall nat
add action=masquerade chain=srcnat out-interface-list=WAN
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1
pref-src=“” routing-table=main scope=30 suppress-hw-offload=no
target-scope=10