dx_sethook randomly not setting phone line back onhook



Hi,
I've encountered this problem when I was forwarding calls. Here's the
program flow.

<program starts>
dx_sethook(onhook)
<waits for event> (async model)
*incoming call*
dx_sethook(offhook)
dx_dial("&,3333")
dx_sethook(onhook) <-- problem
<waits for events> (rinse and repeat)

However, randomly, dx_sethook(onhook) will not set the phone line
back onhook. Yet the TDX_SETHOOK event is properly fired to show that
the line is back onhook.

Restarting the application does not set the phone line back onhook.
Only running dlstop/dlstart or restarting the server does.

Anyone can offer any suggestions? This is driving me crazy grrr

.