Skip to main content

mod_dptools: strepoch

About​

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

Examples​

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."/>
</condition>
</extension>

From the CLI​

 strepoch