[Freeswitch-users] time format

Tihomir Culjaga tculjaga at gmail.com
Wed Jun 2 04:23:41 PDT 2010


On Wed, Jun 2, 2010 at 1:09 PM, Tihomir Culjaga <tculjaga at gmail.com> wrote:

>
>
> On Tue, Jun 1, 2010 at 4:50 PM, David Ponzone <david.ponzone at gmail.com>wrote:
>
>> Tihomir,
>>
>> you can do that yourself with expr.
>>
>> h = expr floor(credit_time/3600)
>> m = expr floor(mod(credit_time,3600)/60)
>> s = expr mod(credit_time,60)
>>
>> Just convert that to the right $expr{} syntax.
>>
>>
>>
> cool, it works:
>
>       <action application="log" data="INFO  TRANSFORM MINUTES=>>>>
> TIME=${expr(floor(405/3600))}:${expr(floor(mod(405,3600)/60))}:${expr(mod(405,60))}"/>
>
> Thanks!
>



and finally its like this:

       <macro name="timeleft_sec">
         <input pattern="(\d+)">
           <match>
             <action function="say"
data="${expr(floor($1/3600))}:${expr(floor(mod($1,3600)/60))}:${expr(mod($1,60))}"

                     method="pronounced"
                     type="time_measurement"/>
           </match>
         </input>
       </macro>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100602/61a8d62a/attachment.html 


More information about the FreeSWITCH-users mailing list