def _call_added(self, path, properties):
call = dbus.Interface(
self._bus.get_object(Ofono.SERVICE_NAME, path),
Ofono.VOICE_CALL_INTERFACE
)
self._calls[call.object_path] = call
properties = call.GetProperties()
state = properties['State']
number = properties['LineIdentification']
self.log().info('%s: %s' % (state, number))
listeners = []
if state == 'incoming' or state == 'waiting':
listeners = self._on_incoming_call_listeners
elif state == 'active' or state == 'dialing':
listeners = self._on_call_began_listeners
for listener in listeners:
listener(path)
评论列表
文章目录