Currently the goal was the following: Open a call to a specific number and send a wave file when the remote party accepts the call. After the file is played, the call should be disconnected.
The current beta version supports this:
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
Because that is not really human readble, you can save the following in a file:
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 load that "script" in the telnet session by calling "load script.txt", if you saved the above with the file name "script.txt".
The first variant is just a single line and you can use copy&paste within the telnet session. You need either a single line or the load command, because if the "wait" statement is active you have no prompt to input further commands.