EspaceNetworks/pygooglevoice

Login, sms okay - call fails with validation error

cleidigh opened this issue · 19 comments

hoping this repo is the latest and greatest...

I can login okay and send an SMS successfully.
when I try to use the CLI gvoice utility to make a call , I get a validation error.

any issues or set up I could investigate?

thanks

Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\googlevoice\voice.py", line 156, in call
'remember': '1'
File "C:\Python27\lib\site-packages\googlevoice\voice.py", line 287, in __validate_special_page
load_and_validate(self.__do_special_page(page, data))
File "C:\Python27\lib\site-packages\googlevoice\util.py", line 65, in load_and_validate
validate_response(loads(response.read()))
File "C:\Python27\lib\site-packages\googlevoice\util.py", line 59, in validate_response
raise ValidationError('There was a problem with GV: %s' % response)
googlevoice.util.ValidationError: There was a problem with GV: {u'data': {u'code': 1}, u'ok': False}

@cleidigh
Try this,

  1. open a browser tab,
  2. Log into the relevant GVoice account:
    https://accounts.google.com
  3. Then visit this URL:
    https://accounts.google.com/displayunlockcaptcha
  4. It will say:

Allow access to your Google account

As a security precaution, Google may require you to complete this additional step when signing into a new device or application.

To allow access, click the Continue button below.
Continue

  1. Click the Continue button
  2. Now run gvoice again. It should login just fine.
  3. Post back here and report your results.

@chris001
Thanks for the quick response !

I don't have a problem logging in, that works and I can send an SMS after logging in successfully.

When I try executing a call that's when I get the validation error.
I tried the display unlock anyway still getting the same error as above.

Thanks for clarifying! I was able to verify this bug, validation error. Use this mainly for sending SMS texts, so the call part hasn't been updated to work with the new GVoice. Will need to take a closer look at this.

@chris001
As a disabled person trying to make this work with Python/DragonVoice it's really important.
Skype stopped working for me.

I would be glad to help if you can point me to the possible code points. I've done a little bit of poking around but not much. can we capture the post from the chrome debugger?

I'm also concerned this related to the fact that Google is retiring Googlehangouts API
I'm wondering if maybe the only support messages now through the API.

@cleidigh

I'm also concerned this related to the fact that Google is retiring Googlehangouts API

No, GHangouts API was retired a year ago. Different API.

I would be glad to help if you can point me to the possible code points.

  • Sure, you're totally welcome to read thru the code and submit a PR. The code expects to receive certain data, which it's not receiving, probably due to changes on the GV side. It can be fixed.
  • Another great way to help, is to share this link on your social networks: https://www.gofundme.com/espacenetworks-pygooglevoice

you could try https://github.com/techno-express/minigooglevoice it's an web/php project app base on my fork https://github.com/techno-express/pygooglevoice, see if it can work for you. I made a few changes added some, most of CLI gvoice are individual python calls that can be used in a php project. i can make outgoing calls directly from the page.

@cleidigh
I've looked into this further, and am confident having found the cause of the error you were facing.
The error occurred (95% likely) because you haven't yet configured your "forwarding phone" number in the web interface, and validated it.

A "forwarding phone" (in GV terminology) is a real phone number which rings a real device you own, such as a cell phone, home land line, work phone number, etc.

The way you add and validate your "forwarding phone" is, log into the Google Voice web interface ( voice.google.com ), click Settings, Phones, Add a phone. GV will send you an SMS text message containing a code number, or if you prefer, it will robo call you and speak the validation code number to you. Just enter the validation code into the GV web interface, It should say, success.

You're now good to go. Run gvoice from the command line, use the call command to call a number, and select the label you assigned to the "forwarding phone" you just added, ("Home", "Mobile", "Work", etc), and GV will connect the two phones together, by means of ringing both numbers. You answer your phone, and the other party answers their phone.

Thanks for your feedback, and thanks for using ESPACEnetworks PyGoogleVoice.

Give it a try, and post back your results here.

@chris001
@techno-express

Thanks, I am crossposting this since both of you are helping me.

BTW my cell phone is registered but the problem is with the Google voice number.

The +1 on the forwarding number does make a difference. The problem is when trying to use the Google voice number as the forwarding number. I want to do a direct call from the Windows PC using the command line or Python (or anything else on the desktop) application to any arbitrary number without calling through the cell phone
which I cannot use since I am disabled.

In the examples below:

4019656105 - Mobile phone
4018304055 - My Google voice number
4015213770 - normal landline phone

The following works but the initial call is placed with the cell phone - useless to me
Python gvcall.py cleidigh@Gmail.com [password] 4015213770 +14019656105 2

The following fails when trying to use the Google voice number to call out - this is what I want
Doing this combination of numbers does work in Chrome on the Google voice page.

Python gvcall.py cleidigh@Gmail.com [password] 4015213770 +14018304055 9

in order to make the above work there has to be both microphone and speaker support within the Google voice Python module and there would have to be follow-on code after the call is dialed
to support the call duration. I don't see anything the library that implies that type of support.
maybe this is only possible through the Google voice Web interface?

Need to get freepbx system, this python package and forks not designed for what is currently asked. calls have to go thru some actually phone if not using an pbx setup with the google voice module.

