Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Getting Incomming Caller Number

    Hello guys, I'm new and I want to make a simple application which retrieve an Incomming Caller Number and vizualize it when I press an option in a app menu. I'm using Nokia C5_00 and Symbian S60 3.2. I found som codes, but I don't know where exactly to implement them in Carbide C++. My base application is Hello World. The one code is :

    Code:
    TBuf<100> CallerNumber; if(iCurrentStatus.iStatus == CTelephony::EStatusRinging|| iCurrentStatus.iStatus == CTelephony::EStatusDialling)
    {	CTelephony::TRemotePartyInfoV1 RemInfoUse;
    	CTelephony::TCallInfoV1		   CallInfoUse;
    	CTelephony::TCallSelectionV1   CallSelectionUse;
     	CallSelectionUse.iLine = CTelephony::EVoiceLine;
    	CallSelectionUse.iSelect = CTelephony::EInProgressCall;
     	CTelephony::TRemotePartyInfoV1Pckg 	RemParty(RemInfoUse);
    	CTelephony::TCallInfoV1Pckg 		CallInfo(CallInfoUse);
    	CTelephony::TCallSelectionV1Pckg 	CallSelection(CallSelectionUse); 
    	iTelephony->GetCallInfo(CallSelection,CallInfo,RemParty);
     	if(iCurrentStatus.iStatus == CTelephony::EStatusRinging)	
                   {	
                    CallerNumber.Copy(RemInfoUse.iRemoteNumber.iTelNumber);
    	}	
                   else if(iCurrentStatus.iStatus == CTelephony::EStatusDialling)	
                   {					
                    CallerNumber.Copy(CallInfoUse.iDialledParty.iTelNumber);	 
                    }
    }
    The Other is :

    Code:
    void GetRemotePartyPhoneNumberL(TDes& aPhoneNumber)
    {	
    // Create a CTelephony object	
    CTelephony* telephony = CTelephony::NewLC();
     	CTelephony::TCallInfoV1 callInfoV1;
    	CTelephony::TCallInfoV1Pckg callInfoV1Pckg(callInfoV1);
     	CTelephony::TCallSelectionV1 callSelectionV1;
    	CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg(callSelectionV1);
     	CTelephony::TRemotePartyInfoV1 remotePartyInfoV1;
    	CTelephony::TRemotePartyInfoV1Pckg remotePartyInfoV1Pckg(remotePartyInfoV1);
     	callSelectionV1.iLine = CTelephony::EVoiceLine;
    	callSelectionV1.iSelect = CTelephony::EInProgressCall;
     	// Get the call info
    	User::LeaveIfError(telephony->GetCallInfo(callSelectionV1Pckg,callInfoV1Pckg, remotePartyInfoV1Pckg));
    	// Copy the remote party's phone number to the target descriptor
    	aPhoneNumber.Copy(remotePartyInfoV1Pckg().iRemoteNumber.iTelNumber);
     	CleanupStack::PopAndDestroy(); // telephony}
    I Want to vizualize the content of "CallerNumber" in the first code or on "aPhoneNumber" in the second code.
    Thank you very much and excuse me for bad English.

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Gurgaon,India
    Posts
    4,114

    Re: Getting Incomming Caller Number

    The following wiki link contains a running project attached to it, so you can give it a try :

    http://www.developer.nokia.com/Commu...ith_CTelephony

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    It works Perfect, Thank's yucca!

  4. #4
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    I try that today, it gives me a many errors. Some of them I removed. But there is one that I Can't.
    On Every case in the function there is a red X in front of it and it says "The message is tihs no matching function for call to `CRetrieveNumber::WriteToFile(TPtrC8)' "
    The code is this :

    Code:
    void CRetrieveNumber::RunL()
    {    
        if(iStatus==KErrNone)
        	{
        	   	
        	CTelephony::TCallStatus status = iCallStatus.iStatus;
           	
           	
           	switch ( status )
           			  {
           			  	case CTelephony::EStatusRinging:
           			  		{
           			  	    WriteToFile(_L8("EStatusRinging\n   "));
           			  		
           			  		iCallSelectionUse.iLine = CTelephony::EVoiceLine;
    						iCallSelectionUse.iSelect = CTelephony::EInProgressCall;
           			  		
           			  		iTelephony->GetCallInfo(iCallSelection,iCallInfo,iRemParty);
    						
    						TBuf8<100> CallerNumber;
    						
    						CallerNumber.Copy(iRemInfoUse.iRemoteNumber.iTelNumber);
    						WriteToFile(CallerNumber);
    						}
              				break;
              			case CTelephony::EStatusConnected :
              				{
              				WriteToFile(_L8("EStatusConnected\n   "));
              				}
                			break;
                		case CTelephony::EStatusAnswering :
                			{
                			WriteToFile(_L8("EStatusAnswering\n	   "));
                			}
                	        break;
    			     	case CTelephony::EStatusDialling:
    			     		{
                			WriteToFile(_L8("EStatusDialling\n   "));
                			}
                	        break;	
                	    case CTelephony::EStatusDisconnecting:
    	       				{
                			WriteToFile(_L8("EStatusDisconnecting\n   "));
                			}
                	        break;
    					case CTelephony::EStatusConnecting:
    						{
                			WriteToFile(_L8("EStatusConnecting\n   "));
                			}
                	        break;
    					case CTelephony::EStatusUnknown:
    						{
                			WriteToFile(_L8("EStatusUnknown\n   "));
                			}
    						break;
    					case CTelephony::EStatusIdle:
    						{
    						WriteToFile(_L8("EStatusIdle\n   "));
                			}
    						break;
    				    case CTelephony::EStatusReconnectPending:
    				    	{
                			WriteToFile(_L8("EStatusReconnectPending\n   "));
                			}
    						break;
    				    case CTelephony::EStatusHold:
    				    	{
                			WriteToFile(_L8("EStatusHold\n   "));
                			}
    						break;
    					case CTelephony::EStatusTransferring:
    				    	{
                			WriteToFile(_L8("EStatusTransferring\n   "));
                			}
    						break;
    				    case CTelephony::EStatusTransferAlerting:
    				    	{
                			WriteToFile(_L8("EStatusTransferAlerting\n   "));
                			}
    						break;  
    				  }
    		       	
    		       	iTelephony->NotifyChange( iStatus,
                                  CTelephony::EVoiceLineStatusChange,
                                  iCallStatusPkg );
           			SetActive();
           	  }
         	else
         		{
           	  	CEikonEnv::Static()->InfoWinL(_L("Error in:"), _L("status"));	
         		}  
    	}
    
    TInt CRetrieveNumber::RunError( TInt aError )
    {
    	return aError;
    }
    The Function is This

    Code:
    void CRetrieveNumber::WriteToFile(TDesC8& aContent8)
    {
    	_LIT(KFileSpec,"C:\\Nokia\\LogsTelephony.txt");
    	TInt iPos=0;
    	RFs iFs;
    	
    	User::LeaveIfError(iFs.Connect());
    	RFile iFile;
    		
    	TInt err = iFile.Open(iFs, KFileSpec, EFileShareExclusive|EFileStreamText|EFileWrite);
    	if(err!= KErrNone)
    		{
    		if (iFile.Create(iFs, KFileSpec, EFileShareExclusive|EFileStreamText|EFileWrite) != KErrNone)
    			{
    			err = iFile.Open(iFs, KFileSpec, EFileShareExclusive|EFileStreamText|EFileWrite);
    			}
    		}
    	
    	err =iFile.Seek(ESeekEnd,iPos);
    	if (err != KErrNone)
    		{
    		TBuf<10> errBuf;
    		errBuf.AppendNum(err);
    		CEikonEnv::InfoWinL(_L("Seek Unsuccessful"), errBuf);			
    		}	
    	
    	err = iFile.Write(aContent8);
    	iFile.Flush();
    
    	if (err != KErrNone)
    		{
    		TBuf<10> errBuf;
    		errBuf.AppendNum(err);
    		CEikonEnv::InfoWinL(_L("Write Unsuccessful"), errBuf);			
    		}
    	iFile.Close();
    	iFs.Close();
    	}

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,798

    Re: Getting Incomming Caller Number

    It may behave better if you take const references in the method:
    Code:
    void CRetrieveNumber::WriteToFile(const TDesC8& aContent8)

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    Yes, that worked and no errors now, but nothing happend. I call from other phone and nothing. The program is open and it must write som file, but no file.
    P.S. What is this file "aknappui.dso" And where can I find it?

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,798

    Re: Getting Incomming Caller Number

    Quote Originally Posted by fukatoki View Post
    Yes, that worked and no errors now, but nothing happend. I call from other phone and nothing. The program is open and it must write som file, but no file.
    How have you checked? Note that the built-in File Manager shows c:\Data as "Phone Memory". c:\Nokia applied to really old devices only.
    P.S. What is this file "aknappui.dso" And where can I find it?
    .dso files are the stub libraries for .dll-s (which are using the same concept as in other operating systems http://en.wikipedia.org/wiki/Dynamic-link_library)
    Based on the name aknappui.dso could implement mostly the CAknAppUi class, however I do not think that there would be a separate .dll/dso for this class. CAknAppUi itself is certainly used by any GUI application, it is the class managing the lifecycle of your application, startup, close, handling menu commands, initializing the controls/views.
    .dso files in general are located in epoc32\release\armv5\lib folder of your SDK.

  8. #8
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    Thank you, wizard! Tomorrow I'll try to rebuild my application with the corrections. Thank's again for the help.

  9. #9
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    Hello, I'm trying to build my application, but it found an error that says "\S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\release\ARMV5\LIB\aknappui.dso: No such file: No such file or directory". How can I pass it?

    The Console shows me this:

    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\helloworldbasic\group\ target gcce udeb
    make -r -f "\S60\devices\S60_3rd_FP2_SDK_v1.1\EPOC32\BUILD\Symbian\Carbide\workspace\helloworldbasic\group\GCCE.make" TARGET CFG=UDEB VERBOSE=-s
    arm-none-symbianelf-ld: \S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\release\ARMV5\LIB\aknappui.dso: No such file: No such file or directory
    make[1]: *** [\S60\devices\S60_3rd_FP2_SDK_v1.1\epoc32\release\GCCE\udeb\helloworldbasic_0xEADABAD1.exe] Error 1
    make: *** [TARGETHELLOWORLDBASIC] Error 2
    make -j 4 -s -C \Symbian\Carbide\workspace\helloworldbasic\group -f "ICONS_SCALABLE_DC.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\S60\devices\S60_3rd_FP2_SDK_v1.1\EPOC32\BUILD\Symbian\Carbide\workspace\helloworldbasic\group\ICONS_SCALABLE_DC\GCCE TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\helloworldbasic\group PLATFORM=GCCE CFG=UDEB BLD
    make -j 4 -s -C \Symbian\Carbide\workspace\helloworldbasic\HELP -f "BUILD_HELP.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\S60\devices\S60_3rd_FP2_SDK_v1.1\EPOC32\BUILD\Symbian\Carbide\workspace\helloworldbasic\group\BUILD_HELP\GCCE TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\helloworldbasic\group PLATFORM=GCCE CFG=UDEB BLD
    make -j 4 -s -r -f "\S60\devices\S60_3rd_FP2_SDK_v1.1\EPOC32\BUILD\Symbian\Carbide\workspace\helloworldbasic\group\HELLOWORLDBASIC\GCCE\HELLOWORLDBASIC.GCCE" UDEB

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,798

    Re: Getting Incomming Caller Number

    I really doubt that such file would exist, so from this point of view the message is correct.
    The question is why it is trying to access this file?
    Have you perhaps edited the .mmp file of this project? In its current form it may contain a reference to aknappui.lib in one of its LIBRARY lines. That reference should be removed.
    You can refer to HelloWorldBasic example in the SDK, and its .mmp file.
    If the issue stays, consider posting the problematic .mmp file here.

  11. #11
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    You are great. I remove this reference and now it work like a charm. Thank you for everyting.

  12. #12
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    Can i Compare a two telephone Numbers and if they are equal then passing the function?
    e.g. I've this number +359886858585 and I want to execute the function only when this number calls?

  13. #13
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Getting Incomming Caller Number

    Quote Originally Posted by fukatoki View Post
    Can i Compare a two telephone Numbers and if they are equal then passing the function?
    e.g. I've this number +359886858585 and I want to execute the function only when this number calls?
    you mean something like TDesC?
    http://www.symlab.org/main/documenta...7D10B8B23.html

  14. #14
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Re: Getting Incomming Caller Number

    Thank's, pavarang I've made it like this:
    Code:
    iCallSelectionUse.iLine = CTelephony::EVoiceLine;
    iCallSelectionUse.iSelect = CTelephony::EInProgressCall;
    iTelephony->GetCallInfo(iCallSelection,iCallInfo,iRemParty);
    TBuf8<100> CallerNumber;
    CallerNumber.Copy(iRemInfoUse.iRemoteNumber.iTelNumber);
    TBuf8<100> Number;
    Number.Copy(_L("+359XXXXXXXXXX"));
    if (CallerNumber==Number)
     {
        .... something
     }

  15. #15
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,184

    Re: Getting Incomming Caller Number

    Basically you should not compare full numbers, since you can not know whether the country code is there or not. So simply do the matching for example for 8 last digits.

Similar Threads

  1. How do I get caller's name/number
    By Leifm in forum Windows Phone General
    Replies: 6
    Last Post: 2011-12-04, 12:38
  2. How to get number of incomming call?
    By night_amir in forum Symbian
    Replies: 5
    Last Post: 2010-07-07, 07:56
  3. Replies: 1
    Last Post: 2010-06-01, 12:24
  4. Getting Caller Number
    By nobias in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2005-04-12, 07:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×