Monitoring and Handling all incoming calls

Nov 22, 2009 at 6:53 AM

 

Hi All,

I am building a Mobile application in order to monitor and handle all the calls. Some calls will be hung up, forwarded or answered.
 In order to do this I have put the following code :
 
   

Telephony tapi = new Telephony();
    tapi.Initialize();
    CellularLine cl = tapi.CellularLineMediaMode.InteractiveVoice,CallPrivilege.Monitor | CallPrivilege.Owner); //
    cl.NewCall += new Line.NewCallHandler(CallAction);


    My call back function is:
    
   
void CallAction(Call call) {
    
        if(String.Compare(number,checkNumber)==0)
           call.Hangup();
           ...
    }

    
    In call back function I check if the number is a specific number.. if so, I hangup..
    But, the application work in one pass.. next time the user calls.. it simply does not hang up!!
    
    Any idea what is my mistake?
    
    Thanks for the help
    
    Regards,
    Abdel

 

Aug 3, 2010 at 5:45 PM
Hi Abdel, Did you ever manage to figure this out? I'm having exactly the same problem. Regards, Martin