[Freeswitch-users] Current timestamp variable in dialplan?

Antony Stone Antony.Stone at freeswitch.open.source.it
Fri Nov 11 12:09:22 UTC 2022

On Friday 11 November 2022 at 11:54:26, Antony Stone wrote:

> On Wednesday 09 November 2022 at 20:23:50, Brian West wrote:
> > All of this is already present in the XML CDR, each action, every step
> > all time stamped down to microseconds and more accurate than setting
> > variables.  Did you happen to load xml_cdr and do a call and see the
> > information?
> So, I have this morning had a chance to get back to this, and it turns out
> that <load module="mod_xml_cdr"/> was already in modules,conf.xml and I
> have a large number of large files under /var/log/freeswitch/xml_cdr from
> previously placed calls.
> Comments / questions:
> 1. Aside from the timestamp variable assignment which I have put into the
> dialplan myself (the one which has already been discussed and you say is a
> bad idea because of session pool swell) I do not see any timestamps
> anywhere in the xml file - how do I enable these?

Ah, I do now see that some of the lines have "app_stamp" fields, containing an 
epoch-format timestamp.  Not the format I need for feeding into syslog (all 
other applications use ISO 8601 format), but I guess it might be post-
processable, if there's no option to specify the format?

The next two items look like bigger problems for now, though:

> 2. The xml file is enormous (20kbytes for a single call) and would take
> considerable parsing - where do I find the options to limit what
> information goes in there?
> 3. https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr tells
> me that this module can log to a file or using an HTTP POST.  Does this
> mean there is no way to get it to write to syslog?
> I do nearly all logging (of everything that's running) to syslog, forward
> this with no further processing to a central syslog server, and then
> process / parse / aggregate / filter the data there, so as to reduce the
> workload on "worker" machines which generate the logs.
> This also makes it easy to combine log output from different applications
> which are running independently (sometimes on different machines) but
> whose actions in processing one "transaction" (for want of a better word)
> are important to see in sequence.
> So, I still wonder what is the best way to get microsecond-resolution
> timestamps for key events ("key" being defined by me) in FreeSwitch during
> the processing of a call.
> Any suggestions on how to do this (preferably efficiently and without
> longer- term drawbacks such as session pool swell) are welcome.

While I'm at it, can anyone tell me quite what a session pool is (or refer me 
to the documentation for it), what causes swell, and how to avoid it (whilst 
still getting the dialplan to do what you need)?

> Thanks,
> Antony.

A user interface is like a joke.
If you have to explain it, it means it doesn't work.

                                                   Please reply to the list;
                                                         please *don't* CC me.

More information about the FreeSWITCH-users mailing list