[asterisk-dev] chan_zap.c question

Steve Davies davies147 at gmail.com
Thu Apr 3 05:46:12 CDT 2008


On 02/04/2008, Kevin P. Fleming <kpfleming at digium.com> wrote:
> 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.

Thanks for confirming that - Looking at do_monitor(), it currently
only deals with un-owned channels, so I assume it would be a bit
"rude" to change that behaviour, so I will need to either start my own
thread, or hook into the existing owner thread somehow.

Regards,
Steve



More information about the asterisk-dev mailing list