[add-cid-to-whitelist]
exten => s,1,Noop(Entering user defined context [add-cid-to-whitelist] in extensions_custom.conf)
exten => s,n,set(name=${STRREPLACE(CALLERID(name),\,)}) ; remove commas from name before passing as agi arg
exten => s,n,AGI(lgaetz-cmadd.php,${CALLERID(number)},${name})
exten => s,n,Return
And I’ve noticed it seems to be stripping preceding '0’s sometimes? Any idea why?
I’ve tested and don’t have issues adding numbers with leading zeros. Depending on where you got the sample dialplan, you may see where I’ve normalized the phone number to 10 digits for consistency here in North America, in which case you will see the var referenced like this:
${CALLERID(number):-10}
If you don’t want to do this, you would need to delete the :-10
Thansk Lorne - we have 11 digit numbers here in the UK on the whole, but there are definitely exceptions as you’d expect for a telephone network as old as ours.
There’s NO mention of ${CALLERID(number):-10} in my extensions_custom.conf, so I’ll have to see if I can find anywhere else in the system where ${CALLERID(number):-10} is being set.
Really can’t think where, though! It’s interesting to note that with most numbers this isn’t happening, it SEEMS to be creeping in via the “add dialled CID” code rather than via the calls which pass the Turing test. They seem to be allowed to keep their 0s.
Happy to post the entire extension_custom if it would be thought to be useful.
It’s only a waste if you come back next week with the same question. Otherwise it’s one more step on the learning curve. Plus you might just save someone from posting the same question in the future.