【转】Using RIL to hangup unwanted calls

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.

posted @ 2016-03-02 11:34  91program  阅读(148)  评论(0编辑  收藏  举报