Old 07/17/2009, 04:37 AM     Thread Author   #1 (permalink)
Member
 
Join Date: Jul 2009
Posts: 23
Likes: 0
Thanks: 6
Thanked 13 Times in 3 Posts

Default Google Voice Hack

Quote:
Originally Posted by tco-jt View Post
Well thought I'd share this hack as it looks like a highly desirable feature...

In /usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js you can find the dial function. Do a search for "dial: function(number){"

Then a few lines in right after checking if there was a number given I added
[CODE]
if(number.match('^DESIRED_PREFIX')) {
gvnum=GOOGLE_VOICE_NUMBER;
gvpin=PIN_NUMBER;
number=gvnum+'t'+gvpin+'t'+'2'+number.substr(2)+'#';
}
[/CODE]

So swap out DESIRED_PREFIX, GOOGLE_VOICE_NUMBER, and PIN_NUMBER and then whenever you prefix a number with the prefix it'll do the voice prompts and use Google Voice.

Use at your own risk but is simple enough where there shouldn't be any side effect.
This was posted by another member about a month ago but he hasn't been back to elaborate on how someone would go about implementing this hack.

I just got the phone last night but i've already got the sdk and rooted the pre over wifi. I haven't gotten as far as installing ssh or dropbear yet but the process doesn't seem incredibly difficult.

My question is how would i go about safely implementing this hack on my pre.

I do have google voice and would love to be able to automate dialing out from my google voice number at least untill there is an app that'll allow for more features.

I'd appreciate it greatly if someone could give me instructions on how to backup and modify dialpad-assistant.js. I'd also like to know if this modification would survive future updates or would the hack have to be reverted before an update.

Any opinions on the benefits of choosing dropbear over openssh or vice versa would also be appreciated. I'm still debating whether either is neccesary if your on a secured network and don't leave your phone in dev mode.
MrDeeds is offline   Reply With Quote
Thanked By: mamouton
Old 07/17/2009, 07:48 AM   #2 (permalink)
Member
 
Join Date: Sep 2007
Posts: 337
Likes: 0
Thanks: 4
Thanked 53 Times in 31 Posts

Default

Hello,

The first thing you would need to do is backup the files by making a copy of the file or the whole folder to /media/internal/.
linux command:
[code]cp dialpad-assistant.js /media/internal/[/code]

Then you could use vi to edit the dialpad-assistant.js
[code]vi /usr/palm/applications/com.palm.app.phone/app/controllers/dialpad-assistant.js[/code]

