From 75bd5642105532f80101fc84849b96996d710a04 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 25 Nov 2010 09:35:14 -0500 Subject: [PATCH] freetdm: wait for state change to be cleared when placing outgoing calls this fixes a race where the call is hangup even before the state DIALING is processed and therefore the HANGUP state change is ignored. --- libs/freetdm/src/ftdm_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 0aeaeedce4..bcceba58ca 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -2270,6 +2270,8 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_place(const char *file, const char UNREFERENCED_PARAMETER(line); #endif + ftdm_wait_for_flag_cleared(ftdmchan, FTDM_CHANNEL_STATE_CHANGE, 100); + ftdm_channel_unlock(ftdmchan); return status;