Solved

Intercept Caller ID Info??

Posted on 2001-07-16
6
462 Views
Last Modified: 2010-07-27
Hi, is there any way I could intercept the caller id info coming from my modem, when my phone rings, without using shareware activex component(s)?  In HyperTerminal, when I connect directly to COM3 (my modem) and type "AT+VCID=1", the next time my phone rings I get the date, time, name, and number of the person calling...

Thx!
0
Comment
Question by:darknite
6 Comments
 
LVL 5

Accepted Solution

by:
GeoffKell earned 200 total points
ID: 6288698
It's worth a read of

http://www.ainslie.org.uk/callerid/cli_faq.htm#Q_29

Regards
GK

0
 

Author Comment

by:darknite
ID: 6290516
Thanx, from that page i've got this code:

Public Function GetVarInfo(strdata As String, lngOffset As Long, lngLength As Long) As String
'
' pluck something out of a long string
'
Dim strTemp As String
'
    GetVarInfo = Mid(strdata, lngOffset, lngLength)
'
End Function

'Added the extra mem variable to hold the variable sized data returned by the
'linegetcallinfo function in the application
Global Const LINECALLINFO_FIXEDSIZE = 296
Global Const LINECALLINFO_VARSIZE = 500
Global Const LINECALLINFO_TOTALSIZE = LINECALLINFO_FIXEDSIZE + LINECALLINFO_VARSIZE

Type LINECALLINFO
    dwTotalSize As Long
    dwNeededSize As Long
    dwUsedSize As Long

    hLine As Long
    dwLineDeviceID As Long
    dwAddressID As Long

    dwBearerMode As Long
    dwRate As Long
    dwMediaMode As Long

    dwAppSpecific As Long
    dwCallID As Long
    dwRelatedCallID As Long
    dwCallParamFlags As Long
    dwCallStates As Long

    dwMonitorDigitModes As Long
    dwMonitorMediaModes As Long
    DialParams As LINEDIALPARAMS

    dwOrigin As Long
    dwReason As Long
    dwCompletionID As Long
    dwNumOwners As Long
    dwNumMonitors As Long

    dwCountryCode As Long
    dwTrunk As Long

    dwCallerIDFlags As Long
    dwCallerIDSize As Long
    dwCallerIDOffset As Long
    dwCallerIDNameSize As Long
    dwCallerIDNameOffset As Long

    dwCalledIDFlags As Long
    dwCalledIDSize As Long
    dwCalledIDOffset As Long
    dwCalledIDNameSize As Long
    dwCalledIDNameOffset As Long

    dwConnectedIDFlags As Long
    dwConnectedIDSize As Long
    dwConnectedIDOffset As Long
    dwConnectedIDNameSize As Long
    dwConnectedIDNameOffset As Long

    dwRedirectionIDFlags As Long
    dwRedirectionIDSize As Long
    dwRedirectionIDOffset As Long
    dwRedirectionIDNameSize As Long
    dwRedirectionIDNameOffset As Long

    dwRedirectingIDFlags As Long
    dwRedirectingIDSize As Long
    dwRedirectingIDOffset As Long
    dwRedirectingIDNameSize As Long
    dwRedirectingIDNameOffset As Long

    dwAppNameSize As Long
    dwAppNameOffset As Long

    dwDisplayableAddressSize As Long
    dwDisplayableAddressOffset As Long

    dwCalledPartySize As Long
    dwCalledPartyOffset As Long

    dwCommentSize As Long
    dwCommentOffset As Long

    dwDisplaySize As Long
    dwDisplayOffset As Long

    dwUserUserInfoSize As Long
    dwUserUserInfoOffset As Long

    dwHighLevelCompSize As Long
    dwHighLevelCompOffset As Long

    dwLowLevelCompSize As Long
    dwLowLevelCompOffset As Long

    dwChargingInfoSize As Long
    dwChargingInfoOffset As Long

    dwTerminalModesSize As Long
    dwTerminalModesOffset As Long

    dwDevSpecificSize As Long
    dwDevSpecificOffset As Long
    mem As String * LINECALLINFO_VARSIZE
End Type

'///////////////////////////////////////////////////////////////////////////
' The Line_Device_Type user-defined structure collects all of the variables associated
' with a Telephone Line being used by the TAPI functions in the application.
'///////////////////////////////////////////////////////////////////////////

