I am looking for a way to remove all but the final 4 digits on an inbound call and pass that on to another trunk connected to the system. The catch is that the call has to be only numbers in a specific inbound route, and not all numbers from the originating trunk. The primary inbound trunk receives all of the calls for the system, and I would like to leave everything untouched except for any numbers matching specific routes.
I was able to hack together something that seems to be working, an inbound route pointed at a custom destination of from-trunk,${FROM_DID:-4:4},1 which is caught by a second inbound route based on what the final 4 digits are. This seems like the completely wrong way to do things even if it does work, and I’d love to know if there is a cleaner way to do this.