Creating video and VoIP calls on Symbian
Article Metadata
Tested with
Compatibility
Article
Contents |
Overview
It is possible to initiate video and Internet telephony (VoIP) calls with the AIW Service Handler API, included in the Extensions plug-in package for S60 3rd Edition SDKs.
2. This works fine in S60 3rd Edition and S60 3rd Edition FP1 devices, but ExecuteServiceCmdL fails with error code(-6),KErrArgument on the Nokia N95 8GB. There is already a Known Issue regarding this, see the following link:
Archived:Dialing a voice call using AIW fails in Nokia N95 8GB (Known Issue).
3. This will also not work on S60 3rd Edition FP2, S60 5th Edition, or Symbian ^3.
MMP file
CAPABILITIES
CAPABILITY NetworkControl ReadDeviceData WriteDeviceData NetworkServices
LIBRARY
LIBRARY servicehandler.lib
LIBRARY ws32.lib
Header file
System Includes
#include <AiwDialDataTypes.h>
#include <AiwCommon.hrh>
#include <AiwCommon.h>
#include <AiwGenericParam.h>
#include <AiwVariant.h>
#include <aiwservicehandler.h>
In Header File
void MakeAiwCallL(const TDesC& aNumber,const TDesC& aName,
TAiwCallType aCallType );
TAiwNameBuffer iNameBuffer;
CAiwCriteriaItem* iCriteria;
CAiwServiceHandler* iServiceHandler;
Source file
In ConstructL of Source File
// Create AIW service handler
iServiceHandler = CAiwServiceHandler::NewLC();
CleanupStack::Pop(iServiceHandler);
// Create AIW iCriteria
iCriteria =CAiwCriteriaItem::NewLC( KAiwCmdCall,KAiwCmdCall,_L8( "*" ) );
CleanupStack::Pop(iCriteria)
MakeAiwCallL(const TDesC& aNumber,const TDesC& aName,TAiwCallType
aCallType )
{
// Create AIW interest
RCriteriaArray interest;
CleanupClosePushL( interest );
const TUid KUidAiwBase = { KAiwClassBase };
iCriteria->SetServiceClass( KUidAiwBase );
User::LeaveIfError( interest.Append( iCriteria ) );
// Attach to AIW interest
iServiceHandler->AttachL( interest );
// Create AIW param package
TAiwDialDataV1 data;
TAiwDialDataV1Pckg dataPckg( data );
iNameBuffer = aName.Left( iNameBuffer.MaxLength() );
data.SetName( iNameBuffer );
TAiwTelephoneNumber iTelNumber(aNumber);
iTelNumber = aNumber.Left( iTelNumber.MaxLength() );
data.SetTelephoneNumber( iTelNumber );
data.SetCallType( aCallType );
data.SetWindowGroup(CCoeEnv::Static()->RootWin().Identifier());
CAiwGenericParamList& paramList = iServiceHandler->InParamListL();
TPtrC8 ptr;
ptr.Set( dataPckg );
TAiwVariant variant( ptr );
TAiwGenericParam param(EGenericParamCallDialDataV1,variant);
paramList.AppendL( param );
// Execute AIW command
iServiceHandler->ExecuteServiceCmdL( KAiwCmdCall,
paramList,
iServiceHandler->OutParamListL());
// destroy interest
CleanupStack::PopAndDestroy( 1 );
}
Using the above function, it is possible to initiate a Voice, Video, and VoIP call as follows:
//To make Voice call
MakeAiwCallL( _L("345672323"), _L("FirstName LastName"),EAiwVoice);
//To make VoIP call
MakeAiwCallL( _L("user@sip.server.com")("FirstName LastName") ,EAiwVoIP);
//To make Video call
MakeAiwCallL( _L("345672323"), _L("FirstName LastName"),EAiwVideo);
//Memory clean up.
if(iCriteria)
{
delete iCriteria;
iCriteria = NULL;
}
if(iServiceHandler)
{
delete iServiceHandler;
iServiceHandler = NULL;
}


(no comments yet)