|
|
2010-12-03
, 04:13
|
|
Posts: 1,463 |
Thanked: 1,916 times |
Joined on Feb 2008
@ Edmonton, AB
|
#2
|
|
|
2010-12-03
, 07:46
|
|
Posts: 235 |
Thanked: 339 times |
Joined on Nov 2010
|
#3
|
One thing i have noticed is that during these 11 seconds i can not even type in the ssh shell, it is like the phone is too busy ... though the UI is answering just fine.
|
|
2010-12-03
, 13:27
|
|
Posts: 187 |
Thanked: 41 times |
Joined on May 2010
|
#4
|
|
|
2010-12-06
, 10:18
|
|
Posts: 3 |
Thanked: 2 times |
Joined on Dec 2010
|
#5
|
Here is a very simple example of a python code that SHOULD reject a call with their respective output.
import gobject import dbus import time import datetime from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() sbus = dbus.SessionBus() def disconnect(): print 'Running disconnect() at' + str(datetime.datetime.now()) callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1') smsiface = dbus.Interface(callobject, 'com.nokia.csd.Call.Instance') print smsiface.Release() def callDetected(state): print 'callDetected() at' + str(datetime.datetime.now()) disconnect() sbus.add_signal_receiver(callDetected,dbus_interface="org.freedesktop.Telepathy.Connection.Interface.Requests",signal_name="NewChannels") gobject.MainLoop().run()Since, i believe, the call is not fully established release will execute but not drop the call. Here is the output...
callDetected() at2010-12-02 22:30:23.555880
Running disconnect() at2010-12-02 22:30:23.557619
The disconnect was executed almost at the same time frame that callDetected() like i expect.
Now, i added a delay before execute the disconnect() method to give time to the connection be really made so i would expect the connection be dropped just fine.
import gobject import dbus import time import datetime from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() sbus = dbus.SessionBus() def disconnect(): print 'Running disconnect() at' + str(datetime.datetime.now()) callobject = bus.get_object('com.nokia.csd.Call', '/com/nokia/csd/call/1') smsiface = dbus.Interface(callobject, 'com.nokia.csd.Call.Instance') print smsiface.Release() def callDetected(state): print 'callDetected() at' + str(datetime.datetime.now()) time.sleep(1) disconnect() sbus.add_signal_receiver(callDetected,dbus_interface="org.freedesktop.Telepathy.Connection.Interface.Requests",signal_name="NewChannels") gobject.MainLoop().run()callDetected() at2010-12-02 22:33:13.602907
Running disconnect() at2010-12-02 22:33:22.481692
Why if i put it to sleep 1 second, the delay is over 11 seconds ?
One thing i have noticed is that during these 11 seconds i can not even type in the ssh shell, it is like the phone is too busy ... though the UI is answering just fine.