[asterisk-dev] Sleeping in a channel but in hangup callback

Paulo Garcia paulo.astdev at gmail.com
Thu Aug 23 15:43:57 CDT 2007


Hi,

I adopt a code recently of a channel driver. I found inside hangup callback
a call to sleep(1). Is it the correct way to wait a while inside the hangup
callback since ast_safe_sleep returns immediately because the hangup flag is
already set?

After all, there is no need to wait 1 second there so I changed to a while
that waits a flag to be set and while is inside the loop I call the usleep
function waiting 50ms each interaction.

Thanks in advance

Paulo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070823/012b0f4e/attachment.htm 


More information about the asterisk-dev mailing list