[asterisk-dev] [design] Realtime changes

Atis Lezdins atis at iq-labs.net
Tue Jan 6 10:03:55 CST 2009

>> I toyed with the idea of making a second store method, where the parameters
>> are specified in a set of 4 each, specifying name, value, type, and length,
>> but I'm not wild about that idea, either.
> Actually this type implementation should be better, because Asterisk
> could pass integer values as integer (for example timestamp in
> queue_log, regseconds in sip_peers), thus MySQL would automatically
> translate them to DATETIME forth and back as necessary. So, no more
> unixtime in db.

Ok, just tested this, it isn't possible to have nice DATETIME format
in db unless using FROM_UNIXTIME function, which is however not
applicable in general, as there's not only SQL backends for realtime
out there.

As there's already field type checking in trunk, it could be added to
each SQL engine, so that if required field is INT or VARCHAR, time is
written in timestamp, however if it's DATETIME - engine can put
timestamp within FROM_UNIXTIME.


Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

More information about the asterisk-dev mailing list