|
|
User login
Feeds |
Read SIM/Phone number...
|
|||||
| Tue, 2005-02-01 13:32 | |
Forum posts: 36
They only need to know ther IMSI and IMEI number.
Forum posts: 104
hello...
so ure saying that there is no way that i can access the GSM number?
I'm trying to make a network application, doesn't involved phone calls or SMS.. I just need to send the GSM number through the network..
I can prompt the user to enter his number but he might enter a different number or hemight enter someone's cellphone number.. so i was thinking that maybe i could get the number programatically..
"its all right, the gun isn't loaded."
Forum posts: 727
As the phone doesn't really know/have the number, the phone never sends the number when making a call or sending a message or browsing, or any other thing that accesses the network.
The operator's network looks the number up based on the SIM serial number (IMSI), and either sends it or doesn't send it (depending on whether sending it has been blocked - except for SMS/MMS with which it is always sent).
And even in those rare cases where an operator chooses to put the number on the SIM card, you need privileged access to the SIM application toolkit APIs (SATK). But because it isn't done, even if you could make the SATK calls, there's no guarantee that any numbers are there.
So, if you need the user's phone number, ask it from the user (or figure out a way to solve your problem without the number).
Forum posts: 18
You can use the API "RMobilePhone::GetSubscriberId()" to get the subscriber ID, which contains the phone number (last 10 digits).
Can refer SDK help for getting it
phalder
Forum posts: 278
MOBINFO.DLL :
http://www.symbian.com/developer/development/syslibs.html#mobinfo
MOBINFOTEST: (I can't compile it...)
http://developer.sonyericsson.com/getDocument.do?docId=68337
-- JumpJack --
Forum posts: 52
Basically, the SIM/Phone number (or officially International Mobile Subscriber Identifier, IMSI) is stored in the EF_IMSI file located in the SIM/USIM card. The ability to retrieve it with a client API is decided by respective vendors. For the project in which I'm participating now, the TSY does not support Symbian'S API RMobilePhone::GetSubscriberId(), but it provides its own HMI API to read EF_IMSI file. That API is for system's usage and will not be published to App developer.
I guess that you'd follow Symbian's API doc suggestion, as:
The TSY may not support client retrieval of the IMSI and a client can discover whether it is available using the GetIdentityCaps() request.
Best regards.
NewLC #2150
Forum posts: 17
i read the discussion and now finaly want to know we can get the any unique identification of any sim card to differentiate from other.
one of frnd suggest RMobilePhone::GetSubsriberIf(). but it's not available in SDK 2nd Edition is it in 3 rd edition.
Forum posts: 149
Symbian OS 9.x (3rd Edition):
#include <Etel3rdParty.h> // CTelephony
class CGetIMEI : public CActive
{
public:
static CGetIMEI* NewL();
~CGetIMEI();
public:
// Function for making the initial request
void StartL();
const TPtrC GetIMEI();
private:
CGetIMEI();
void ConstructL();
// From CActive
void RunL(); // Handle completion
void DoCancel();
private:
enum TGetIMEIState
{
EStart = 1,
EGetPhoneInfo,
EDone
};
private:
TInt iState; // State of the active object
CTelephony* iTelephony;
CTelephony::TPhoneIdV1 iPhoneId;
CActiveSchedulerWait iActiveSchedulerWait;
TBuf<CTelephony::KPhoneSerialNumberSize> iIMEI;
};
CGetIMEI* CGetIMEI::NewL()
{
ALLOCD(CGetIMEI*, self, CGetIMEI());
CleanupStack::PushL(self);
self->ConstructL();
CleanupStack::Pop(self);
return self;
}
CGetIMEI::CGetIMEI() : CActive(EPriorityHigh) // HIGH priority
{
iIMEI.Zero();
iState = EStart;
}
void CGetIMEI::ConstructL()
{
iTelephony = CTelephony::NewL();
CActiveScheduler::Add(this);
}
CGetIMEI::~CGetIMEI()
{
Cancel();
delete iTelephony;
}
void CGetIMEI::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetPhoneIdCancel);
}
void CGetIMEI::StartL()
{
Cancel(); // Cancel any request, just to be sure
iState = EGetPhoneInfo;
CTelephony::TPhoneIdV1Pckg phoneIdPckg( iPhoneId );
iTelephony->GetPhoneId(iStatus, phoneIdPckg);
SetActive(); // Tell scheduler a request is active
iActiveSchedulerWait.Start();
}
void CGetIMEI::RunL()
{
iState = EDone;
if ( iActiveSchedulerWait.IsStarted() )
{
iActiveSchedulerWait.AsyncStop();
if(iStatus == KErrNone)
{
iIMEI.Append(iPhoneId.iSerialNumber);
}
else
{
ERROR(PRINT("[IMEI_3rd.RunL] ERROR: returned " + CString::FromInt(iStatus.Int())));
}
}
}
const TPtrC CGetIMEI::GetIMEI()
{
StartL();
TPtrC ptr(iIMEI.Ptr());
return ptr;
}
CString GetImei()
{
#ifdef __WINS__
CString toRet = "8034049425440";
#else
CGetIMEI* getIMEI = CGetIMEI::NewL();
CString toRet(getIMEI->GetIMEI().Ptr(), getIMEI->GetIMEI().Length());
INFO(PRINT("[IMEI_3rd.GetIMEI] IMEI=[" + toRet + "]"));
DELETE(getIMEI);
#endif
return toRet;
}
For Symbian OS 6.x: http://www3.symbian.com/faq.nsf/0/ba491eaeb25c5c7d80256bf3003e75fc?OpenDocument&Highlight=2,IMEI
For Symbian OS 7/8:
(The top method has worked on all of the devices I have tested)
TPlpVariantMachineId imei;
PlpVariant::GetMachineIdL(imei);
CString toRet(imei.Ptr(), imei.Length() > 32 ? 32 : imei.Length());
DBG(PRINT("GetImei: Method 1 is %s", toRet.Get()));
return toRet;
// For use with Symbian OS v8.0 (Series 60 2nd Edition, FP2 and higher)
// Apparently will not work on Nokia 6630
// Link against Etel3rdParty.lib
//
/*
CTelephony::TPhoneIdV1 iPhoneId;
CTelephony* telephony = CTelephony::NewL();
CTelephony::TPhoneIdV1Pckg phoneInfo(iPhoneId);
TRequestStatus iStatus;
telephony->GetPhoneId(iStatus, phoneInfo);
User::WaitForRequest(iStatus);
TPtrC theIMEI(iPhoneId.iSerialNumber);
CString toRet(theIMEI.Ptr(), theIMEI.Length());
PRINT("GetImei: Method 2 is %s", toRet.Get());
return toRet;
*/
Forum posts: 1
As mentioned previously, you can ask the user to enter the phone number, but then how do you know it's true?
What can be done, is send an SMS to the phone number that the user entered, then check the messages and see if your message is in the inbox.
If it is, you know it's the right number.
Good luck,
Ofer
Forum posts: 27
Hi all,
Im assuming that this is a problem whereby the TSY does not support the given functionality.
I am using the following code: (http://wiki.forum.nokia.com/index.php/How_to_get_my_own_phone_number) to try to retrieve my MIDDN. I have the necessary access to the Binary access kit. However when I get to the section:
if(status.Int() == KErrNone)
{
CheckCapabilities(ownStoreInfo.iCaps);
if(ownStoreInfo.iUsedEntries < 1)
{
console->Printf(_L("No entry found.\n"));
User::Leave(KErrNotFound);
}
}
else
{
User::Leave(status.Int());
}
the application leaves with a KErrPermissionDenied.
Originally I had thought that this was a Permissions issue but after looking up the documentation I see that the APi requires ReadUserData permission which I have.
I am now thinking that it is the TSY that is retruning this error as it does not support the functionality. I am working on an N73 device.
Has anybody else seen this problem or managed to resolve it? I am particularly interested in the S60 third edition paltform.
Also I am wondering that even if the TSY returned the MISDN, would this work on most networks or can you be guarnteed that this API will retrieve it for all networks? Perhaps it is dependant on the operator?
~b