×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    IMSI code example

    I had tried following three examples and they gets compiled but i am still not been able to see the IMSI huh

    In every case application exits..

    I think i am doing something wrong.. please suggest

    Example 1:

    RTelServer server;
    CleanupClosePushL(server);
    User::LeaveIfError(server.Connect());

    //Load in the phone device driver
    User::LeaveIfError(server.LoadPhoneModule(KTsyName));

    //Find the number of phones available from the tel server
    TInt numberPhones;
    User::LeaveIfError(server.EnumeratePhones(numberPhones));

    //Check there are available phones
    if (numberPhones < 1)
    User::Leave(KErrNotFound);

    //Get info about the first available phone
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(server.GetPhoneInfo(0, info));

    //Use this info to open a connection to the phone, the phone is identified by its name
    //RAdvGsmPhone phone;
    //CleanupClosePushL(phone);
    //User::LeaveIfError(phone.Open(server, info.iName));

    RMobilePhone phone;
    CleanupClosePushL(phone);
    User::LeaveIfError(phone.Open(server, info.iName));

    TRequestStatus satus;
    RAdvGsmPhone::TSubscriberId imsiNumber;
    phone.GetSubscriberId(satus, imsiNumber);
    User::WaitForRequest(satus);

    CAknInformationNote* informationNote;
    informationNote = new (ELeave) CAknInformationNote;
    informationNote->ExecuteLD(imsiNumber);



    // imsiNumber is a TBuf which contains the IMSI number
    CleanupStack::PopAndDestroy(2);//phone, line


    //Unload the phone device driver
    User::LeaveIfError(server.UnloadPhoneModule(KTsyName));

    //Close the connection to the tel server and remove it from the cleanup stack
    CleanupStack::PopAndDestroy(&server);

    ------------------------------------------------------

    Example 2:

    TMobileIMSI kImsi;
    TRequestStatus status;

    CMobileInfo* iMobile = CMobileInfo::NewL();

    iMobile->GetIMSI(kImsi, status);

    User::WaitForRequest(status);
    //User::After(8000000);

    CAknInformationNote* informationNote;
    informationNote = new (ELeave) CAknInformationNote;
    informationNote->ExecuteLD(kImsi);

    ------------------------------------------------------------

    Example 3:

    RTelServer server;
    CleanupClosePushL(server);
    User::LeaveIfError(server.Connect());

    //Load in the phone device driver
    User::LeaveIfError(server.LoadPhoneModule(KTsyName));

    //Find the number of phones available from the tel server
    TInt numberPhones;
    User::LeaveIfError(server.EnumeratePhones(numberPhones));

    //Check there are available phones
    if (numberPhones < 1)
    User::Leave(KErrNotFound);

    //Get info about the first available phone
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(server.GetPhoneInfo(0, info));


    RMobilePhone phone;
    CleanupClosePushL(phone);
    User::LeaveIfError(phone.Open(server, info.iName));
    TRequestStatus status;
    RMobilePhone::TMobilePhoneSubscriberId aIMSI;
    phone.GetSubscriberId(status,aIMSI);

    User::WaitForRequest(status);
    //User::After(5000000);

    CAknInformationNote* informationNote1;
    informationNote1 = new (ELeave) CAknInformationNote(); //ETrue);
    informationNote1->ExecuteLD(aIMSI);

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803

    Re: IMSI code example

    Hi,

    are you sure that the problem is in this code? Maybe this code is never executed because your application crashes before it reaches it. Try to add logging to your app and determine what line of code causes a problem.
    Regards,
    ivey

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: IMSI code example

    Hello dear,
    try out with following:

    RTelServer iServer;
    RMobilePhone iPhone;
    RMobilePhone::TMobilePhoneSubscriberId iImsi;
    TRequestStatus iImsiStatus;
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(iServer.Connect());
    User::LeaveIfError(iServer.GetPhoneInfo(0, info));
    User::LeaveIfError(iPhone.Open(iServer, info.iName));
    iPhone.GetSubscriberId(iImsiStatus, iImsi);
    User::WaitForRequest(iImsiStatus);


    Regards,
    Kiran.

  4. #4
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    Re: IMSI code example

    Quote Originally Posted by kiran10182
    Hello dear,
    try out with following:

    RTelServer iServer;
    RMobilePhone iPhone;
    RMobilePhone::TMobilePhoneSubscriberId iImsi;
    TRequestStatus iImsiStatus;
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(iServer.Connect());
    User::LeaveIfError(iServer.GetPhoneInfo(0, info));
    User::LeaveIfError(iPhone.Open(iServer, info.iName));
    iPhone.GetSubscriberId(iImsiStatus, iImsi);
    User::WaitForRequest(iImsiStatus);


    Regards,
    Kiran.
    Ok Kiran i will try this as well.. I was lucky to that i make it run on Nokia 7610, but not lucky enough to run on Nokia 6600..

    Does ur code works well for Nokia 6600 ??

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: IMSI code example

    Absolutely.

    It works flawlessly on Nokia 6600 and Nokia 3230.
    These two models i have tested on regorously.
    It must work on Nokia 6600.

    If u find any problem meanwhile yr development, u r free to ask anyrhing.

    Regards.
    Kiran.

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: IMSI code example

    Hi,

    I also think that there should not be problem with getting IMSI, try to log every line into file and double check that everything passed fine...

    Bye
    STeN

  7. #7
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    Re: IMSI code example

    Thanks both of you...
    This one is working fine on Nokia 6600 :-)

  8. #8
    Registered User
    Join Date
    Apr 2006
    Posts
    12

    Re: IMSI code example

    etelmm.h is not public,so i cannot use some functions like "getSubscribedID()" and so on.Does anyone know how to use them?

    regards

    Jason

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: IMSI code example

    Hello dear,
    I don't find any problem using it.
    What's yr problem exactly!!!

    U just need to have etelmm.h in yr sdk's include directory.
    There are some other files and libraries to be included though.
    And then u need to have entry in yr project.
    That's it.

    Regards.
    Kiran.

  10. #10
    Registered User
    Join Date
    Apr 2006
    Posts
    12

    Re: IMSI code example

    Thanks for you reply,btw,what`s your sdk version ? 2th FP2??

    My sdk version is 2th FP2 and there are no such functions like "getSubscribeID()" in etelmm.h

    regards

    Jason

  11. #11
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: IMSI code example

    Give me yr mail id:
    I'll send u that file.

    Regards.
    Kiran.

  12. #12
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    Red face Re: IMSI code example

    Hi Kiran,

    I am 1 of the needy. Could you sent me the etelmm.h, and libs (if possible) too.

    Thanks very much. my email is zichangfu@hotmail.com

  13. #13
    Registered User
    Join Date
    Oct 2006
    Location
    philippines
    Posts
    40

    Re: IMSI code example

    hi all...does this work on s60 8.0a fp2?
    im trying to get imsi or msisdn for a n6680 unit..

    thanks..
    misfit - a square peg in a round hole.

  14. #14
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: IMSI code example

    Hi,
    Quote Originally Posted by misfit.physics
    hi all...does this work on s60 8.0a fp2?
    im trying to get imsi or msisdn for a n6680 unit..

    thanks..
    Yes, Of course it works for s60 8.0a fp2.
    http://discussion.forum.nokia.com/fo...ad.php?t=87959

    Moreover search for "GetSubscriberId" on the forum, you would get good stuffs within.

    Regards.
    Kiran.

  15. #15
    Super Contributor
    Join Date
    Mar 2004
    Location
    Bangalore,India
    Posts
    2,146

    Re: IMSI code example

    I am wondering if there is a way to find out the kind of connection i am using.

    Say a pre-paid or a post paid connection..

    if pre paid then whats the balance on the card..?

    would sending out at commands or something do the trick..

    has anyone tried this before..?

    Cheers
    mayank

Similar Threads

  1. Replies: 2
    Last Post: 2007-10-05, 20:40
  2. Security code bug on 6230!
    By dabII in forum General Development Questions
    Replies: 1
    Last Post: 2005-05-17, 17:21
  3. Replies: 0
    Last Post: 2005-05-08, 12:32
  4. How to handle a response with HTTP status code 100 (Continue)?
    By danieldkim in forum Mobile Java General
    Replies: 5
    Last Post: 2004-01-19, 10:54
  5. Why is client code to CSocketEngine hanging at Access Point dialogue?
    By nawkboy in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2003-03-11, 11:16

Posting Permissions

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