Detecting dropped calls - android.telephony API

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Detecting dropped calls - android.telephony API

Postby LBDev » Thu Feb 25, 2010 11:00 am

I have been scouring the Telephony API and can not find how to detect when a call has been dropped. I have seen older code that leads me to believe that it 'may' have been once possible. Here is a snippet of the old code from what appears to be from The Android Open Source Project, 2007:

private getCallFailedString(Call call) {
Phone phone = PhoneApp.getInstance().phone;
Connection c = call.getEarliestConnection();

Connection.DisconnectCause cause = c.getDisconnectCause();
switch (cause) {
case BUSY:
break;

case CONGESTION:
break;

case LOST_SIGNAL:
break;

case LIMIT_EXCEEDED:
break;

case POWER_OFF:
break;

case SIM_ERROR:
break;

case OUT_OF_SERVICE:
break;

default:
break;

}

}

I would really like to have this functionality of determining a disconnection cause, but cannot find it in the current API. Does anybody know if this functionality stills exits, or maybe a subset?
LBDev
Freshman
Freshman
 
Posts: 7
Joined: Fri Feb 06, 2009 8:25 pm
Location: Long Beach, Ca

Top

Postby waynesilver » Wed Mar 03, 2010 11:13 pm

I have been looking for the same functionality, but haven't even got as far as you have. I want to take actions based on Dropped call, and a hang up.
waynesilver
Developer
Developer
 
Posts: 28
Joined: Mon Jan 04, 2010 9:01 pm
Location: Seattle

Postby LBDev » Wed Mar 03, 2010 11:54 pm

I have found further info on the above code snippet. It turns out it originally came from the sipdroid project. sipdroid is an open source project and you can download through SVN the source (read-only) from here:

http://code.google.com/p/sipdroid/source/checkout

In the Connection.java file there is an enum DisconnectCause, which contains a lot of sipdroid reasons for disconnections, but their method getDisconnectCause() only returns NORMAL. Further investigation into the code shows that they only use DisconnectCause.BUSY and Disconnect.NORMAL. This is not to say that the answers we seek are not in there somewhere.

If you find a solution, please post back on this thread. Good luck.
LBDev
Freshman
Freshman
 
Posts: 7
Joined: Fri Feb 06, 2009 8:25 pm
Location: Long Beach, Ca

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 5 guests