+ def _call(self, contact, on_success, on_error):
+ contactNumber = contact.phoneNumber
+
+ self.__calledNumber = contactNumber
+ self.CallStateChanged(self.__contactHandle, telepathy.constants.CHANNEL_CALL_STATE_RINGING)
+
+ try:
+ result = yield self._conn.session.pool.add_task, (
+ self._conn.session.backend.call,
+ (contactNumber, ),
+ {},
+ on_success,
+ on_error,
+ ), {}
+ except Exception:
+ _moduleLogger.exception(result)
+ return
+
+ self._delayedClose.start(seconds=0)
+ self.CallStateChanged(self.__contactHandle, telepathy.constants.CHANNEL_CALL_STATE_FORWARDED)
+
+ def _cancel(self, on_success, on_error):
+ _moduleLogger.debug("Cancelling call")
+ try:
+ result = yield self._conn.session.pool.add_task, (
+ self._conn.session.backend.cancel,
+ (self.__calledNumber, ),
+ {},
+ on_success,
+ on_error,
+ ), {}
+ except Exception:
+ _moduleLogger.exception(result)
+ return
+