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
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to