ACC module EPOCH for timestart

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ACC module EPOCH for timestart

thomcr
Hello,

I have been looking to se if I can store on my DB along with the time field that is actually a datetime in the DB, and EPOCH value.

I have been looking in the acc module documentation but I haven't found anything relevant.

I would like to get the EPOCH directly from the dialog module in opensips, and not with a DB now() hack.

When I do a opensipsctl fifo dlg_list 

dialog::  hash=3011:1918496183
state:: 4
user_flags:: 0
timestart:: 1301897869

I can see the timestart value in EPOCH, how can I access it? 

I found the variables functions fetch_dlg_value(name,pvar) or get_dialog_info(attr,var,key,key_val) but I don't think this is what I'm looking for.

From a general sql log, I could find that the insert query already has a string like formated value for the time column.

insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,src,dst,duration,setuptime,created ) values ('INVITE','809be9c8-f25c-e011-9bb7-bcaec5119b9b','as67e5ca83','ba9de9c8-f25c-e011-9bb7-bcaec5119b9b@wkst','200','OK','2011-04-04 00:31:22','robert','50624309951',17,0,'2011-04-04 00:31:22')

I'm looking for a way to get the internal epoch value for the timestart of the dialog.
--
Robert

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ACC module EPOCH for timestart

Brett Nemeroff
On Mon, Apr 4, 2011 at 1:34 AM, Robert Thomas <[hidden email]> wrote:
I have been looking to se if I can store on my DB along with the time field that is actually a datetime in the DB, and EPOCH value.


Using db_extra, you can add just about any field you want to the acc record:
http://www.opensips.org/html/docs/modules/1.6.x/acc.html#id293711

For example, you can write the PV $Ts.

That being said, you can normally use a db time field with some simple conversion for whatever you need. Remember it's a date object and not really a string. 
 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users