[Shtoom] investigation of call acceptance confusion

zooko at zooko.com zooko at zooko.com
Fri Oct 22 17:22:56 CEST 2004

I think I understand the first part of what is wrong in call accept state
machine.  Maybe if I post my hypothesis here then Anthony or someone can fill
in the blanks and fix it.

If you look in phone.acceptCall() it says 'd = self._createRTP()'.  That d is a
deferred which is going to be triggered when the sockets are connected and any
STUN has been completed.  A few lines later in acceptCall(), if 
calltype == 'inbound', it says 'self.ui.incomingCall(..., ..., d)'.

Now this is Just Wrong!  The last argument to self.ui.incomingCall is a
deferred which the UI object can use to signal to the app object whether to
accept the call or not.  By passing d here, then when the user clicks "accept
call", the same thing will happen as when the STUN discovery completes!  That's
not right.  And if the user clicks "reject", then same thing will happen as if
there were an unhandled exception in our STUN and RTP code.  :-)

This problem is not specific to the wx UI, although it is definitely related to
the other problems with the wx UI.

It would have been easier for me to figure this stuff out if we weren't using
errbacks to mean "user clicked reject".  We could pass a boolean as the
argument to the deferred: True means the user said accept, False means the user
said reject.



More information about the Shtoom mailing list