Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge Call programmatically while other call is running (Conference call)

Tags:

android

merge

api

My requirement is like this: Say I am calling a number on that time and I want to call another number programmatically. So far what I have done is: I am able to call to a particular number while some call is already going. For example, suppose I am calling on number 123 and after 1 minute (by using Alarm Manger I trigger an event to call on another number 456 and that is done!

Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse("tel:456")); startActivity(intent); 

I am using such intent to call and now I am able to see the screen on my phone with a button to merge the calls:

screenshot of phone

In this image you can see a button of Merging calls. Now when the user clicks on merge, it will merge all 3 Calls. I want to do it programmatically, not with the user interface.

like image 992
Aamirkhan Avatar asked Jan 06 '14 14:01

Aamirkhan


People also ask

Can you merge two conference calls?

When the second person picks up the call, you will see both calls listed at the top of your screen. Tap "Merge" to merge the two calls together into one conference call. You and the two people you've called can now all hear and speak to each other on the same line.

How do you merge a 3 way call?

On an Android phone Now, add the call via the "Add call" button and your phone's keypad will pop up. Dial the second person and wait for them to pick up the phone. Once they pick up the phone, you'll see the "Merge call" button. Tap this and your phone will merge the calls into a three-way call.


2 Answers

Your question seemed interesting so I started digging in Android Source. Here is what I found:

The activity in the picture you posted is called InCallUI

When you start looking around you will find InCallPresenter which at line 463 has:

final boolean canMerge = activeCall.can(Capabilities.MERGE_CALLS); 

and then at 472:

CallCommandClient.getInstance().merge(); 

when you check that merge() method in CallCommandClient you will find it uses ICallCommandService interface which I think is what you where looking for :)

Initialization of that CallCommandClient is in CallHandlerService around line 193.

Hope this helps & good luck.

PS. The APIs I listed are mostly internal Android stuff. You may have to use reflection to call it or it might not be possible at all - it may be inaccesible for your app because it's not marked as system app.

like image 190
MeTTeO Avatar answered Oct 05 '22 10:10

MeTTeO


Android API doesn't support call merging facility you can see this thread for this. https://groups.google.com/forum/?fromgroups#!searchin/android-developers/conference$20call/android-developers/6OXDEe0tCks/8cuKdW1J9b8J but what you can do is open phone's call pad screen using aidl from there user can add another call or merge the call.

like image 22
Akhil Dad Avatar answered Oct 05 '22 10:10

Akhil Dad