Speaking Clock +


(Simon Telephonics) #1

I made a small enhancement to Speaking Clock. :smile:

[speaking-clock-plus]
exten => s,1,Set(CONNECTEDLINE(name-charset,i)=utf8)
exten => s,n,Set(CONNECTEDLINE(name,i)=Time and Temperature)
exten => s,n,Set(CONNECTEDLINE(num,i)=${CALLERID(dnid)})
exten => s,n,Macro(user-callerid,)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n,Set(NumLoops=0)
exten => s,n(start),Set(FutureTime=$[${EPOCH} + 8])
exten => s,n,Set(FutureTimeMod=$[${FutureTime} % 10])
exten => s,n,Set(FutureTime=$[${FutureTime} - ${FutureTimeMod} + 10])
exten => s,n,Gosub(sub-hr12format,s,1())
exten => s,n(waitloop),Set(TimeLeft=$[${FutureTime} - ${EPOCH}])
exten => s,n,GotoIf($[${TimeLeft} < 1]?playbeep)
exten => s,n,Wait(1)
exten => s,n,Goto(waitloop)
exten => s,n(playbeep),Playback(beep)
exten => s,n,Wait(1)
exten => s,n,Playback(temperature)
exten => s,n,Set(TEMPERATURE=${FILTER(0123456789,${CURL(http://wttr.in/Philadelphia?u&format='%t')})})
exten => s,n,SayNumber(${TEMPERATURE})
exten => s,n,Playback(degrees)
exten => s,n,Wait(5)
exten => s,n,Set(NumLoops=$[${NumLoops} + 1])
exten => s,n,GotoIf($[${NumLoops} < 5]?start)
exten => s,n,Playback(goodbye)
exten => s,n,Hangup

Check out http://wttr.in for a cool project.


Connection time limit for Talking Clock?
IVR Script Install
#2

For fun, if you ever use bash then,

PS1="$(curl -s wttr.in?format=2) $PS1"

If you like it add it to your shellโ€™s .rc file
Looks even better in tmux as documented :wink: