Sometimes you need to connect two PBXs in different locations via VPN network, and you can ping each other's IP addresses on the PBXs, but the sip trunk cannot be established.
Capture the pcap log on both PBXs at the same time, then disable the trunk between them on one of the PBXs, then enable it again. When it shows connection failure or unavailable, click stop on both and then download both pcap logs to check. See if the PBX on the other end is receiving registration packets, and OPTIONS packets from the other end.
If not, the SIP packet may be dropped or not transmitted in the VPN network.
Then, you can check the VPN connection protocol on the VPN server and try to change the protocol from L2TP to IPsec IKEv2.
If the registration packet and OPTIONS packet is received, but the connection is not successful, at this time, please provide the system log to our support team (firstname.lastname@example.org) to check.
Here is the guide about how to get the PCAP capture: https://support.yeastar.com/hc/en-us/articles/360007739473-How-to-Get-PCAP-Dump-Capture
Here is the guide about how to get the System Log: https://support.yeastar.com/hc/en-us/articles/360007653294-How-to-Get-System-Log