I am trying to connect to Avaya with DevLink sample code which is written in VB. When DLOpen is called it connects successfully but the problem is that when DLRegisterType2CallDeltas() function is called the result is a number greater than 2 something like 432563542633 and it seems there is an issue in connection the output is "Bhoo!! 432563542633 "
. I read DevLink help but only 3 values are mentioned for the result of DLRegisterType2CallDeltas() just 0 for success and 1 , 2 for error. I really don't know what the value greater than 2 means. Any help please?
The code is below:
Public Sub StartMonitor(idPbx As Integer, PbxAddress As String, pbxPassword As String)
Dim PConn As Connection_Parameter.Connection_Status_Paramenter = New Connection_Parameter.Connection_Status_Paramenter
Try
PConn.IdPbx = idPbx
PConn.ErrorLevel = Connection_Enum.ErrorLevel.info
PConn.StatusMessage = "Connection in progress..."
PConn.Status = CommsEvent_Enum.CommsEvent_State.DEVLINK_COMMS_OPERATIONAL
RaiseEvent ConnectionStatus(Me, PConn)
Dim iRet As Long = DLOpen(New IntPtr(idPbx), PbxAddress, pbxPassword, Nothing, Nothing, oCommsEvent)
If iRet = 0 Then
PConn.StatusMessage = "IpOffice is present!!"
RaiseEvent ConnectionStatus(Me, PConn)
Else
PConn.StatusMessage = "IpOffice is present ?? "
RaiseEvent ConnectionStatus(Me, PConn)
'Exit Sub
End If
PConn.StatusMessage = "Wait connection response..."
RaiseEvent ConnectionStatus(Me, PConn)
Do
Thread.Sleep(100)
Application.DoEvents()
Loop While Not bIsConnect And Not bIsInterrupt
iRet = DLRegisterType2CallDeltas(New IntPtr(idPbx), oCallLogEvent)
If iRet > 0 Then
If iRet = 1 Then
PConn.ErrorLevel = Connection_Enum.ErrorLevel.warning
PConn.StatusMessage = "Error!! Check ip office IP Address or LAN Connection!!!"
RaiseEvent ConnectionStatus(Me, PConn)
End If
If iRet = 2 Then
PConn.ErrorLevel = Connection_Enum.ErrorLevel.warning
PConn.StatusMessage = "Error!! CTI License not found...!!!"
RaiseEvent ConnectionStatus(Me, PConn)
End If
If iRet > 2 Then
PConn.ErrorLevel = Connection_Enum.ErrorLevel.ignore
PConn.StatusMessage = "Bhoo!! " & iRet.ToString
RaiseEvent ConnectionStatus(Me, PConn)
End If
'Exit Sub
Else
PConn.StatusMessage = "DLRegisterType2CallDeltas is OK"
RaiseEvent ConnectionStatus(Me, PConn)
End If
Catch ex As Exception
Throw
Finally
PConn = Nothing
End Try
End Sub