<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I don't think we have any way to do this, you can use color ring back and you can ignore progress and play it right away, but you can not then have real ring indication take over. &nbsp;I'm not sure the feature makes any sense as it should never be more than a few seconds, in practice it would be a very strange effect to call someone and immediately get music, then a couple seconds later get ringing.<div><br><div><div>On Aug 12, 2014, at 12:11 PM, 刘宁 &lt;<a href="mailto:ningliuxd@gmail.com">ningliuxd@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi all<div><br><div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Sorry to trouble you ,but I really &nbsp;came across a problem still remaining unsolved when using freeswitch to develop some features.</div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Assume that Bob calls Alice, before Bob here the ringtone of Alice,may be a clip of music. When bob use voip phone, after he dials,</div><div style="font-family: 宋体, sans-serif; font-size: 14px;">maybe there will be a bit longer time before he receives the ringtone. I want to play some music in this period.&nbsp;</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Here is the diaplan config&nbsp;</div><div style="font-family: 宋体, sans-serif; font-size: 14px;">The path is :/usr/local/freeswitch/conf/dialplan/default/call.xml</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Here is the content:</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><div>&lt;/extension&gt;</div><div>&lt;extension name="testlua"&gt;</div><div>&lt;condition field="destination_number" expression="^(\d{4}\d+)$"&gt;</div><div>&lt;action application="playback" data="voicemail/qav_video_incoming.wav"/&gt; &lt;!-- just for test replace it later--&gt;</div><div>&lt;action application="lua" data="gen_dialplan_xml.lua"/&gt;</div><div>&lt;/condition&gt;</div><div>&lt;/extension&gt;</div><div>&lt;/include&gt;</div></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">The &nbsp;lua scripts “gen_dialplan_xml.lua" &nbsp;have to set some arguments &nbsp;for the session and finally &nbsp;it calls &nbsp;freeswitch.bridge(session,newsession)</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Assume that the time when entering the bridge function is t1, and the time when the ringtone of Alice arrives is t2, thus &nbsp;a time of (t1— t2) exists.</div><div style="font-family: 宋体, sans-serif; font-size: 14px;">I want to play a music to Bob during this time. But the action of “playback” and “lua” seem to be applied sequentially, that means ,the music is not played during the (t1—t2)time.</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">I also tried</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><div>&lt;extension name="testlua"&gt;</div><div>&lt;condition field="destination_number" expression="^(\d{4}\d+)$"&gt;</div><div>&lt;!--action application="playback" data="voicemail/qav_video_incoming.wav"/--&gt; &lt;!-- just for test replace it later--&gt;</div><div>&lt;action application="set" data="hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/&gt; &lt;!-- just for test replace it later--&gt;</div><div>&lt;action application="set" data="tmp_hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/&gt; &lt;!-- just for test replace it later--&gt;</div><div>&lt;action application="lua" data="gen_dialplan_xml.lua"/&gt;</div><div>&lt;/condition&gt;</div><div>&lt;/extension&gt;</div><div>&lt;/include&gt;</div></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">And the music file does exist, but it still did not work.</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">How could I complete this feature?Do I have to complete this in the lua scripts?</div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;"><br></div><div style="font-family: 宋体, sans-serif; font-size: 14px;">Than you in advance,looking forward to your reply.</div></div></div></div></blockquote></div><br></div></body></html>