Dmann, you are right,

thank you

On Thu, Jan 21, 2016 at 7:14 PM, Michael Jerris <mike@jerris.com> wrote:
maybe check out billsec ?  there are quite a number of values available depending on what exactly you need, try checking the cdr for what values you actually want and what format they are in.

> On Jan 21, 2016, at 11:02 AM, ik <idokan@gmail.com> wrote:
>
> Hello,
>
> I require to calculate on hangup the duration of a call regardless of the CDR, and do some logic if it's above a range.
>
> I'm placing at the api_hangup_hook a cli parameters that one of them is answered_time.
>
> I need the data in minutes unit, and the data seems to be a timestamp in microseconds, but converting it to seconds (e.g. answered_time / 1000000) provides me a very low range of number, sometimes even less then a millisecond.
>
> I can't seems to find at the documentation what is the unit for the answered_time in order to properly convert it to my requirements.
>
> I'm also missing the place at the source code where the data is set to the variable (here is the grep result (at the src directory):
>
> grep  answered_time ./* -R
> ./mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c:                 bson_append_long(&cdr, "answered_time", caller_profile->times->answered);
> ./mod/languages/mod_managed/managed/ChannelVariables.cs:            const string answered_time = "answered_time";
> ./mod/languages/mod_managed/managed/ChannelVariables.cs:                get { return readUsecsDateTime(answered_time); }
> ./switch_caller.c:      if (!strcasecmp(name, "answered_time")) {
> ./switch_core_session.c:                                                } else if (!strcmp(tag3->name, "answered_time")) {
> ./switch_ivr.c:                 if (!(time_tag = switch_xml_add_child_d(x_times, "answered_time", t_off++))) {
> ./switch_ivr.c:                 cJSON_AddItemToObject(j_times, "answered_time", cJSON_CreateString(tmp));


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org