Search for "dial: function(number){":
Type / then the string while your in vi then press enter
[code]/dial: function(number){[/code]

About three lines under the above code you will see
[code]if (!number)
return;[/code]

Under this you need to add the code the user provided above.
Put vi into insert mode by pressing the letter i.

and copy and paste the code in under the return;

[code]
if(number.match('^DESIRED_PREFIX')) {
gvnum=GOOGLE_VOICE_NUMBER;
gvpin=PIN_NUMBER;
number=gvnum+'t'+gvpin+'t'+'2'+number.substr(2)+'#';
}
[/code]

change the variables to fit your info
ex.
[code]
if(number.match('^000')) {
gvnum="5605555555";
gvpin="2255";
number=gvnum+'t'+gvpin+'t'+'2'+number.substr(2)+'#';
}
[/code]

Press ESC button to exit insert mode and type

[code]
:wq
[/code]

to write the changes back to the file and quit out of it.
After you have done this reset your phone.. open the phone app
and you should be able to type 000then a phone number you want to call and it will use
google voice to call the number auto.

P.S. I nor Precentral.net are responsible for anything that happens to your phone while preforming any hacks.

Always make sure to backup and the file can be replaced by doing.

[code]
cp /media/internal/dailpad-assistant.js /usr/palm/applications/com.palm.app.phone/app/controllers/
[/code]
atlanta is offline   Reply With Quote
Thanked by mamouton, MrDeeds
Old 07/17/2009, 07:56 AM   #3 (permalink)
Member
 
Join Date: Jun 2009
Posts: 63
Likes: 0
Thanks: 1
Thanked 2 Times in 2 Posts

Default

will try it out, once I get home.
lionsgraphics is offline   Reply With Quote
Old 07/17/2009, 09:20 AM   #4 (permalink)
Member
 
Join Date: Jun 2009
Posts: 79
Likes: 0
Thanks: 57
Thanked 28 Times in 9 Posts

Default

Curious, does this totally replace the number shown? Or does this give you an option to "Dial Out Using Google Voice".

In other words is this all or nothing? Or do I have an option to dial out using regular cell number, and an option to dial out using Google Voice?
derrickonline is offline   Reply With Quote
Old 07/17/2009, 11:01 AM   #5 (permalink)
Member
 
TMed_ATL's Avatar
 
Join Date: May 2009
Location: ATL/ Athens, GA
Posts: 414
Likes: 0
Thanks: 61
Thanked 27 Times in 24 Posts

Default

Quote:
Originally Posted by derrickonline View Post
Curious, does this totally replace the number shown? Or does this give you an option to "Dial Out Using Google Voice".

In other words is this all or nothing? Or do I have an option to dial out using regular cell number, and an option to dial out using Google Voice?

this is what im wondering as well. I just got a invite from google voice last night!
__________________
SCK Manager
TMed_ATL is offline   Reply With Quote
Old 07/17/2009, 11:17 AM   #6 (permalink)
Member
 
Join Date: Jan 2009
Location: Philadelphia
Posts: 73
Likes: 0
Thanks: 6
Thanked 6 Times in 6 Posts

Default

It looks like it will only use google voice if you put a prefix on the number so if you dialed: 222 (xxx) xxx-xxxx it should use gv if you chose 222 as your prefix.

I haven't tried this myself yet, but that's my understanding of the code.
Khidr is offline   Reply With Quote
Old 07/17/2009, 12:17 PM   #7 (permalink)
Member
 
Join Date: May 2009
Posts: 987
Likes: 0
Thanks: 72
Thanked 124 Times in 86 Posts

Default

Hrmm, this looks interesting. I haven't rooted my pre yet, but if a GV app isnt on the horizon I may just root it to give this a try.
gabbott is offline   Reply With Quote
Old 07/17/2009, 01:09 PM   #8 (permalink)
Member
 
Join Date: Sep 2007
Posts: 337
Likes: 0
Thanks: 4
Thanked 53 Times in 31 Posts

Default

Quote:
Originally Posted by derrickonline View Post
Curious, does this totally replace the number shown? Or does this give you an option to "Dial Out Using Google Voice".

In other words is this all or nothing? Or do I have an option to dial out using regular cell number, and an option to dial out using Google Voice?
No it doesnt totally replace your number, what you would do like Khidr said.. you would dail for instance on the dailpad, press 222 then the phone number you want to call and the hack will know you want to call out using your google number it will call your google number put in yuor pin and dail the number you want to call.
atlanta is offline   Reply With Quote
Old 07/17/2009, 01:11 PM   #9 (permalink)
Member
 
Join Date: Sep 2007
Posts: 337
Likes: 0
Thanks: 4
Thanked 53 Times in 31 Posts

Default

Looks like i would be able to make a edit on the main phone app to add a button to so you can just tap it and call out using your google voice number.
atlanta is offline   Reply With Quote
Old 07/17/2009, 01:22 PM   #10 (permalink)
Member
 
Join Date: Jun 2009
Location: Utah
Posts: 70
Likes: 0
Thanks: 17
Thanked 2 Times in 2 Posts

Default

I have a quick question. Does this simply change the number you dial out with or is there something more it. I ask because I had to switch from my 3000 minutes to 450. Would dialing using the google voice number not count against my minutes? That would make this hack invaluable.
ms2474 is offline   Reply With Quote
Old 07/17/2009, 01:32 PM   #11 (permalink)
Member
 
Join Date: Sep 2007
Posts: 337
Likes: 0
Thanks: 4
Thanked 53 Times in 31 Posts

Default

Yea it just edits the number you are dailing.... The only way i could see it working as you want if you have the Sprint 5 free number dailing thing on your account. but other than that it will still use your mins. Im looking into making an app which will send a ajax request to google and it will call your phone would have been lovely for when i had free incoming.
atlanta is offline   Reply With Quote
Old 07/17/2009, 04:38 PM     Thread Author   #12 (permalink)
Member
 
Join Date: Jul 2009
Posts: 23
Likes: 0
Thanks: 6
Thanked 13 Times in 3 Posts

Default

I just tried this and it doesn't attempt to dial out, i just get a beeping tone.

Quote:
if(number.match('^000')) {
gvnum="5605555555";
gvpin="2255";
number=gvnum+'t'+gvpin+'t'+'2'+number.substr(2)+'#';
}
I put all the numbers in without quotes then tried again with quotes and it still doesn't attempt to dial.

I'm going to go back again and try to use a prefix other than 000.

Any suggestions would be great.

Thanks again to atlanta for the info.
MrDeeds is offline   Reply With Quote
Old 07/17/2009, 05:07 PM   #13 (permalink)
Member
 
sushi's Avatar
 
Join Date: Jul 2009
Posts: 159
Likes: 0
Thanks: 15
Thanked 15 Times in 10 Posts

Default

Be aware that you are leaving your pin in plaintext. So if you, like many, use the same pin everywhere, you should consider changing it for Google Voice if you decide to use this method.
sushi is offline   Reply With Quote
Old 07/17/2009, 05:57 PM   #14 (permalink)
Member
 
sushi's Avatar
 
Join Date: Jul 2009
Posts: 159
Likes: 0
Thanks: 15
Thanked 15 Times in 10 Posts

Default

Just tried this out and it doesn't work quite right. It's adding extra characters after the phone number is dialed.
sushi is offline   Reply With Quote
Old 07/17/2009, 06:06 PM     Thread Author   #15 (permalink)
Member
 
Join Date: Jul 2009
Posts: 23
Likes: 0
Thanks: 6
Thanked 13 Times in 3 Posts

Default

I got this to work but only after changing the prefix to something other than 000.
MrDeeds is offline   Reply With Quote
Old 07/17/2009, 08:35 PM   #16 (permalink)
Member
 
Join Date: Jun 2009
Posts: 30
Likes: 0
Thanks: 0
Thanked 6 Times in 4 Posts

Default

I tried this hack and used the prefix 222. It does not dial the number I give right. What did you use for a prefix to make it work? Did you use the exact code on from the thread or did you make changes from what is posted?

- Garrett
garrettwp is offline   Reply With Quote
Old 07/17/2009, 09:37 PM   #17 (permalink)
Member
 
Join Date: Jun 2009
Posts: 32
Likes: 0
Thanks: 1
Thanked 8 Times in 4 Posts

Default

Quote:
Originally Posted by atlanta View Post
Looks like i would be able to make a edit on the main phone app to add a button to so you can just tap it and call out using your google voice number.
I would be pretty interested in this versus dialing a different prefix each time. Or a partial clone of the phone app gui(diff icon to click), except to dial from gv
johntash is offline   Reply With Quote
Old 07/17/2009, 09:38 PM     Thread Author   #18 (permalink)
Member
 
Join Date: Jul 2009
Posts: 23
Likes: 0
Thanks: 6
Thanked 13 Times in 3 Posts

Default

Quote:
Originally Posted by garrettwp View Post
I tried this hack and used the prefix 222. It does not dial the number I give right. What did you use for a prefix to make it work? Did you use the exact code on from the thread or did you make changes from what is posted?

- Garrett
Sorry, i should have clarified. I was able to get it to work with 444, but it isn't functioning as it should. That leads me to believe the person that originally posted it didn't or wasn't able to test it out.

I also can't say for sure if the prefix was my sole issue because i also deleted a blank line, so that might have been the issue.

It doesn't get a chance to log into google voice because of the message that lets you know how many voicemails you currently have.

So there needs to be a longer delay before the gv password is entered.

I'm experimenting now and i'll report back if i have any progress.

If someone knows what strings should be fixed so we can add a delay in the dialing process, that would be great.
MrDeeds is offline   Reply With Quote
Old 07/17/2009, 10:16 PM   #19 (permalink)
Member
 
Join Date: Jun 2009
Posts: 109
Likes: 0
Thanks: 9
Thanked 31 Times in 25 Posts

Default

Quote:
Originally Posted by MrDeeds View Post
Sorry, i should have clarified. I was able to get it to work with 444, but it isn't functioning as it should. That leads me to believe the person that originally posted it didn't or wasn't able to test it out.

I also can't say for sure if the prefix was my sole issue because i also deleted a blank line, so that might have been the issue.

It doesn't get a chance to log into google voice because of the message that lets you know how many voicemails you currently have.

So there needs to be a longer delay before the gv password is entered.

I'm experimenting now and i'll report back if i have any progress.

If someone knows what strings should be fixed so we can add a delay in the dialing process, that would be great.
I have not performed this hack, but the timed pause is from the 't' strings being added in the number string. I would suggest adding more 't' in order to increase the delay between the google number and the pin.

hope this helps... plee3
plee3 is offline   Reply With Quote
Old 07/17/2009, 11:26 PM   #20 (permalink)
Member
 
Join Date: May 2009
Posts: 1
Likes: 0
Thanks: 0
Thanked 1 Time in 1 Post

Default

Just wanted to point out that the code listed above is hard coded to use a 2-digit prefix. If you try to use a prefix that is not 2-digits, you will have a problem with the number that is passed to Google Voice (assuming the timing issue mentioned above is also corrected).

Here's an alternative that doesn't hard code the length:
[CODE]
gvprefix = 'DESIRED_PREFIX';
if(number.match('^'+gvprefix)) {
gvnum=GOOGLE_VOICE_NUMBER;
gvpin=PIN_NUMBER;
number=gvnum+'t'+gvpin+'t'+'2'+number.substr(gvprefix.length)+'#';
}
[/CODE]

NOTE: this code does NOT address the issue that others mentioned about pausing longer before entering the PIN. I don't have a Pre so I can't test that out...

Last edited by silentShab; 07/17/2009 at 11:29 PM. Reason: see note
silentShab is offline   Reply With Quote
Thanked By: sushi

 

Content Relevant URLs by vBSEO 3.6.0