I have:
FreePBX behind NAT
Trunk1 to service provider A
Trunk2 to service provider B
Multiple internal extensions
calls from/to Trunk1 works fine.
calls from/to Trunk2 works fine.
Now I change Incoming Route for Trunk1, and set destination to “Misc Destinations”, and set destination dial = mobile number.
Outbound route for this number = via Trunk2.
But now called party see call, but both callers cannot hear each other.
Confirm that if the trunk sends a UDP packet to the public IP e.g. port 12345, it will reach the PBX, even though the PBX hasn’t yet sent one from that port.
Yes, it’s not enough. On a call to Trunk1 answered by (for example) an extension, audio sent by the extension is relayed to the trunk, so audio sent by the trunk appears as ‘replies’ and is passed by the firewall. But on a trunk-to-trunk call, no audio is sent until some is received, but nothing is received because the firewall blocks it until something is sent.
If the firewall is not within your administrative control, you can work around the problem by routing the call to an Announcement, e.g. 1/2 second of silence, and then to the Misc destination. Many other workarounds are possible, but the recommended solution is to forward the RTP port range to the PBX.
My guess would be that you are trying to pass foreign Caller-ID out through a trunk that doesn’t like it - This will often result in a reject of the call - Simple way to test - go into your outbound routes and force the caller-id on the trunk you are trying to outbound on to the trunk caller-id and re-test.
If that is the case, your trunk provider is kind of lame.
If you answer the call and play a recording before forwarding to the outbound number, does the audio work then? If so, the issue is probably as @Stewart1 said in post 1, firewall is blocking inbound RTP.