Strange Behavior with Channel Variable [session:setVariable() vs <action application="set" ... /> ]
Dear All, I am using a little known but very useful channel variable called "playback_timeout_sec" In Lua if I do: session:setVariable("playback_timeout_sec", "10") and subsequently in a macro I have: <action function="play-file" date="/some/filename.mp3" /> Then the filename.mp3 stops playing automatically after 10 seconds. This is very useful if you want to play short excerpts of a file that could be very long. But if I do: <action application="set" date="playback_timeout_sec=10" /> <action function="play-file" date="/some/filename.mp3" /> My file does NOT stop playing after 10 seconds. This is weird given that <action application="set" .. /> is doing exactly the same thing as session:setVariable() ... right? My question 1. What could be the problem with application set? 2. Is there a way to automatically stop playback after a certain number of seconds for a file? (without doing tedious things like create a separate 10second version of an mp3 using ffmpeg etc.) Thanks, Sidharth -- Sidharth Kshatriya www.sidk.info
Is this a delayed email? I think this was resolved yesterday, right? /Peter Från: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] För Sidharth Kshatriya Skickat: den 10 mars 2011 21:22 Till: freeswitch-users@lists.freeswitch.org Ämne: [Freeswitch-users] Strange Behavior with Channel Variable [session:setVariable() vs <action application="set" ... /> ] Dear All, I am using a little known but very useful channel variable called "playback_timeout_sec" In Lua if I do: session:setVariable("playback_timeout_sec", "10") and subsequently in a macro I have: <action function="play-file" date="/some/filename.mp3" /> Then the filename.mp3 stops playing automatically after 10 seconds. This is very useful if you want to play short excerpts of a file that could be very long. But if I do: <action application="set" date="playback_timeout_sec=10" /> <action function="play-file" date="/some/filename.mp3" /> My file does NOT stop playing after 10 seconds. This is weird given that <action application="set" .. /> is doing exactly the same thing as session:setVariable() ... right? My question 1. What could be the problem with application set? 2. Is there a way to automatically stop playback after a certain number of seconds for a file? (without doing tedious things like create a separate 10second version of an mp3 using ffmpeg etc.) Thanks, Sidharth -- Sidharth Kshatriya www.sidk.info<http://www.sidk.info> !DSPAM:4d7a03ab32764871212382!
Yes, this was resolved! On Fri, Mar 11, 2011 at 4:53 PM, Peter Olsson < peter.olsson@visionutveckling.se> wrote:
Is this a delayed email? I think this was resolved yesterday, right?
/Peter
*Från:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *För *Sidharth Kshatriya *Skickat:* den 10 mars 2011 21:22 *Till:* freeswitch-users@lists.freeswitch.org *Ämne:* [Freeswitch-users] Strange Behavior with Channel Variable [session:setVariable() vs <action application="set" ... /> ]
Dear All,
I am using a little known but very useful channel variable called "playback_timeout_sec"
In Lua if I do: session:setVariable("playback_timeout_sec", "10")
and subsequently in a macro I have:
<action function="play-file" date="/some/filename.mp3" />
Then the filename.mp3 stops playing automatically after 10 seconds. This is very useful if you want to play short excerpts of a file that could be very long.
But if I do:
<action application="set" date="playback_timeout_sec=10" />
<action function="play-file" date="/some/filename.mp3" />
My file does NOT stop playing after 10 seconds. This is weird given that <action application="set" .. /> is doing exactly the same thing as session:setVariable() ... right?
My question
1. What could be the problem with application set?
2. Is there a way to automatically stop playback after a certain number of seconds for a file? (without doing tedious things like create a separate 10second version of an mp3 using ffmpeg etc.)
Thanks,
Sidharth
-- Sidharth Kshatriya www.sidk.info
!DSPAM:4d7a03ab32764871212382!
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sidharth Kshatriya www.sidk.info
<action application="set" date="playback_timeout_sec=10" /> I assume you mean data="..." not date="..."? -Steve On 10 March 2011 20:21, Sidharth Kshatriya <sid.kshatriya@gmail.com> wrote:
Dear All,
I am using a little known but very useful channel variable called "playback_timeout_sec"
In Lua if I do: session:setVariable("playback_timeout_sec", "10")
and subsequently in a macro I have:
<action function="play-file" date="/some/filename.mp3" />
Then the filename.mp3 stops playing automatically after 10 seconds. This is very useful if you want to play short excerpts of a file that could be very long.
But if I do:
<action application="set" date="playback_timeout_sec=10" /> <action function="play-file" date="/some/filename.mp3" />
My file does NOT stop playing after 10 seconds. This is weird given that <action application="set" .. /> is doing exactly the same thing as session:setVariable() ... right?
My question 1. What could be the problem with application set? 2. Is there a way to automatically stop playback after a certain number of seconds for a file? (without doing tedious things like create a separate 10second version of an mp3 using ffmpeg etc.)
Thanks,
Sidharth -- Sidharth Kshatriya www.sidk.info
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yes data :-) checkout http://jira.freeswitch.org/browse/FS-3142 for resolution... On Fri, Mar 11, 2011 at 6:04 PM, Steven Ayre <steveayre@gmail.com> wrote:
<action application="set" date="playback_timeout_sec=10" />
I assume you mean data="..." not date="..."?
-Steve
On 10 March 2011 20:21, Sidharth Kshatriya <sid.kshatriya@gmail.com>wrote:
Dear All,
I am using a little known but very useful channel variable called "playback_timeout_sec"
In Lua if I do: session:setVariable("playback_timeout_sec", "10")
and subsequently in a macro I have:
<action function="play-file" date="/some/filename.mp3" />
Then the filename.mp3 stops playing automatically after 10 seconds. This is very useful if you want to play short excerpts of a file that could be very long.
But if I do:
<action application="set" date="playback_timeout_sec=10" /> <action function="play-file" date="/some/filename.mp3" />
My file does NOT stop playing after 10 seconds. This is weird given that <action application="set" .. /> is doing exactly the same thing as session:setVariable() ... right?
My question 1. What could be the problem with application set? 2. Is there a way to automatically stop playback after a certain number of seconds for a file? (without doing tedious things like create a separate 10second version of an mp3 using ffmpeg etc.)
Thanks,
Sidharth -- Sidharth Kshatriya www.sidk.info
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Sidharth Kshatriya www.sidk.info
participants (3)
-
Peter Olsson
-
Sidharth Kshatriya
-
Steven Ayre