<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 12pt; font-family: "Times New Roman",Times,serif'>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<p><tt>The duration of the media playback is returned from the play_media()<span> </span></tt><tt>command (see `media_duration` modparam). You could use some sort of<span> </span></tt><tt>timer to invoke media unblocking after media playback ends. Sadly my<span> </span></tt><tt>Kamailio-Fu isn't strong enough to be able to tell you how to run this<span> </span></tt><tt>sort of timer. :)</tt></p>
<pre>Cheers</pre>
<pre> </pre>
</blockquote>
<p><span style="font-family: monospace;">Thank you for the hint.</span></p>
<p><span style="font-family: monospace;">I was thinking about timers, but rtimer cannot be triggered in an event route. I used a "timer" module, it could trigger another route from the event route but when a new route is triggered unblock_media() is not aware of the call-id and if i assign call-id to a variable in the event route, that variable is unavailable at new route. Hope that make sense.</span></p>
<p><span style="font-family: monospace;">here is my peace of code: </span></p>
<p><span style="font-family: monospace;">loadmodule "timer.so" </span></p>
<p><span style="font-family: monospace;">modparam("timer", "declare_timer", "PB_TIMER=START,5000");</span></p>
<p><br /></p>
<p>route[START]{<br />xlog("current call id at event route is $ci, but call-id avp is $avp(call_id)");<br />unblock_media("all");<br />timer_enable("PB_TIMER",0); #we need to disable timer or it will be triggered over and over again</p>
<p>}</p>
<p>event_route[dialog:start]{<br />xlog("L_INFO", "dialog started, received 200OK");<br />#block_media();<br />play_media("all file=/usr/local/src/myfile.wav");<br />$avp(call_id)=$ci;<br />timer_enable("PB_TIMER",1);<br />}</p>
<p><br /></p>
</body></html>