[Freeswitch-users] Current timestamp variable in dialplan?

Gregor Nanger gregor at infomedia.si
Wed Nov 9 12:54:07 UTC 2022


If you would aks me, I would say that this simple functionality is
available in FS and within 2 minutes I can google it. But now I am
struggling for hours and can't find a solution to print, log... current
time in microseconds or nanoseconds. If %q would work in strftime it would
be a solution, but it doesn't work.

Is there another tool to display the current time in micro/nano seconds?

On Wed, 9 Nov 2022 at 12:10, Antony Stone <
Antony.Stone at freeswitch.open.source.it> wrote:

> On Wednesday 09 November 2022 at 10:31:26, Gregor Nanger wrote:
>
> > now is by default, if you just use strftime. Try eval ${strftime()}
>
> Aha, yes, that works, and the (undocumented as far as I can see) %q
> parameter
> gives me nanoseconds.
>
> > Do you know how to print now in milliseconds like:
> > <action application="set" data="var_name=${utcnow}"/>
>
> No :(
>
> I wanted microseconds, but %6q gives nothing, as does %3q (which I would
> expect to give milliseconds).
>
> So, %S.%q gives seconds + nanoseconds, but I don't see a way to reduce the
> resolution (interestingly, Asterisk's strftime function does support this,
> also with the %q parameter).
>
>
> Antony.
>
> > On Wed, 9 Nov 2022 at 10:22, Antony Stone wrote:
> > > On Tuesday 08 November 2022 at 23:55:18, Gregor Nanger wrote:
> > > > Antony, would strftime [format_string] do the job?
> > >
> > > Quite possibly, provided I can find a value of "now" to format with it.
> > >
> > > > On Sat, 5 Nov 2022 at 21:48, Piotr Gregor wrote:
> > > > > Antony,
> > > > >
> > > > > This sounds like a job for a module, especially that you mentioned
> > > > > you would like to upload/send it somewhere and combine it with data
> > > > > from other services.
> > > > > You create a module that exports one or more applications, you can
> > > > > call them from dialplan.
> > > > >
> > > > > best,
> > > > >
> > > > >
> > > > > Piotr Gregor
>
> --
> You can spend the whole of your life trying to be popular,
> but at the end of the day the size of the crowd at your funeral
> will be largely dictated by the weather.
>
>  - Frank Skinner
>
>                                                    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



-- 
Gregor Nanger

*CTO*
t./f.: 00386 (0) 7 6000 308/309 • m:. 00386 (0)41 756485
• Infomedia d.o.o. • Jerebova 3, Novo mesto, Slovenia
• www.infomedia.si
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20221109/d6dd68cb/attachment.html>


More information about the FreeSWITCH-users mailing list