SOLVED SMS with Google Voice WORKING (sometimes for some people)

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
FYI to all, here are the four documents all agree to by using GVoice, collectively know as the GVoice "terms of service".

The first two are specific to GVoice, interesting to read. Last two pertain to any G service.

GVoice Acceptable Use Policy
.
https://www.google.com/googlevoice/program-policies.html

GVoice Additional Terms of Service
https://www.google.com/intl/en/googlevoice/legal-notices.html

G Terms of Service:
http://www.google.com/policies/terms/

G Privacy Policy:
http://www.google.com/policies/privacy/
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
After a lot of searching, there doesn't seem to be a public OAUTH2 login URL available for GVoice, "Google Voice" is not a listed API in Google's (OAuth) Developer Console.. :confused5:

So, until they add a GVoice API, login will continue via saved email/password, over https.

Beware of PBX server security, intrusion detection, backups. Use a secondary burner google voice account, with several valid recovery phones and emails, not your main google account, for the sending SMS from the PBX on the command line.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Not sure where this security paranoia is coming from. I thought I had the title on that one. :donatello:

Absent a "man in the middle" attack, Google Voice logins from Incredible PBX are very secure. The server cannot be seen from the public Internet unless the attacker's IP address has been whitelisted. That makes an attack extremely unlikely. In fact, I can't recall ever hearing of a successful one with or without a firewall in place.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Have experienced more than a few server break ins. Never again, if possible.

If attackers get their hands on the crown jewel, the gvoice email/password, then they can lock the true account holder out, and port out the phone number. Or, hold the account for ransom. Terribly disruptive damaging and potentially fatal to a small/medium business.

One huge weakness is in how IPBX doesn't notify an admin via email/sms when security services are down or failing while it's trying to start them, such as iptables, fail2ban. Nor when regular services are down, asterisk, mysql, apache, knockd, etc. Both the security part and the telephony part are critical and the system must notify the admin when any component is in a fail state.

Time to make a cron script for that.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Here using the latest code from the pettazz repo, getting "Login failed. Retry? [y/n]" despite having "Less secure apps" and approving the linux server "Sevice" under security.
Does anyone have this command-line SMS working as of right now?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Here using the latest code from the pettazz repo, getting "Login failed. Retry? [y/n]" despite having "Less secure apps" and approving the linux server "Sevice" under security.
Does anyone have this command-line SMS working as of right now?

Try this:
Code:
cd /root
rm -r pygooglevoice
git clone https://github.com/wardmundy/pygooglevoice.git
cd pygooglevoice
python setup.py install
cp -p bin/gvoice /usr/bin/.

Using a browser, (in addition to enabling Less Secure Apps) you also need to log into your Google account and then activate the GV reset procedure before attempting to use SMS.
 
Last edited:

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Thanks for that tip! @wardmundy :cheers2:
FYI for anyone else with this issue. Even with the original code from the pettazz repo, the required step is the "gvoice reset procedure", which allows the gvoice app to login from the new "Device" (pbx server).
GVoice reset procedure: https://accounts.google.com/DisplayUnlockCaptcha
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.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,534
Reaction score
727
An OAUTH2 login to the GV web console or an API offering the same functions would be gold. Besides SMS functions, it would give us the ability to poll for messages waiting. Since the entire Google Voice team is now working for other companies, I think no one should hold his breath waiting on this.
 

Joe Lones

Member
Joined
Feb 10, 2016
Messages
50
Reaction score
4
I'm getting the
Code:
"Login failed. Retry? [y/n]"
error message again with gvoice, has something changed?
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
@Joe Lones
GV upgraded the web interface and the android app. Much welcomed improvements, yet the variables and page layouts have changed, and we're working on fixing it on github.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
New version of gvoice command line sms text messaging is available, which is fixed to work with Google's new modernized "AngularJS" gvoice web interface. It was a small change to get it working, in case anyone is wondering.
Paste these commands into your shell to upgrade:
Code:
cd ~
git clone https://github.com/pettazz/pygooglevoice
cd pygooglevoice
python setup.py install
cp -p bin/gvoice /usr/bin/.
# required for the parse_sms.py example program.
pip install --upgrade BeautifulSoup
exit
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
For Incredible PBX servers, use this command instead of pip:
Code:
easy_install -U BeautifulSoup
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Google renovated and updated their new AngularJS web interface this month, which made the login change. Causing a Login crash. I fixed this Login crash last night. Waiting on Nick Pettazzoni @pettazz to try it out and merge the updated files into the github repo. Then, all can update (see above shell commands). Not yet though. Probably in the next 24-48 hours?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Google personified:

DAdE9jvXYAIkLlq.jpg
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
This is a perfectly valid interpretation of these events! This gvoice code was written under the assumption that the web interface wouldn't change much if ever, and for several years, the luck held, and the code worked just fine. In recent years though as you may have noticed, there's been a widespread evolution of web sites, and for all the google sites to start using their new and more user friendly dynamic web interface framework AngularJS, which emulates a mobile feel everywhere, including in the desktop browser. However there's a solution for that, which ought adapt better to this dynamic gvoice application and make it easy to fix when the interface details change more drastically. Work has started on this better gvoice app, and so far, the login is working.
 

Captain Mike

New Member
Joined
May 22, 2017
Messages
6
Reaction score
3
Here is my stack trace after breaking the latest PETTAZZ repo as of a few days ago:

Traceback (most recent call last):
File "./google_voice_sms.py", line 27, in <module>
send_mass_text ()
File "./google_voice_sms.py", line 25, in send_mass_text
voice.send_sms(this_phone_number, the_message)
File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 192, in send_sms
self.__validate_special_page('sms', {'phoneNumber': phoneNumber, 'text': text})
File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 289, in __validate_special_page
load_and_validate(self.__do_special_page(page, data))
File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 302, in __do_special_page
return self.__do_page(page, data, headers, terms)
File "/usr/lib/python2.7/site-packages/googlevoice/voice.py", line 282, in __do_page
return urlopen(Request(pageuri, data, headers))
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error​

Here is my linux terminal command:
cd ~
cd pygooglevoice/googlevoice
./google_voice_sms.py [email protected] password phone_numbers.txt "sample message"
Here is the reference for google_voice_sms.py which was working up until a few days ago: https://motiondesigntechnology.word...ng-sms-messaging-via-google-voice-and-python/
 
Last edited:

Members online

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top