|
||||
Re: Lookup City based on Caller ID
Quote:
![]() |
This post has been thanked 1 times. |
|
||||
Re: Lookup City based on Caller ID
It shouldn't be too hard to modify the .reg file to make this a little more specific, instead of just showing the state.
ie. 415 isn't the entire state of California, it's mainly just San Francisco & Marin Counties. (see http://www.bennetyee.org/ucsd-pages/area.html or several other lists) My question is, how will this app handle all the extra text? Would it be hard to modify the app to show both the state and area descriptions on separate lines? |
|
||||
Re: Lookup City based on Caller ID
Quote:
Eventually I'd like to just have an external database file that the program will read from... I've been looking around for a good source database (ideally one that has city/state info instead of just state), but the only free one with city/state info that I could find online was: http://www.wcisd.hpc.mil/~phil/npanxx/npanxx99.txt Problem with the above file is that it's from 1999 (and so it's out-of-date). If anyone has suggestions or finds a good database file to use, feel free to post here or PM me... I'd be more than happy to give it a shot. Last edited by auto_exec; 01-15-2009 at 01:26 AM. |
|
||||
Re: Lookup City based on Caller ID
Ah, yeah, using Area code + prefix is way better than what I was proposing. From your '99 list, going up one dir, and clicking one of the links on that page led me to this:
http://www.nanpa.com/reports/reports...es_assign.html Which contains this: http://www.nanpa.com/nanp1/allutlzd.zip Which has all states, area code, prefix, *provider*, and city. Doesn't look too hard to parse either, I may give it a shot if I get some free time today, but of course you'd still have to modify your app to accept it. |
This post has been thanked 1 times. |
|
||||
Re: Lookup City based on Caller ID
Quote:
Update: I also found a similar file for Canada on this page http://www.cnac.ca/co_codes/co_code_status_map.htm, direct link to file is http://www.cnac.ca/data/NPANXX.zip... Last edited by auto_exec; 01-15-2009 at 12:13 PM. Reason: added Canadian file |
|
||||
Re: Lookup City based on Caller ID
awk gets you most of the way there, this is for a CSV output:
cat allutlzd.txt |awk -F"\t" '{print $1","$2","$4","$5}' output is like this: AK ,907-200,"ACS WIRELESS, INC." ,VALDEZ AK ,907-209,"DOBSON CELLULAR SYSTEMS, INC." ,JUNEAU but of course you'll want to modify it to output in .reg format... something like this maybe? Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\HTC\PHONE\AreaCode\] [HKEY_LOCAL_MACHINE\SOFTWARE\HTC\PHONE\AreaCode\\41 5] [HKEY_LOCAL_MACHINE\SOFTWARE\HTC\PHONE\AreaCode\\41 5\343] "Company"="MCI WORLDCOM COMMUNICATIONS, INC., CA" "RateCenter"="SNFC CNTRL" "State"="CA" [HKEY_LOCAL_MACHINE\SOFTWARE\HTC\PHONE\AreaCode\\41 5\344] "Company"="PACIFIC BELL" "RateCenter"="SNFC CNTRL" "State"="CA" Last edited by edraven; 01-15-2009 at 05:56 PM. |
|
||||
Re: Lookup City based on Caller ID
Quote:
![]() |
|
||||
Re: Lookup City based on Caller ID
That'd probably be better, but if you change your mind, I just finished the script. This uses TCL.
#!/usr/bin/tclsh set f [open allutlzd.txt r] puts "Windows Registry Editor Version 5.00" while {[gets $f line] != -1} { set field [split $line "\t" ] set tmp [split [lindex $field 1] -] set state [string trim [lindex $field 0]] set areaCode [string trim [lindex $tmp 0]] set prefix [string trim [lindex $tmp 1]] set company [string trim [lindex $field 3]] regsub -all {"} $company {} company set rateCenter [string trim [lindex $field 4]] #puts "$areaCode $prefix $company $rateCenter $state" if {[regexp {[0-9]{3}} $areaCode]} { puts " \[HKEY_LOCAL_MACHINE\\SOFTWARE\\HTC\\PHONE\\AreaCode \\\\$areaCode\\$prefix\\] \"Company\"=\"$company\" \"RateCenter\"=\"$rateCenter\" \"State\"=\"$state\" " } } close $f |
|
||||
Re: Lookup City based on Caller ID
Quote:
hopefully that makes sense, it just doesnt appear correctly in landscape mode. let me know if i can help! ![]() |
![]() |
|
|
|