[Asterisk-Dev] say.c Support for Urdu

Atif Rasheed atif at iphonica.com
Wed Jul 13 04:17:40 MST 2005


well its Pakistani Urdu. I am not sure about Punjabi Grammar and 
pronunciation, but we will be able to add that also


Roy Sigurd Karlsbakk wrote:

> is there only one ur language, or do you have variants like pakistani  
> punjabi etc? if so, perhaps it could be nice to specify...
>
>
> Den 13. jul. 2005 kl. 11.54 skrev Atif Rasheed:
>
>> I have used urdu to test this change, but according to 639-1 its  
>> "ur", so we will be using "ur".
>> I am signing disclaimer, after that I will submit the patch to  
>> bugs.digium.com.
>>
>>
>>> What's the language code for Urdu? "ur"? "urd"?
>>>
>>> http://www.loc.gov/standards/iso639-2/englangn.html#uvwxyz
>>>
>>>
>>>
>>>>>         return(ast_say_number_full_urdu(chan, num, ints, language,
>>>>>
>>>> audiofd, ctrlfd));
>>>>
>>>>
>>>> /*---- Urdu sound files needed for Time/Date functions:
>>>> minute
>>>> second
>>>> ---- Urdu sound files needed for Currency:
>>>> Rupay
>>>> Rupia
>>>> Paisa
>>>> Paisay
>>>> /*
>>>>
>>>> /*--- ast_say_number_full_urdu: Urdu syntax */
>>>> /*--- Urdu syntax is little different, so we will require alot of  
>>>> extra files. from 0 - 99  */
>>>> static int ast_say_number_full_urdu(struct ast_channel *chan, int  
>>>> num, char *ints, char *language, int audiofd, int ctrlfd)
>>>> {
>>>>       int res = 0;
>>>>       int playh = 0;
>>>>       char fn[256] = "";
>>>>       if (!num)
>>>>               return ast_say_digits_full(chan, 0,ints, language,  
>>>> audiofd, ctrlfd);
>>>>
>>>>       while(!res && (num || playh)) {
>>>>                       if (playh) {
>>>>                               snprintf(fn, sizeof(fn), "digits/ 
>>>> hundred");
>>>>                               playh = 0;
>>>>                       } else  if (num < 100) {
>>>>                               snprintf(fn, sizeof(fn), "digits/% 
>>>> d", num);
>>>>                               num = 0;
>>>>                       } else {
>>>>                               if (num < 1000){
>>>>                                       snprintf(fn, sizeof(fn),  
>>>> "digits/%d", (num/100));
>>>>                                       playh++;
>>>>                                       num -= ((num / 100) * 100);
>>>>                               } else {
>>>>                                       if (num < 1000000) { /*  
>>>> 1,000,000 */
>>>>                                               res =  
>>>> ast_say_number_full_en(chan, num / 1000, ints, language, audiofd,  
>>>> ctrlfd);
>>>>                                               if (res)
>>>>                                                       return res;
>>>>                                               num = num % 1000;
>>>>                                               snprintf(fn, sizeof 
>>>> (fn), "digits/thousand");
>>>>                                       } else {
>>>>
>>>>
>>>
>>> Is it just me, or the part below is replicated in too many functions?
>>>
>>>
>>>
>>>>                                               if (num <  
>>>> 1000000000) { /* 1,000,000,000 */
>>>>                                                       res =  
>>>> ast_say_number_full_en(chan, num / 1000000, ints, language,  
>>>> audiofd, ctrlfd);
>>>>                                                       if (res)
>>>>                                                                
>>>> return res;
>>>>                                                       num = num %  
>>>> 1000000;
>>>>                                                       snprintf (fn, 
>>>> sizeof(fn), "digits/million");
>>>>                                               } else {
>>>>                                                       ast_log 
>>>> (LOG_DEBUG, "Number '%d' is too big for me\n", num);
>>>>                                                       res = -1;
>>>>                                               }
>>>>                                       }
>>>>                               }
>>>>                       }
>>>>                       if (!res) {
>>>>                               if(!ast_streamfile(chan, fn,  
>>>> language)) {
>>>>                                       if ((audiofd > -1) &&  
>>>> (ctrlfd > -1))
>>>>                                               res =  
>>>> ast_waitstream_full(chan, ints, audiofd, ctrlfd);
>>>>                                       else
>>>>                                               res = ast_waitstream 
>>>> (chan, ints);
>>>>                               }
>>>>                               ast_stopstream(chan);
>>>>                       }
>>>>       }
>>>>       return res;
>>>> }
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Asterisk-Dev mailing list
>> Asterisk-Dev at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-dev
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
>




More information about the asterisk-dev mailing list