Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi everyone,
i am doing work on Telephony application the only requirement is that i have to show the incoming caller number on PC when i try the following code it doesnot do anything :

MSIL
class callnotification : TAPI3Lib.ITTAPIEventNotification
   {
       public delegate void listshow(string str);
       public listshow addtolist;
       public void Event(TAPI3Lib.TAPI_EVENT te, object eobj)
       {
           TAPI3Lib.ITCallStateEvent a;
           ITCallInfo b; ;
           string callerid="lol";
ITCollection2 calls;

           switch (te)
           {
               case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION:
                   addtolist("call notification event has occured");
                   break;
               case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE:
                   a = (TAPI3Lib.ITCallStateEvent)eobj;
                   b = a.Call;
                   switch (b.CallState)
                   {
                       case TAPI3Lib.CALL_STATE.CS_CONNECTED:
                           addtolist("Connected");
                           break;
                       case TAPI3Lib.CALL_STATE.CS_DISCONNECTED:
                          addtolist("Disconnected");
                           break;
                       case TAPI3Lib.CALL_STATE.CS_OFFERING:
                           {
                                callerid=a.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME).ToString();
                               MessageBox.Show(callerid);
                               addtolist("A party wants to communicate with you!");
                               break;
                           }
                   }
                   break;
           }
        //   MessageBox.Show(callerid, "Incoming call");
       }
       #region ITTAPIEventNotification Members
     void ITTAPIEventNotification.Event(TAPI_EVENT TapiEvent, object pEvent)
       {
           throw new NotImplementedException();
       }
       #endregion
   }





it just shot the notification but not giving me caller Number

Kindly Please help me Please
the bold area is not working Please Help me
Posted
Updated 14-Nov-12 2:23am
v3

CallerID implementation varies from modem manufacturers.(thinking that you are using your modem to have teh caller id).

Because of that, in order to activate the callerID you need to inform the modem with a command. You will need to find out how you modem passes the information through. You might be able to get the information using hayes commands.Or maybe it could be something like;

AT#CID=1 (or AT+VCID=1)
OK

You might want to test your modem for that.
How to Test a MODEM for Caller ID Support[^]

But there is one other issue that you should take into consideration too:

You have to double check with your carrier or provider for the caller ID support. A basic POTS line won't include this information unless the carrier has done some extra work to add it. For that support you need to pay a fee.

Also another helpful link with some code about this. check here[^].

Good luck,
Orc
 
Share this answer
 
v2
VB
thanX for ur suggestion bus that thing is not working properly when I start the Application it halts :(
 
Share this answer
 
C#
a.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME)

delay to return the caller id.
In your case u should put it to sleep for seconds and then try to get the caller id.

Or you can user another case:
C#
case TAPI3Lib.TAPI_EVENT.TE_CALLINFOCHANGE:
callerid=a.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME).ToString();
                               MessageBox.Show(callerid);
 
Share this answer
 
this worked for me!
https://itapi3.codeplex.com/discussions/580418[^]

Hope it help!
 
Share this answer
 
Comments
ali_heidari_ 25-Feb-15 11:39am    
Well i tried to say, it is modem driver problem! It should support callerID. It worked for me btw.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900