correct method to play an audio file in a call originated from Freeswitch to a mobile number
Hi, I have a use case using ESL, where I need to originate a call from from Freeswitch to a mobile number and play a .wav after the recipient has answered the call. I am using following way to achieve this : Step 1 . Issue esl command = ""originate " + gateway + "+91" + phone_number + " &park"" Step 2. command = ""uuid_transfer " + uuid + " 4441"" where dialplan 4441 has : <extension name="ivr_demo"> <condition field="destination_number" expression="^4441$"> <action application="playback" data="/usr/local/freeswitch/recordings/file.wav"/> <action application="sleep" data="1000"/> </condition> </extension> This works fine but sometimes, after answering of the call, listener does not hear anything, file does not play. If I do not use the park command and directly transfer to dialplan then the file starts playing immediately even if the user has not answered. How can I add a condition of answering in dialplan (<action application="answer"/> does not work). Is any other alternative to achieve this correctly. Regards, Deepika
Try this. esl command = ""originate " + gateway + "+91" + phone_number + " " + 4441 <extension name="ivr_demo"> <condition field="destination_number" expression="^4441$"> <action application="wait_for_answer"/> <action application="playback" data="/usr/local/freeswitch/ recordings/file.wav"/> <action application="sleep" data="1000"/> </condition> </extension>
Thanks, I will try this method also. This worked for me : esl command = "originate " + gateway + "+91" + phone_number + " 7778" <extension name="exe_on_ans"> <condition field="destination_number" expression="^7778$"> <action application="set" data="execute_on_answer=transfer 4441 XML default"/> <action application="log" data="INFO Waiting 30 seconds for $1 to answer..."/> <action application="sleep" data="30000"/> </condition> </extension> <extension name="ivr_demo"> <condition field="destination_number" expression="^4441$"> <action application="playback" data="/usr/local/freeswitch/ recordings/file.wav"/> <action application="sleep" data="1000"/> </condition> </extension> On Fri, Aug 26, 2016 at 8:16 PM, Aqs Younas <aqsyounas@gmail.com> wrote:
Try this.
esl command = ""originate " + gateway + "+91" + phone_number + " " + 4441
<extension name="ivr_demo"> <condition field="destination_number" expression="^4441$"> <action application="wait_for_answer"/> <action application="playback" data="/usr/local/freeswitch/recordings/file.wav"/> <action application="sleep" data="1000"/> </condition> </extension>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Aqs Younas
-
Deepika Yadav