freeswitch controlling play

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

freeswitch controlling play

ik_5
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld-2
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

BTW, How can I know if res arrived to the end of the play file ?

# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld-2
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
when using res.register_event_handler do |event|
logger.debug "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! event: #{event.inspect}"
end

it never triggers, but the global event handler of ahn (events.rb) does catches the end of the recording.
Also, using call.register_event_handler, there is no capture of DTMF, not even on the global event handler.

So what am I doing wrong here ?

Thanks,
Ido

On Sun, Dec 7, 2014 at 5:08 PM, ik <[hidden email]> wrote:
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5
I'm unable to figure out how to do it  using a normal ahn lib.
What will be the difference if it was a plugins for example ?
Would I get access to more events ?

On Mon, Dec 8, 2014 at 12:19 PM, ik <[hidden email]> wrote:
when using res.register_event_handler do |event|
logger.debug "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! event: #{event.inspect}"
end

it never triggers, but the global event handler of ahn (events.rb) does catches the end of the recording.
Also, using call.register_event_handler, there is no capture of DTMF, not even on the global event handler.

So what am I doing wrong here ?

Thanks,
Ido

On Sun, Dec 7, 2014 at 5:08 PM, ik <[hidden email]> wrote:
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Langfeld-2
The only difference in a plugin would be the way it's packaged.

I'm travelling and extra busy right now, but I'll see how I can help as soon as I get some time.

On 9 December 2014 at 07:01, ik <[hidden email]> wrote:
I'm unable to figure out how to do it  using a normal ahn lib.
What will be the difference if it was a plugins for example ?
Would I get access to more events ?

On Mon, Dec 8, 2014 at 12:19 PM, ik <[hidden email]> wrote:
when using res.register_event_handler do |event|
logger.debug "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! event: #{event.inspect}"
end

it never triggers, but the global event handler of ahn (events.rb) does catches the end of the recording.
Also, using call.register_event_handler, there is no capture of DTMF, not even on the global event handler.

So what am I doing wrong here ?

Thanks,
Ido

On Sun, Dec 7, 2014 at 5:08 PM, ik <[hidden email]> wrote:
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

Ben Klang-2
In reply to this post by ik_5
Il giorno Dec 9, 2014, alle ore 4:01 AM, ik <[hidden email]> ha scritto:


I'm unable to figure out how to do it  using a normal ahn lib.
What will be the difference if it was a plugins for example ?
Would I get access to more events ?

Plugins have no more access to events than regular application code.  Plugins are just a way to conveniently bundle configuration, code and documentation into a re-useable form.  Otherwise, they behave just like application code.


On Mon, Dec 8, 2014 at 12:19 PM, ik <[hidden email]> wrote:
when using res.register_event_handler do |event|
logger.debug "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! event: #{event.inspect}”
end

You need to keep in mind the scope of events when registering handlers.  For example, if you use `res.register_event_handler` (assuming your example that `res` is set to the return value from `play!`) then you will only get events from that playback action.  Since it is a playback and not a recording, then you should not expect it to get recording events.  The only event I think you would get from that is the end event when the playback completes.

I’m not sure whether `call.register_event_handler` gets events for components executed on the call, but it wouldn’t surprise me if they did not.

If you want an event that fires on the end of the recording, you need to work with the record component.  Something like this:

```
record async: true do |event|
  logger.warn “This is the event fired when the recording is completed: #{event.inspect}”
end
```

Does that help?

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo




it never triggers, but the global event handler of ahn (events.rb) does catches the end of the recording.
Also, using call.register_event_handler, there is no capture of DTMF, not even on the global event handler.

So what am I doing wrong here ?

Thanks,
Ido

On Sun, Dec 7, 2014 at 5:08 PM, ik <[hidden email]> wrote:
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.




--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: freeswitch controlling play

ik_5


On Wed, Dec 10, 2014 at 7:26 PM, Ben Klang <[hidden email]> wrote:
Il giorno Dec 9, 2014, alle ore 4:01 AM, ik <[hidden email]> ha scritto:


I'm unable to figure out how to do it  using a normal ahn lib.
What will be the difference if it was a plugins for example ?
Would I get access to more events ?

Plugins have no more access to events than regular application code.  Plugins are just a way to conveniently bundle configuration, code and documentation into a re-useable form.  Otherwise, they behave just like application code.


