asterisk2billing.org
http://forum.asterisk2billing.org/

Rates/Minutes announcement after 20 in German
http://forum.asterisk2billing.org/viewtopic.php?f=19&t=3439
Page 1 of 1

Author:  mazhar996 [ Mon Mar 24, 2008 1:24 pm ]
Post subject:  Rates/Minutes announcement after 20 in German

Hi All,
How can I solve this problem:
The digits sound files contain files with 0,1,2...20,30,40,50,60,70,80,90,hundred

Lets say rate for cuba is 75 cents per minute, In english its easy to combine 70 and 5 to announce 75 cents per minute, but in German its not seventy five, rather its something like five and seventy (fünf und siebzig)
cents per minute.

How to overcome this problem?

Author:  xrg [ Mon Mar 24, 2008 1:48 pm ]
Post subject: 

http://www.voip-info.org/wiki-Asterisk+cmd+SayNumber

Author:  krzykat [ Mon Mar 24, 2008 4:20 pm ]
Post subject: 

I have a similar need, but it gets more complicated than this. The currency instead of using 100 cents = 1 dollar, it is in essence 1000 cents = 1 dollar. Anyone have a clue how to handle this ?

Author:  stavros [ Mon Mar 24, 2008 4:38 pm ]
Post subject: 

krzykat wrote:
I have a similar need, but it gets more complicated than this. The currency instead of using 100 cents = 1 dollar, it is in essence 1000 cents = 1 dollar. Anyone have a clue how to handle this ?
Luckily you shouldn't need to modify the Asterisk sources to accomplish this. I think you can do this in Class.A2Billing.php around line 1233 by swapping:
Code:
      list($units, $cents)=split('[.]', sprintf('%01.2f', $credit_cur));
for
Code:
      list($units, $cents)=split('[.]', sprintf('%01.3f', $credit_cur));
(that is just swap the 2 for a 3)

Author:  krzykat [ Mon Mar 24, 2008 4:50 pm ]
Post subject: 

THANKS - now if only all the problems were this easy to solve.

Author:  mazhar996 [ Mon Mar 24, 2008 9:43 pm ]
Post subject: 

Hi,
Does modify the code in Class.A2Billing.php ? solve both problems? or for the first issue I need to search voip.info.org ?
I went to the link provided but doesn't look like to be a final solution at first glance, so I pended this issue for the time being due to ratecard problem.

BTW what if i add sound files 21, 22,23... 99 explicityly, would it still try to combine 20.wav and 1.wav when the rate is 21 cent/min or would it play 21.wav ?

with sincere regards

mazhar

Author:  stavros [ Mon Mar 24, 2008 9:49 pm ]
Post subject: 

mazhar996 wrote:
I went to the link provided but doesn't look like to be a final solution at first glance
No, it's not the complete solution. You'd need to modify the SayNumber() application in Asterisk to correctly phrase numbers in your chosen language.
Quote:
BTW what if i add sound files 21, 22,23... 99 explicityly
Good question! I don't know, but I'd be interested to hear your findings if you test this experimentally.

Author:  mazhar996 [ Mon Mar 24, 2008 10:06 pm ]
Post subject: 

I will test and let the forum know.

regards
mazhar

Author:  mazhar996 [ Tue Mar 25, 2008 1:14 pm ]
Post subject: 

Ok, I tried it but didn't work.

Now although this is a direct asterisk forum question, I have posted it there too, but since krzykat had similar need and looks like he fixed out, so writing in a hope that krzykat responds.
I am writing here after searching asterisk forum with no luck.

I have asterisk ver 1.4.17
My german sound files are with correct path
/sounds/de/
/sounds/digits/de/

The files are not corrupt.

Now when i set language to de and try to announce a price 68 cents per minute, instead of saying 8 & 60 , it says only 60

If i copy the same 8.gsm and 60.gsm files in fr or en directories i hear 68. but in case of german it has to be 8 & 60

Dear krzykat, please advise what more configurations are needed.

with sincere regards,

Author:  stavros [ Tue Mar 25, 2008 1:34 pm ]
Post subject: 

mazhar996 wrote:
Now when i set language to de and try to announce a price 68 cents per minute, instead of saying 8 & 60 , it says only 60
Hmm... the source for ast_say_number_full_de() looks like it should work:
Code:
      /* The grammar for German numbers is the same as for English except
      * for the following:
      * - numbers 20 through 99 are said in reverse order, i.e. 21 is
      *   "one-and twenty" and 68 is "eight-and sixty".
      * - "one" varies according to gender
      * - 100 is 'hundert', however all other instances are 'ein hundert'
      * - 1000 is 'tausend', however all other instances are 'ein tausend'
      * - 1000000 is always 'eine million'
      * - "million" is different in singular and plural form
Also the contrib/i18n.testsuite.conf shipped with Asterisk indicates that they tested this to their satisfaction.
I'm fairly sure you're just missing the necessary audio files:
Code:
/* New files:
In addition to English, the following sounds are required:
"millions"
"1-and" through "9-and"
"1F" (eine)
"1N" (ein)
NB "1" is recorded as 'eins'
*/

Author:  mazhar996 [ Tue Mar 25, 2008 3:30 pm ]
Post subject: 

thats true,, these files are missing.
1-and ... 9-and are missing

thanks a lot stavros, you are a great help always,

Added after 1 hours 37 minutes:

Hi Stavros,
whats the path to contrib/i18n.testsuite.conf
and ast_say_number_full_de() and other asterisk functions?

regards
mazhar

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/