Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 :
 
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 25-May-11 6:30am
Edited 14-Nov-12 2:23am
TorstenH.33.4K
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

thanX for ur suggestion bus that thing is not working properly when I start the Application it halts :(
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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:
case TAPI3Lib.TAPI_EVENT.TE_CALLINFOCHANGE:
callerid=a.Call.get_CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME).ToString();
                               MessageBox.Show(callerid);
 
  Permalink  

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



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100