#2 Synchronous telephone.dial() and telephone.hang_up()


Functions 'telephone.dial()' and 'telephone.hang_up()' are asynchronous on EKA2 platform.
If they are used from a python script via mod_python on Raccoon (Apache for mobile phones), the call status in 'CPhoneCall::iStatus' is not updated because 'CPhoneCall::RunL()' is not called upon completion (the most likely cause is that the HTTP request handler terminates before the asyncronous request is completed). The result is that the first 'dial()' and 'hang_up()' sequence succeeds, but subsequent 'dial()'s will report that there is already a call in progress, while 'hang_up()'s say that there is no call in progress that could be hung up.

However, if 'CPhoneCall::Dial()' and 'CPhoneCall::HangUp()' wait for the completion of the asynchronous requests, the state is maintained and further 'dial()'s and 'hang_up()'s will succeed.

On Python level the only visible change is the addition of an optional parameter to 'telephone.dial()' and 'telephone.hang_up()'. If the value of this parameter (called 'wait') is not None, the functions will wait for the completion of the asynchronos requests.

Perhaps using background threads and mod_python directives in Raccoon could solve the problem as well, but the solution would be very sensitive to Raccoon server setup. Providing synchronized versions of the functions seems to be much simpler and more robust.