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: 1.1.1.1
I want all calls from that trunk, from that IP to be routed via ROUTE 1

Customer number 2 calls from TRUNK 2 IP: 2.2.2.2 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: 1.1.1.1
So calls from that IP must be sent: 2000 [phonenumber]

However, if IP: 2.2.2.2 tries to send a call with prefix 2000, it will be rejected, since IP 2.2.2.2 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:

[from-trunk-2]
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.