I need to do some OutboundCID manipulation based trunk name and CallerID.
I’m used [macro-dialout-trunk-predial-hook] to put my code in. Caller ID is not a big problem as I used ${CALLERID(number)} to get it. But its a bit unclear how to get the Trunk Name being called. Any advises on this?
However if I try to fit everything in one line it wouldn’t work and return empty line
exten => s,n,Set(the_trunk=${CUT(${OUTNUM}${OUT_${DIAL_TRUNK}_SUFFIX},@,2)})
The CUT function takes variable name as a first argument so I don’t think it will work the way you intend to use.
e.g.
exten => s,1,Set(foo=${CUT(bar,2)}) ; This is correct syntax exten => s,1,Set(foo=${CUT(${bar},2)}) ; This is invalid syntax (unless bar contains the name of another variable)