Capturing Data

Posted on 2011-10-10
Last Modified: 2013-11-26
In debug...the output window...I can see this data

Debug:[ManagerReader-57] ManagerReader:Run - AppData: Using CallerID "TVDEV-9998887777" <9998887777>

Why is it I can't see the "TVDEV" in my readers, array, etc anywhere?
Question by:lrbrister
    LVL 40

    Expert Comment

    by:Jacques Bourgeois (James Burger)
    Could you show us the code you use to generate that line.

    Author Comment

    Using Asterisk.Net and wrapping it.

    On a button click...the function is called.
    The output is actually this piece of the attached code...

    If InStr(pArray(0).ToString, "Local/" & extension & "@from-internal") >= 1 Then
        If pArray(2).ToString = queue And pArray(3).ToString = "1" Then
            'source = pArray(7).ToString
            source = "3334445555"   'changed for this
            binComingCall = True
        End If
    End If
    RichTextBox1.Text += presponse(i) & Environment.NewLine

    Public Function sendCommand(ByVal paction As String, ByVal pcommand As String) As String
            Dim pCommandAction As New Action.CommandAction
            Dim pExtensionStateAction As New Action.ExtensionStateAction
            Dim pSIPShowPeerAction As New Action.SIPShowPeerAction
            Dim binComingCall As Boolean = False
            sendCommand = ""
            queue = "691"
            If _manager.IsConnected = True Then
                Dim presponse As Array
                If Len(paction) = 0 Then
                    paction = "Command"
                End If
                If Len(pcommand) <> 0 Then
                    presponse = Nothing
                    Select Case LCase(paction)
                        Case "command"
                            pCommandAction.Command = pcommand
                            presponse = _manager.SendAction(pCommandAction, 500).ToString.Split(";"c)
                        Case "extensionstate"
                            pExtensionStateAction.Exten = pcommand
                            presponse = _manager.SendAction(pExtensionStateAction, 500).ToString.Split(";"c)
                        Case "sipshowpeer"
                            pSIPShowPeerAction.Peer = pcommand
                            presponse = _manager.SendAction(pExtensionStateAction, 500).ToString.Split(";"c)
                        Case Else
                            MsgBox("Action not in list!")
                            'Dim s As String = "nothing;Local/1026@from-internal-c9fd,1!from-internal!691!1!Down!AppQueue!(Outgoing Line)!9548811302!!3!3!(None)"
                            'presponse = s.Split(";"c)
                    End Select
                    If IsNothing(presponse) = False Then
                        RichTextBox1.Text = ""
                        For i As Integer = 0 To presponse.Length - 1
                            Dim pArray As Array = presponse(i).ToString.Split("!"c)
                            If InStr(pArray(0).ToString, "Local/" & extension & "@from-internal") >= 1 Then
                                If pArray(2).ToString = queue And pArray(3).ToString = "1" Then
                                    'source = pArray(7).ToString
                                    source = "3334445555"
                                    binComingCall = True
                                End If
                            End If
                            RichTextBox1.Text += presponse(i) & Environment.NewLine
                    End If
                    If binComingCall = True Then
                        userName = GetUserName()             'I) Get user's name logged in on windows
                        Dim dirEntry As DirectoryEntry = New DirectoryEntry()                   'Verify that user is on the domain
                        dirEntry = FindUserOnDirectoryEntry(userName)      'II) Directory search for user
                        If IsNothing(dirEntry) = False Then
                            Dim pForm As New PopupForm
                            sendCommand = source
                        End If
                    End If
                    MsgBox("Enter a command!")
                End If
                btnConnect.Enabled = True
                MsgBox("Connection lost. Re-establish connection!")
            End If
        End Function

    Open in new window

    LVL 40

    Accepted Solution

    This code does not tell me anything. All it does from what I see is that it changes the variable source according to the content of pArray. Then you put the value of presponse(i) in a RichTextBox.

    I do not see the use of "TVDEV" with source, or the way presponse(i) is built.

    Where is the problem?

    In the content of the RichTextBox? If so, there is no way to tell where the problem could be, since presponse is buit from _manager.SendAction, and we do not even know what _manager is.

    Where is "TVDEV" supposed to come from in there. From _manager.SendAction, or from one of the pArray elements? If it is in p_Array(7), then there is a comment at the beginning of the line.

    The code we need to see is the code that builds the "Debug:[ManagerReader-57] ManagerReader:Run - AppData: Using CallerID "TVDEV-9998887777" <9998887777>" string. And be able to compare it to the code that builds the "readers, array, etc anywhere?" where TVDEV vanish.


    Author Comment

    This is an Asterisk.Net dll we're accessing.

    Earlier it was getting called with a "concise" paramater which was wrong.

    Your question put me on the backtrack
    Thanks for the help

    Author Closing Comment

    See comments

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    20 Experts available now in Live!

    Get 1:1 Help Now