Play Voice Prompt with Asterisk using Channel Driver before vocie commnication

Hello there,

I have a requirement with Asterisk to play a voice prompt to the user before going to voice communication, to prompt the user some message. However, i don’t want to use the dialplan. I have a channel driver i need to play voice prompt using channel driver. Please let me know if there is any way to do so.

Thank You, Anand

Generally, no, not without writing code to do so in whichever channel driver you are referring to. The result would be the same as using dialplan, just coded in C instead.

This is another of those strange requests where it is important to explain the high level goal.

The channel driver is, structurally, completely the wrong place to do this.

Are there any specific asterisk API to do so in channel driver using C ?

We have a reuirement in our product wherein we use channel driver to do the call setup and voice communication. So, before successful communication when the caller dials callee if there is any error or if callee is offline or inform the caller if connection is success in these cases we need to notify the caller about the same using a voice prompt. I am not sure how this can be done using Dial Plan.

There are APIs and such for playing sounds, the same as is used for the Playback dialplan application. If you’re asking if there’s an API to do precisely what you want in a way you can just stick it in and have it work, I don’t think so. You’d have to actually understand the channel driver, where things go, the API, etc. That’s not something I’ll help with.

As for using the dialplan - most of that is how things just work. For example if a call fails or the person is offline, then people send that to voicemail in the dialplan.

This is beginning to sound like a homework exercise.

There are examples of playing tones, using the dialplan, in similar cases, in the sample one supplied with Asterisk. Using Playback instead is a trivial change.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.