<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. 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, 刘宁 <<a href="mailto:ningliuxd@gmail.com">ningliuxd@gmail.com</a>> 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 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. </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 </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></extension></div><div><extension name="testlua"></div><div><condition field="destination_number" expression="^(\d{4}\d+)$"></div><div><action application="playback" data="voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later--></div><div><action application="lua" data="gen_dialplan_xml.lua"/></div><div></condition></div><div></extension></div><div></include></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 lua scripts “gen_dialplan_xml.lua" have to set some arguments for the session and finally it calls 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 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><extension name="testlua"></div><div><condition field="destination_number" expression="^(\d{4}\d+)$"></div><div><!--action application="playback" data="voicemail/qav_video_incoming.wav"/--> <!-- just for test replace it later--></div><div><action application="set" data="hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later--></div><div><action application="set" data="tmp_hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later--></div><div><action application="lua" data="gen_dialplan_xml.lua"/></div><div></condition></div><div></extension></div><div></include></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>