提交 6c5132a5 authored 作者: Moises Silva's avatar Moises Silva

freetdm: - Clear the IO flag when FreeSWITCH hangs up before notifying freetdm

         - Misc fixes to log messages to aid debugging
         - Added ftdm ioread command to read media from the channel
         - Modified the ftdm_channel_open() API to return FTDM_EBUSY if the channel is already open
上级 f4facb0f
...@@ -1855,7 +1855,14 @@ static ftdm_status_t _ftdm_channel_open(uint32_t span_id, uint32_t chan_id, ftdm ...@@ -1855,7 +1855,14 @@ static ftdm_status_t _ftdm_channel_open(uint32_t span_id, uint32_t chan_id, ftdm
goto done; goto done;
} }
ftdm_mutex_lock(check->mutex); ftdm_channel_lock(check);
if (ftdm_test_flag(check, FTDM_CHANNEL_OPEN)) {
/* let them know is already open, but return the channel anyway */
status = FTDM_EBUSY;
*ftdmchan = check;
goto unlockchan;
}
/* The following if's and gotos replace a big if (this || this || this || this) else { nothing; } */ /* The following if's and gotos replace a big if (this || this || this || this) else { nothing; } */
...@@ -1902,7 +1909,7 @@ openchan: ...@@ -1902,7 +1909,7 @@ openchan:
goto done; goto done;
unlockchan: unlockchan:
ftdm_mutex_unlock(check->mutex); ftdm_channel_unlock(check);
done: done:
ftdm_mutex_unlock(globals.mutex); ftdm_mutex_unlock(globals.mutex);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论