电话客户端扩展API

本文介绍电话客户端扩展API的功能及使用方法,包括静音默认铃声、静音/取消静音麦克风、接听挂断电话等操作。此外还介绍了如何通过此API实现多方通话和基本的呼叫转移等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Phone Client Extension API
电话客户端扩展API

Note!
This API is not part of the public SDK. It can be found in the SDK API Plug-in.
这不是公共API的一部分


Purpose
The general purpose of using Phone Client Extension API is for performing Voice Call related functionalities
like muting/unmuting microphone during a call, muting the default ringtone when phone ringing starts.

这个API提供语音通话相关功能,比如在通话中 对麦克风 静音/取消静音 ,在电话响起时静音默认的铃音。

Apart from these, the phone client extension API can also be used for general voice call functionalities like Answer an incoming call,
hold up/ resume, hangup call, call transfer, basic Multiparty call. This can also be used to handle VoIP calls.
Phone Client Extension does not provide apis for removing a participant from basic multi party conversation.

To have more control over mutiparty conversation, for example to remove a single participant from multiparty conversation,
 we have to implement call dialing part with CTelephony. So that we can track individual call with their call ids
and removing a particular participant can be easily done with CTelephony Hangup.

Use cases
How to build an application to implement code which does mute the default ring tone and mute/un mute the microphone volume of the phone,
basic Call transfer and Multi party conversation.
Sample application is attached which can be used to answer, hangup/resume and hold VoIP calls using phone client extension apis.

Example code
Header files: PhCltExt.h, RPhCltServer.h
Libraries: Phoneclient.LIB

_LIT( KPhCltExtLib, "PhoneClientExt.dll" );
 RLibrary                    iLibrary;
 CPhCltExtFactory*           iFactory = NULL; // Factory class for creating command handler
 User::LeaveIfError( iLibrary.Load( KPhCltExtLib ) ); // Load PhoneClientExt  dll
 TInt res = 0; TInt err=0;
 TRAP(err,res = iLibrary.Lookup( 1 )());
 if ( !err )
 {// Factory creation was successful.
        iFactory = reinterpret_cast< CPhCltExtFactory * >( res );}
 
 CPhCltCommandHandler*       iCommandHandler = NULL;
 if ( iFactory )
        {// Factory creation was successful, create Command Handler.
            iCommandHandler = iFactory->CPhCltCommandHandlerLD();
        }
 RPhCltServer iPhoneClient;
 User::LeaveIfError ( iPhoneClient.Connect() ); //connect to Phone Server
 iCommandHandler->Open( iPhoneClient );
 
 // Muting the default ringing tone
 TRequestStatus status;
 iCommandHandler->MuteRingingTone(status);
 User::WaitForRequest(status);
 
 // For Muting microphone volume
 TRequestStatus status;
 iCommandHandler->MuteMicrophone( status,ETrue);
 User::WaitForRequest(status);
 
 // For Un muting microphone volume
 TRequestStatus status;
 iCommandHandler->MuteMicrophone( status,EFalse);
 User::WaitForRequest(status);
 
 //For Adding new call
 //EPhCltChldThree Add a held call to the conversation.
 //This Code adds a participant to Multi party conversation
 iPhCommandHandler->Chld(iStatus,EPhCltChldThree,0);
 SetActive();
 
 //For hold/resume call
 //EPhCltChldTwo Place all active calls on hold and accept the other
 //(held or waiting) call.
 iPhCommandHandler->Chld(iStatus,EPhCltChldTwo,0);
 SetActive(); 
                                                                              .  
 //For Hang up call
 iPhCommandHandler->Chup( iStatus );
 SetActive(); 
 
 //For Transfering call
 //EPhCltChldFour Connect the two calls and disconnect the subscriber from both
 //calls (Explicit call transfer).
 iPhCommandHandler->Chld(iStatus,EPhCltChldFour,0);
 SetActive();

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值