Summary:ASTERISK-02637: [patch] SayUnixTime and SayNumber to say in British and Norwegian syntax
Reporter:darkskiez (darkskiez)Labels:
Date Opened:2004-10-19 16:48:30Date Closed:2008-01-15 15:12:57.000-0600
Versions:Frequency of
Environment:Attachments:( 0) say.c.patch
( 1) say.c.patch
( 2) say.c.patch
Description:The following patch adds "and" inbetween numbers, eg,
two thousand AND four, which british people find most
familiar.  I am informed that norwegian syntax is identical,
and have added an appropriate hook.
Comments:By: darkskiez (darkskiez) 2004-10-19 16:52:33

I meant [patch] not [request], ho hum.

By: Tilghman Lesher (tilghman) 2004-10-19 18:11:52

A page at http://www.wordiq.com/definition/American_and_British_English_differences#Numbers suggests that for years, the word AND is omitted, which would tend to favor
the preexisting method of saying the year.

By: darkskiez (darkskiez) 2004-10-19 18:24:17

In the wordiq example, "and" is omitted as years are phrased differently, such as in the example 1234, twelve thirty-four. With my patch, dates are still said correctly as such, eg, "1909"="Nineteen oh nine", but for eg 2004, it's "Two thousand and four" which is correct.

By: Mark Spencer (markster) 2004-10-19 23:59:44

Do you have a disclaimer on file?

By: inspired (inspired) 2004-10-20 01:33:58

Many thanks for this patch. I just noticed that the Danish syntax has 1 in both commune and neutrum. This also applies to Norwegian. For instance. "You have one message = Du har en beskjed" which is commune, and "You have one letter = Du har ett brev", which is neutrum.

Could someone add this to Norwegian?

* - 1 exists in both commune ("en", file "1") and neutrum ("ett", file "1N")

Proof: http://en.wikibooks.org/wiki/Norwegian_Numbers

edited on: 10-21-04 12:02

By: darkskiez (darkskiez) 2004-10-20 03:15:47

And you told me it was identical! :] I'll update the patch to have norweigan syntax properly then later. I've left in some comments from the danish codeblock i used as a basis, that I have to remove anyway.

RE: disclaimer, I have not a disclaimer on file, do I sign both? Is there another way other than fax? would an email of a scan be ok?

By: Mark Spencer (markster) 2004-10-20 08:38:54

Either of the documents is fine, at your option.  Fax is preferred, but I will accept an e-mail.

By: darkskiez (darkskiez) 2004-10-20 16:02:51

In addition to previous patch,
Fixed commenting issues, added Norwegian properly, with common and neutrum genders

By: inspired (inspired) 2004-10-21 06:52:24

I just encountered a new problem. I have a SayUnixTime telling me todays date and it's supposed to say "Twentyfirst October 2004", but actually says "Twentyone October 2004" Can this be fixed? Twentyfirst should be constructed out of 20.gsm and h-1.gsm. The problem exists both when using "en" AND when using "no"

I want 1-20 to be looked up in h-%d where %d is the digit. 21-29 is 20 + h-1, h-2 etc. 30 is h-30 and 31 is h-30 + h-1. This is the same behavior as in English, but is not working for either language with this patch.

I also want the ability to say the month number in SayUnixTime. I now have "dbY" which says "21 October 2004". I would like to use a "m" instead of "d", which says the number of the month. In Norwegian this would be "tjueførste i tiende, to tusen og fire. Directly translated "Twentyfirst in tenth, two thousand and four". A new sound "in.gsm" could be added

Edit: Say month number is done. add the following code to ast_say_date_with_format_en etc.

case 'm':
                               /* First - Twelfth */
                               snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mon +1);
                               res = wait_file(chan,ints,nextmsg,lang);


BTW: "oh" and "oclock" are not used in the Norwegian language.

edited on: 10-21-04 13:38

By: inspired (inspired) 2004-10-21 14:53:04

My first attempt at programming :-)

All the things I mentioned are now working. lower case "m" was added. It says the number of the month.

One issue still remaining is that I can't add a filename in SayUnixTime.
This is how my extension looks like:

exten => 602,1,SetLanguage(no
exten => 602,2,SayUnixTime(,,d 'in' mYkM)

The error:
Oct 30 21:40:04 WARNING[557075]: say.c:2369 ast_say_date_with_format_en: Unknown character in datetime format d in mYkM: i at pos 2
Oct 30 21:40:04 WARNING[557075]: say.c:2369 ast_say_date_with_format_en: Unknown character in datetime format d in mYkM: n at pos 2

Someone willing to take a look at why I can't play gsm files in between?

By: inspired (inspired) 2004-10-22 08:51:32

I'm not sure if I messed something up in my say.c or if the problem was already there, but at least it works with the example below. If the patch is pretty enough, please include it in CVS.

exten => 602,1,SetLanguage(no)
exten => 602,2,SayUnixTime(,,d '\'in'\' mYkM)

By: Mark Spencer (markster) 2004-11-07 19:49:40.000-0600

What ever happened with the disclaimer?

By: darkskiez (darkskiez) 2004-11-08 03:35:12.000-0600

I faxed it a couple of weeks ago, probably on a thursday. If you need it sent again, I may be able to send it this thursday.

By: Mark Spencer (markster) 2004-11-08 10:01:18.000-0600

No, that's fine, just needed to know for sure it was sent.  Thanks!

By: Russell Bryant (russell) 2004-11-09 00:19:04.000-0600

not included in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:12:57.000-0600

Repository: asterisk
Revision: 4187

U   trunk/say.c

r4187 | markster | 2008-01-15 15:12:56 -0600 (Tue, 15 Jan 2008) | 2 lines

Add British and Norwegian syntax (bug ASTERISK-2637)