Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) CLI (Read 2995 times)
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
CLI
10. Mar 2022 at 13:56
Print Post  
The latest beta version contains support for some kind of command line interface (CLI). You can enable it via Options menu. Then start a telnet client and connect to port 50600. For example on the same PC you can run:
Code
Select All
telnet localhost 50600 


To initiate a call you can run the following:
Code
Select All
SetNumber 0123456789
HookOff 

  

cli.png ( 43 KB | 30 Downloads )
cli.png
Back to top
WWW  
IP Logged
 
VoIPDAU
Junior Member
**
Offline


Phoner is great!

Posts: 59
Joined: 12. Feb 2015
Re: CLI
Reply #1 - 12. Mar 2022 at 18:01
Print Post  
Great! Smiley
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #2 - 14. Mar 2022 at 14:50
Print Post  
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:
Code
Select All
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:
Code
Select All
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.
« Last Edit: 21. Mar 2022 at 11:36 by Phoner Admin »  
Back to top
WWW  
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #3 - 22. Mar 2022 at 11:39
Print Post  
Another example:
Wait for incoming call. Answer that call and play an announcement and terminate the call - and do that again!
There is no loop support in the current implementation, but you can use the "load" command. The following example is saved as "script2.txt" and you see, that it loads itself again to simulate such loop.
Code
Select All
Print waiting for call
Wait HasCall
if !IsIncoming
  Print wait until outgoing call ends
  Wait !HasCall
  Print outgoing call ended - restart
  Load script2.txt
EndIf
Print Incoming call available
HookOff
Wait 10,StateIsActive
If StateIsActive
  Wave announcement.wav
  Print play announcement
  Wait !HasCall,WavePlayed
EndIf
HookOn
Wait !HasCall
Print Incoming call ended - restart
Load script2.txt 

  
Back to top
WWW  
IP Logged
 
Videko90
YaBB Newbies
*
Offline


Phoner is great!

Posts: 1
Joined: 09. Feb 2022
Re: CLI
Reply #4 - 26. Mar 2022 at 10:36
Print Post  
Thank you for the latest beta version, I will try it on Monday when I will call my colleagues in their houses in Palm Jumeirah. Hope all will be working fine
  
Back to top
 
IP Logged
 
phonic
YaBB Newbies
*
Offline


Phoner is great!

Posts: 7
Joined: 31. Mar 2022
Re: CLI
Reply #5 - 03. Apr 2022 at 01:15
Print Post  
I've tested out this beta today but could not connect to the CLI.
I've tested changing the port and do get the message to use telnet client, but the port remains closed. 

Using Windows 11 Pro connecting directing from same computer via command prompt tested using localhost(127.0.0.1) and local lan IPv4 address and different ports.

Any ideas?
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #6 - 03. Apr 2022 at 08:05
Print Post  
I can't reproduce a problem with it. Maybe you have installed a local firewall that prevents TCP connections to the configured port.
  
Back to top
WWW  
IP Logged
 
phonic
YaBB Newbies
*
Offline


Phoner is great!

Posts: 7
Joined: 31. Mar 2022
Re: CLI
Reply #7 - 03. Apr 2022 at 15:30
Print Post  
Phoner Admin wrote on 03. Apr 2022 at 08:05:
I can't reproduce a problem with it. Maybe you have installed a local firewall that prevents TCP connections to the configured port.

Thatís for your reply.

No firewall.  Clean Windwos 11 Pro install. I even disabled windows firewall just, but Iím connecting via the same computer. 

I noticed the debug option and have enabled it, but I get no error shown in the CLI window only the message to use the telnet client.

Does this extra feature(CLI) require any extra dependencies? Iím wondering if some library is missing from the default windows 11 install. I will also try with another PC running Windows 10 and let you know the outcome.   
  
Back to top
 
IP Logged
 
phonic
YaBB Newbies
*
Offline


Phoner is great!

Posts: 7
Joined: 31. Mar 2022
Re: CLI
Reply #8 - 03. Apr 2022 at 19:32
Print Post  
I've just downloaded the new beta 3.0.2beta and both in app and external telnet are working fine.
  

Screenshot_2022-04-03_at_18_30_49.png ( 100 KB | 21 Downloads )
Screenshot_2022-04-03_at_18_30_49.png
Back to top
 
IP Logged
 
phonic
YaBB Newbies
*
Offline


Phoner is great!

Posts: 7
Joined: 31. Mar 2022
Re: CLI
Reply #9 - 04. Apr 2022 at 01:49
Print Post  
It's not listed in the help screen but I also noticed in the new 3.0.2beta that "answer:" has been added and is working perfectly. 
Thank you. Smiley
  

Screenshot_2022-04-04_at_00_46_14.png ( 404 KB | 21 Downloads )
Screenshot_2022-04-04_at_00_46_14.png
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #10 - 04. Apr 2022 at 11:30
Print Post  
Thanks for the feedback
  
Back to top
WWW  
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #11 - 19. Apr 2022 at 14:20
Print Post  
I uploaded a new beta version. You can use and set variables and you can initiate call recording by script now.
Example: Record all calls and print the file name. In this case %WAVE% contains the filename, but only as long as the call exists. Therefore this is saved into a new variable. Save the following script as "AutoRecord.txt". The script loads itself again at the end.
Code
Select All
Wait HasCall
Wait !HasCall,State=Active
If State=Active
  Record
  Set %RecFile%=%WAVE%
EndIf
Wait !HasCall
Print recorded to file %RecFile%
Load AutoRecord.txt

 

  
Back to top
WWW  
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 10894
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: CLI
Reply #12 - 09. May 2022 at 15:46
Print Post  
Actual beta version (3.04beta) now supports:
  • UTF-8 encoded inputs
  • "Say" command for simple text to speech. Call "TTS" to get a list of installed speech engines (languages). Example: "TTS 1" selects the entry with index 1.

Your feedback is welcome - especially editing UTF-8 encoded inputs may need some check.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint