I am developing an application for land line phone using C# and Julmar.tapi3(itapi) library, When getting callerId its behaviour is inconsistent, When tracing code step by step then sometimes it returns callerid and most of the times it returns nothing.
I used the code found when searching but it returns empty string
This Link describes to open line in monitor mode to get caller id I tried but still same problem.
I had read somewhere that CallInfoChange event must be fired to get CallerId but its not firing in my case.
Does Itapi supports callerId
Below is the code I used to get caller id
private void IncomingForm_Load(object sender, EventArgs e)
{
_tapiMgr.Initialize();
foreach (TAddress addr in _tapiMgr.Addresses)
{
if (addr.QueryMediaType(TAPIMEDIATYPES.AUDIO))
{
try
{
TAPIMEDIATYPES mt = TAPIMEDIATYPES.AUDIO;
addr.OpenAndMonitor(mt);
// addr.Open(mt);
}
catch(TapiException ex)
{
}
}
}
}
private void OnNewCall(object sender, TapiCallNotificationEventArgs e)
{
if (e.Call.Privilege == CALL_PRIVILEGE.CP_OWNER)
{ MessageBox.Show(e.Call.get_CallInfo(CALLINFO_STRING.CIS_CALLERIDNUMBER).ToString());
}
}