[asterisk-users] Measuring audio file legth

Suity Zsolt suich at yunord.net
Thu Apr 12 09:57:20 MST 2007

> On Thu, 2007-04-12 at 13:28 +0200, Suity Zsolt wrote:
>> Hi,
>> I have to set call length to 3min, but before hangup have to warn
>> caller. There are many IVRmenu and submenu options with different
>> warning audio.
>> I have to measure somehow the audio file length and subtract it from 3
>> minutes.
> I have not tried this, so I may be off - but do you really have to do
> this?  The documentation I have indicates that if there is an extension
> T in the context, that extension is used at the absolute timeout.  So,
> would:
>   exten => T,1,<play your warning message>
>   exten => T,n,Hangup
> work?

Yes, it works and I use it already! But when caller go to extension 1
there are a 10 second warning message and when go to extension 2 there are
a 6 second message and so on...
I should not to exceed 3minutes time limit, but use connection to last the
last seconds...
Because all the lines are same I want to make a macro
or something like this

exten => _X,1,Set(_AudioLength=MeasureSomehow(warning${EXTEN})
exten => _X,n,Set(TIMEOUT(absolute)=${${MaxCallDuration}-${AudioLength}})
exten => _X,n,DoSomeJob

exten => T,1,Playback(warning${EXTEN})
exten => T,n,Hangup

I can't figure out what command can I write instead of MeasurSomehow.


More information about the asterisk-users mailing list