Hi  Brandon! Thank you for your response.

Is the example you sent to receive a call and respond with correct audio?
What I need to do is originate a call to cell phone and play audio. For now
no need for DTMF.

Regards,
Adriano Santos

Em sex, 23 de nov de 2018 às 18:34, Brandon Haugen <[email protected]>
escreveu:

> Hey Adriano,
>
> I have within the last few months started using Asterisk-Java for a
> project and you can certainly playback an audio file. There are a couple of
> things that you will have to think about to determine the best approach for
> your situation, here is what I can tell you though
>
>    - If you do *not* need to listen for DTMF input (keypresses) while
>    playing the audio file then you can play an audio file on an AgiChannel in
>    Java by using something like `agiChannel.exec("playback", "<path to audio
>    file>");`
>       - This example in the Asterisk Java GitHub repository shows
>       answering a call, playing a file back, and then hanging up (note that in
>       the example they rely on methods defined in the AgiOperations class so 
> they
>       aren't operating directly on the AgiChannel like the line of code I am
>       sharing is doing)
>       
> https://github.com/asterisk-java/asterisk-java/blob/master/src/main/java/org/asteriskjava/examples/fastagi/ExampleCallIn.java
>    - If you *do* need to listen for DTMF input while playing the audio
>    file then you will want to use the `getData` or `getOption` methods defined
>    on AgiChannel. You will need to pick which method is appropriate depending
>    on the length of DTMF you need to listen for (`getOption` returns a single
>    char while `getData` will return a String)
>
> Thanks,
> Brandon
>
> On Thu, Nov 22, 2018 at 12:09 PM adriano santos <[email protected]>
> wrote:
>
>> Hello, guys!
>>
>> I would like to play an audio file on a initialized call via java. I
>> haven't found an example for this.
>> Is this possible?
>>
>> --
>> Adriano P. Santos
>>
>> "O homem erudito é um descobridor de fatos que já existem - mas o homem
>> sábio é um criador de valores que não existem e que ele faz existir."
>> Albert Einstein
>> _______________________________________________
>> Asterisk-java-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
>>
> _______________________________________________
> Asterisk-java-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
>


-- 
Adriano P. Santos

"O homem erudito é um descobridor de fatos que já existem - mas o homem
sábio é um criador de valores que não existem e que ele faz existir."
Albert Einstein
_______________________________________________
Asterisk-java-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/asterisk-java-users

Reply via email to