]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
FreeTDM: Add span start/stop callbacks to ftdm_io_interface.
authorStefan Knoblich <stkn@openisdn.net>
Wed, 15 Aug 2012 11:19:38 +0000 (13:19 +0200)
committerStefan Knoblich <stkn@openisdn.net>
Wed, 15 Aug 2012 11:34:22 +0000 (13:34 +0200)
commit548222f9f3e2f67cbda48f13e56e5762d925a68a
treee4bd00f97d88015d68b80b9bddb6ba572d807f9c
parent431f7dd6bf7e7ad22e9d2ebbb7d350bc459c20bb
FreeTDM: Add span start/stop callbacks to ftdm_io_interface.

Callbacks are invoked from ftdm_span_start/_stop().
I/O is started before SIG and shut down in reverse order.

This is needed for ftmod_misdn, to move the mISDN message handling
into a separate thread (solving the mISDN socket vs. FreeTDM API issues).

With these callbacks, the I/O thread can be started after the span I/O configuration
has been (successfully) completed and stopped before destroying the span.

NOTE: Both SIG and I/O callbacks are called with the span mutex locked,
so threads created or destroyed synchronously in either of the custom
start/stop functions, can not use ftdm_span_*() functions that lock
the span mutex (e.g. ftdm_span_get_channel_count()).

Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
libs/freetdm/src/ftdm_io.c
libs/freetdm/src/include/freetdm.h