[Freeswitch-users] play back and moh

Anthony Minessale anthony.minessale at gmail.com
Wed Aug 13 21:42:37 MSD 2014


You might be able to set the "ringback" variable on the inbound leg then
call the bridge application on the outbound leg dial string.  If you insist
to do it manually in lua, you need to set ringback on inbound leg and
supply the inbound session object to the constructor for the outbound leg
which is over complicated.

Based on what you are doing, I suggest that you consult one of the FS books
or some of the wiki to properly understand the way the software works
because you have several false assumptions going on.



On Aug 12, 2014 10:21 PM, "Michael Jerris" <mike at jerris.com> wrote:
>
> only if its before you try calling the other party.
>
> On Aug 12, 2014, at 9:44 PM, Leo Lau <ningliuxd at gmail.com> wrote:
>
>> In the original mail,
>>>
>>> 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.
>>
>>
>> ——— the ringtone means the color ring of Alice. So, is there any way I
can play my own music before the color ring?
>>
>>
>> 发件人: Michael Jerris <mike at jerris.com>
>> 答复: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
>> 日期: 2014年8月13日 星期三 5:01
>> 至: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
>> 主题: Re: [Freeswitch-users] play back and moh
>>
>> 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.
>>
>> On Aug 12, 2014, at 12:11 PM, 刘宁 <ningliuxd at gmail.com> wrote:
>>
>>> 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.
>>
>>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140813/724f4435/attachment.html 


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