[asterisk-dev] AMD

Kevin Harwell kharwell at digium.com
Thu Jan 30 17:18:47 CST 2020

On Thu, Jan 30, 2020 at 2:58 PM info at magnussolution.com <
info at magnussolution.com> wrote:

> in my country when I dial to a mobile and I not answer the call, the call
> going to the voicemail, but the audio is executed before the 200OK, on 183
> early media.
> so, I need to execute the AMD when I receive the 183, not the 200 OK.

Unfortunately I am unaware of any easy solution.

Something to be aware of if you are not. From what I understand app_dial is
reading the frames from the channel. Any solution that attempts to also
read frames from the same channel at the same time is going to run into
problems. So for instance, you can't execute app_dial and app_amd at the
same time.

If you wish to inject some kind of audio listening, and detection
algorithms while dialing you'll have to do that within the confines of the
dial application. Basically, while app_dial is waiting for the other side
to answer it's processing frames. When an audio frame is received then that
is where you'll want to do your detection. Also once answered you'll need
to continue processing incoming audio frames. Maybe you are already doing
all of this?

If that's the case then if a hangup occurs app_dial will automatically
handle what you need since it will detect the hangup and stop reading
frames, which in turn means audio will not get passed down into your
detection checks anymore. There is no loop to break out of since the dial
application is handing that for you (reading of frames, etc.).

Kevin Harwell
Senior Software Developer
Sangoma Technologies
Check us out at: https://sangoma.com & https://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20200130/5760e100/attachment-0001.html>

More information about the asterisk-dev mailing list