Type Line_Device_Type
    Device_Name As String               'Device Name for a Telephone Line (Dialogic XXXX).
    LineID As Integer                   'Device Driver ID for a Telephone Line (0,1,2 Channel #).
    lphLine As Long                     'Device ID for a Telephone Line (XXXXXX).
    udtLineCall As LINECALLPARAMS       'Parameters filled in after the Line is Initialized.
    Reply_ID As Long                    'Reply ID returned by asynchronous TAPI Functions.
    lhActiveCall As Long                'Handle ID to an Active Call (Out/In Bound).
    Line_Open As Boolean                'True: If Line is opened
    Line_Has_Call As Boolean            'True: If Line has a Call
    CallerIDAddress As String           'Caller ID Address (Phone #)received on line
    CallerID_Flag As Integer            'Caller ID flags received on line
End Type

'Parameters:        pLineDevice         'Line Device Record Structure.
'
'Return:            String: Description of Call Progress State.
'
Function TAPI_GetCallerID(pLineDevice As Line_Device_Type) As Boolean
'Local Variables.
Dim RetCode As Long                 'Error Code returned from the TAPI fucnctions.
                                    ' (0=Success).
Dim Success As Boolean              'True: If the function executes successfully.
Dim TempLineInfo As LINECALLINFO    'Structure needed to retrieve the Caller ID.
Dim TempCallerID As String          'Caller ID status for the trace file.

    'Initialize Local Variables.
    Success = True
    TempCallerID$ = "Unknown"

    'Set the Total Size of the Caller ID Structure.
    TempLineInfo.dwTotalSize = LINECALLINFO_TOTALSIZE

    'Retrieve the Call Information for the Inbound Line.
    RetCode = lineGetCallInfo(pLineDevice.lhActiveCall, TempLineInfo)
    If RetCode < 0 Then 'If un-successful.
        AddText DisplayPanel, TAPIErrMsg(RetCode) & " - Line Get Caller ID"
        Success = False
        TempCallerID$ = "Error getting Caller ID"
    Else 'If Successful.
        'Save Caller ID Flags
        pLineDevice.CallerID_Flag = CInt(TempLineInfo.dwCallerIDFlags)
        'Test to see that the CallerIDFlags has the bit for Caller Party ID set.
        If (TempLineInfo.dwCallerIDFlags And LINECALLPARTYID_ADDRESS) Then
            'Test to see if the CallerID Offset and Size is greater than 0.
            If (TempLineInfo.dwCallerIDOffset > 0) _
            And TempLineInfo.dwCallerIDSize > 0 Then
                'Set the Caller ID Address found in the Memory Buffer of the Structure.
                pLineDevice.CallerIDAddress$ = GetVarInfo(TempLineInfo.mem, (TempLineInfo.dwCallerIDOffset - LINECALLINFO_FIXEDSIZE + 1), TempLineInfo.dwCallerIDSize - 1)
                TempCallerID$ = pLineDevice.CallerIDAddress$
            Else 'If Offset or Size is not found.
                TempCallerID$ = "Unknown - No Offset/Size"
            End If
        Else 'If LINECALLPARTYID_ADDRESS bit is not set.
            TempCallerID$ = "Unknown - Flags: " & "(" & Trim$(Str$(TempLineInfo.dwCallerIDFlags)) & ")"
        End If

        'Display results.
    End If
    AddText DisplayPanel, "Line Get Caller ID: " & TempCallerID$

    'Return Success Status.
    TAPI_GetCallerID = Success

End Function

'-------------------- END CODE --------------------------

But, I have no idea what to do with it!!?  Also, it keeps telling me that there are two user-types that are undefined... i'm not sure what I have to do there either cause they look defined to me!?


Any help would be greatly appreciated, thanks!
0
 
LVL 1

Expert Comment

by:ncw
ID: 6716397
I'm trying to do the same thing. I've been lookinig at http://www.yes-tele.com

I'd be pleased if anyone could help with my similar question at http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20252441

Thanks
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Expert Comment

by:ncw
ID: 6718673
I'm trying to do the same thing. I've been lookinig at http://www.yes-tele.com

I'd be pleased if anyone could help with my similar question at http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=visualbasic&qid=20252441

Thanks
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7153491
Hi darknite,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept GeoffKell's comment(s) as an answer.

darknite, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:nec_noc
ID: 10093195
hi experts,

i'm working on call barring system and i'm wondering if anyone knows how to make the line busy with a busy tone using tapiline.

thanks,
Cen
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now