TIL: on #Asterisk, the variable "${CALLERID(num):0:8}" is needed to snag the first 8 digits of a caller ID from #Voipfone in format NNNNNNNN*ext where NNNNNNNN is the account number and ext is the Voipfone extension. (I am using the account number to distinguish multiple Voipfone accounts arriving at this box)

I'd expected this to be :0:7 like anything else with a zero index into the string, but it doesn't work quite like that! Had me cursing for some time..

https://wiki.asterisk.org/wiki/display/AST/Manipulating+Variables+Basics

Manipulating Variables Basics - Asterisk Project - Asterisk Project Wiki

@vfrmedia cut would be a decent function to consider there as well.