HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] Modem Initialization Question



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 15.07.2010 00:01, schrieb Greg Youngers:

> The Cisco CDR SQL database contains a number of records.  It is
> currently configured to purge records older than 5 days
[...]

Hello Greg,

that means you will still have access to the correct record if you receive a new connection while waiting for the data to be written to the DB.

> There are time-stamp fields included in the records, such as:
> dateTimeConnect (mentioned above)
> dateTimeDisconnect

I guess dateTimeDisconnect of the correct record should be just before the time when your FaxDispatch is called and dateTimeDisconnect of a new connection should be after this.
You could save the current time when FaxDispatch is called, wait for 65 seconds and then select the row with the newest dateTimeDisconnect before the remembered time.

> The ugly part of the time fields is that they are "written in Universal
> Coordinated Time (UTC), which is the number of seconds since January 1,
> 1970 GMT, or simply Epoch time."

This type of time information is normal on UNIX systems and it's easy to convert between different forms.
Possible methods to get the current time in this format are these:

perl -e 'print time() . "\n";'
perl -e 'print gmtime(time()) . "\n";'
perl -e 'print localtime(time()) . "\n";'
perl -e 'use POSIX;print strftime("%Y-%M-%dT%H:%M:%S", gmtime(time())) . "\n";'
perl -e 'use POSIX;print strftime("%Y-%M-%d %H:%M:%S", localtime(time())) . "\n";'

It depends on the exact form you need for your DB query.


Bodo

P.S.: Don't send me a copy of your message when you reply to the mailing list.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkw+nD0ACgkQnMz9fgzDSqd27ACeLfNTNor7dDBo7bfxsCfkrbsA
fugAnAnN/kbyPk09BALY46ibGnBAQeV+
=nufC
-----END PGP SIGNATURE-----


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions