Window mobile 5.0 intercepts incoming calls

Source: Internet
Author: User

When developing an incoming call firewall or incoming call daemon, you must first intercept incoming calls and analyze them. The method to intercept incoming calls is generally the API functions provided by TAPI. These functions are used in TAPI. h.
1. initialize the line and open the line
DWORD linehandlecount;
Hline * linehandles;
Hlineapp lineapp;

If (lineinitialize (& lineapp, theapp. m_hinstance, (linecallback) linecallback, l "video", & linehandlecount) = 0)
{
Linehandles = new hline [linehandlecount];

For (DWORD I = 0; I <linehandlecount; I ++)
{

Int RC;
DWORD ver;
Lineextensionid extensionid;

If (linenegotiateapiversion (lineapp, I, 0x00010000, 0x00020000, & Ver, & extensionid) = 0)
{
Rc = lineopen (lineapp, I, & linehandles [I], Ver, 0, (DWORD) 0, linecallprivilege_monitor | linecallprivilege_owner, linemediamode_interactivevoice, null );
}
}
}

2. Compile the callback function to implement the function in this function.
Void callback linecallback (DWORD hdevice, DWORD dwmsg, DWORD dwcallbackinstance, DWORD dwparam1, DWORD dwparam2, DWORD dwparam3)
{
// Dwmsg is a line message
// Dwparam1 and dwparam2 are specific events
}

3. When it endsProgramClose the line
For (DWORD I = 0; I <linehandlecount; I ++)
Lineclose (linehandles [I]);

Delete [] linehandles;
Lineshudown (lineapp );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.