Dial Plan Greeting

I need to setup my dial plan so that it says good morning good afternoon or good evening depending on the time of day. Please let me know what I would need to put in my dial plan to do this.

Thanks

ExecIfTime and Playback. There are several different detailed ways of implementing this and the general principles of time dependent dialplans are illustrated in the sample extensions.conf that comes with Asterisk.

1 Like

This is how I set it up but it does not work I get tis error.
pbx_builtins.c:974 pbx_builtin_execiftime: Cannot locate application Playback,good&morning

same = n,ExecIfTime(00:00-11:59,,,?Playback,GoodMorning)
same = n,ExecIfTime(12:00-16:59,
,,?Playback,Good&Afternoon)
same = n,ExecIfTime(17:00-23:59,,,*?Playback,Good&Evening)

ExecIfTime(times,weekdays,mdays,months,[timezone]?appname[(appargs]))

doesn’t match

you have used, and you can clearly see how appname was matched, as a result. Square brackets follow a very old convention, for indicating optional items, although appargs are not optional in your case.

Also, it looks to me as though you didn’t accurately copy the dialplan you used, as the error message is not going to invent an & that wasn’t there.

Is this correct

same = n,ExecIfTime(00:00-11:59,,,*,[America/Chicago]?playback[(Good&Morning]))

No it is not correct. You did not read the bit about the use of square brackets, a convention that dates back to the 1960s, and probably earlier, and your brackets don’t nest properly.