Using RIL to hangup unwanted calls

来源:互联网 发布:软件标准规范建设内容 编辑:程序博客网 时间:2024/05/19 02:06

 

When a call is coming, the RIL will call our NotifyCallback functon. The first call will be with RIL_NOTIFY_RING notification code. The it will be called with RIL_NOTIFY_CALLERID notification code. At this point the the lpData member will contain the pointer to the structure RILREMOTEPARTYINFO. The raAddress member contains the caller address (number).

The RIL function RIL_Hangup can be used to hangup a call. The behavior of this function is defined by the RIL driver component. The function hangups a data call if one is active or a voice call in one is present. If both are active at the time of calling, it will hangup the voice call.

The sample application presented here is a single document interface document using MFC. Upon receiving the RIL_NOTIFY_CALLERID, the application searches a database to see whether the number is present or not. If the number is present in the database it will hangup the call. Using the main user interface you can insert, edit or delete the numbers in the database.

To compile this sample you should install Windows CE. An evaluation copy can be downloaded from the Microsoft Windows CE website.