From 63113af127a1a79e5bb92b363e8bbdaed10939fb Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 26 Apr 2023 20:15:30 +0200 Subject: [PATCH 1/1] Initial working version --- .gitignore | 2 ++ README.rst | 39 +++++++++++++++++++++++++++++ Start-PegaMedCti.bat | 12 +++++++++ fritzboxcallformat | 6 +++++ pegamed-cti.bat | 59 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 .gitignore create mode 100644 README.rst create mode 100644 Start-PegaMedCti.bat create mode 100644 fritzboxcallformat create mode 100755 pegamed-cti.bat diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d54737 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/downloads/ +/README.html diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..90dd3b7 --- /dev/null +++ b/README.rst @@ -0,0 +1,39 @@ +=================== +FritzBox-zu-PegaMed +=================== + +Meldet eingehende Anrufer einer Fritzbox an die PegaMed-Software. + +PegaMed zeigt bei Anrufen dann den Anrufernamen, und mit einem Klick ist +dessen Akte geöffnet. + + +Installation +============ + +1. FritzBoxCallMonitor__ runterladen und entpacken +2. Callmonitor bei der Fritzbox aktivieren: ``#96*5*`` anrufen +3. ``pegamed-cti.bat`` und ``Start-PegaMedCti.bat`` in den ``Examples``-Ordner + in FritzBoxCallMonitor kopieren +4. Eine Verknüpfung zu ``pegamed-cti.bat`` erstellen und ``pegamed-cti`` nennen + (direkt im ``Examples``-Verzeichnis) +5. Verknüpfung bearbeiten und "Shortcut > Run: Minimized" einstellen +6. ``Start-PegaMedCti.bat`` ausführen + +__ https://github.com/berrnd/FritzBoxCallMonitor + + +Konfiguration PegaMed +--------------------- +1. Prüfen, ob Telefonie verfügbar ist: ``Hilfe`` > ``Über`` und ganz nach unten scrollen. + Dort muss "Telefonie" ein grünes Häkchen haben. +2. ``Einstellungen`` > ``Programm`` > ``Telefon`` > ``CTI verwenden`` aktivieren. +3. PegaMed neu starten +4. Oben rechts in der Symbolleiste wird jetzt ein historisches Telefon angezeigt, + neben dem Teamviewer-Symbol. + + +Links +===== +- FritzBoxCallMonitor: https://github.com/berrnd/FritzBoxCallMonitor +- .bat-Befehle: https://ss64.com/nt/ diff --git a/Start-PegaMedCti.bat b/Start-PegaMedCti.bat new file mode 100644 index 0000000..ce0659d --- /dev/null +++ b/Start-PegaMedCti.bat @@ -0,0 +1,12 @@ +@echo off +pushd "%~dp0" + +set fritzBox=fritz.box +set callMonitor=..\FritzBoxCallMonitor.exe + +set scriptOnIncomingCall=pegamed-cti.lnk +set scriptOnOutgoingCall=pegamed-cti.lnk +set scriptOnConnected=pegamed-cti.lnk +set scriptOnConnectionEnd=pegamed-cti.lnk + +start "" /D "%cd%" "%callMonitor%" "FritzBox=%fritzBox%" "OnIncomingCall=%scriptOnIncomingCall%" "OnOutgoingCall=%scriptOnOutgoingCall%" "OnConnected=%scriptOnConnected%" "OnConnectionEnd=%scriptOnConnectionEnd%" diff --git a/fritzboxcallformat b/fritzboxcallformat new file mode 100644 index 0000000..75dda56 --- /dev/null +++ b/fritzboxcallformat @@ -0,0 +1,6 @@ +Siehe https://github.com/berrnd/FritzBoxCallMonitor#parameters + +Timestamp | RING | ConnectionId | RemoteNumber | LocalNumber +Timestamp | CALL | ConnectionId | LocalExtension | LocalNumber | RemoteNumber +Timestamp | CONNECT | ConnectionId | LocalExtension | RemoteNumber +Timestamp | DISCONNECT | ConnectionId | DurationInSeconds diff --git a/pegamed-cti.bat b/pegamed-cti.bat new file mode 100755 index 0000000..189054a --- /dev/null +++ b/pegamed-cti.bat @@ -0,0 +1,59 @@ +@echo off +REM PegaMed konfigurieren: +REM 1. "Einstellungen|Programm: Telefon" öffnen +REM 2. "CTI verwenden" aktivieren +REM 3. Das Programm neu starten. +REM +REM Fritzbox konfigurieren: Anrufen bei .. +REM #96*5* Callmonitor-Support aktivieren +REM #96*4* Callmonitor-Support deaktivieren +REM +REM Dateiort: %temp%\PM_CTI.ini +REM +REM Dateiformat: +REM [CTI] +REM Nummer=… +REM Status=x +REM +REM Status: +REM 0=klingelt +REM 1=abgehoben (Gesprächsbeginn) +REM 2=aufgelegt (Gesprächsende) +REM 3=verpasst + +SET ctiFile=%temp%\PM_CTI.ini + +SET timestamp=%~1 +SET eventType=%~2 + +SET pegaStatus=999 +IF "%eventType%"=="RING" ( + SET connectionId=%~3 + SET remoteNumber=%~4 + SET localNumber=%~5 + SET pegaStatus=0 +) +IF "%eventType%"=="CALL" ( + REM outgoing call + EXIT /B +) +IF "%eventType%"=="CONNECT" ( + SET connectionId=%~3 + SET localExtension=%~4 + SET remoteNumber=%~5 + SET pegaStatus=1 +) +IF "%eventType%"=="DISCONNECT" ( + SET connectionId=%~3 + REM Wir haben keine Telefonnummer + SET remoteNumber= + SET pegaStatus=2 +) + +IF %pegaStatus%==999 EXIT /B + +( + echo [CTI] + echo Nummer=%remoteNumber% + echo Status=%pegaStatus% +)>%ctiFile% -- 2.30.2