[Freeswitch-users] Current timestamp variable in dialplan?

Andrew Cassidy andrew at cassidywebservices.co.uk
Fri Nov 4 14:40:23 UTC 2022


Set logging to debug, then every dialplan instruction, all parameters, and
microsecond timings are recorded in the log file.

You can also add your own log entries, which will also have that
information.

https://freeswitch.org/confluence/display/FREESWITCH/mod_logfile



On Wed, 2 Nov 2022 at 19:00, Antony Stone <
Antony.Stone at freeswitch.open.source.it> wrote:

> On Wednesday 02 November 2022 at 18:25:52, Brian West wrote:
>
> > What problem are you trying to solve?  I still can't clearly
> > understand what you're trying to accomplish.
>
> Oh, I didn't realise you wanted to know what I planned to *do* with the
> information - I thought you were just trying to understand exactly what
> information I need.
>
> So, to answer your question about why I need these timestamps, I have
> specific
> points throughout the dialplan where I need to know the current (accurate)
> timestamp, in order to collect statistics on the efficiency of different
> parts of
> the dialplan (basically, how long does *this* section take to complete,
> how
> long does *that* section take, etc).
>
> These timing values are then combined with similar timestamps from other
> parts
> of the system (which includes Asterisk, database lookups, and other
> external
> services) to give an overall measure of the performance of individual
> parts of
> the whole thing.
>
> Ultimately I do not intend to collect this quantity of data from
> production
> systems, but on development and test systems I need to be able to spot
> quickly
> when some part of what FreeSwitch is doing, or anything else we are
> collecting
> these timestamps from, changes (for better or for worse) in how long the
> processing takes.
>
> Does that answer your question sufficiently to be able to guide to me
> where I
> can find the current timestamp inside the dialplan?
>
> I didn't realise that this could be a complicated question, but perhaps
> the
> fact that I didn't find the answer easily indicates that it is?
>
> > On Wed, Nov 2, 2022 at 12:12 PM Antony Stone wrote:
> > > On Wednesday 02 November 2022 at 17:18:26, Brian West wrote:
> > > > Ok let's step back, what do you mean by this?
> > >
> > > I mean that I wish either to assign the current timestamp to a variable
> > > in the format 2022-11-02 12:34:56.789789, or to find a system variable
> > > which will provide this when I reference something like ${now}.
> > >
> > > I hope that's clear?
> > >
> > > As a workaround until I find out how to do this the correct way, the
> > > following command does what I want, however I suspect it's not very
> > > efficient:
> > >
> > > <action
> > >         application="set"
> > >         data="now=${regex(${system date '+%F %T.%N'}|(.+)|%1)}"
> > > />
> > >
> > > I got the somewhat complicated syntax of that command from
> > >
> https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools:+system
> > >
> > >
> > > Antony.
>
> --
> "A person lives in the UK, but commutes to France daily for work.
> He belongs in the UK."
>
>  - From UK Revenue & Customs notice 741, page 13, paragraph 3.5.1
>  - http://tinyurl.com/o7gnm4
>
>                                                    Please reply to the
> list;
>                                                          please *don't* CC
> me.
>
> _________________________________________________________________________
>
> The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
> Enhance your FreeSWITCH install with disruptive priced SMS and PSTN
> services.
> Build your next product on our scalable cloud platform.
>
> Join our online community to chat in real time
> https://signalwire.community
>
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> https://freeswitch.com



-- 
*Andrew Cassidy BSc (Hons) MBCS*
Managing Director

0330 44 55 960 <+443304455960> andrew at cassidyweb.co.uk www.cassidyweb.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20221104/559e582a/attachment.html>


More information about the FreeSWITCH-users mailing list