The way the dial plan is compiled and executed will vary depending on a lot of factors, what purpose are you using this for? because it's a metric that will show little to no variance, your best bet is to turn on xml_cdr and use that it has all the info and history of what and when things took place. Don't burden the dialplan with these sorts of tasks as freeswitch wasn't designed to be used like that. /b On Wed, Nov 2, 2022 at 2:03 PM Antony Stone < Antony.Stone@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users https://freeswitch.com
-- Brian West | Co-founder and Developer Need Commercial support? email sales@freeswitch.com FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045 <https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g> Email: brian@freeswitch.com Mobile: 918-424-9378 Website: https://www.FreeSWITCH.com <https://www.freeswitch.com/> [image: https://www.facebook.com/signalwireinc?src=email] <https://www.facebook.com/freeswitch> [image: https://twitter.com/freeswitch] <https://twitter.com/freeswitch>