0

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());
                }
            }
Naveed Yousaf
  • 436
  • 4
  • 14

1 Answers1

0

On most systems caller id is not available immediately. In North America caller id is sent after the first ring. To get caller id reliably, you need to handle CallInfo event in addition to the NewCall event. If caller id is not available in your NewCall event handler, it will be available later when CallInfo event is fired.