[asterisk-users] Asynchronous play music

Pham Quy quyps at vega.com.vn
Tue Mar 30 21:11:23 CDT 2010


Hi, 

Thanks a lot Steve, Im gonna try it in Asterisk 1.6.

Quyps

On Tue, 2010-03-30 at 12:30 -0700, Steve Edwards wrote:
> > On Tue, 30 Mar 2010, Pham Quy wrote:
> >
> >> Is there anyway to catch DTMF keypress while a music file is playing 
> >> without stop the music?
> 
> On Mon, 29 Mar 2010, Steve Edwards wrote:
> 
> > Have you tried externivr(). I've never used it, but it looks 
> > interesting.
> 
> I hate it when people post about things they know nothing about...
> 
> So I wrote My First ExternalIVR (mfe.c). I'm a 1.2 Luddite, so things may 
> be a bit different for the Asterisk version you are using. Comparing the 
> documentation, it looks like a lot of useful commands have been added.
> 
> The first question I had was "Where do you put the executable?" The 
> documentation is silent on this point. ASTAGIDIR seemed a likely guess. 
> Guess not. It looks like it has to be an absolute path. Inconvenient, but 
> it works.
> 
> The actual protocol is trivial, way "simpler" and limited than AGI.
> 
> Here's a snippet that shows how to play a file and then "handle" the key 
> press events.
> 
> // play a file
>          printf("S,demo-congrats\n");
>          fflush(stdout);
> 
> // read events
>          while   (NULL != fgets(event, sizeof(event), stdin))
>                  {
>                  syslog(LOG_ERR, event);
>                  if      ('#' == *event)
>                          {
>                          break;
>                          }
>                  }
> 
> (The full source is at http://www.sedwards.com/mfe.c)
> 
> -- 
> Thanks in advance,
> -------------------------------------------------------------------------
> Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
> Newline                                              Fax: +1-760-731-3000
> 





More information about the asterisk-users mailing list