wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,168
- Reaction score
- 5,199
In the FreePBX version of IncrediblePBX, one of the Custom Applications/Destinations is Time (8463). Will you port this to your IncrediblePBX list of applications?
As a time geek, I love this application. I call into my PBX. I have set to this destination to hear the time at the sound of the tone. My own time server (not as accurate as the NIST but good enough for me )
*61 Time Of Day is already in the new Incredible PBX for XiVO build for Raspberry Pi 3. Here's how to add it to an existing server.
1. In /etc/asterisk/extensions_extra.d, create a new timeofday.conf file:
Code:
;# // BEGIN TimeOfDay
[new-time]
exten => s,1,ringing
exten => s,2,Set(FutureTime=$[${EPOCH} + 8])
exten => s,3,Set(FutureTimeMod=$[${FutureTime} % 10])
exten => s,4,Set(FutureTime=$[${FutureTime} - ${FutureTimeMod}])
;180 in next line is max # seconds connection can be held open. Use multiples of 10.
exten => s,5,Set(MaxConnectTime=$[${FutureTime} + 180])
exten => s,6,Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => s,7,GotoIf($["${FutureTimeMod}" < "0"]?10:8)
exten => s,8,wait(1)
exten => s,9,goto(6)
exten => s,10,Answer
exten => s,11,Set(FutureTime=$[${FutureTime} + 10])
exten => s,12,Set(FutureTimeMod=$[${FutureTime} % 60])
exten => s,13,wait(1)
exten => s,14,playback(at-tone-time-exactly)
exten => s,15,SayUnixTime(${FutureTime},,IM)
exten => s,16,GotoIf($["${FutureTimeMod}" = "0"]?17:19)
exten => s,17,SayUnixTime(${FutureTime},,p)
exten => s,18,goto(22)
exten => s,19,playback(and)
exten => s,20,SayUnixTime(${FutureTime},,S)
exten => s,21,playback(seconds)
exten => s,22,Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => s,23,GotoIf($["${FutureTimeMod}" < "1"]?26:24)
exten => s,24,wait(1)
exten => s,25,goto(22)
exten => s,26,playback(beep)
exten => s,27,Set(FutureTimeMod=$[${MaxConnectTime} - ${EPOCH}])
exten => s,28,GotoIf($["${FutureTimeMod}" < "1"]?29:11)
exten => s,29,Hangup
;# // END TimeOfDay
2. Set the permissions on the new file:
Code:
chown asterisk:www-data /etc/asterisk/extensions_extra.d/timeofday.conf
chmod 664 /etc/asterisk/extensions_extra.d/timeofday.conf
3. Edit /etc/asterisk/extensions_extra.d/xivo-extrafeatures.conf and add this code at the bottom:
Code:
;# // BEGIN TimeOfDay
exten => *61,1,Goto(new-time,s,1)
exten => 8463,1,Goto(new-time,s,1)
;# // END TimeOfDay
4. Reload the dialplan: /etc/init.d/asterisk reload
To use Time of Day feature, dial *61 or 8463 (T-I-M-E) from any extension.
Last edited: