[asterisk-users] Little t38 bug?

Tilghman Lesher tlesher at digium.com
Tue May 25 09:09:51 CDT 2010


On Tuesday 25 May 2010 08:28:57 Steve Underwood wrote:
> On 05/25/2010 07:54 PM, Kevin P. Fleming wrote:
> > On 05/25/2010 05:48 AM, Alexandru Oniciuc wrote:
> >> 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);
> >>
> >> Shouldn’t it be
> >>
> >> if((sscanf(a, "T38FaxMaxBuffer:%30u",&x) == 1)&&  ((sscanf(a,
> >> "T38MaxBitRate:%30u",&x) == 0) || (sscanf(a, "T38FaxMaxRate:%30u",&x)
> >> == 0))) ??
> >
> > No. You aren't understanding the code :-) It's comparing a string buffer
> > against various patterns, and the string can't match all the patterns at
> > the same time.
> >
> > This code is executed as each line of the SDP is processed, and each one
> > will match one of the branches of this tree, and it's values will be
> > extracted and stored for later use.
> >
> > In other words... this is not the cause of your problem.
>
> Quite true, but the space in "T38MaxBitRate: %d\n" might be a problem,
> as the number doesn't necessarily have a space in front of it.

That's a debug statement, not an sscanf, so it's superfluous to the problem.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list