Re: [Asterisk-java-users] fastagi.command.GetDataCommand issue
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-04-29 23:57:01
|
> > It seems to me that "GET DATA foo" is translated to "GET DATA foo 0 > > 1024" and thats exactly what asterisk-java sends. right? >=20 > Yes, that is what it sends. I think it should send "GET DATA foo". hmm we could do this, though it would imply to use nullable Integers instead of the easier to use ints for timeout and maxDigits. That would make GetDataCommand quite different from the other Commands that use primitive attributes. Nevertheless asterisk uses a default timeout of 0 and a default maxDigits of 1024, so there is really no semantic difference between the two. You might consider this knowledge of asterisk internals a violation of encapsulation practices but some knowledge is needed anyway (i.e. to enforce the maximum maxDigits of 1024 to prevent buffer overflows, see below). Using 0 as timeout indicates "default timeout" and thats defined as 6000 in app.c ast_app_getdata_full(..). Using 1024 as maxDigits is the maximum number of digits GET DATA can handle anyway as the buffer that is used by asterisk is defined as char data[1024]. Although asterisk does not enforce a maximum of 1024 reading more digits would result in a buffer overflow. =3DStefan |