Speaking Clock Fails After First Use

Thanks Tony.

I know that you don’t know me very well, but I ALWAYS worry too much!

StoneT,

Can you repost your original solution, which involved disabling the clock feature altogether and creating a separate dialplan? I’d like to set-up both features in my system.

I ended up with something a bit more sophisticated:

[app-speakingclock]

exten => *60,1,Answer
exten => *60,n,Wait(1)
exten => *60,n,Set(NumLoops=0)
exten => *60,n(start),Set(FutureTime=$[${EPOCH} + 11])
exten => *60,n,NoOp(Time Format: ${TIMEFORMAT})
exten => *60,n,Playback(at-tone-time-exactly)
exten => *60,n,GotoIf($["${TIMEFORMAT}"=“kM”]?:hr12)
exten => *60,n,SayUnixTime(${FutureTime},kM ‘and’ S ‘seconds’)
exten => *60,n,Goto(waitloop)
exten => *60,n(hr12),SayUnixTime(${FutureTime},IM ‘and’ S ‘seconds’ p)
exten => *60,n(waitloop),Set(TimeLeft=$[${FutureTime} - ${EPOCH}])
exten => *60,n,GotoIf($[${TimeLeft} < 1]?playbeep)
exten => *60,n,Wait(1)
exten => *60,n,Goto(waitloop)
exten => *60,n(playbeep),Playback(beep)
exten => *60,n,Wait(5)
exten => *60,n,Set(NumLoops=$[${NumLoops} + 1])
exten => *60,n,GotoIf($[${NumLoops} < 5]?start)
exten => *60,n,Playback(goodbye)
exten => *60,n,Hangup

;end app-speakingclock

I put this in globals_custom.conf and it works when the speaking clock app is enabled and stops working when the app is disabled.

I put it there because globals_custom.conf is included in extensions_additional.conf close to the beginning so the app is picked up before the speaking clock app that resides further down in extensions_additional.conf.

With this the speaking clock performs exactly as it did before the bug was introduced, however, you can’t change the feature code it has to be *60 and you don’t have the luxury of being able to change the language.

StoneT

Can you please repost the very first suggestion that you posted (before you edited it)? I’m referring to the one where you disable the speaking clock and then created your own dial plan.

My plan is to enable the speaking clock and use yours (with a different phone number) so that both versions are available going forward.

The main thing that I can’t remember from your original post is the file you were going to put it in, but I’d love to see the entire solution again.

This is fixed in Asterisk 11.

I suspect that it’ll be fixed in the next version of Asterisk 1.8 and 10 as well.

This in extensions_custom.conf should do the trick. Just replace *60 with your access code

[extn-speakingclock-custom]

exten => *60,1,Answer()
exten => *60,n,SayUnixTime()
exten => *60,n,Hangup()

;end of extn-speakingclock-custom

Thanks!

Any updated word on getting this bug resolved, and whether the Asterisk bug affects any other FreePBX features?