i need to modify the CID before every inbound route for a certain trunk.
How is that possible?
Creating many Custom Contexts is NOT an option.
same => n,ExecIf($["${CALLERID(num):0:3}" = "+49"]?Set(CALLERID(num)=$[0${CALLERID(num):3}]))
same => n,ExecIf($["${CALLERID(num):0:1}" = "+"]?Set(CALLERID(num)=$[00${CALLERID(num):1}]))
CID modifier not possible since we don’t know how the CID is. So it would need to check for both (+49 and 00). Sometimes number only has one 0.
That is why i asked how to run custom code before any inbound Route.
Can you tell me more? Tried that with Dial Restrictions but this is not working INBOUND.
Remember: goal is to it for the whole trunk. Not for every inbound route itself.
Sure, wishlist for dynamic destination sounds good. But again. This would be needed for every inbound-route then. I need it for the whole trunk.
You can still open that wish.
Put the trunk in a custom COS with a custom dialing restrictions. In that dialing restrictions add a custom context, then in the conf file, write a custom dialplan that does a DumpChan. Reload asterisk and see if it gets hit.