[Freeswitch-users] How to delay setInputCallback() while playing audio?

Muhammad Naseer Bhatti nbhatti at gmail.com
Wed Jun 28 18:53:27 UTC 2017


What about playback or streamFile from/to an offset and once this stream is
finished, start another stream from where the last finished and then listen
for events?

session:streamFile(audioFile, 5000, 10000)
and then session:streamFile(audioFile, 10001) and later listen for
inputcallback.

Offset is defined in playback and streamFile but no end point for the
audio, so I guess that would not be possible? Or if there is a better logic
to do that?

-- 

Sent with Airmail

From: Michael Jerris <mike at jerris.com> <mike at jerris.com>
Reply: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
<freeswitch-users at lists.freeswitch.org>
Date: June 28, 2017 at 11:17:42 PM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
<freeswitch-users at lists.freeswitch.org>
Subject:  Re: [Freeswitch-users] How to delay setInputCallback() while
playing audio?

you’d have to handle ignoring for a couple seconds in your callback.. there
is no way to delay setting the callback that I can think of.

On Jun 28, 2017, at 2:02 PM, Muhammad Naseer Bhatti <nbhatti at gmail.com>
wrote:


I guess this would only introduce a silence of 2 seconds. I am trying to
play the file but delay DTMF detection for a few seconds. So my file is
being played but I want to ignore a few seconds of DTMF inputs for callback
function. Can’t think of a better way to do that.

-- 

Sent with Airmail

From: Brian West <brian at freeswitch.org> <brian at freeswitch.org>
Reply: Brian West <brian at freeswitch.org> <brian at freeswitch.org>
Date: June 28, 2017 at 10:12:00 PM
To: Muhammad Naseer Bhatti <nbhatti at gmail.com> <nbhatti at gmail.com>
Cc: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
<freeswitch-users at lists.freeswitch.org>
Subject:  Re: [Freeswitch-users] How to delay setInputCallback() while
playing audio?

use streamFile silence_stream://2000



On Wed, Jun 28, 2017 at 11:48 AM, Muhammad Naseer Bhatti <nbhatti at gmail.com>
 wrote:

>
> Or something like sched_api_function() which calls the function to detect
> events?
>
> --
>
> Sent with Airmail
>
> From: Muhammad Naseer Bhatti <nbhatti at gmail.com> <nbhatti at gmail.com>
> Reply: Muhammad Naseer Bhatti <nbhatti at gmail.com> <nbhatti at gmail.com>
> Date: June 28, 2017 at 12:18:40 AM
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> <freeswitch-users at lists.freeswitch.org>, Brian West <brian at freeswitch.org>
> <brian at freeswitch.org>
>
> Subject:  Re: [Freeswitch-users] How to delay setInputCallback() while
> playing audio?
>
>
> playbackMessage() function is actually doing session:streamFile(audio_file).
> Input callback is functioning fine, but I want to delay detection a few
> seconds somehow.
>
> On the other hand, is there a way to stop a running session:streamFile() ?
>
> --
>
> Sent with Airmail
>
> From: Brian West <brian at freeswitch.org> <brian at freeswitch.org>
> Reply: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> <freeswitch-users at lists.freeswitch.org>
> Date: June 28, 2017 at 12:15:20 AM
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> <freeswitch-users at lists.freeswitch.org>
> Subject:  Re: [Freeswitch-users] How to delay setInputCallback() while
> playing audio?
>
> Show us how you're doing the playback,  If you're doing
> session:execute('playback', 'blah.wav'); The input callback won't function
> you have to use session:streamFile instead.
>
> /b
>
>
> On Tue, Jun 27, 2017 at 1:10 PM, Muhammad Naseer Bhatti <nbhatti at gmail.com
> > wrote:
>
>> I am running an IVR which collects DTMF input while the file is being
>> played, written in Lua. I set InputCallback and then listen for DTMF
>> events. If event found, take actions etc.
>>
>>     session:setInputCallback("eventHandler")
>>     playbackMessage (playback_delay)
>>
>> Facing a strange issues with Verizon where they send a quick RTP Event
>> write after starting the audio, which triggers the DTMF event and bad
>> things happen in my script. This only happens within first 1 to 2 seconds
>> of RTP. How can I have my InputCallback listen for events only after a few
>> seconds while still playing the audio? or do I have to switch to
>> playAndGetDigits() ?
>>
>>
>> --
>>
> _________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at 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 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/20170628/c7d5aca7/attachment.html>


More information about the FreeSWITCH-users mailing list