I have this situation - my extensions are the three last numbers from the trunk.
I have some trunks like these (external numbers from my provider): 352111, 352112, 352113.
The extensions (internal numbers): 111, 112, 113.
I want to map extension to trunk - when extension 111 dial something to go though trunk 352111.
All solutions I looked use prefixes but I want to do something like in next example but without messing with macros.
Sample config:
exten => _X.,1,NoOp()
exten => _X.,n,Set(LAST="${CALLERID(num)}")
exten => _X.,n,NoOp(${LAST})
exten => _X.,n,Set(CALLERID(all)=352${LAST}<352${LAST}>
exten => _X.,n,Dial(SIP/${EXTEN}@352${LAST})
exten => _X.,n,Hangup()
In the above example if caller is 111 it will go through 352111 SIP trunk without using any prefix in extension.
Thanks for any assistance.