aaronpk/Google-Voice-PHP-API

BROKEN!!!

Closed this issue · 2 comments

I've been using this for months without any issues. Google just updated their security for "voice mail" and it seems to have broken the programming. Anyone have a solution or experience the same problem?

php gvtest.php

PHP Fatal error: Uncaught exception 'Exception' with message 'Could not parse for GALX token' in /var/lib/asterisk/GoogleVoice.php:46
Stack trace:
#0 /var/lib/asterisk/GoogleVoice.php(89): GoogleVoice->_logIn()
#1 /root/gvtest.php(5): GoogleVoice->callNumber('xxxxxxxxxx', 'yyyyyyyyyy', 'mobile')
#2 {main}
thrown in /var/lib/asterisk/GoogleVoice.php on line 46

I had to replace line 43
if(preg_match('/name="GALX"\s*value="([^"]+)"/', $html, $match))
with
if(preg_match('/name="GALX"\s+type="hidden"\s+value="([^"]+)"/', $html, $match))

Worked like a charm. Good work.