On Mon, Dec 8, 2014 at 12:19 PM, ik <[hidden email]> wrote:
when using res.register_event_handler do |event|
logger.debug "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! event: #{event.inspect}”
end

You need to keep in mind the scope of events when registering handlers.  For example, if you use `res.register_event_handler` (assuming your example that `res` is set to the return value from `play!`) then you will only get events from that playback action.  Since it is a playback and not a recording, then you should not expect it to get recording events.  The only event I think you would get from that is the end event when the playback completes.


It's not about recording.
I wish to be able to play a recording, that is a wav/mp3 file, and allow the listener to forward and backward points the the files.
 

I’m not sure whether `call.register_event_handler` gets events for components executed on the call, but it wouldn’t surprise me if they did not.

If you want an event that fires on the end of the recording, you need to work with the record component.  Something like this:

```
record async: true do |event|
  logger.warn “This is the event fired when the recording is completed: #{event.inspect}”
end
```

Does that help?

The understanding of the events is much clearer

Thank you

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo




it never triggers, but the global event handler of ahn (events.rb) does catches the end of the recording.
Also, using call.register_event_handler, there is no capture of DTMF, not even on the global event handler.

So what am I doing wrong here ?

Thanks,
Ido

On Sun, Dec 7, 2014 at 5:08 PM, ik <[hidden email]> wrote:
updated the gist with freeswitch.log

On Sun, Dec 7, 2014 at 3:36 PM, Ben Langfeld <[hidden email]> wrote:
I would need trace logs from Adhearsion, and debug logs from FreeSWITCH :)

On 7 December 2014 at 11:17, ik <[hidden email]> wrote:
I'll try to use the event based.
thanks.

On Sun, Dec 7, 2014 at 1:47 PM, Ben Langfeld <[hidden email]> wrote:

Em 07/12/2014, às 08:13, ik <[hidden email]> escreveu:

I'ved done the following, and it constantly starting from the beginning, even though I'm pressing on '6'

Can I see ahn and FS logs?

BTW, How can I know if res arrived to the end of the play file ?

It will have a complete event set, will have passed this to its completion callback, and #seek! will raise.


# encoding: utf-8

class Forward < Adhearsion::CallController
  def run
    answer
    res = play! '/tmp/test.mp3'
    logger.debug "---------------------------------> res: #{res.inspect}"

    while res do
      dtmf = ask interruptible: true, limit: 1, timeout: 50000
      logger.debug "-------------------------------> dtmf: #{dtmf.utterance}"
      case dtmf.utterance
      when '4'
        logger.debug '---------------------------- going backwards'
        res.seek! direction: 'backward', amount: '1500'
      when '6'
        logger.debug '---------------------------- going forward'
        res.seek! direction: 'forward', amount: '1500'
      end
    end
  end
end

On Sat, Dec 6, 2014 at 1:55 PM, Ben Langfeld <[hidden email]> wrote:
An input component is asynchronous as long as you don't explicitly block on a response.



Em 06/12/2014, às 08:58, ik <[hidden email]> escreveu:

How can I get async input, can't find it at Punchblock::Component::Input documentation, and neither at the Adhearsion::CallController::Input documentation

On Sat, Dec 6, 2014 at 12:21 PM, Ben Langfeld <[hidden email]> wrote:
It could be a plugin, but you can start in your app's call controllers. Start simple and build up the layers.



Em 06/12/2014, às 08:18, ik <[hidden email]> escreveu:

wow, how can I start writing something like this ?
should it be a component (plugin) for ahn ?

On Thu, Dec 4, 2014 at 6:14 PM, Ben Langfeld <[hidden email]> wrote:
You would need to use async playback (CallController#play!) to get a handle on the Rayo output component. You would then use Punchblock::Component::Output#seek! to move around in the playback. To move forward 1 second:

output.seek! direction: 'forward', amount: '1000'

To do this in response to DTMF you would have to setup an async input component.

On 3 December 2014 at 10:29, ik <[hidden email]> wrote:
Hello,

Is there a way to control play of freeswitch something in the way Asterisk's ControlPlayback does, that is jump few seconds in the recordings on DTMF ?

Thanks,
Ido

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.




--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.