[asterisk-dev] Deprecate app_saycountpl

Igor A. Goncharovsky igi-go at ya.ru
Tue Nov 27 06:36:45 CST 2007


Hi!

Stanisław Pitucha wrote:
> On Nov 22, 2007 3:39 PM, Igor A. Goncharovsky <igi-go at 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 at ya.ru
________________________________ 




More information about the asterisk-dev mailing list