Strip incoming CID leading digits in from-analog context

I use the [from-analog] context to apply a fake DID to DAHDI trunks, and that works fine with our regular lines

But have just hooked up a 4G router that outputs (00 + Country Code +Number) in the CID on incoming cellular calls to an analog trunk. I would like to strip off those leading 4 digits, but cannot find a place to insert the appropriate code. In the past with a SIP device, I just used a [from-pstn-custom] entry.

Its not a big deal as I currently force outgoing callers to dial the whole number on this particular trunk, to keep everything consistent, but any suggestions where (not how) to modify this in the dialplan are welcome.

If you have only one Inbound Route for the DID, create a Set CID object. Change CallerID Number to
${CALLERID(num):4}
and set the Destination the same as your present Inbound Route. Then, change the Inbound Route to go to the Set CID.

If you have many routes and the above would be a big hassle, change the context for the 4G trunk to a custom one that you create in /etc/asterisk/extensions_custom.conf .

3 Likes

@Stewart1: Your first suggestion did the trick. Thanks for the quick and concise explanation.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.