Hi Jeffry,
I don't know why they make this so hard, but here's how I get the phone number.
It works on all models. One note, though, the phone has to be powered to get
this information.
Char* number = NULL;
PhnAddressList list;
PhnAddressHandle address;
Err err = errNone;
PhnLibOpen(phoneLibrary);
if (IsCDMA())
{
err = PhnLibGetOwnNumbers(phoneLibrary, &list);
if (!err)
{
err = PhnLibAPGetNth(phoneLibrary, list, 1, &address);
if (!err && address)
{
number =
PhnLibAPGetField(phoneLibrary,address,phnAddrFldPhone);
MemHandleFree(address);
}
}
}
else
{
err = PhnLibGetOwnNumbers(phoneLibrary, &list);
if (!err)
{
err = PhnLibGetNth(phoneLibrary, list, 1, &address);
if (!err && address)
{
number =
PhnLibGetField(phoneLibrary,address,phnAddrFldPhone);
MemHandleFree(address);
}
}
}
if (number)
{
StrCopy(destNumber,number);
MemPtrFree (number);
}
PhnLibClose(phoneLibrary);
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeffry Loucks
Sent: Friday, December 17, 2004 5:29 PM
To: Palm Developer Forum
Subject: HELP! Retrieving phone info on Treo 600 and 650
Any help would be appreciated.
I've asked this question mostly before, but so far nobody admits to knowing
anything about the subject.
I need to programatically retrieve the ESN, IMSI(MIN) and phone number from
the Treo 6x0 CDMA phones for use in identifying the phone and subscriber to
a billing network.
I have successfully retrieved the IMEI, IMSI and sometimes phone number from
a Treo 600 GSM.
I cannot retrieve any of the info on a Treo 6x0 CDMA, except ESN on the Treo
600 (Treo 650 crashes when I try the same call).
The documentation is severly limited, and where it does suggest a possible
API, they either don't work or cause a fatal exceptions.
BTW: the Treo 650 exception when I call PhnLibCardInfoEx() is:
"TILUtilsCDMAHtc.c, Line:69, Not NV read response"
--------------------
Jeff Loucks
Work 425-284-1128 [EMAIL PROTECTED]
Home 253-851-8908 [EMAIL PROTECTED]
Mobile 253-691-8812
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/