[OpenSER-Devel] Dialog start time issue

Jerome Martin jmartin at longphone.fr
Wed Jan 9 12:02:16 UTC 2008


Hello all,

I'm being confronted to an annoying issue with the dialog module (using
rev 3442 from 1.3 branch svn) :

One of the purposes of me using the dialog is to be able to calculate
call duration. This works fine in basic cases, but fails when openser is
stopped then restarted (dialog database mode 1 aka realtime). I need
this to work, as this is the only way I can ensure reliable dialog-state
awareness in a HA environment (in my setup, if the physical machine
holding the openser vserver dies, the vserver is restarted somewhere
else).

Here is the issue : when saving dialog state in database, the stored
value is the start_ts of the dialog, which is a relative amount of time
since openser startup. For the dialog state to be meanfull accross
restarts, it needs to be an absolute time value (relative to epoch). So
intuitively, we would need to store time(0)-get_ticks()+start_ts, which
is exactly what is curretly being done for the dialog expiration time
(tl.timeout). However, the problem is that one can not restore that
value simply without completly changing the way the dialog module
handles those timestamps (relative to openser start), because this is an
unsigned value and upon restore the start_ts will be negative (dialog
start time is BEFORE the actual openser start). I was thinking of
submitting a patch, but before that I'd like to have your advice on the
best implementation :

1/ Use signed int values, allowing start_ts dating back to before the
actual openser startup. This is easy, but maybe an int will be a bit
short for that ?

2/ Convert all jiffies to absolute time (get_ticks would return jiffies
+ startup time).

3/ Keep the start_ts not to break anything but add an absolute_start_ts
in db, and make DLG_DURATION use that one.

4/ Suggest a better way than 1,2 or 3 that I have missed, that would be
simpler :-)

What do you think ?

Regards,
-- 
Jérôme Martin | LongPhone
Responsable Architecture Réseau
122, rue la Boetie | 75008 Paris
Tel :  +33 (0)1 56 26 28 44
Fax : +33 (0)1 56 26 28 45
Mail : jmartin at longphone.fr
Web : www.longphone.com <http://www.longphone.com>




More information about the Devel mailing list