Solved

C# - TAPI Question

Posted on 2007-03-29
7
330 Views
Last Modified: 2008-01-09
Hi guys 'n gals,

I have a phone line attached to my computer's modem, I would like to make a bit of software which will, detect when a phone rings up the line connected to the computer, and tell me the number of the caller. Anybody have any ideas on this?

Cheers!
0
Comment
Question by:Cyber-Drugs
  • 4
  • 3
7 Comments
 
LVL 12

Accepted Solution

by:
ShazbotOK earned 500 total points
ID: 18815284
Use the CallNotificationEvent() to capture the CallerID...  This example is in VB.Net but could easily be converted to C# >:)

http://www.codeproject.com/useritems/CShart_TAPI_3x.asp?df=100&forumid=205449&exp=0&select=1190369
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18815389
Hi,

Thanks for the link, it's quite a large bit of code in there doing numerous different things, am I right in assuming I only need the following?


Import TAPI3Lib

        Private Sub CallNotificationEvent()
            ' here we should check to see various notifications of new and ended calls

            Select Case CallNotificationObject.Event

                Case CALL_NOTIFICATION_EVENT.CNE_MONITOR
                    ' the notification is for a monitored call

                Case CALL_NOTIFICATION_EVENT.CNE_OWNER
                    ' the notification is for an owned call
            End Select

        End Sub




and merely, convert that to C#, or do I need more for what I am trying to achieve?
0
 
LVL 12

Expert Comment

by:ShazbotOK
ID: 18815410
This is the event handler portion that you would need as well to process the event:
        Private CallInfoObject As ITCallInfoChangeEvent
        Private Sub CallInfoEvent()
            ' here you can extract information from the call

            'the code to extract the caller ID
            ' >>> put the following code in a try block and swallow the exception if it gives errors
            Dim CallerID As String
            CallerID = CallInfoObject.Call.CallInfoString(CALLINFO_STRING.CIS_CALLERIDNAME)

        End Sub
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18820412
Sorry to sound a bit daft, but what triggers the function call when the Modem is contacted by an outside phone line? Should I have something checking the status every few seconds, or how does this work?


Cheers!
0
 
LVL 12

Expert Comment

by:ShazbotOK
ID: 18823701
the code example that wz on codeproject creates a "listener" that connects to the TAPI... so you should not need anything more there...
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18851042
ShazbotOK,

Just to let you know, I haven't forgot about this question, I've just been quite a bit busy, I will hopefully to get to close this question off this evening, if everything goes smoothly.


Thank you for your patience thus far.
0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18913336
Sorry for taking so long to get around to accepting this question, I've been a bit busy with a few other things, thanks for your patience. :o)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET 5 Templates 2 78
Exit the loop 4 42
Media.Imaging 1 18
C# guarantee sql connection close 6 39
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question