how to monitor a line

Jun 9, 2010 at 12:29 PM

Hi there,

I have managed to find my TAddress to a phone extension. How can I register a callback that is called when an incoming call occurs?


Jun 9, 2010 at 3:30 PM

I have found that


tapi.TE_CALLNOTIFICATION += delegate(object sender, TapiCallNotificationEventArgs e)
                Console.WriteLine("New call {0} detected from {1}", e.Call.ToString(), e.Event);

might be needed to monitor the line, but it is not clear how the event loop is started, i.e. what should I do to wait for an event to occur.

Feb 23, 2011 at 1:07 PM

Correct - you need to wire up to the manager's events (TE_xxx) and you will receive notifications.  When you wire up to the event, the library performs the appropriate RegisterXXX calls with TAPI to get that notification.  TAPI is event driven - there is no loop, instead there is a thread receiving the events for you and it forwards them to the event handlers you subscribe to.  I hope that helps!