Ticket #3673 (closed Bugs: fixed)

Opened 10 months ago

Last modified 10 months ago

Speaking Clock fails on Asterisk 1.6

Reported by: drmessano Assigned to:
Priority: minor Milestone: 2.6
Component: Info Services Version: 2.5-branch
Keywords: speaking clock 1.6 Cc:
Confirmation: Unreviewed SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

Due to dialplan changes in 1.6, the speaking clock will partially execute and fail.

Attachments

infoservices-functions.inc.php-patch-speakingclock.diff (1.2 kB) - added by drmessano on 05/10/09 22:50:16.

Change History

05/10/09 22:50:16 changed by drmessano

  • attachment infoservices-functions.inc.php-patch-speakingclock.diff added.

05/13/09 20:44:56 changed by wiseoldowl

I've always liked this speaking clock routine a bit better - as shown you can have multiple entry points if you have users in different time zones, but the main thing is that it speaks the time in ten second intervals (at :00, :10, :20 ... :50) and repeats for three minutes before hanging up (useful if you are trying to set a clock and need to flip a switch or push a button exactly on the :00 mark). But it's only 12 hour (with am/pm on the full minute). To hear it in action try dropping it into extensions_custom.conf, then access it using a Custom Destination of custom-speaking-clock,s,est for Eastern time or custom-speaking-clock,s,cst for Central time (just as a demo):

[custom-speaking-clock]
exten => s,1,Noop(Entering Custom Context: Speaking Clock Modified)
exten => s,n(est),NoOp(Speaking Clock for Eastern Time Zone)
exten => s,n,Set(TimeZn=EST5EDT)
exten => s,n,goto(scstart)
exten => s,n(cst),NoOp(Speaking Clock for Central Time Zone)
exten => s,n,Set(TimeZn=CST6CDT)
exten => s,n(scstart),Ringing
exten => s,n,Set(FutureTime=$[${EPOCH} + 8])
exten => s,n,Set(FutureTimeMod=$[${FutureTime} % 10])
exten => s,n,Set(FutureTime=$[${FutureTime} - ${FutureTimeMod}])
exten => s,n,Set(MaxConnectTime=$[${FutureTime} + 180])
exten => s,n(scringsomemore),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => s,n,GotoIf($["${FutureTimeMod}" < "0"]?scanswer:scwaitasec)
exten => s,n(scwaitasec),wait(1)
exten => s,n,goto(scringsomemore)
exten => s,n(scanswer),Answer
exten => s,n(scplayagain),Set(FutureTime=$[${FutureTime} + 10])
exten => s,n,Set(FutureTimeMod=$[${FutureTime} % 60])
exten => s,n,wait(1)
exten => s,n,playback(at-tone-time-exactly)
exten => s,n,SayUnixTime(${FutureTime},${TimeZn},IM)
exten => s,n,GotoIf($["${FutureTimeMod}" = "0"]?scexactmin:scsaysecs)
exten => s,n(scexactmin),SayUnixTime(${FutureTime},${TimeZn},p)
exten => s,n,goto(scwaittobeep)
exten => s,n(scsaysecs),playback(and)
exten => s,n,SayUnixTime(${FutureTime},${TimeZn},S)
exten => s,n,playback(seconds)
exten => s,n(scwaittobeep),Set(FutureTimeMod=$[${FutureTime} - ${EPOCH}])
exten => s,n,GotoIf($["${FutureTimeMod}" < "1"]?scplaybeep:scwaitsectobeep)
exten => s,n(scwaitsectobeep),wait(1)
exten => s,n,goto(scwaittobeep)
exten => s,n(scplaybeep),playback(beep)
exten => s,n,Set(FutureTimeMod=$[${MaxConnectTime} - ${EPOCH}])
exten => s,n,GotoIf($["${FutureTimeMod}" < "1"]?scthatsall:scplayagain)
exten => s,n(scthatsall),GotoIf($["x${IVR_CONTEXT}" = "x"]?app-blackhole,hangup,1:${IVR_CONTEXT},return,1)
exten => s,n,Goto(app-blackhole,hangup,1)
exten => h,1,Macro(hangupcall,)

Perhaps the best of both routines could be combined?

05/14/09 17:01:20 changed by xrobau

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in (core) r7725 - the back slashes are required in 1.4, so we need to leave them there, and strip them out for 1.6.