Saying Time Period (AM/PM) With new mode In say.conf

Greetings!

I’m starting to use the say.conf file with mode=new to control playback of numbers for certain regional languages.

While doing some testing, I noticed that Asterisk would always playback the time as PM. On inspecting the say.conf file, I noticed the following in the [date-base](!) section:

[general]
mode=new

...
...

[date-base](!)
...
...
    ; XXX too bad the '?' function does not remove the quotes
    ; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"]      ; am pm
    _date:[pP]:. => digits/p-m  ; am pm
...
...

Based on that I can see why Asterisk always uses the p-m prompt.

To “fix” this, I ended up doing this:

[general]
mode=new

...
...

[date-base](!)
...
...
    ; XXX too bad the '?' function does not remove the quotes
    _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"]      ; am pm
    ;_date:[pP]:. => digits/p-m  ; am pm
...
...

Since my Asterisk server is running on Ubuntu, I ran the following commands to create symlinks for the new prompts that is “required” due to my earlier change.

cd /var/lib/asterisk/sounds/en/digits

ln -s a-m.gsm \"a-m\".gsm
ln -s p-m.gsm \"p-m\".gsm

ln -s a-m.wav \"a-m\".wav
ln -s p-m.wav \"p-m\".wav

This works. But I’m not sure if this is a good or the right way to handle this issue. Since the [date-base](!) section is being used in multiple language sections in the say.conf, I will need to create these symlinks in multiple languages. While it is certainly an additional step to be mindful of, it can definitely be automated. However I want to make sure this is OK before heading down this path as we have a lot of Asterisk servers running and I want to be absolutely sure before rolling out the change.

I’m looking for pointers on how the community at large is handling this issue for saying the correct time period.

Is no one else experiencing this issue?

I’ve never seen this functionality used by anyone, or at least noone has stated they’re using it so the lack of responses likely reflect that.

Thank you for your response @jcolp.

I would appreciate any additional pointers you are able to provide either with my approach or a better way of handling this situation.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.