Skip to content

Instantly share code, notes, and snippets.

@gitlarryf
Created January 18, 2019 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitlarryf/4f3506c92fe56ba762a8d66bf027fee4 to your computer and use it in GitHub Desktop.
Save gitlarryf/4f3506c92fe56ba762a8d66bf027fee4 to your computer and use it in GitHub Desktop.
3CX VoIP Phone System accessibility script.
@ECHO OFF
SETLOCAL
SET Version=1.1
SET TCX="%ProgramData%\3CXPhone for Windows\PhoneApp\CallTriggerCmd.exe"
SET Away=561
SET Custom1=562
SET Available=563
SET Exceptions=564
SET CustomHours=565
SET Custom2=566
SET OutOfOffice=567
IF /I "%1"=="help" GOTO:Help
IF /I "%1"=="-?" GOTO:Help
IF /I "%1"=="/?" GOTO:Help
IF /I "%1"=="lunch" GOTO:Lunch
IF /I "%1"=="ready" GOTO:Ready
IF /I "%1"=="logout" GOTO:Logout
IF /I "%1"=="login" GOTO:Login
IF /I "%1"=="queue" Call:Queue 1
IF /I "%1"=="dial" Call:Dial %1 %2 %3 %4 %5
IF /I "%1"=="fix" (
echo Fixing broken 3CX connection...
CALL:Logout
echo Restored 3CX Connection. Logging back in...
CALL:Login
CALL:Ready
CALL:Dial
GOTO:eof
)
:Unknown
echo.
echo "%1" is an unknown or invalid 3CX command!
echo.
goto:End
:End
ENDLOCAL
goto:eof
:Help
echo 3CX Phone System Helper Application
echo v%VERSION% by Larry Frieson
echo.
echo The following commands are supported:
echo.
echo LUNCH - Places your phone in DND mode, and marks you at Lunch.
echo READY - Places you back in the normal "read" mode.
echo LOGOUT - Logs you out of the 3CX system, and marks you "Away".
echo LOGIN - Logs you back into the 3CX system, and marks you "ready".
echo QUEUE x - Logs you into queue x.
echo DIAL n - Dials the provided number "n".
echo FIX - Attempts to fix a broken connection between your PC and the 3CX server.
echo.
goto:End
:Lunch
%TCX% --set-active-profile=%OutOfOffice% --set-profile-status=%OutOfOffice%/"CallCtrl.cmd: At Lunch"
goto:end
:Ready
%TCX% --set-active-profile=%Available%
goto:end
:Logout
Call:Queue 0
%TCX% --set-active-profile=%OutOfOffice%
goto:end
:Login
Call:Queue 1
goto:Ready
:Queue
%TCX% --queue=%1
goto:End
:Dial
shift
%TCX% --call="%1 %2 %3 %4 %5 %6 %7 %8 %9"
goto:End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment