Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic scrip-automatically end a call after 5 min (Read 349 times)
catalin_neacsea
YaBB Newbies
*
Offline


Phoner is great!

Posts: 1
Joined: 22. Nov 2022
scrip-automatically end a call after 5 min
22. Nov 2022 at 13:51
Print Post  
hello,

can you help please, i need to make a script to automatically end a live call when call duration is 5 min
  
Back to top
 
IP Logged
 
Phoner Admin
YaBB Administrator
*****
Offline



Posts: 11010
Location: Germany
Joined: 12. Oct 2003
Gender: Male
Re: scrip-automatically end a call after 5 min
Reply #1 - 23. Nov 2022 at 08:19
Print Post  
A minimal script could look like this:
Code
Select All
Set %MAX_CALL_DURATION%=300
Print Wait for new call
Wait HasCall
Print New call available
Wait !HasCall,StateIsActive
If !HasCall
  Print Call ended unanswered
  Load %LOAD_FILE%
EndIf
Print Call answered - wait for %MAX_CALL_DURATION% seconds
Wait %MAX_CALL_DURATION%,!HasCall
If !HasCall
  Print Call ended
EndIf
Print Max call duration reached - terminate call
HookOn
Wait !HasCall
Load %LOAD_FILE% 



That just disconnects the call after 300 seconds (5 minutes). You can optionally send an announcement after the max time. Just insert before "HookOn" something like this:
Code
Select All
Say Maximum call duration reached. Buy!
Wait !HasCall,WavePlayed 



Just save the code in a text file (e.g. "script_max_call_duration.txt"). You can test it by typing "load script_max_call_duration.txt". If that is OK you can enter the filename as "Startup script" - so it will be loaded automatically.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint