[asterisk-users] play audio file within an active call

2009-09-29 Thread Vieri
Hi,

I'm wondering if someone can share their thoughts on how to implement a system 
that periodically checks active channels which have been up for more than X 
minutes and plays/injects a sound file. The idea is to simply warn users that 
they've been on the phone for quite a while and maybe they should consider 
hanging up. If the call stays up for more than Y minutes, it is dropped 
automatically (softhangup).

What's the simplest approach to playing a sound file within an active channel?

I thought of writing a cron agi script that scans active channels, retrieves 
their duration and if it's  X minutes then RedirectChannel to a context 
which executes a Playback(file); if it's  Y minutes then RedirectChannel to 
a context which executes both a Playback(forcing hang up now...) and HangUp.

Any thoughts?



  

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] play audio file within an active call

2009-09-29 Thread Matthew Edmondson
If you redirect the channel, the person they're talking to is likely
to be dropped.

The only way I know of doing this is with a conference bridge like
meetme. You would have to have both parties in the conference and then
call the 3rd party (your msg) into it.

On Tue, Sep 29, 2009 at 6:05 PM, Vieri rentor...@yahoo.com wrote:
 Hi,

 I'm wondering if someone can share their thoughts on how to implement a 
 system that periodically checks active channels which have been up for more 
 than X minutes and plays/injects a sound file. The idea is to simply warn 
 users that they've been on the phone for quite a while and maybe they should 
 consider hanging up. If the call stays up for more than Y minutes, it is 
 dropped automatically (softhangup).

 What's the simplest approach to playing a sound file within an active channel?

 I thought of writing a cron agi script that scans active channels, retrieves 
 their duration and if it's  X minutes then RedirectChannel to a context 
 which executes a Playback(file); if it's  Y minutes then RedirectChannel 
 to a context which executes both a Playback(forcing hang up now...) and 
 HangUp.

 Any thoughts?





 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

 AstriCon 2009 - October 13 - 15 Phoenix, Arizona
 Register Now: http://www.astricon.net

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] play audio file within an active call

2009-09-29 Thread Benny Amorsen
Vieri rentor...@yahoo.com writes:

 Hi,

 I'm wondering if someone can share their thoughts on how to implement a 
 system that periodically checks active channels which have been up for more 
 than X minutes and plays/injects a sound file. The idea is to simply warn 
 users that they've been on the phone for quite a while and maybe they should 
 consider hanging up. If the call stays up for more than Y minutes, it is 
 dropped automatically (softhangup).

 What's the simplest approach to playing a sound file within an active channel?

I think you should be able to do this with ChanSpy and the whisper
option. However, Asterisk already has a facility for this. This is from
core show application Dial

L(x[:y][:z]) - Limit the call to 'x' ms. Play a warning when 'y' ms are
   left. Repeat the warning every 'z' ms. The following special
   variables can be used with this option:
   * LIMIT_PLAYAUDIO_CALLER   yes|no (default yes)
  Play sounds to the caller.
   * LIMIT_PLAYAUDIO_CALLEE   yes|no
  Play sounds to the callee.
   * LIMIT_TIMEOUT_FILE   File to play when time is up.
   * LIMIT_CONNECT_FILE   File to play when call begins.
   * LIMIT_WARNING_FILE   File to play as warning if 'y' is defined.
  The default is to say the time remaining.


/Benny


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] play audio file within an active call

2009-09-29 Thread Vieri

--- On Tue, 9/29/09, Matthew Edmondson maxn...@gmail.com wrote:

 If you redirect the channel, the
 person they're talking to is likely
 to be dropped.

Thanks for pointing that out. So it sounds like RedirectChannel() is similar to 
Transfer().

 The only way I know of doing this is with a conference
 bridge like
 meetme. You would have to have both parties in the
 conference and then
 call the 3rd party (your msg) into it.

This may be trivial but how can I force both parties to enter a conference 
(eg. meetme)?

Also, once they're in the conference and I've called a third party playing a 
sound file, how can I force them to exit the conference and revert to their 
bridged call as before the conference? Or, if I have to keep them within the 
conference/meetme, then I'd have to make sure that the 3rd party can :
1- play a msg such as on the phone too long; consider hanging up
2- wait N minutes
3- play you have Z minutes of conversation left. Call will be hung up 
automatically
4- hang up both parties in conference

Does this make sense?

Thanks,

