[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] Deprecate app_saycountpl
From:       "Igor A. Goncharovsky" <igi-go () ya ! ru>
Date:       2007-11-27 12:36:45
Message-ID: 474C0F5D.9090303 () ya ! ru
[Download RAW message or body]

Hi!

Stanisław Pitucha wrote:
> On Nov 22, 2007 3:39 PM, Igor A. Goncharovsky <igi-go@ya.ru> wrote:
>   
>> 4) It is no need in writing general purpose module, because task of
>> determine needed word is very easy and can be solved by 6 strings of
>> dialplan, or in any AGI. For example smthing like that:
>>
>> [macro-saycount]
>>     
> That would be nice, but for pl it doesn't help much:
> 1 -> kopiejka, 11 -> kopiejek, 101 -> kopiejek
> 2-> kopiejki, 12 -> kopiejek, 22 -> kopiejki
>   
Oh, sorry. I wrote macro for Russian. Here it for pl (not tested, may be
some bugs):

[macro-saycount]
exten => s,1,Set(REM1=$[${ARG4}%1000])
exten => s,1,Set(REM2=$[${REM1}%100])
exten => s,1,Set(REM3=$[${REM1}%10])
exten => s,n,GotoIf($[${REM1} = 1]:a)
exten => s,n,GotoIf($[${REM3} >= 2]:?c)
exten => s,n,GotoIf($[${REM3} <= 4]:?c)
exten => s,n,GotoIf($[${REM2} < 10]:b)
exten => s,n,GotoIf($[${REM2} > 20]:b)
exten => s,n,GoTo(s,n(c))
exten => s,n(a),Say(${ARG1})
exten => s,n(b),Say(${ARG2})
exten => s,n(c),Say(${ARG3})

A little bigger, but more simpler then maintain dedicated app for one
language.

-- 
Best regards,
Igor A. Goncharovsky
________________________________
ICQ: 648337
mailto: igi-go@ya.ru
________________________________ 


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic