[Freeswitch-users] play back and moh

刘宁 ningliuxd at gmail.com
Tue Aug 12 20:11:23 MSD 2014


Hi all

Sorry to trouble you ,but I really  came across a problem still remaining unsolved when using freeswitch to develop some features.
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,
maybe there will be a bit longer time before he receives the ringtone. I want to play some music in this period. 

Here is the diaplan config 
The path is :/usr/local/freeswitch/conf/dialplan/default/call.xml

Here is the content:

</extension>
<extension name="testlua">
<condition field="destination_number" expression="^(\d{4}\d+)$">
<action application="playback" data="voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later-->
<action application="lua" data="gen_dialplan_xml.lua"/>
</condition>
</extension>
</include>


The  lua scripts “gen_dialplan_xml.lua"  have to set some arguments  for the session and finally  it calls  freeswitch.bridge(session,newsession)

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.
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.

I also tried

<extension name="testlua">
<condition field="destination_number" expression="^(\d{4}\d+)$">
<!--action application="playback" data="voicemail/qav_video_incoming.wav"/--> <!-- just for test replace it later-->
<action application="set" data="hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later-->
<action application="set" data="tmp_hold_music=${sound_prefix}/voicemail/qav_video_incoming.wav"/> <!-- just for test replace it later-->
<action application="lua" data="gen_dialplan_xml.lua"/>
</condition>
</extension>
</include>


And the music file does exist, but it still did not work.


How could I complete this feature?Do I have to complete this in the lua scripts?


Than you in advance,looking forward to your reply.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140813/2717f2e6/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list