webOS Nation Forums >  webOS apps and software >  webOS development > HOWTO - Show STATE location of U.S. numbers for Incoming and Outgoing Calls (and log)
HOWTO - Show STATE location of U.S. numbers for Incoming and Outgoing Calls (and log)

  Reply
 
LinkBack Thread Tools Display Modes
Old 07/09/2009, 03:25 AM   #1 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default HOWTO - Show STATE location of U.S. numbers for Incoming and Outgoing Calls (and log)

UPDATE 10-08-2009 - This patch is now available through webOS quick installer under the patch repositories - its also available using preware w/ the patch repository!! USE THE REMOVE COMMAND / SCRIPT BELOW TO REMOVE THIS PATCH BEFORE APPLYING THE ONE FROM THE REPOSITORY!

- UPDATE 09-29-2009 - UPDATED AND CERTIFIED FOR Palm WebOS v1.2.1

THIS HOWTO IS CERTIFIED FOR WEBOS v1.2.0 - DO NOT USE THIS FOR OLDER VERSIONS OF WEBOS!

This HOWTO requires that you already have root access to your phone. If you need more information on how to do that search the forum.

Click Here to search for my HOWTO's and Answers for the Palm PRE!

Notes:
While working on a few other HACKS I came across a file that contained all the area-codes and their corresponding U.S. states in a function. It looks like the PALM Devs had this in there before, or they are working to include it in the future. I'm too impatient to wait so here is a method to get this now. What I did here is add the STATE name where it was possible to fit it in the caller-id, missed call pop-up, missed call notification, call log, and outgoing call display. This works with unknown numbers, because I usually know where someone in my contacts is located and don't need it for those.

I have attached some screen-shots from the Pre to this post (Numbers distorted for their protection).

I'll try to make this as simple as possible.

1. Login to your Palm PRE and obtain root access.. (Again look around the forums to see how to do this)

2. Once you are at the "root@castle" prompt COPY and PASTE all of the following code into your terminal / putty / ssh window.. (These commands will make backup copies of the original files, then modify them)


** This will reboot your PRE so be sure to close all of your applications beforehand. **
Code:
# DISPLAY STATE FOR UNKNOWN CALLERS
#
mount -o remount,rw /
#
# RESTORE FILES
# 
echo RESTORING ORIGINAL FILES IF AVAILABLE
cp /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
#
# BACKUP FILES
#
echo BACKING UP ORIGINAL FILES
cp /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js_1-1-0
cp /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js_1-1-0
#
# MAKE MODIFICATIONS TO incomingcall-assistant.js
#
echo MAKING MODIFICATIONS TO incomingcall-assistant.js
sed -i "s/name = Messages.unknownCaller;/name = RegionLookup.regionFromPhoneNumber(number);/g" /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
#
# MAKE MODIFICATIONS TO calllog-assistant.js
#
echo MAKING MODIFICATIONS TO calllog-assistant.js
sed -i "s/item.label = '';/item.label = RegionLookup.regionFromPhoneNumber(item.number);/g" /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
#
# MAKE MODIFICATIONS TO announcer-assistant.js
#
echo MAKING MODIFICATIONS TO announcer-assistant.js
sed -i "s/call.displayName = FormatPhoneNumber(number);/call.displayName = FormatPhoneNumber(number);\n\
                        var message = Messages.contactWithLabel;\n\
                        call.displayName = new Template(message).evaluate({\"contact\":call.displayName, \"label\":RegionLookup.regionFromPhoneNumber(number)});/g" /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
#
# MAKE MODIFICATIONS TO missedcall-assistant.js
#
echo MAKING MODIFICATIONS TO missedcall-assistant.js
sed -i "s/this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted  : \"\");/this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted  : RegionLookup.regionFromPhoneNumber(number));/g" /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
#
# MAKE MODIFICATIONS TO FormattedCall.js
#
echo MAKING MODIFICATIONS TO FormattedCall.js
sed -i "s/this.displayLabel = (callMsg\[lineNumber\].contact.labelFormatted ? callMsg\[lineNumber\].contact.labelFormatted : \"\");/this.displayLabel = (callMsg\[lineNumber\].contact.labelFormatted ? callMsg\[lineNumber\].contact.labelFormatted : RegionLookup.regionFromPhoneNumber(callMsg\[lineNumber\].number));/g" /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
#
# COMPLETE UPDATE
#
mount -o remount,ro /
echo INSTALLATION COMPELTE... REBOOTING DEVICE...
/sbin/reboot
#
Good luck!

