[asterisk-dev] AGI SayNumber gender option

John Lange j.lange at epic.ca
Wed Sep 27 07:30:38 MST 2006


Ok, I'll bite. What gender is "c" or "n" ?

On Wed, 2006-09-27 at 11:41 +0400, asterisk-dev at agk.nnov.ru wrote:
> Hello,
> I've tried to use gender option for agi SAY NUMBER command in different way, but failed.
> So, I modified source code to make it possible to add 'f', 'm', 'c', or 'n' option at
> the end of a number to specify it's gender.
> Please, check following patch and apply it to main asterisk source code.
> 
> --- res_agi.c.orig      2006-09-07 00:02:59.000000000 +0400
> +++ res_agi.c   2006-09-26 17:17:27.000000000 +0400
> @@ -658,11 +658,17 @@
>  {
>         int res;
>         int num;
> +       int len;
> +       char opt[] = "\0\0";
>         if (argc != 4)
>                 return RESULT_SHOWUSAGE;
>         if (sscanf(argv[2], "%d", &num) != 1)
>                 return RESULT_SHOWUSAGE;
> -       res = ast_say_number_full(chan, num, argv[3], chan->language, (char *) NULL, agi->audio, agi->ctrl);
> +       len = strlen(argv[2]) - 1;
> +       if ( len >=0 && (argv[2][len] == 'f' || argv[2][len] == 'm' 
> +         || argv[2][len] == 'c' || argv[2][len] == 'n') ) 
> +           opt[0] = argv[2][len];
> +       res = ast_say_number_full(chan, num, argv[3], chan->language, opt, agi->audio, agi->ctrl);
>         if (res == 1)
>                 return RESULT_SUCCESS;
>         fdprintf(agi->fd, "200 result=%d\n", res);
> 




More information about the asterisk-dev mailing list