dmorlitz / pygooglevoice

Automatically exported from code.google.com/p/pygooglevoice
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

pygooglevoice seems to be not working #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pygooglevoice isn't working for calls, and I was told that Google added a
new parameter.
Any way to get it updated?

Original issue reported on code.google.com by ytlev...@gmail.com on 18 Nov 2009 at 7:53

GoogleCodeExporter commented 9 years ago
It looks like google voice changes its interface. any fix to this issue?

Traceback (most recent call last):
  File "/usr/bin/gvoice", line 94, in ?
    voice.call(input('Outgoing number: '), input('Forwarding number: '))
  File "/usr/lib/python2.4/site-packages/googlevoice/voice.py", line 88, in call
    self.__validate_special_page('call', {
  File "/usr/lib/python2.4/site-packages/googlevoice/voice.py", line 198, in 
__validate_special_page
    load_and_validate(self.__do_special_page(page, data))
  File "/usr/lib/python2.4/site-packages/googlevoice/voice.py", line 211, in 
__do_special_page
    return self.__do_page(page, data, headers)
  File "/usr/lib/python2.4/site-packages/googlevoice/voice.py", line 191, in 
__do_page
    return urlopen(Request(getattr(settings, page), data, headers))
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 402, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

Original comment by ahy...@gmail.com on 18 Nov 2009 at 8:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
adding param 'phoneType'='3' to the post solves this issue

Original comment by andylipp...@gmail.com on 18 Nov 2009 at 2:33

GoogleCodeExporter commented 9 years ago
in voice.py: add a new line at 86:
     'phoneType': '3',

then rerun 
     python setup.py install

Original comment by andylipp...@gmail.com on 18 Nov 2009 at 2:38

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Does anyone know what "phoneType" is for?
Someone else told me that he used phoneType 2...

Original comment by ytlev...@gmail.com on 18 Nov 2009 at 3:45

GoogleCodeExporter commented 9 years ago
Can you post the entire line 88, so we can see where the "phoneType" goes?

    def call(self, outgoingNumber, forwardingNumber, subscriberNumber=None):
        """
        Make a call to an outgoing number using your forwarding number """
        self.__validate_special_page('call', {
            'outgoingNumber': outgoingNumber,
            'forwardingNumber': forwardingNumber,
            'subscriberNumber': subscriberNumber or 'undefined',
            'remember': '1'
        })

Original comment by mark...@gmail.com on 18 Nov 2009 at 5:01

GoogleCodeExporter commented 9 years ago
adding the line  
'phoneType': '3',
and then  
python setup.py install
still yields:
File "/usr/bin/gvoice", line 125, in ?
    getattr(voice,action)(*args)
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 88, in call
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 198, in 
__validate_special_page
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 211, in 
__do_special_page
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 191, in __do_page
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 402, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

Original comment by mark...@gmail.com on 18 Nov 2009 at 5:15

GoogleCodeExporter commented 9 years ago
    def call(self, outgoingNumber, forwardingNumber, subscriberNumber=None):
        """
        Make a call to an outgoing number using your forwarding number """
        self.__validate_special_page('call', {
            'outgoingNumber': outgoingNumber,
            'forwardingNumber': forwardingNumber,
            'subscriberNumber': subscriberNumber or 'undefined',
            'phoneType': '3',
            'remember': '1'
        })

Perhaps the continuing problem is related to the actual value as noted above.  I
lifted the value 3 from what my browser was sending on my account poking the 
call button.

Original comment by andylipp...@gmail.com on 18 Nov 2009 at 5:44

GoogleCodeExporter commented 9 years ago
Could it be the setting by the phone number in the GV settings, on the Phones 
tab - 
i.e. home, work, or cell?
Can someone try changing the setting in the GV Phones tab, and seeing what it 
sends 
then?
I don't know how to check it...
Thanks!

Original comment by ytlev...@gmail.com on 18 Nov 2009 at 5:46

GoogleCodeExporter commented 9 years ago
thanks andylippitt,
it works now.

Original comment by ahy...@gmail.com on 18 Nov 2009 at 6:24

GoogleCodeExporter commented 9 years ago
cell seems to be 2

Original comment by jeremyla...@gmail.com on 18 Nov 2009 at 9:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
have you bind your landline number with google voice?

Original comment by ahy...@gmail.com on 18 Nov 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Nope. Didn't realize I needed to. But with the fix,it does work if the callback
number is listed on your account.

Thanks.

Original comment by jbea...@newharbor.com on 19 Nov 2009 at 12:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
python setup.py install did not work properly.
But the following did:
after adding  voice.py
cd /root
easy_install pygooglevoice
that updated the egg file, and gvoice.  gvoice then worked.
hope this helps someone.

Original comment by mark...@gmail.com on 19 Nov 2009 at 4:43

GoogleCodeExporter commented 9 years ago
Mark, that worked for mine as well, been trying for hours to fix this, way to 
go! 
Thanks

Original comment by jjsch...@gmail.com on 19 Nov 2009 at 5:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have committed a fix to this issue which should help. It checks to detect 
what type
of phone to use by default, but provides for the optional phoneType argument to 
the
call function. phoneTypes are defined as 

                1 - Home
                2 - Mobile
                3 - Work
                7 - Gizmo

Try cloning/pulling the new source code from the hg repository and follow up 
with any
further issues here. If the error you get does not contain HTTP Error 500, 
please
raise another issue.

Original comment by justquick on 19 Nov 2009 at 5:47

GoogleCodeExporter commented 9 years ago
I don't see that argument as being optional.  That's why everything broke to 
start 
with, no?

Original comment by jeremyla...@gmail.com on 19 Nov 2009 at 5:51

GoogleCodeExporter commented 9 years ago
Will it detect which phone type I have, so that I don't have to set it when I 
call?

Original comment by ytlev...@gmail.com on 19 Nov 2009 at 5:56

GoogleCodeExporter commented 9 years ago
It will automatically choose the type from the first phone in your list. Nothing
should be broke to start as long as you have a phone list (voice.phones)

Original comment by justquick on 19 Nov 2009 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by justquick on 19 Nov 2009 at 6:18

GoogleCodeExporter commented 9 years ago
Problem is, I don't have it forward to the first phone on my list, and it seems 
like 
there's no way to change the order...
Any ideas?

Original comment by ytlev...@gmail.com on 19 Nov 2009 at 6:25

GoogleCodeExporter commented 9 years ago
I have just committed another patch that checks your phones to see which type of
phone you are trying to call from (matching forwardingNumber). Give this new 
source
code a try and see if it can detect the correct phone a bit better.

Original comment by justquick on 19 Nov 2009 at 6:41

GoogleCodeExporter commented 9 years ago
What's the best way to install/update it?
I am using it with a PBX in a Flash system...
Thanks!

Original comment by ytlev...@gmail.com on 19 Nov 2009 at 6:43

GoogleCodeExporter commented 9 years ago
What version of gvoice are you using?  Original gvoice (see my steps in issue 
15), 
or if you have version 0.4, or having problems:
cd /root
yum install mercurial (incase you need to use hg)
yum install python-setuptools
easy_install simplejson
rm -r pygooglevoice
rm -r /usr/lib/python2.4/site-packages/googlevoice/
get the update pygooglevoice:
hg clone https://pygooglevoice.googlecode.com/hg/ pygooglevoice
cd /root/pygoovlevoice/googlevoice
vi voice.py (edit the phone type, or use the new code above and skip this)
cd /root
easy_install pygooglevoice

Original comment by mark...@gmail.com on 19 Nov 2009 at 7:02

GoogleCodeExporter commented 9 years ago
get the mercurial clone:

$ yum install mercurial
$ hg clone https://pygooglevoice.googlecode.com/hg/ pygooglevoice
$ cd pygooglevoice
$ sudo python setup.py install
$ python ./bin/gvoice

Original comment by justquick on 19 Nov 2009 at 7:04

GoogleCodeExporter commented 9 years ago
OK, everything works now!!
Thanks a lot!

Original comment by ytlev...@gmail.com on 19 Nov 2009 at 7:43

GoogleCodeExporter commented 9 years ago
justquick: It really would be helpful to understand the difference between:
$ sudo python setup.py install
$ python ./bin/gvoice
vs
$ cd /root
$ easy_install pygooglevoice

Thanks for your hardwork and patience.
PS. Is there anywhere on the website that shows the date, or the version of the 
lastest hg clone https://pygooglevoice.googlecode.com/hg/ pygooglevoice ?
Depending on when you ran this today, you got different versions, and different 
results.

Original comment by mark...@gmail.com on 19 Nov 2009 at 9:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm getting the same error.  I tried with the latest clone but it made no 
difference.

Thanks.

Original comment by tenshi.h...@gmail.com on 20 Nov 2009 at 7:52

GoogleCodeExporter commented 9 years ago
The specifc value for phoneType will depend on your individual account. In my 
case it
turned out to be '7' for a Gizmo line and '2' for a mobile phone. I got this by 
using
LiveHTTPHeaders in FireFox and placing a Call through the GV website.

Original comment by chitra....@gmail.com on 21 Nov 2009 at 3:39

GoogleCodeExporter commented 9 years ago
I tried 7 for my gizmo but still get an internal server error.

Original comment by tenshi.h...@gmail.com on 21 Nov 2009 at 3:44

GoogleCodeExporter commented 9 years ago
I'm getting the same error. I've tried changing my phone type in Google Voice 
to see
if that would fix it, but I still get the error. I'm using the latest code from 
the
hg repository.

Original comment by dereki...@gmail.com on 21 Nov 2009 at 8:46

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Any tips on how to apply the fix when the egg is installed in a virtualenv?

Original comment by mattch...@gmail.com on 22 Nov 2009 at 2:27

GoogleCodeExporter commented 9 years ago
Like I said, '7' turned out to be the right value for my account. You may have 
to get
that for your account using the LiveHTTPHEaders Firefox extension.

Original comment by chitra....@gmail.com on 22 Nov 2009 at 3:48

GoogleCodeExporter commented 9 years ago
It is 7 for me as well, but changing it to 7 in voice.py makes no difference.

Original comment by jason.ho...@gmail.com on 23 Nov 2009 at 8:03

GoogleCodeExporter commented 9 years ago
I've done all this and I'm still getting http error 500. I tried 1,2,3, and 7. 
No 
go. Has Google Voice changed their setup again? Here's what I'm getting.
Traceback (most recent call last):
  File "/usr/bin/gvoice", line 5, in ?
    pkg_resources.run_script('pygooglevoice==0.4', 'gvoice')
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 407, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1091, in run_script
    exec script_code in namespace, namespace
  File "/usr/bin/gvoice", line 125, in ?

  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 88, in call
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 198, in 
__validate_special_page
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 211, in 
__do_special_page
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 191, in __do_page
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 402, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error
Logging out of voice...

Original comment by 411white...@gmail.com on 23 Nov 2009 at 11:28

GoogleCodeExporter commented 9 years ago
Same issue here. I've changed it to the right phoneType and it makes no 
difference...

Original comment by dereki...@gmail.com on 27 Nov 2009 at 5:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
SOLUTION THAT WORKS:

cd /root
yum install mercurial (incase you need to use hg)
yum install python-setuptools
easy_install simplejson
rm -r pygooglevoice
rm -r /usr/lib/python2.4/site-packages/googlevoice/
get the update pygooglevoice:
hg clone https://pygooglevoice.googlecode.com/hg/ pygooglevoice
cd /root/pygoovlevoice/googlevoice
cd /root
easy_install pygooglevoice

Original comment by notle...@gmail.com on 27 Nov 2009 at 5:40

GoogleCodeExporter commented 9 years ago
notlegal,

that does not work for gizmo.  Also, I think you forgot an instruction line 
after "cd
/root/pygooglevoice/googlevoice" such as to edit voice.py.

Original comment by jason.ho...@gmail.com on 27 Nov 2009 at 4:21

GoogleCodeExporter commented 9 years ago
Well I'm not sure why, seeing as how I did these steps from following the other
posts. But the instructions in notlegal's post worked for me. THANKS NOTLEGAL!!

Original comment by 411white...@gmail.com on 28 Nov 2009 at 12:55

GoogleCodeExporter commented 9 years ago
notlegal's instructions also fixed it for me. Thanks notlegal!

Original comment by dereki...@gmail.com on 28 Nov 2009 at 9:08

GoogleCodeExporter commented 9 years ago
Can someone tell me how to edit the setup.py string?
the scripts were changed to "asterisk-gvoice-setup" but not the setup.py
vi setup.py
    scripts = ['bin/gvoice','bin/asterisk-gvoice-setup']#,'bin/gvi']

python setup.py install
running install
running build
running build_py
running build_scripts
error: file 'bin/asterisk' does not exist

Original comment by mark...@gmail.com on 30 Nov 2009 at 4:16

GoogleCodeExporter commented 9 years ago
When the script setup.py was fixed, gvoice then generated the following error:

Traceback (most recent call last):
  File "/usr/bin/gvoice", line 5, in ?
    pkg_resources.run_script('pygooglevoice==0.4', 'gvoice')
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 407, in 
run_sc                                                                          

ript
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 1091, in 
run_s                                                                           

cript
    exec script_code in namespace, namespace
  File "/usr/bin/gvoice", line 125, in ?

  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 88, in call
    # first phone matching forwardingNumber
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 198, in 
__valida                                                                        

 te_special_page
    return urlopen(Request(getattr(settings, page) + data, None, headers))
  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 211, in 
__do_spe                                                                        

 cial_page

  File "build/bdist.linux-i686/egg/googlevoice/voice.py", line 191, in 
__do_pag                                                                        

 e
    Loads a page out of the settings and pass it on to urllib Request
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 402, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 480, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

Original comment by mark...@gmail.com on 30 Nov 2009 at 4:33