( TO RESTORE ORIGINAL FUNCTION )
- If you ever need to recover your original files and set the PRE back to its defaults you can use the following:

** This will reboot your PRE so be sure to close all of your applications beforehand. **
Code:
mount -o remount,rw /
#
# RESTORE FILES
# 
echo RESTORING ORIGINAL FILES IF AVAILABLE
cp /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
cp /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js_1-1-0 /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
#
mount -o remount,ro /
echo INSTALLATION COMPELTE... REBOOTING DEVICE...
/sbin/reboot
#
Enjoy!

-D2G

- WEBOS VERSION CHANGELOG -

- v1.2.0 -
No Changes!

- v1.1.0 -
/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js - variable name changed from entry.label to item.label in replacement string.

- v1.0.4 - FIRST HOWTO CREATED
-
Attached Images
File Type: jpg call-log-1.jpg (101.5 KB, 924 views) Email Attachment
File Type: jpg incoming-call-1.jpg (80.5 KB, 822 views) Email Attachment
File Type: jpg missed-call-alert-1.jpg (101.9 KB, 602 views) Email Attachment
File Type: jpg missed-call-popup-1.jpg (72.2 KB, 597 views) Email Attachment
File Type: jpg outgoing-call-1.jpg (57.8 KB, 619 views) Email Attachment

Last edited by d2globalinc; 10/08/2009 at 12:56 PM. Reason: added extra space after reboot command.
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 09:28 AM   #2 (permalink)
Member
 
Join Date: Apr 2009
Location: Boston
Posts: 212
Likes Received: 0
Thanks: 30
Thanked 31 Times in 19 Posts
Default

*** just happened to this post?
en0x is offline   Reply With Quote
Old 07/09/2009, 09:30 AM   #3 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Good Question.. It may need to be moderated? I did an update - it showed it saved, and then its not available now after I went back into forums..
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 09:30 AM   #4 (permalink)
Member
 
hmagoo's Avatar
 
Join Date: Jun 2009
Location: Palm Desert, CA
Posts: 249
Likes Received: 1
Thanks: 38
Thanked 47 Times in 22 Posts
Default

really nice hack, quick and easy.

to make it more drawn out and less easy, you could allude to the backup script posted in the pre dev wiki "Modifying Stock Apps" for backing up the relevant files.

predev.wikidot.com stock-application-mods

yeah, I know what I just said, but..

Last edited by hmagoo; 07/09/2009 at 09:41 AM.
hmagoo is offline   Reply With Quote
Old 07/09/2009, 09:34 AM   #5 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

OK - So It must be my security access to the forums.. My posts seem to keep needing to be moderated since I'm New to these forums..
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 09:37 AM   #6 (permalink)
Member
 
Join Date: Apr 2009
Location: Boston
Posts: 212
Likes Received: 0
Thanks: 30
Thanked 31 Times in 19 Posts
Default

tat sucks :S I want the post back so I can mod my pre!
en0x is offline   Reply With Quote
Old 07/09/2009, 09:53 AM   #7 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Its Back! - Happy Hacking!
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 10:03 AM   #8 (permalink)
Editor Emeritus
 
Dieter Bohn's Avatar
 
Join Date: Feb 2001
Location: Sunnyvale, CA
Posts: 4,872
Likes Received: 6
Thanks: 290
Thanked 1,362 Times in 360 Posts
Default

sorry guys -- the auto-moderation spam detector is getting a little wacky on us today.
__________________
Dieter Bohn is offline   Reply With Quote
Old 07/09/2009, 10:05 AM   #9 (permalink)
Member
 
Join Date: Apr 2009
Location: Boston
Posts: 212
Likes Received: 0
Thanks: 30
Thanked 31 Times in 19 Posts
Default

for those ppl who don't like to execute this script i made a patch

http://wklej.org/id/118622/txt

en0x is offline   Reply With Quote
Thanked By: mfive
Old 07/09/2009, 10:14 AM   #10 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by en0x View Post
for those ppl who don't like to execute this script i made a patch
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 10:17 AM   #11 (permalink)
Member
 
andidendel's Avatar
 
Join Date: Jan 2007
Location: Fort Worth
Posts: 168
Likes Received: 0
Thanks: 149
Thanked 101 Times in 89 Posts
Default

