pettazz / pygooglevoice

Fixed version of pygooglevoice cloned from googlecode project that hasn't been updated since 2009.
BSD 3-Clause "New" or "Revised" License
182 stars 117 forks source link

Any way to obtain phone's call forwarding state? #34

Open nalipaz opened 8 years ago

nalipaz commented 8 years ago

Currently there are methods for changing the call forwarding state. Phone.enable() and Phone.disable() set the call forwarding for configured phones. However, I was attempting to be able to simply obtain the current value. Truthfully it would more than likely be best that the value were actually set on the phone's dict when returned from the listed phones. Such as:

#!/usr/bin/env python
from googlevoice import Voice,Phone,util
import sys

voice = Voice()
voice.login()

for phone in voice.phones:
    print phone.call_forwarding

On a side note, I did see some properties that seems like they might be of use, but they did not get the state correctly. It seems that many of the phone properties are meant to represent a contact entry rather than a phone per se, being they are returned from voice.contacts['phones']