[Asterisk-Users] Problem with CallerIDNum

Bart Fisher bhfisher at icpage.com
Fri Nov 11 15:19:22 MST 2005


I've been jacking with this for a while but don't understand all that I'm reading...

The problem is sometimes I get ANI II digits from the phone company.  These will be two digits that prefix ANI - so some callerid might arrive as only "00" or  "007147391234", "00714", "714"  or normal "7147391234".  

The prefix digits I get are "00", "23", "61", "62", "63" - see http://www.nanpa.com/number_resource_info/ani_ii_assignments.html for info on ANI II digits.

I need a script deals with this by normalizes the ANI as received at the beginning of the call. 

What I would like to do is ( ANI = ${CALLERIDNUM}  ):

if the ANI is a 10 digit number - do noting

if ANI is greater than 10 digits and the first two digits are one of these: "00", "23", "61", "62", "63" or might be others not found yet  - Then strip the first two digits and make CALLERIDNUM = corrected ANI

if ANI is less than 10 digit and the first two digits are one of these: "00", "23", "61", "62", "63" or might be others not found yet  - then strip these digits and make CALLERIDNUM = corrected ANI

I was wondering if you could show me an example of how you would do this? 

TIA

Bart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051111/4d4567e2/attachment.htm


More information about the asterisk-users mailing list