locked
Phone Active Call Status ? RRS feed

  • Question

  • Hello everybody!

    I'm new to WM development, I want to ask a question :

    When user make a call (let say A call B) , how to known when B answer A ?

    I want to known when the call is connected to do vibrate the phone :)

    BTW: I want to do it in native API, it will perform faster :D

    thanks


    Nguyễn Nhật Dũng
    Tuesday, June 15, 2010 11:07 AM

Answers

  • You can use snapi (state and notifications api) to register with the OS and get notified about the active calls. Take a look at this thread below,

    http://social.msdn.microsoft.com/Forums/en/windowsmobiledev/thread/949a996b-9bfd-4a58-9dd4-4fbe10d43984

    Quoting Chunsheng Tang,

    <>
    Using the State and Notifications Broker in Native Code
    http://msdn.microsoft.com/en-us/library/bb154479.aspx  

    The related constants are defined in snapi.h:

    ////////////////////////////////////////////////////////////////////////////////
    // PhoneCallCalling
    // Gets a value indicating whether the phone is currently attempting to connect an outgoing call.
    #define SN_PHONECALLCALLING_ROOT HKEY_LOCAL_MACHINE
    #define SN_PHONECALLCALLING_PATH TEXT("System\\State\\Phone")
    #define SN_PHONECALLCALLING_VALUE TEXT("Status")
    #define SN_PHONECALLCALLING_BITMASK 0x20000

    ////////////////////////////////////////////////////////////////////////////////
    // PhoneActiveCallCount
    // Gets the number of active phone calls.
    #define SN_PHONEACTIVECALLCOUNT_ROOT HKEY_LOCAL_MACHINE
    #define SN_PHONEACTIVECALLCOUNT_PATH TEXT("System\\State\\Phone")
    #define SN_PHONEACTIVECALLCOUNT_VALUE TEXT("Active Call Count")
    <>

     

    Prabhu
    www.geekswithblogs.net/techtwaddle

    • Marked as answer by warrentang Friday, June 18, 2010 8:19 AM
    Tuesday, June 15, 2010 3:46 PM

All replies

  • You can use snapi (state and notifications api) to register with the OS and get notified about the active calls. Take a look at this thread below,

    http://social.msdn.microsoft.com/Forums/en/windowsmobiledev/thread/949a996b-9bfd-4a58-9dd4-4fbe10d43984

    Quoting Chunsheng Tang,

    <>
    Using the State and Notifications Broker in Native Code
    http://msdn.microsoft.com/en-us/library/bb154479.aspx  

    The related constants are defined in snapi.h:

    ////////////////////////////////////////////////////////////////////////////////
    // PhoneCallCalling
    // Gets a value indicating whether the phone is currently attempting to connect an outgoing call.
    #define SN_PHONECALLCALLING_ROOT HKEY_LOCAL_MACHINE
    #define SN_PHONECALLCALLING_PATH TEXT("System\\State\\Phone")
    #define SN_PHONECALLCALLING_VALUE TEXT("Status")
    #define SN_PHONECALLCALLING_BITMASK 0x20000

    ////////////////////////////////////////////////////////////////////////////////
    // PhoneActiveCallCount
    // Gets the number of active phone calls.
    #define SN_PHONEACTIVECALLCOUNT_ROOT HKEY_LOCAL_MACHINE
    #define SN_PHONEACTIVECALLCOUNT_PATH TEXT("System\\State\\Phone")
    #define SN_PHONEACTIVECALLCOUNT_VALUE TEXT("Active Call Count")
    <>

     

    Prabhu
    www.geekswithblogs.net/techtwaddle

    • Marked as answer by warrentang Friday, June 18, 2010 8:19 AM
    Tuesday, June 15, 2010 3:46 PM
  • thanks!, i'll try

    btw:

     nc.dwMask      = SN_PHONECALLCALLING_BITMASK;

    i want to use :
    #define SN_PHONEACTIVECALLCOUNT_ROOT HKEY_LOCAL_MACHINE

    #define SN_PHONEACTIVECALLCOUNT_PATH TEXT("System\\State\\Phone")

    #define SN_PHONEACTIVECALLCOUNT_VALUE TEXT("Active Call Count")

    what should i give nc.dwMask ?


    Nguyễn Nhật Dũng
    Saturday, June 19, 2010 11:13 AM