Ticket #2414 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

Daynight module creates typo in config

Reported by: ronald.lew Assigned to:
Priority: minor Milestone: 2.4
Component: Other Module Version: 2.3.0
Keywords: Cc:
Confirmation: Confirmed Distro:
Backend Engine: Asterisk 1.2.x Distro Ver:
Backend Ver: 1.2.24 SVN Revision (if applicable):

Description

The daynight module (ver 1.0.2.2) creates a typo in the configuration file which may lead to unexpected results. An example of a daynight configuration in sip_additional.conf:

[app-daynight]
include => app-daynight-custom
exten => 0,1,GotoIf($["${DB(DAYNIGHT/C${EXTEN}}" = "NIGHT"]?timeconditions,1,1:ext-queues,2000,1)

; end of [app-daynight]


[app-daynight-toggle]
include => app-daynight-toggle-custom
exten => *280,1,Answer
exten => *280,n,Wait(1)
exten => *280,n,Set(INDEX=0)
exten => *280,n,Goto(app-daynight-toggle,s,1)
exten => s,1,Set(DAYNIGHTMODE=${DB(DAYNIGHT/C${INDEX}})
exten => s,n,GotoIf($["${DAYNIGHTMODE}" = "NIGHT"]?day:night)
exten => s,n(day),Set(DB(DAYNIGHT/C${INDEX})=DAY)
exten => s,n,Playback(beep&silence/1&day&reception&digits/${INDEX}&enabled)
exten => s,n,Hangup
exten => s,n(night),Set(DB(DAYNIGHT/C${INDEX})=NIGHT)
exten => s,n,Playback(beep&silence/1&beep&silence/1&day&reception&digits/${INDEX}&disabled)
exten => s,n,Hangup

; end of [app-daynight-toggle]

Note the missing right parenthesis when accessing DAYNIGHT/C${INDEX} as well as setting the DAYNIGHTMODE variable.

Change History

10/04/07 12:23:31 changed by ronald.lew

I forgot to add the warning from the CLI: WARNING[11640]: pbx.c:1388 ast_func_read: Can't find trailing parenthesis?

Note: One side effect I experienced is when an agent turns off night mode at 8am but won't route to day mode routes until 3-5 minutes later.

10/04/07 17:07:14 changed by p_lindheimer

  • status changed from new to closed.
  • confirmation changed from Unreviewed to Confirmed.
  • resolution set to fixed.

r5099 (2.3)
r5097 (trunk)

Concerning the 3-5 minutes later issue, I'm not sure what is going on with your system. The variable is either going to be set or not given the syntax error. I suspect it still gets set or the feature code would never have worked. There is nothing that I could possible imagine that would create a delayed reaction like you describe.

Thanks for the bug fix.

10/07/07 19:34:17 changed by habile

Sorry I missed this bug and raised 2422. I have 1.0.2.3 which claims to fix this but I still see the problem.

Thanks.

10/07/07 22:22:59 changed by p_lindheimer

r5103, r5105 there was another one, fixed now.