PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Windows Mobile > Windows Mobile Software
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 12-30-2008, 02:20 AM
auto_exec's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Threadstarter
Location: Chicago
 
Join Date: Jul 2007
Posts: 97
Reputation: 90
auto_exec is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by briggs View Post
quick question:

Will this area code database work for canada as well? This would be a nice feature for my diamond.

Also, if I have a dialer skin installed, will they interfer with each other?

Thanks

<EDITED>: Didn't realize other area codes were included, see my post below. Canada will work.


This shouldn't interfere with dialer skins at all, as it's a standalone app that gets triggered based on incoming/outgoing communications.

Last edited by auto_exec; 12-30-2008 at 02:41 AM.
Reply With Quote
  #22 (permalink)  
Old 12-30-2008, 02:39 AM
auto_exec's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Threadstarter
Location: Chicago
 
Join Date: Jul 2007
Posts: 97
Reputation: 90
auto_exec is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by auto_exec View Post
Hmm.. by default, this won't work for Canada.. it should pop up with "State: Area code not found." for anything not in the reg file I attached in the first post (since the reg file I've attached only has the US area codes/states cross-referenced). That said, if you were to add new String values in that same key (HKLM/Software/HTC/PHONE/AreaCode) with Name = 3-digit area code and String = area, it should read it with no problem.

If you could point me to a website or listing of area codes to areas, I could probably get that set up in a reg file ready for import... I'll do some looking around on my own as well, maybe I can build my own listing of area codes, etc, to cover more places if I have time.

This shouldn't interfere with dialer skins at all, as it's a standalone app that gets triggered based on incoming/outgoing communications.
I was wrong! Looking at the reg file, it DOES have Canadian area codes. Should be all good!
Reply With Quote
This post has been thanked 1 times.
  #23 (permalink)  
Old 01-15-2009, 01:10 AM
edraven's Avatar
Lurker
Offline
Pocket PC: Touch Pro
Carrier: Sprint
 
Join Date: Aug 2007
Posts: 16
Reputation: 5
edraven is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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?
Reply With Quote
  #24 (permalink)  
Old 01-15-2009, 01:23 AM
auto_exec's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Threadstarter
Location: Chicago
 
Join Date: Jul 2007
Posts: 97
Reputation: 90
auto_exec is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by edraven View Post
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?
I'd actually started researching this a bit after I first posted... looked at the NANPA database, etc... if we could find a good list with reasonable patterned descriptions (i.e. a description that would be easily parse-able), it wouldn't be hard to update the app... I was planning on removing the "Unknown number" line at the top of the form (since it's somewhat redundant as your incoming call screen shows it anyways) and maybe just making it a one-liner with the state/area info.

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.
Reply With Quote
  #25 (permalink)  
Old 01-15-2009, 11:41 AM
edraven's Avatar
Lurker
Offline
Pocket PC: Touch Pro
Carrier: Sprint
 
Join Date: Aug 2007
Posts: 16
Reputation: 5
edraven is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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.
Reply With Quote
This post has been thanked 1 times.
  #26 (permalink)  
Old 01-15-2009, 12:04 PM
auto_exec's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Threadstarter
Location: Chicago
 
Join Date: Jul 2007
Posts: 97
Reputation: 90
auto_exec is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by edraven View Post
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.
Great catch! I was on the NANPA site, but somehow I missed this page... I can probably try to incorporate this file/data when I get home from work today... shouldn't be too hard. Maybe I can even add settings options where you can choose what you want displayed (i.e. state only, city/state, city/state/provider).


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
Reply With Quote
  #27 (permalink)  
Old 01-15-2009, 05:39 PM
edraven's Avatar
Lurker
Offline
Pocket PC: Touch Pro
Carrier: Sprint
 
Join Date: Aug 2007
Posts: 16
Reputation: 5
edraven is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by edraven View Post
Doesn't look too hard to parse either
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.
Reply With Quote
  #28 (permalink)  
Old 01-15-2009, 06:11 PM
auto_exec's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Threadstarter
Location: Chicago
 
Join Date: Jul 2007
Posts: 97
Reputation: 90
auto_exec is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by edraven View Post
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"
Actually I was just thinking of leaving it in a physical file that would install in the pgm directory... the program would then parse through the file to find required info... this way people dont have to mess with their registry, and they can update the file if they need to/want to...
Reply With Quote
  #29 (permalink)  
Old 01-15-2009, 06:43 PM
edraven's Avatar
Lurker
Offline
Pocket PC: Touch Pro
Carrier: Sprint
 
Join Date: Aug 2007
Posts: 16
Reputation: 5
edraven is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
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
Reply With Quote
  #30 (permalink)  
Old 01-23-2009, 12:44 PM
joeykrim's Avatar
N00b
Offline
Pocket PC: htc evo 3d
Carrier: sprint
Location: nyc
 
Join Date: Jan 2009
Posts: 49
Reputation: 145
joeykrim is keeping up the good workjoeykrim is keeping up the good work
Mentioned: 1 Post(s)
Tagged: 0 Thread(s)
Re: Lookup City based on Caller ID

Quote:
Originally Posted by auto_exec View Post
Actually I was just thinking of leaving it in a physical file that would install in the pgm directory... the program would then parse through the file to find required info... this way people dont have to mess with their registry, and they can update the file if they need to/want to...
i really like this program. i hope you can make the update to remove the unknown caller line since it is redundant. also one bug ive found is on the touch pro, when i have the keyboard slide out the screen is in landscape mode. when i receive a text or call from an unknown caller in landscape mode it doesnt appear correctly on the screen. it makes a small rectangular box. when i put the keyboard back in, whether during the call or 10 min later, and the screen changes to portrait mode the program then pops up with the information and i have to hit hide.

hopefully that makes sense, it just doesnt appear correctly in landscape mode. let me know if i can help!
Reply With Quote
Reply

  PPCGeeks > Windows Mobile > Windows Mobile Software


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 06:07 PM.


Powered by vBulletin® ©2000 - 2025, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com