Friday, June 30, 2006

Conference call on Symbian phones

The procedure to create conference call is targeted for Symbian OS prior version 3.0.
The code needs a little hack to compile and link because it uses telephony APIs that are not public on Nokia SDKs; in fact third party software that manages phone calls should use the CTelephony class however only a subset of functionalities are provided by this class.
The whole functionalities are provided by Etel Core and Etel GSM APIs.

RMobileConferenceCall, in etelmm.h, is the class to set up conference call.

class RMobileConferenceCall : public RTelSubSessionBase
{
public:

IMPORT_C RMobileConferenceCall();
IMPORT_C TInt Open(RMobilePhone& aPhone);
IMPORT_C void Close();


IMPORT_C void CreateConference(TRequestStatus& aReqStatus) const;
IMPORT_C void AddCall(TRequestStatus& aReqStatus, const TName& aCallName) const;
IMPORT_C void Swap(TRequestStatus& aReqStatus) const;
IMPORT_C void HangUp(TRequestStatus& aReqStatus) const;
IMPORT_C TInt EnumerateCalls(TInt& aCount) const;
IMPORT_C TInt GetMobileCallInfo(TInt aIndex, TDes8& aCallInfo) const;

.....

};

I assume that you are familiar with Active Object (AO) and call notification because most part of the methods are asynchronous so you have to create an AO to wait for completion. And of course you can create a conference call only if there are two or more active calls.

The state machine that describe the engine is:

Just for sake of simplicity, when the second call is answered listening is stopped and the two calls are joined in conference until one of them terminates.

Below I provide some snippets to use the RMobileConferenceCall class.

The 2nd phase of the constructor:
void CConferenceEngine::ConstructL()
{
User::LeaveIfError(iTelServer.Connect());
RTelServer::TPhoneInfo phoneInfo;
User::LeaveIfError(iTelServer.GetPhoneInfo(0, phoneInfo));
User::LeaveIfError(iPhone.Open(iTelServer, phoneInfo.iName));

//array of call names
iCallNameArray = new (ELeave) CDesCArrayFlat(2);

}


How to start incoming call notification:
void CConferenceEngine::StartListening()
{

RPhone::TLineInfo lineInfo;

RLine newLine;
User::LeaveIfError(iPhone.GetLineInfo(n_lines, lineInfo));
User::LeaveIfError(newLine.Open(iPhone, lineInfo.iName));
iLines.Append( newLine );

iLines[n_lines].NotifyIncomingCall(iStatus, iCallName);
iInternalState = EConfCallListening;
SetActive();
}



Creation of the conference call:
TInt CConferenceEngine::CreateConference()
{

TInt err = iConfcall.Open(iPhone);
iConfcall.CreateConference( iStatus );
isConferenceCreated = ETrue;
iInternalState = EConfCallCreated;
SetActive();
return err;
}



How to add a phone call to the conference:
void CConferenceEngine::AddCall(TInt index)
{
iConfcall.AddCall( iStatus, (*iCallNameArray)[index] );
iInternalState = EConfCallAdded;
SetActive();

}

2 Comments:

At 8:40 AM, Blogger Bruce Lye said...

wondering whether there is anyway to use the Rmobileconferencecall without signing up as a symbian partner? You mentioned a "hack". Any 3rd party APIs that i can use instead?

 
At 4:35 PM, Blogger Fabrizio said...

Thansk for comment.
This solution was implemented on S60 2nd ed. I've never thought about porting it to 3rd ed...

 

Post a Comment

<< Home