[asterisk-dev] Patch for cdr_odbc.c

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Apr 11 08:25:15 MST 2007

On Wednesday 11 April 2007 08:33, Peter Lemenkov wrote:
> We discovered that this module didn't work with Oracle driver for
> unixODBC. After some investigations we found that binding of
> variables didn't conforms recomendations (actually I can't understant
> how it worked at all!).
> According to
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc
> we found that pre-last parameter must be lenght of string passed or
> even bigger (sizeof(buffer) would be satisfactory) but someone set it
> to zero. So we created a simple patch and tested it woth MySQL and
> Oracle driver for unixODBC.
> Any comments and suggestions are welcome :)

Not to wholly defend it, but a reading of the webpage above can be taken
to mean that the parameter should be ignored by the driver:

"For input/output and output parameters, it is used to determine whether
to truncate character and binary C data on output...For all other types
of C data, the BufferLength argument is ignored."

Since these parameters are ONLY used for input, they fall under the
exception granted in the specification.

However, given that we generally code Asterisk to what works, rather
than exactly to specification (cf. SIP), we'll probably make this
suggested modification anyway.


More information about the asterisk-dev mailing list