Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-28 Thread Steve Edwards

On 27/09/12 02:13 PM, Mehdi Rahimi wrote:


I want to play music in my AGI while i am searching for a field in DB.
Actually during some processes in AGI i need to play music .


On Fri, 28 Sep 2012, Leif Madsen wrote:

It's been quite some time since I did this, so I can't give you a specific 
example (that's left as an exercise to the reader), and I may be 
misremembering, but essentially I had 2 Local channels that I "called" via 
the Dial() application. One path played MusicOnHold() and the other would 
perform some fancy stuff (I think it was an API call via CURL() that would 
attempt to return a valid agent; a sort of dialplan based queuing system that 
used an external API interface that managed the availability of the agents).


Anyways, the one Local channel would play MusicOnHold(), then when the API 
returns data to CURL(), the dialplan would continue and pull the caller out 
of the MusicOnHold() application, and then send them to the dialplan section 
to call the agent.


The same principles could be applied here. I think it was a combination of 
MusicOnHold(), Local channels, and the Bridge() application.


Sometimes you just have to be really clever with Asterisk to make it do what 
you want :)


A multi-threaded AGI or externalivr() sound easier to me if it meets your 
needs.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-28 Thread Leif Madsen

On 27/09/12 02:13 PM, Mehdi Rahimi wrote:

On Wed, Sep 26, 2012 at 11:31 PM, Leif Madsen
 wrote:

On 26/09/12 05:35 AM, Mehdi Rahimi wrote:


I want to play music in my AGI while i am searching for a field in DB.
Actually during some processes in AGI i need to play music .



Probably Local channels to the rescue here.

>

Dear Leif Madsen,

Please explain more




It's been quite some time since I did this, so I can't give you a 
specific example (that's left as an exercise to the reader), and I may 
be misremembering, but essentially I had 2 Local channels that I 
"called" via the Dial() application. One path played MusicOnHold() and 
the other would perform some fancy stuff (I think it was an API call via 
CURL() that would attempt to return a valid agent; a sort of dialplan 
based queuing system that used an external API interface that managed 
the availability of the agents).


Anyways, the one Local channel would play MusicOnHold(), then when the 
API returns data to CURL(), the dialplan would continue and pull the 
caller out of the MusicOnHold() application, and then send them to the 
dialplan section to call the agent.


The same principles could be applied here. I think it was a combination 
of MusicOnHold(), Local channels, and the Bridge() application.


Sometimes you just have to be really clever with Asterisk to make it do 
what you want :)


--
Leif Madsen
http://www.oreilly.com/catalog/asterisk

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-27 Thread Mehdi Rahimi
Dear Leif Madsen,

Please explain more

On Wed, Sep 26, 2012 at 11:31 PM, Leif Madsen
 wrote:
> On 26/09/12 05:35 AM, Mehdi Rahimi wrote:
>>
>> I want to play music in my AGI while i am searching for a field in DB.
>> Actually during some processes in AGI i need to play music .
>
>
> Probably Local channels to the rescue here.
>
> --
> Leif Madsen
> http://www.oreilly.com/catalog/asterisk
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> 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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-26 Thread Leif Madsen

On 26/09/12 05:35 AM, Mehdi Rahimi wrote:

I want to play music in my AGI while i am searching for a field in DB.
Actually during some processes in AGI i need to play music .


Probably Local channels to the rescue here.

--
Leif Madsen
http://www.oreilly.com/catalog/asterisk

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-26 Thread Steve Edwards

On Wed, 26 Sep 2012, Mehdi Rahimi wrote:

I want to play music in my AGI while i am searching for a field in DB. 
Actually during some processes in AGI i need to play music .


Many moons ago, I had a client that wanted 'instantaneous' response to a 
credit card authorization request. (The request could take a couple of 
seconds because it involved an external vendor.)


My solution was an AGI that played a prompt ('Please wait while your card 
is being processed and get ready for a good time') in one thread while the 
'mainline' code processed the auth. By the time the prompt finished, I had 
the auth response and the 'experience' was that the auth was 
instantaneous.


One of the 'gotchas' is that you can't do any 'AGI' stuff in the mainline 
code while the background thread is playing the prompt -- which is kind of 
obvious if you understand the AGI protocol.


Another option to consider is the externalivr() application.

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-26 Thread Danny Nicholas
+1 - if your query is going to take long enough that you need to play music,
you need to optimize the process somewhere. FWIW, if you do play music, you
will need to "fork" the process as the music process is not asynchronous.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Thorsten
Göllner
Sent: Wednesday, September 26, 2012 5:11 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

Do your query really takes "so" long? You should consider to use to optimize
your database or query instead.

OR take a look at AsncAGI:
http://ofps.oreilly.com/titles/9780596517342/AGI.html

Am 26.09.2012 11:35, schrieb Mehdi Rahimi:
> Dear All,
>
> I want to play music in my AGI while i am searching for a field in DB.
> Actually during some processes in AGI i need to play music .
> Thanks in advanced.
>
> Regards,
> Mehdi
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- 
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> 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 -- New to
Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


Re: [asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-26 Thread Thorsten Göllner
Do your query really takes "so" long? You should consider to use to 
optimize your database or query instead.


OR take a look at AsncAGI:
http://ofps.oreilly.com/titles/9780596517342/AGI.html

Am 26.09.2012 11:35, schrieb Mehdi Rahimi:

Dear All,

I want to play music in my AGI while i am searching for a field in DB.
Actually during some processes in AGI i need to play music .
Thanks in advanced.

Regards,
Mehdi

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

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 --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] PLAYIN MUSIC WHILE SEARCHING MYSQL

2012-09-26 Thread Mehdi Rahimi
Dear All,

I want to play music in my AGI while i am searching for a field in DB.
Actually during some processes in AGI i need to play music .
Thanks in advanced.

Regards,
Mehdi

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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