Lockin customer trunk to take specific route

Dear everybody

How can I force a trunk to route calls via a specific outbound route?

E.g customer calls in, using IP-AUTH on a trunk e.g. IP:
I want all calls from that trunk, from that IP to be routed via ROUTE 1

Customer number 2 calls from TRUNK 2 IP: I want all calls from that trunk to route via ROUTE 2

and the small detail, the PREFIX (e.g. 2000) we have allocated to the trunk, must match with the IP, to be able to do outbound calls.

E.g. prefix 2000 is allocated to IP:
So calls from that IP must be sent: 2000 [phonenumber]

However, if IP: tries to send a call with prefix 2000, it will be rejected, since IP has prefix 2001 allocated

Any help, please?

Not tested, but try this:

In /etc/asterisk/extensions_custom.conf, add two lines for each of these trunks:

exten => _.,1,Goto(from-internal,2000${EXTEN},1)

and set Context for Trunk 2 to from-trunk-2

This will prefix 2000 to calls from Trunk 2 (which should be sent without a prefix).

Thank you very much :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.