[asterisk-users] Little t38 bug?

Alexandru Oniciuc Alexandru.Oniciuc at trivenet.it
Tue May 25 05:48:27 CDT 2010


Hello List,

                I think I've discovered a little bug in t.38 bug in 1.6.0.22 regarding the speed (T38MaxBitRate) used to send the faxes.

                Asterisk always responds  with a=T38MaxBitRate:2400. I've tried with Patton and Grandstream devices and the result is always the same.
                Patton ignores the parameter and sends the fax at 9600.
                Grandstream doesn't, and all the faxes are going in and out at 2400.

                Looking at the code I found this in chan_sip.c (line 7736):

if ((sscanf(a, "T38FaxMaxBuffer:%30u", &x) == 1)) {
                ast_debug(3, "MaxBufferSize:%d\n", x);
                found = TRUE;
        } else if ((sscanf(a, "T38MaxBitRate:%30u", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%30u", &x) == 1)) {
                ast_debug(3, "T38MaxBitRate: %d\n", x);
                switch (x) {
                case 14400:
                        p->t38.their_parms.rate = AST_T38_RATE_14400;
                        break;
                case 12000:
                        p->t38.their_parms.rate = AST_T38_RATE_12000;
                        break;
                case 9600:
                        p->t38.their_parms.rate = AST_T38_RATE_9600;
                        break;
                case 7200:
                        p->t38.their_parms.rate = AST_T38_RATE_7200;
                        break;
                case 4800:
                        p->t38.their_parms.rate = AST_T38_RATE_4800;
                        break;
                case 2400:
                        p->t38.their_parms.rate = AST_T38_RATE_2400;
                        break;
                }
                found = TRUE;
else if {...



If I'm not misteaking the second "if else" condition will never be true if the other device sends "T38FaxMaxBuffer" (wich they all usually do).

Shouldn't it be

if((sscanf(a, "T38FaxMaxBuffer:%30u", &x) == 1) && ((sscanf(a, "T38MaxBitRate:%30u", &x) == 0) || (sscanf(a, "T38FaxMaxRate:%30u", &x) == 0))) ??

Thanks,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100525/ab27af29/attachment.htm 


More information about the asterisk-users mailing list