AnsweredAssumed Answered

vb.net CTIOS Agent and Manager Montioring

Question asked by cahafad01 on Dec 3, 2014
Latest reply on Jan 15, 2015 by cahafad01

Hi,

 

I created a quick simple vb.net program to test a login that successfully connects to the hosts and logs in the agent (successfully); however the manager tool still has the state of that ext as LogOut; but if i do queryagentstate, it shows logged in

 

This is a quick test of code to see if what I need can be done in this method

    Dim _session As New CTIOSCLIENTLib.Session
    Dim ext As String = "1234"

  Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles Me.Load
        If _session.Connect(getSessionArgs) = 1 Then
            Dim _agt As New CTIOSCLIENTLib.Agent
            _agt.SetValue("AgentID", ext)
            _agt.SetValue("PeripheralID", ext)
            _agt.SetValue("AutoLodgin", "1")
            _session.SetAgent(_agt)
            If _agt.Login(getLoginArgs) = 1 Then
                _agt.SetAgentState(getAgentStateLoginArgs)
                lblerr.Text = "Done"
            Else
                lblerr.Text = "Login Failed"
            End If
        Else
            lblerr.Text = "Failed to Connect to IPC Hosts"
        End If
    End Sub

    Function getSessionArgs() As CTIOSCLIENTLib.Arguments
        Dim _args As New CTIOSCLIENTLib.Arguments
        _args.SetValue("CtiosA", "HostA")
        _args.SetValue("PortA", 42028)
        _args.SetValue("CtiosB", "HostB")
        _args.SetValue("PortB", 42028)
        Return _args
    End Function

    Function getLoginArgs() As CTIOSCLIENTLib.Arguments
        Dim _args As New CTIOSCLIENTLib.Arguments
        _args.SetValue("AgentID", ext)
        _args.SetValue("AgentPassword", ext)
        _args.SetValue("AgentInstrument", ext)
        _args.SetValue("PeripheralID", ext)
        _args.SetValue("AutoLodgin", "1")
        Return _args
    End Function

    Function getAgentStateLoginArgs() As CTIOSCLIENTLib.Arguments
        Dim _args As New CTIOSCLIENTLib.Arguments
        _args = getLoginArgs()
        _args.SetValue("AgentState", 1)        
        Return _args
    End Function

 

 

Is there something I'm fundamentally missing?

 

Thanks

A

Outcomes