Force trunk to use specific route

Hello, I have two sip trunks both are connected to grandstream FXO gateway each.

When a call arrive from trunk A, I need to ring the extension 200, but when a call arrive from trunk B I need to ring the extension 220.

I am trying to find the way to force a trunk to use a specific route, but with no successs :frowning:

Any idea?

Thanks!

In the outbound route you can specify a CID of the extension. That allows you to build routes for each extension or group of extensions.

but my problem is with incoming calls.
I need that an incoming call arriving from a specific sip trunk be routed to extension X, the call can have any CID so, I can’t use CID to match route, I need to use the trunk, but the inbound route does not has a “trunk maching” field

You want to match on the DID in your inbound route. The DID is normally the telephone number associated with the trunk and is often defined in the trunk registration string. If you don’t quite understand that, I’ll refer you to this document:

http://www.freepbx.org/support/documentation/howtos/how-to-get-the-did-of-a-sip-trunk-when-the-provider-doesnt-send-it-and-

Note especially the second paragraph - the “yourDIDnumber” in the example shown is the DID you’d use in your inbound route.