IT Nothotline, allgemeine Verbesserungen

This commit is contained in:
ms
2023-04-21 16:26:51 +02:00
parent 499e63e9ce
commit 8f1362f9fc
20 changed files with 1842 additions and 71 deletions

View File

@@ -1,5 +1,7 @@
Imports System.Reflection
Imports Chilkat
Imports VERAG_PROG_ALLGEMEIN.cCreditSafeAPI
Public Class cPascom
Dim API_USER_AUTHORIZATION = "bW9ieTpnWlhTSVprTnhmaUQxOEU="
@@ -95,29 +97,142 @@ Public Class cPascom
End Function
'Public Function GetTelArbeitsplatz4Host() As Boolean
' Try
' Dim lines = IO.File.ReadAllLines("\\dc01.verag.ost.dmn\NETLOGON\Telefonarbeitsplaetze.ini")
' Dim colCount = lines.First.Split(";"c).Length
Public Function Weiterleitung(fromNr As String, toNr As String, Optional ByRef Target As String = "")
Try
' For Each line In lines
' Dim objFields = From field In line.Split(";"c)
cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at"
Dim rest As New Chilkat.Rest
Dim success As Boolean
Dim bTls As Boolean = True
Dim port As Integer = 443
Dim bAutoReconnect As Boolean = True
' If String.Compare(cRes.LocalUser.Hostname, objFields(0).ToString, True) = 0 Then
' Arbeitsplatz = objFields(1).ToString
' '_ConString = objFields(2).ToString
' Return True
' Exit Function
' End If
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
If (success <> True) Then
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
Debug.WriteLine(rest.LastErrorText)
Return False
End If
rest.AddHeader("Content-Type", "application/json")
rest.SetAuthBasic("moby", "XgDsFmMSutaMLA1")
Dim json As New Chilkat.JsonObject
Dim successJsonLoad As Boolean = json.Load("
{""target"":""" & toNr & """}}")
If (successJsonLoad <> True) Then
MsgBox(json.LastErrorText)
Return False
End If
Dim sbRequestBody As New Chilkat.StringBuilder
json.EmitSb(sbRequestBody)
' MsgBox(sbRequestBody.ToString)
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestSb("POST", "/verag/services/redirect/" & fromNr, sbRequestBody, sbResponseBody)
If (success <> True) Then
Debug.WriteLine(rest.LastErrorText)
Return False
End If
Dim respStatusCode As Integer = rest.ResponseStatusCode
If (respStatusCode <> 200) Then
' MsgBox(sbResponseBody.GetAsString())
Return False
End If
Dim jsonResp = New Chilkat.JsonObject()
jsonResp.LoadSb(sbResponseBody)
Dim gatewayId = jsonResp.StringOf("gatewayId")
Dim Resp_error = jsonResp.StringOf("error")
Dim Resp_errorCode = jsonResp.StringOf("errorCode")
Target = jsonResp.StringOf("target")
' MsgBox("Hier!!!")
Return True
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
Return True
End Function
Function getredirect(ByRef target As String) As String
Try
cChilkat_Helper.UnlockCilkat()
Dim API_STRING = "pbx3.flashnet.at"
Dim rest As New Chilkat.Rest
Dim success As Boolean
Dim bTls As Boolean = True
Dim port As Integer = 443
Dim bAutoReconnect As Boolean = True
success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
If (success <> True) Then
Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
Debug.WriteLine(rest.LastErrorText)
Return False
End If
rest.AddHeader("Content-Type", "application/json")
rest.SetAuthBasic("moby", "XgDsFmMSutaMLA1")
Dim json As New Chilkat.JsonObject
Dim sbRequestBody As New Chilkat.StringBuilder
json.EmitSb(sbRequestBody)
' MsgBox(sbRequestBody.ToString)
Dim sbResponseBody As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET", "/verag/services/redirect/", sbResponseBody)
If (success <> True) Then
Debug.WriteLine(rest.LastErrorText)
Return False
End If
Dim respStatusCode As Integer = rest.ResponseStatusCode
If (respStatusCode <> 200) Then
Return False
End If
Return sbResponseBody.GetAfterBetween(target, ":", ",")
Catch ex As Exception
MsgBox(ex.Message)
Return False
End Try
Return True
End Function
' ' End Select
' Next
' Return False
' Catch ex As Exception
' ' MsgBox("Fehler beim Lesen TSAnmeldung.ini: " & vbCrLf & ex.Message)
' End Try
'End Function
End Class