Vieri

 On Tue, Sep 29, 2009 at 6:05 PM, Vieri rentor...@yahoo.com
 wrote:
  Hi,
 
  I'm wondering if someone can share their thoughts on
 how to implement a system that periodically checks active
 channels which have been up for more than X minutes and
 plays/injects a sound file. The idea is to simply warn users
 that they've been on the phone for quite a while and maybe
 they should consider hanging up. If the call stays up for
 more than Y minutes, it is dropped automatically
 (softhangup).
 
  What's the simplest approach to playing a sound file
 within an active channel?
 
  I thought of writing a cron agi script that scans
 active channels, retrieves their duration and if it's  X
 minutes then RedirectChannel to a context which executes a
 Playback(file); if it's  Y minutes then
 RedirectChannel to a context which executes both a
 Playback(forcing hang up now...) and HangUp.
 
  Any thoughts?
 


  

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] play audio file within an active call

2009-09-29 Thread Vieri

--- On Tue, 9/29/09, Benny Amorsen benny+use...@amorsen.dk wrote:

  I'm wondering if someone can share their thoughts on
 how to implement a system that periodically checks active
 channels which have been up for more than X minutes and
 plays/injects a sound file. The idea is to simply warn users
 that they've been on the phone for quite a while and maybe
 they should consider hanging up. If the call stays up for
 more than Y minutes, it is dropped automatically
 (softhangup).
 
  What's the simplest approach to playing a sound file
 within an active channel?
 
 I think you should be able to do this with ChanSpy and the
 whisper
 option. However, Asterisk already has a facility for this.
 This is from
 core show application Dial
 
     L(x[:y][:z]) - Limit the call to 'x' ms. Play
 a warning when 'y' ms are
            left. Repeat
 the warning every 'z' ms. The following special
            variables can
 be used with this option:
            *
 LIMIT_PLAYAUDIO_CALLER   yes|no (default
 yes)
                
                
       Play sounds to the caller.
            *
 LIMIT_PLAYAUDIO_CALLEE   yes|no
                
                
       Play sounds to the callee.
            *
 LIMIT_TIMEOUT_FILE       File to
 play when time is up.
            *
 LIMIT_CONNECT_FILE       File to
 play when call begins.
            *
 LIMIT_WARNING_FILE       File to
 play as warning if 'y' is defined.
                
                
       The default is to say the time
 remaining.

Benny,
thanks a lot. Will try that out.

Vieri



  

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] play audio file within an active call

2009-09-29 Thread Matthew Edmondson
I didn't think of Benny's solution. That would be the way to go as it is a
core asterisk command.

On Tue, Sep 29, 2009 at 6:47 PM, Vieri rentor...@yahoo.com wrote:


 --- On Tue, 9/29/09, Matthew Edmondson maxn...@gmail.com wrote:

  If you redirect the channel, the
  person they're talking to is likely
  to be dropped.

 Thanks for pointing that out. So it sounds like RedirectChannel() is
 similar to Transfer().

  The only way I know of doing this is with a conference
  bridge like
  meetme. You would have to have both parties in the
  conference and then
  call the 3rd party (your msg) into it.

 This may be trivial but how can I force both parties to enter a
 conference (eg. meetme)?

 Also, once they're in the conference and I've called a third party
 playing a sound file, how can I force them to exit the conference and
 revert to their bridged call as before the conference? Or, if I have to keep
 them within the conference/meetme, then I'd have to make sure that the 3rd
 party can :
 1- play a msg such as on the phone too long; consider hanging up
 2- wait N minutes
 3- play you have Z minutes of conversation left. Call will be hung up
 automatically
 4- hang up both parties in conference

 Does this make sense?

 Thanks,

 Vieri

  On Tue, Sep 29, 2009 at 6:05 PM, Vieri rentor...@yahoo.com
  wrote:
   Hi,
  
   I'm wondering if someone can share their thoughts on
  how to implement a system that periodically checks active
  channels which have been up for more than X minutes and
  plays/injects a sound file. The idea is to simply warn users
  that they've been on the phone for quite a while and maybe
  they should consider hanging up. If the call stays up for
  more than Y minutes, it is dropped automatically
  (softhangup).
  
   What's the simplest approach to playing a sound file
  within an active channel?
  
   I thought of writing a cron agi script that scans
  active channels, retrieves their duration and if it's  X
  minutes then RedirectChannel to a context which executes a
  Playback(file); if it's  Y minutes then
  RedirectChannel to a context which executes both a
  Playback(forcing hang up now...) and HangUp.
  
   Any thoughts?
  




 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

 AstriCon 2009 - October 13 - 15 Phoenix, Arizona
 Register Now: http://www.astricon.net

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users