Batch-Dateien im Client ausführen#
Einrichtung der Batch-Dateien#
Pfad#
Die Batch-Dateien müssen in folgendem Pfad hinterlegt werden:
C:\Program Files (x86)\Common Files\C4B\AppLink
Konfiguration im Connect Client#
Damit die Batch-Dateien vom XPhone Connect Client aufgerufen werden, muss dem Connect Client der „Befehl“ gegeben werden. Dies geschieht über die Erweiterte Einstellungen in der Administrationsoberfläche im Standort.
Folgende Parameter müssen hinzugefügt werden:
Parameter 1
Name:
StartCall.ActionStringWert:
Name=<batchfile_name.bat>Erklärung: Name der Batch-Datei.
Parameter 2
Name:
StartCall.EnableWert:
1Wert = 1
Die Datei wird ausgeführt bei eingehendem Anruf.
Wert = 0
Die Datei wird nicht ausgeführt.
Parameter 3
Name:
EndCall.ActionStringWert:
Name=<batchfile_Name.bat>Erklärung: Name der Batch-Datei.
Parameter 4
Name:
EndCall.EnableWert:
1Wert = 1
Die Datei wird ausgeführt bei eingehendem Anruf.
Wert = 0
Die Datei wird nicht ausgeführt.
Kurzanleitung#
Erstellen Sie aus den Codebeispielen Batch-Dateien.
Fügen Sie die Batch-Datei bei den Benutzern, die dieses Feature nutzen wollen, in folgendem Pfad ein:
C:\Program Files (x86)\Common Files\C4B\AppLink\
Aktivieren Sie die Funktion in der Administrationsoberfläche für die gewünschten Benutzer.
Navigieren Sie in der Adminoberfläche zum gewünschten Standort/Konfigurationsgruppe.
Öffnen Sie dort die Connect Client Einstellungen und scrollen Sie nach ganz unten zu den Erweiterten Einstellungen.
Fügen Sie folgende Parameter hinzu:
Parameter #1
Name:
StartCall.ActionStringWert:
Name=<batchfile_name>.bat
Parameter #2
Name:
StartCall.EnableWert:
1
Bei allen Benutzern des betroffenen Standorts bzw. der betroffenen Konfigurationsgruppe wird bei eingehendem Anruf die Batchdatei ausgeführt.
Codebeispiele für „Eingehender Ruf“#
Variablenbezeichnungen#
Die Batch-Datei wird mit verschiedenen Informationen über den Benutzer, den Anrufer und den Anruf versorgt. Bei der Ausführung stehen diese Informationen als Umgebungsvariablen zur Verfügung.
Beispiele
XP.USER.FIRSTNAMEXP.CONTACT.FIRSTNAMEXP.CALL.CALLNOAlle Umgebungsvariablen sind hier dokumentiert.
Batch-Beispiele#
Rufnummer in Text-Datei schreiben
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
'stateAsInt = 2
'callno = "+49321"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
callno = wshProcessEnv( "XP.CALL.CALLNO" )
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
'create the text file
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFile=objFSO.CreateTextFile("C:\temp\test.txt",2,true)
'output to file
objFile.WriteLine (callno)
objFile.close
else
dim dummy2
dummy2 = 1
end if
end if
</script></job>
.exe-Datei ausführen
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
'stateAsInt = 2
'callno = "+49321"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
callno = wshProcessEnv( "XP.CALL.CALLNO" )
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
dim url
url = "c:\temp\ConsoleAppSupport.exe "
url = url + callno
wshShell.Run url
else
dim dummy2
dummy2 = 1
end if
end if
</script></job>
.exe-Datei in UNC-Pfad ausführen
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
'stateAsInt = 2
'callno = "+49321"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
callno = wshProcessEnv( "XP.CALL.CALLNO" )
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
dim url
url = "\\fs\tmp\art\Dashboard+Batch\ConsoleAppSupport.exe "
url = url + callno
wshShell.Run url
else
dim dummy2
dummy2 = 1
end if
end if
</script></job>
.exe-Datei ausführen (nur bei aufgelöstem Kontakt)
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
dim personenid
personenid = ""
'stateAsInt = 2
'callno = "+49321"
'personenid = "3"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
personenid = wshProcessEnv( "XP.CONTACT.USERDEF_1" )
'personenid = replace( personenid, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt und Feld befüllt
if Len(personenid) > 0 then
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
dim url
url = """C:\Program Files (x86)\vea\personen\Person.exe """
url = url + personenid
wshShell.Run url
else
dim dummy2
dummy2 = 1
end if
end if
end if
</script></job>
URL aufrufen
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
'stateAsInt = 2
'callno = "+49321"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
callno = wshProcessEnv( "XP.CALL.CALLNO" )
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
dim url
url = "https://www.c4b.com/de/"
url = url + callno
wshShell.Run url
else
dim dummy2
dummy2 = 1
end if
end if
</script></job>
URL aufrufen (nicht bei unterdrückten Rufnummern)
<!-- : Begin batch script
rem mshta javascript:alert^("%XP.CALL.CALLNO%"^);close^(^);
@echo off
cscript //nologo "%~f0?.wsf" ^""%1"^"
exit /b
----- Begin wsf script --->
<job><script language="VBScript">
set wshShell = wscript.CreateObject( "wscript.Shell" )
Set wshProcessEnv = wshShell.Environment( "PROCESS" )
dim stateAsInt
dim stateAsString
dim callno
dim customerno
'stateAsInt = 2
'callno = "+49321"
stateAsString = wshProcessEnv( "XP.CALL.STATE" )
stateAsInt = Cint( wshProcessEnv( "XP.CALL.STATE" ) )
callno = wshProcessEnv( "XP.CALL.CALLNO" )
customerno = wshProcessEnv( "XP.CONTACT.CUSTOMERNO" )
'callno = replace( callno, chr(34), "", 1, 10 ) ' Quotes entfernen
'callno = replace( callno, " ", "", 1, 10 ) ' Blanks entfernen
'callno = replace( callno, "+", "00", 1 ) ' + in 00 umwandeln
' wshShell.Popup callno, AUTO_DISMISS, "Dump output", OK_BUTTON
' Kommend und Klingelt
if not IsNull(callno) then
if (stateAsInt and 1) <> 1 then
if (stateAsInt and 2) <> 0 then
dim url
url = "https://www.c4b.com/de/"
url = url + callno
wshShell.Run url
else
dim dummy2
dummy2 = 1
end if
end if
end if
</script></job>
Call-State#
In die Environment-Variable XP.CALL.STATE schreibt der Connect Client den aktuellen Call-Status als Bit-kodierten Wert:
Bit |
Wert |
Bedeutung |
|---|---|---|
Bit 0 |
1 |
Gehend |
Bit 1 |
2 |
Klingelt |
Bit 2 |
4 |
Verbunden |
Bit 3 |
8 |
Interner Anruf |
Bit 4 |
16 |
Softphone-Call |
Bit 5 |
32 |
Konferenz-Anruf |
Bit 6 |
64 |
Einwahl-Anruf für Konferenz |