Archived:Telephony in m
This article shows how to handle calls in m.
On S60 3rd Edition an incoming call cannot be hung up without being answered first.
Dialing a number and displaying the call duration
//Dial the number
//Wait until the phone is in idle state, meaning the call has been hung up
//Show the duration of the call in milliseconds
print "Duration: " + phone.ms()
Answering a call from a certain number and hanging up
//Wait for an incoming call
call = phone.new()
if call["incoming"] = true then
//Check the caller's number
if call["number"] = "1234567890" then
//Answer the call
//Wait 10 seconds
//Hang up the call
The operations described are performed.