Thanks d2globalinc! I couldn't believe Palm left this out. Now all is [almost] right with the world...
andidendel is offline   Reply With Quote
Old 07/09/2009, 10:28 AM   #12 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by andidendel View Post
Thanks d2globalinc! I couldn't believe Palm left this out. Now all is [almost] right with the world...
I agree! I was looking over the phone apps code because I wanted to put this feature in myself, and then stumbled upon their file that already had the function and areacode to state data.. I felt like I hit the jackpot at the casino..

- D2G
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 10:32 AM   #13 (permalink)
Member
 
Leke's Avatar
 
Join Date: Jan 2007
Posts: 602
Likes Received: 0
Thanks: 8
Thanked 59 Times in 36 Posts
Default

Maybe a future firmware update would have unlocked this feature?
Leke is offline   Reply With Quote
Old 07/09/2009, 10:37 AM   #14 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by Leke View Post
Maybe a future firmware update would have unlocked this feature?
Thats my guess as well - but I'm impatient and have to have it... well.. Like yesterday! :P

I see lots of hints of things to come in the code - so I'm very excited to see what is going to come down the line in the future..

-D2G
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 10:38 AM   #15 (permalink)
Member
 
Join Date: Apr 2008
Posts: 259
Likes Received: 0
Thanks: 8
Thanked 64 Times in 30 Posts
Default

d2globalinc -- I want to thank you for not only putting this out there, but actually taking the time to condense it into one simple easy-to-run script that works out of the box. Well done.
xcomputerman is offline   Reply With Quote
Old 07/09/2009, 10:39 AM   #16 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by xcomputerman View Post
d2globalinc -- I want to thank you for not only putting this out there, but actually taking the time to condense it into one simple easy-to-run script that works out of the box. Well done.
No problem - in fact - I have a few others that are already out there that use this same script format and will post them shortly!

-D2G
d2globalinc is offline   Reply With Quote
Old 07/09/2009, 10:57 AM   #17 (permalink)
Member
 
Mitalis's Avatar
 
Join Date: Apr 2009
Posts: 186
Likes Received: 0
Thanks: 19
Thanked 11 Times in 9 Posts
Default

Ok I just made my attempt to do this, by copying in all the code and executing it. Phone rebooted.. Attempted to make a call and I don't see the state appearing.. What I do see is the type of number appearing: Home, Mobile, Work, etc... But that's always been there. So not sure what I did wrong....
Mitalis is offline   Reply With Quote
Old 07/09/2009, 10:58 AM   #18 (permalink)
Member
 
DNic's Avatar
 
Join Date: Jun 2009
Posts: 599
Likes Received: 0
Thanks: 174
Thanked 44 Times in 34 Posts
Default

Seems to work only in some instances. For example VM shows the state, but if I call someone from my contacts list it shows mobile, home, etc. However if I call a number not in my contacts it shows the state.
DNic is offline   Reply With Quote
Old 07/09/2009, 11:00 AM   #19 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by Mitalis View Post
Ok I just made my attempt to do this, by copying in all the code and executing it. Phone rebooted.. Attempted to make a call and I don't see the state appearing.. What I do see is the type of number appearing: Home, Mobile, Work, etc... But that's always been there. So not sure what I did wrong....
This modification only shows the STATE for any number that is NOT in your contacts.. So any number calling or being called that is not in your contacts it will get the area code and display the U.S. State.. I figured we already know usually the state our contacts our in - so in order to not remove any functionality that's already in there we just do numbers we don't have contacts for..

-D2G
d2globalinc is offline   Reply With Quote
Thanked By: Mitalis
Old 07/09/2009, 11:02 AM   #20 (permalink)
Member
 
d2globalinc's Avatar
 
Join Date: Mar 2008
Posts: 105
Likes Received: 0
Thanks: 2
Thanked 243 Times in 42 Posts
Default

Quote:
Originally Posted by DNic View Post
Seems to work only in some instances. For example VM shows the state, but if I call someone from my contacts list it shows mobile, home, etc. However if I call a number not in my contacts it shows the state.
I'll look into adding a display for numbers already in contacts.. But in order to not eliminate other information or go through and expand display area's it just look's up the state for numbers you don't have or know (ie. not in your contacts).
d2globalinc is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes


LinkBacks (?)
LinkBack to this Thread: http://forums.webosnation.com/webos-development/191758-howto-show-state-location-u-s-numbers-incoming-outgoing-calls-log.html
Posted By For Type Date
Pre Central: There's a Patch For That! (Part 2) | Best Buy Mobile: everything mobile - every point of view This thread Refback 05/11/2010 02:35 PM


 


Content Relevant URLs by vBSEO 3.6.0