×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Emergency Call Codes

    Hello,

    With the following code, I'd like to get the emergency call codes on my phone:
    Code:
    TBuf<50> address;
    TInt ret = RProperty::Get(KPSUidTelephonyInformation, KTelephonyEmergencyNumbers, address);
    According to the documentation, the received value is of the following type:
    Code:
    /**
    * Space separated list of supported emergency call codes.
    * @type RProperty::EText
    */
    const TUint32 KTelephonyEmergencyNumbers = 0x00000001;
    Anyway, I always get KErrArgument (-6 / argument is out of range) as return value...

    Does someone have an idea what's wrong?

    Thanks for your help,
    Patrick

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

    Re: Emergency Call Codes

    As the API is not part of standard SDK, you mgiht want to check first that for which SDK the API isa said to be working, and use devices fro that platform to test the API.

    Also do check that KTelephonyEmergencyNumbers is really defined for KPSUidTelephonyInformation.

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    Yes, KTelephonyEmergencyNumbers has to be used in combination with KPSUidTelephonyInformation, as you can see from the code:
    Code:
    /**
    * Telephony Information API UID
    */
    const TUid KPSUidTelephonyInformation = {0x101F8789};
    
    /**
    * Space separated list of supported emergency call codes.
    * @type RProperty::EText
    */
    const TUint32 KTelephonyEmergencyNumbers = 0x00000001;
    The file is part of the SharedData package that is contained in the S60 3rd Ed. Maintenance Release API Plug-In package. Shouldn't it be compatible then with all devices from S60 3rd up to Nokia Belle?

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

    Re: Emergency Call Codes

    there are no compatibility promise on any API which is not part of the SDK, thus it could be that the API might have been replaced by something else. You should check whether API plug-in packages for newer platform versions would include any API for the task.

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

    Re: Emergency Call Codes

    Hello,
    i've looked into old symbian 3 sources, there's no KPSUidTelephonyInformation defined....
    but i found this description:
    http://www.symlab.org/main/documenta...5CCB7747A.html
    and the file contains:
    Code:
    #ifndef DEFAULTEMERGENCYNUMBERSCRKEYS_H
    #define DEFAULTEMERGENCYNUMBERSCRKEYS_H
    
    #include <e32std.h>
    
    /******************************************************************************
    * Default emergency numbers API
    * Keys under this category are used in defining product specific emergency
    * numbers.
    ******************************************************************************/
    const TUid KCRUidDefaultEmergencyNumbers = { 0x102078F1 };
    
    /**
    * Contains a space separated list of product specific default emergency numbers.
    * Can be empty, contain 1 number or more numbers.
    * Varies in different product variants.
    */
    const TUint32 KDefaultEmergencyNumbersList    = 0x00000001; 
    
    #endif // DEFAULTEMERGENCYNUMBERSCRKEYS_H
    
    // End of file
    hope it helps,
    regards
    pg

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: Emergency Call Codes

    (Minor remark: KCR... is Central Repository, so CRepository is the API you may want to try)

  7. #7
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    Thank you! That helps a lot. Will try if it works...

  8. #8
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    Hello Pavarang

    I've found an the Nokia_Symbian3_SDK_v1.0. But the file defaultemergencynumberscrkeys.h is not included there. Can you tell me where I can download the file defaultemergencynumberscrkeys.h?

    Many thanks!

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

    Re: Emergency Call Codes

    Quote Originally Posted by patrickfrei View Post
    Hello Pavarang

    I've found an the Nokia_Symbian3_SDK_v1.0. But the file defaultemergencynumberscrkeys.h is not included there. Can you tell me where I can download the file defaultemergencynumberscrkeys.h?

    Many thanks!
    Hello,
    entire content is in post #5, just put that code into a file blahblah.h and import into your code, or, for a quick try, just define

    Code:
    const TUid KCRUidDefaultEmergencyNumbers = { 0x102078F1 };
    const TUint32 KDefaultEmergencyNumbersList    = 0x00000001;
    right before using them

    regards,
    pg

  10. #10
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    O.k., great. Thanks!

  11. #11
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    Hi

    I've tried it again on Anna, Belle and 5th ed. devices, but the code always fails with return code KErrNotFound (-1). Header file is included properly.

    Example #1 (TInt):
    Code:
    TInt numbers;
    TInt ret = RProperty::Get(KCRUidDefaultEmergencyNumbers, KDefaultEmergencyNumbersList, numbers);
    aEmergencyNumbers.AppendNum(numbers);
    Example #2 (TBuf):
    Code:
    TBuf<50> numbers;
    TInt ret = RProperty::Get(KCRUidDefaultEmergencyNumbers, KDefaultEmergencyNumbersList, numbers);
    aEmergencyNumbers.Append(numbers);
    Do you have an idea why? Thanks!

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

    Re: Emergency Call Codes

    I suppose you did not read what Wizard said on #6. You are using id's specified for CRepository API usage, thus RProperty will fail with -1 (KerrNotFound), so try using the actual APIO the Ids are defined for.

  13. #13
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Switzerland
    Posts
    476

    Re: Emergency Call Codes

    I've read this on #6. But I don't exactly understand what he means... What shall I exactly do and from where do I get these ID's?

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

    Re: Emergency Call Codes

    Quote Originally Posted by patrickfrei View Post
    I've read this on #6. But I don't exactly understand what he means... What shall I exactly do and from where do I get these ID's?
    Hello,
    i'm not in front of my work pc, so this is the first and quick example i found, i hope it helps:
    http://developer.nokia.com/Community...ng_CRepository

    just use keys of this thread instead of keys of the example :-)

    regards,
    pg

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

    Re: Emergency Call Codes

    yep, the point is that its different API you need to use, and indeed the given example shows on how to use it.

Similar Threads

  1. How to make emergency call in symbian ~3
    By krishnaramram in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2011-09-14, 14:03
  2. Detection of emergency call
    By Vibodh in forum VoIP
    Replies: 1
    Last Post: 2010-09-04, 08:54
  3. Emergency call problem with ctelephony
    By ram4soft in forum Symbian
    Replies: 0
    Last Post: 2010-06-09, 12:11
  4. Emergency call number
    By tektronic in forum Symbian
    Replies: 8
    Last Post: 2008-07-31, 15:09
  5. How can I make an emergency call by code?
    By asingoro in forum Symbian
    Replies: 5
    Last Post: 2007-07-05, 03:45

Posting Permissions

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