[Freeswitch-users] Current timestamp variable in dialplan?

Antony Stone Antony.Stone at freeswitch.open.source.it
Wed Nov 9 11:09:29 UTC 2022


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.



More information about the FreeSWITCH-users mailing list