raise telepathy.errors.NotImplemented("Cannot change directions")
@gtk_toolbox.log_exception(_moduleLogger)
- def RequestStreams(self, contact, streamTypes):
+ def RequestStreams(self, contactId, streamTypes):
"""
For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
if streamType != telepathy.constants.MEDIA_STREAM_TYPE_AUDIO:
raise telepathy.errors.NotImplemented("Audio is the only stream type supported")
- print self._contactHandle, contact
+ contact = self._conn.handle(telepathy.constants.HANDLE_TYPE_CONTACT, contactId)
+ assert self._contactHandle == contact, "%r != %r" % (self._contactHandle, contact)
contactId, contactNumber = handle.ContactHandle.from_handle_name(contact.name)
self._conn.session.backend.call(contactNumber)
subscriberNumber = None
phoneType = guess_phone_type(self._callbackNumber) # @todo Fix this hack
- page = self._get_page_with_token(
- self._callUrl,
- {
+ callData = {
'outgoingNumber': outgoingNumber,
'forwardingNumber': self._callbackNumber,
'subscriberNumber': subscriberNumber or 'undefined',
- 'phoneType': phoneType,
- 'remember': '1'
- },
+ 'phoneType': str(phoneType),
+ 'remember': '1',
+ }
+ _moduleLogger.info("%r" % callData)
+
+ page = self._get_page_with_token(
+ self._callUrl,
+ callData,
)
+ _moduleLogger.info(page)
self._parse_with_validation(page)
return True
return page
def _parse_with_validation(self, page):
- json, html = extract_payload(page)
+ json = parse_json(page)
validate_response(json)
- return json, html
+ return json
def itergroup(iterator, count, padValue = None):
def guess_phone_type(number):
if number.startswith("747") or number.startswith("1747"):
- return GVDialer.PHONE_TYPE_GIZMO
+ return GVoiceBackend.PHONE_TYPE_GIZMO
else:
- return GVDialer.PHONE_TYPE_MOBILE
+ return GVoiceBackend.PHONE_TYPE_MOBILE
def set_sane_callback(backend):