PhonerLite logo

CLI - Command Line Interface

You can enable some kind of scripting via options menu: CLI access

If you have activated that you can connect to Port 50600 using a telnet client:

        
	telnet localhost 50600
		  
		
An integrated script control is enabled by default.

CLI

You can enter commands like "help" or you can load a script from file. There some limitations like no nested "If" statements or no loop support. But you can load a script file - all current states and remaining commands are resetted.

The "Wait" and "If" command can check multiple conditions. They are comma separated and use a logical OR combination.

Examples

This example shows, how to initatiate an outgoing call and play a wave file when the call is established and after the file is played the call will be terminated:

        
If HasCall
  Print Stop script due existing other call
  Stop
EndIf
SetNumber 0123456789
HookOff
Wait 5,HasCall
If !HasCall
  Print Stop script due no call could be created
  HookOn
  Stop
EndIf
Print Waiting for call is beeing answered within 30 seconds
Wait 30,!HasCall,StateIsActive
if !StateIsActive
  Print Call not answered within 30 seconds
  HookOn
  Stop
EndIf
Print Waiting 2 seconds before playing wave file
Wait 2
Wave announcement.wav
Print Waiting for wave file is being played
Wait !StateIsActive,WavePlayed
Wait 1
HookOn 
		  
		

You can't enter such script manually in that formatted way, because the "Wait" command may hide the prompt - so you can't enter further commands. You should save a script in a file (e.g. "script.txt") and enter the following command at the prompt: "load script.txt".

Alternativ kann man obiges Script auch in einer Zeile darstellen, die Zeilen werden durch "&" getrennt:

        
If HasCall & Print Stop script due existing other call & Stop & EndIf & SetNumber 0123456789 & HookOff & Wait 5,HasCall & If !HasCall & Print Stop script due no call could be created & HookOn & Stop & EndIf & Print Waiting for call is beeing answered within 30 seconds & Wait 30,!HasCall,StateIsActive & if !StateIsActive & Print Call not answered within 30 seconds & HookOn & Stop & EndIf & Print Waiting 2 seconds before playing wave file & Wait 2 & Wave announcement.wav & Print Waiting for wave file is being played & Wait !StateIsActive,WavePlayed & Wait 1 & HookOn 
		  
		

Text-To-Speech (TTS)

You get an overview about installed languages by typing: "tts" command. The entry with asterisk (*) is the current active language.

        
PL>tts
 0: Microsoft Hedda Desktop - German
*1: Microsoft Zira Desktop - English (United States)
 2: Microsoft Irina Desktop - Russian
		  
		
To switch to German language you can type: "tts 0".
You can initiate text to speech conversion by typing something like this: "say Hello world"
If no call is active you will hear the output via speaker - else the generated speech is transmitted instead of microphone signal.

Sub script per call

If there are multiple calls in parallel - it makes sense to to use a sub script per call.
This can be achieved by using such distribution script:

        
Wait NewCall
LoadCall script_newcall.txt
Load %LOAD_FILE%
            
		
Per default an existing call will be set to hold when a further call is accepted. To avoid this you can deactivate that behaviour. The following script deactivates the notification window for incoming calls additionally.:
        
DesktopAlertOff
AutoHoldOff
Wait NewCall
LoadCall script_newmulticall.txt
Load %LOAD_FILE%
            
		

Speech-To-Text (STT)

Using 64-bit version of PhonerLite audio transcription is supported by using a special version of Whisper.cpp. No external services via Internet will be used - all calculations are running locally on the PC. Just type "stt" to check if the needed files are available. By typing "stt install" the needed files are downloaded (~465 MB). By default the small model is downloaded. If you want a better one - type "stt install medium". But be aware that this models size is ~1.42 GB. At the moment an audio file (.wav) can be transcribed by using the "ListenFile" command. Depending of the file size and the available GPU this may last a while. The result is printed at console and also stored in variable %STT%. Using "ListenOn" and later "ListenOff" a kind of live transcription can be tried. If no call is active the microphone signal is used, else the received audio from network will be transcribed.

The language used for transcription is the one selected as language for PhonerLite GUI. To use a different language you can enter the the short id of the langage, e.g. "stt 1 de" will use the small model and German language.



(C) Heiko Sommerfeldt