Saying Ordinal Numbers
Hi,
Is there any way in Asterisk to say an ordinal number? For instance if I
were to pass the application 1 it would say first. If I were to pass it 2
it would say Second etc.? I know that Voicemail has this when hearing your message count but I have not seen any application that allows this from the dialplan.
TIA.
Dovid
5 thoughts on - Saying Ordinal Numbers
My sounds directory (en_UK) contains files with names such as “first.gsm”,
“second.gsm”, “ninth.gsm” etc.
You could simply copy these to a subdirectory named “ordinal” into filenames like “ordinal/1.gsm”, “ordinal/2.gsm” etc (the same as you have already under the “digits” subdirectory), and then use:
Playback(ordinal/${DIGIT})
The main limitation would be whether you want it to go beyond 20th (which is far as those recordings go for me, except for the decades 30th, 40th…100th).
Antony.
—
“The tofu battle I saw last weekend was quite brutal.”
– Marija Danute Brigita Kuncaitis
Please reply to the list;
please *don’t* CC me.
—
The prompts for saying any ordinal number are all there: from 1 to
999,999,999 – they just need to be spliced together properly. I am currently in the process of refactoring core “Say” code and could add a SayOrdinal() application while I’m at it. Would this meet your needs?
NA
—
already from the queue (where it announces what caller number you are).
Are you sure it says “you are currently third in the queue”?
I thought it said “you are currently at position number three in the queue”…
Antony.
—
Douglas was one of those writers who honourably failed to get anywhere with
‘weekending’. It put a premium on people who could write things that lasted thirty seconds, and Douglas was incapable of writing a single sentence that lasted less than thirty seconds.
– Geoffrey Perkins, about Douglas Adams
Please reply to the list;
please *don’t* CC me.
—
Indeed, it seems that app_queue uses ast_say_number:
https://github.com/asterisk/asterisk/blob/master/apps/app_queue.c#L4041
Either way, I have already finished adding the application, and will push it up for review shortly.
NA
—