• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

Intercept Caller ID Info??

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
darknite
Asked:
darknite
1 Solution
 
GeoffKellCommented:
It's worth a read of

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

Regards
GK

0
 
darkniteAuthor Commented:
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
 
ncwCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ncwCommented:
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
 
DanRollinsCommented:
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
 
nec_nocCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now