首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian英文资料 >> Network >> 正文
Retrieving the dialed number in P800/P910.
作者:佚名    文章来源:不详    更新时间:2006-5-7 11:16:57

For a long time there has been this issue about retrieving the dialed number in UIQ devices. There have been numerous posts about the same where developers have complained about getting empty values when they query the number being dialed in the current call.

So here is the code for getting the dialed number of the present call. This blocking version of the code is only for the article. I have provided both the blocking/non-blocking versions in the demo application. Only the non-blocking version seems to run on the phone. The code as such is self explanatory .


void CExampleAppUi::GetRemotePartyNumber()
{
        TApaTaskList iTaskList(CEikonEnv::Static()->WsSession());       
        const TUid KUiduiqCall = { 0x101F6163 };
        TApaTask iThisTask = iTaskList.FindApp(KUiduiqCall);

        RAdvGsmPhone iPhone;
        RTelServer iServer;
        RTelServer::TPhoneInfo iPhoneInfo;
        RPhone::TLineInfo iLineInfo;
        RCall::TStatus iCallStatus;
        RAdvGsmCall iCall;
        RLine iLine;
        TRequestStatus iStatus;

        iServer.Connect();
        iServer.LoadPhoneModule( KGsmModuleName );
        TInt enumphone;
        User::LeaveIfError(iServer.EnumeratePhones(enumphone));
        if (enumphone < 1) {
                   User::Leave(KErrNotFound);
        }
        //Initialise the phone object
        User::LeaveIfError(iServer.GetPhoneInfo(0, iPhoneInfo));
        User::LeaveIfError(iPhone.Open(iServer, iPhoneInfo.iName));
        User::LeaveIfError(iPhone.GetLineInfo(0,iLineInfo));
        User::LeaveIfError(iLine.Open(iPhone,iLineInfo.iName));
       
        iStatus = KRequestPending;
        //first send the app to the background
        iThisTask.SendToBackground();
       
        iLine.NotifyStatusChange(iStatus, iCallStatus);
        User::WaitForRequest(iStatus);
        if(iStatus.Int()==KErrNone){
                switch(iCallStatus){
                        case RCall::EStatusDialling :
                        {
                                //come to the foreground
                                iThisTask.BringToForeground();
                                //now get the number of the present call
                                 RLine::TLineInfo lineInfo;
                             iLine.GetInfo(lineInfo);
                              iCall.OpenExistingCall(iLine, lineInfo.iNameOfLastCallAdded);
                              TBuf<20> myDialedNumber;
                              TBuf<20> myRemoteNumber;
                                RAdvGsmCall::TDialledNumberInfo myDialedNumberInfo;
                                RAdvGsmCall::TRemotePartyInfo myRemoteNumberInfo;
                                iCall.GetDialledNumberInfo(myDialedNumberInfo);
                                iCall.GetRemotePartyInfo(myRemoteNumberInfo);
                                myDialedNumber = myDialedNumberInfo.iNumber.iTelNumber;
                                myRemoteNumber = myRemoteNumberInfo.iNumber.iTelNumber;
                              iCall.HangUp();                               
                                CEikonEnv::InfoWinL(_L("Dialed number : "),myDialedNumber);
                                CEikonEnv::InfoWinL(_L("Remote party number : "),myRemoteNumber);

                      }
                        break;
                }
        }
        //cleanup stuff ,close all sessions        
        iCall.Close();
        iLine.Close();
        iPhone.Close();
        iServer.UnloadPhoneModule(KGsmModuleName);
        iServer.Close();


}

Also please do READ the readme.txt provided with the demo application as it has directions about the files which you need to compile the demo application.

Lastly , I would like to thank Tomer Egozi for helping me.

Demo + Source
This zip contains a small demo with its source code.


Please post all the queries regarding this issue on the forum.
相关文章:
How to detect if an application is launched by user or the startup list
Using SIP with Nokia Series60 and Asterisk
Getting the Current Cell Id using Symbian S60
My experiences making a Task Manager
Symbian OS Exec Calls
An application for Series 60 - a step-by-step example
Detecting user inactivity
Programming IrComm3 wire raw
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号