@cleidigh
If you place the call on the command line, and choose either "GoogleChat" / "GoogleTalk" / "Hangouts" option for your phoneType, then it GV should ring both the called party's phone, and your computer but only when you're logged into GMail on a browser tab. You'll have to click to answer, and then you can talk thru your headset/mic. You'll have to click the buttons when you want to dial touch tones on the on screen keypad, and when you want to hang up the call.

And what @techno-express says about setting up a pbx is an option, is also accurate, it'd be a bit more involved to setup one time once, the benefit of a pbx is it'd let you use any windows (or mac or linux) softphone app on your PC, to do essentially the same as described above, an onscreen software phone app for the computer.

@cleidigh
Following up with you about the special conditions you're facing regarding phone calling.

  1. How did you previously use dragon and voice commands to control skype, when it was working for you?
  2. You using skype traditional desktop app, or skype new windows app store style app?
  3. What changed with skype, what does it do now that's different and makes it so your using skype with voice commands is difficult?
  4. Are you trying to use any reliable working software phone on the pc, which goes thru the gv phone number?
  5. Can you use the mouse? Keyboard? Do you prefer to use them, or to avoid using them?
  6. Have you seen this page about using dragon to make commands to control skype, is this helpful, or useless for you to make calls in skype, and why? http://www.dummies.com/software/dragon-naturallyspeaking/how-to-use-naturallyspeaking-with-skype/
  7. Have you ever tried using Siri (on iphone and the apple home speaker) or google assistant app (iphone, android), or alexa (iphone, android, and amazon echo home speaker) to make voice commands to place calls to your contacts, or to any phone number?

@chris001
@techno-express
I have not disappeared, just been doing all sorts of research. free PBX looks like it has tons of capabilities
I'm just not sure I can do all set up without a lot of effort and I have to run everything on Windows I cannot set up a separate server.

I've also been testing a variety of provider services Twillo Sinch Nexmo and others
I did just get an outgoing call to work with Nexmo+zoiper using SIP
I still have to do with keyboard access unfortunately the Z soft phone is completely not keyboard accessible which is pathetic.

no I have to look for other clients or libraries that might help with this approach

@techno-express
a question about your PHP app: if you want to make an outgoing call can you use the Google voice number and not have to connect two calls meaning a direct call from the Google voice?
that might be a viable approach if I want to use the browser

@cleidigh

  1. Some windows softphones which can be controlled by keyboard: zoiper + autohotkey, and ninja pro.
  2. Subscribe for a small one time fee $5.99 to the highly rated Simonics google voice gateway by Bill Simon, which converts gv to SIP, and lets your windows sip softphone app connect thru the gateway to gv: https://simonics.com/gw/
    Problem solved.
  • Of course, this all depends on your windows softphone working acceptably well via keyboard and dragon voice. You'll need to test this out to your satisfaction.
  • Autohotkey might also be able to get your windows desktop skype app working again.

@cleidigh
When you log into your Gmail in the browser, and try this, does it work:
"How to make a phone call in Gmail"
https://www.youtube.com/watch?v=icivyrZPK0M

The "How to make a phone call in Gmail" is probably the best route to go, nothing else to setup or install.

@chris001
@techno-express
Well I've done a lot more experiments with a variety of services. I also tried what you both suggested.
Google voice in the browser is okay but still requires a lot of back-and-forth with hangouts and button presses. I really want a solution that's outside the browser for full-time status awareness{.

I have soft phones working now with SIP including Twilio, Sinch and most recently Plivo.
the inbound and outbound calls work great still trying to get messaging working through SIP.

BTW in case you guys are interested the above services are pretty interesting and
X-lite freebie is very keyboard accessible and the paid version has a built-in API.

If you guys need to do anything with soft phones PhonerLite is interesting because
besides having a lot of features it has a debug window which really helps debugging the SIP connection.

I still need to look at and understand the SIP/Google voice service you mentioned. I took a brief look and was hoping it was open source because I think we could learn a lot from that.
Seems like there should be some way to connect Google voice from outside the browser

@cleidigh
The key is converting between standard SIP protocol, used by all the softphones and hardware voip phones, and the gv protocol. There are hardware solutions available for outside the browser: many versions of the obihai box. The only 2 software protocol converters to convert between gv and sip I'm aware of, are the simonics hosted service which is a one-time fee of 5.99, and to self host an open source pbx which has the converter included as a module, however hosting your own pbx incurs hosting expense and/or you would need to dedicate a computer, or 1GB of your computer's ram, and to leave it on all the time, which might cost quite a lot in electricity, for it to be always on and running the pbx, which is a bit much when all you want is one phone line. The simonics service, at 5.99 one time once, is probably the best for your needs, again, if all you want is the one phone line and a software SIP voip phone of your choice, running as an app on your pc/laptop desktop.

My setup is an dedicated server from https://www.nocix.net/dedicated/ where which you will be responsible for everything except the hardware. Part of this setup an partitioned VPS, hosting Docker.
In there is an FreePBX running with various modules including "Google Voice/Chan Motif" and the "IVR". My setup is similar to what you would get from RingCentral.

I have no converter, not needed. What must be done is adding the GV module and then setting up correctly, in addition checking off in GV website setting to have calls forward to GV Chat only, plus making basic SIP setting corrections, then adding extensions, Once that's done you can set up softphones or whatever. You can receive and make calls multi lines straight without adding any other service, no simonics, no external anything. No added cost besides the server my case $30.

Before this setup now, i was using Twilio, that's where my PHP app UI was model after, looked at Plivo and the others you mentioned.