[asterisk-dev] chan_zap.c question
Kevin P. Fleming
kpfleming at digium.com
Wed Apr 2 12:23:47 CDT 2008
Steve Davies wrote:
> 1) Is it safe for zt_call to block while it waits for the dialtone, or
> does it have to go into some sort of new "pre-dialling state", and
> return?
>
> 2) Is it safe (or sensible) for zt_call to call zt_read to cause the
> DSP processing to occur and detect the dialtone?
>
> I suspect that neither of the above are possible, otherwise some
> bright spark would have done dialtone detection already :)
You are correct on both counts... for example, app_dial calls zt_call()
indirectly to initiate outbound calls, and may do so on 2, 3, or more
channels at the same time, so it needs those calls to be non-blocking.
You will need to store away the dialing information and spawn a thread
(or have the do_monitor() thread handle this like it does for other
things) to listen to the incoming audio and then trigger the actual
dialing once you have decided that dialtone is present.
--
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)
More information about the asterisk-dev
mailing list