Misc. Dialplan Tools strepoch

From FreeSWITCH Wiki
Revision as of 12:05, 20 May 2010 by Diego.viola (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



Returns the number of seconds since the Unix epoch (UTC of midnight January 1, 1970)

From the dialplan

<action application="set" data="my_timestamp=${strepoch()}"/>


The following extension will only start to play music on hold if called before the date/time specified by the epoch.

<extension name="moh">
  <condition field="destination_number" expression="^1234$"/>
  <condition field="${cond(${strepoch()} < 1273755900 ? true : false)}" expression="^true$">
    <action application="answer"/>
    <action application="playback" data="$${hold_music}"/>
    <anti-action application="log" data="NOTICE The string quartet has gone home."/>

From the CLI