提交 a8ddece1 authored 作者: Moises Silva's avatar Moises Silva

more freetdm changes

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@974 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 a5bd5142
......@@ -1342,7 +1342,7 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
}
static ZIO_SIGNAL_CB_FUNCTION(on_fxo_signal)
static FIO_SIGNAL_CB_FUNCTION(on_fxo_signal)
{
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
......@@ -1402,7 +1402,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxo_signal)
return FTDM_SUCCESS;
}
static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
static FIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
{
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
......@@ -1609,7 +1609,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_fxs_signal)
return status;
}
static ZIO_SIGNAL_CB_FUNCTION(on_r2_signal)
static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
{
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
......@@ -1709,7 +1709,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_r2_signal)
return status;
}
static ZIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
static FIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
{
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
......@@ -1795,7 +1795,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
}
static ZIO_SIGNAL_CB_FUNCTION(on_analog_signal)
static FIO_SIGNAL_CB_FUNCTION(on_analog_signal)
{
switch_status_t status = SWITCH_STATUS_FALSE;
......
差异被折叠。
......@@ -392,7 +392,7 @@ static int parse_ss7_event(ftdm_span_t *span, m3uac_connection_t *mcon, m3uac_ev
return 0;
}
static ZIO_CONFIGURE_FUNCTION(m3ua_configure)
static FIO_CONFIGURE_FUNCTION(m3ua_configure)
{
m3ua_channel_profile_t *profile = NULL;
......@@ -424,65 +424,65 @@ static ZIO_CONFIGURE_FUNCTION(m3ua_configure)
return FTDM_SUCCESS;
}
static ZIO_CONFIGURE_SPAN_FUNCTION(m3ua_configure_span)
static FIO_CONFIGURE_SPAN_FUNCTION(m3ua_configure_span)
{
return FTDM_FAIL;
}
static ZIO_OPEN_FUNCTION(m3ua_open)
static FIO_OPEN_FUNCTION(m3ua_open)
{
return FTDM_FAIL;
}
static ZIO_CLOSE_FUNCTION(m3ua_close)
static FIO_CLOSE_FUNCTION(m3ua_close)
{
return FTDM_FAIL;
}
/*static ZIO_SET_INTERVAL_FUNCTION(m3ua_set_interval)
/*static FIO_SET_INTERVAL_FUNCTION(m3ua_set_interval)
{
return 0;
}*/
static ZIO_WAIT_FUNCTION(m3ua_wait)
static FIO_WAIT_FUNCTION(m3ua_wait)
{
return FTDM_FAIL;
}
static ZIO_READ_FUNCTION(m3ua_read)
static FIO_READ_FUNCTION(m3ua_read)
{
return FTDM_FAIL;
}
static ZIO_WRITE_FUNCTION(m3ua_write)
static FIO_WRITE_FUNCTION(m3ua_write)
{
return FTDM_FAIL;
}
static ZIO_COMMAND_FUNCTION(m3ua_command)
static FIO_COMMAND_FUNCTION(m3ua_command)
{
return FTDM_FAIL;
}
static ZIO_SPAN_POLL_EVENT_FUNCTION(m3ua_poll_event)
static FIO_SPAN_POLL_EVENT_FUNCTION(m3ua_poll_event)
{
return FTDM_FAIL;
}
static ZIO_SPAN_NEXT_EVENT_FUNCTION(m3ua_next_event)
static FIO_SPAN_NEXT_EVENT_FUNCTION(m3ua_next_event)
{
return FTDM_FAIL;
}
static ZIO_SPAN_DESTROY_FUNCTION(m3ua_span_destroy)
static FIO_SPAN_DESTROY_FUNCTION(m3ua_span_destroy)
{
m3ua_span_data_t *span_data = (m3ua_span_data_t *) span->mod_data;
......@@ -492,7 +492,7 @@ static ZIO_SPAN_DESTROY_FUNCTION(m3ua_span_destroy)
return FTDM_SUCCESS;
}
static ZIO_CHANNEL_DESTROY_FUNCTION(m3ua_channel_destroy)
static FIO_CHANNEL_DESTROY_FUNCTION(m3ua_channel_destroy)
{
m3ua_chan_data_t *chan_data = (m3ua_chan_data_t *) ftdmchan->mod_data;
m3ua_span_data_t *span_data = (m3ua_span_data_t *) ftdmchan->span->mod_data;
......@@ -522,7 +522,7 @@ static ZIO_CHANNEL_DESTROY_FUNCTION(m3ua_channel_destroy)
static ZIO_GET_ALARMS_FUNCTION(m3ua_get_alarms)
static FIO_GET_ALARMS_FUNCTION(m3ua_get_alarms)
{
return FTDM_FAIL;
}
......
......@@ -48,7 +48,7 @@ struct ftdm_analog_data {
uint32_t max_dialstr;
uint32_t digit_timeout;
char hotline[FTDM_MAX_HOTLINE_STR];
zio_signal_cb_t sig_cb;
fio_signal_cb_t sig_cb;
};
......
......@@ -47,7 +47,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj);
*
* Initialises state, starts tone progress detection and runs the channel in a new a thread.
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxo_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxo_outgoing_call)
{
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) && !ftdm_test_flag(ftdmchan, FTDM_CHANNEL_INTHREAD)) {
ftdm_channel_clear_needed_tones(ftdmchan);
......@@ -71,7 +71,7 @@ static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxo_outgoing_call)
*
* Indicates call waiting if channel is already in use, otherwise runs the channel in a new thread.
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxs_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxs_outgoing_call)
{
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_INTHREAD)) {
......@@ -103,8 +103,8 @@ static ftdm_status_t ftdm_analog_start(ftdm_span_t *span)
* \param ap List of configuration variables
* \return Success or failure
*/
static ZIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
//ftdm_status_t ftdm_analog_configure_span(ftdm_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, zio_signal_cb_t sig_cb)
static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_configure_span)
//ftdm_status_t ftdm_analog_configure_span(ftdm_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, fio_signal_cb_t sig_cb)
{
ftdm_analog_data_t *analog_data;
const char *tonemap = "us";
......@@ -715,12 +715,12 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
rlen = ftdm_buffer_read_loop(dt_buffer, frame, len);
if (ftdmchan->effective_codec != FTDM_CODEC_SLIN) {
zio_codec_t codec_func = NULL;
fio_codec_t codec_func = NULL;
if (ftdmchan->native_codec == FTDM_CODEC_ULAW) {
codec_func = zio_slin2ulaw;
codec_func = fio_slin2ulaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW) {
codec_func = zio_slin2alaw;
codec_func = fio_slin2alaw;
}
if (codec_func) {
......@@ -947,7 +947,7 @@ static void *ftdm_analog_run(ftdm_thread_t *me, void *obj)
* \brief FreeTDM analog signaling module initialisation
* \return Success
*/
static ZIO_SIG_LOAD_FUNCTION(ftdm_analog_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_analog_init)
{
return FTDM_SUCCESS;
}
......
......@@ -51,7 +51,7 @@ struct ftdm_analog_data {
uint32_t flags;
uint32_t max_dialstr;
uint32_t digit_timeout;
zio_signal_cb_t sig_cb;
fio_signal_cb_t sig_cb;
};
static void *ftdm_analog_em_run(ftdm_thread_t *me, void *obj);
......
......@@ -52,7 +52,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj);
*
* Initialises state, starts tone progress detection and runs the channel in a new a thread.
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_em_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_em_outgoing_call)
{
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) && !ftdm_test_flag(ftdmchan, FTDM_CHANNEL_INTHREAD)) {
ftdm_channel_clear_needed_tones(ftdmchan);
......@@ -89,8 +89,8 @@ static ftdm_status_t ftdm_analog_em_start(ftdm_span_t *span)
* \param ap List of configuration variables
* \return Success or failure
*/
static ZIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_em_configure_span)
//ftdm_status_t ftdm_analog_em_configure_span(ftdm_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, zio_signal_cb_t sig_cb)
static FIO_SIG_CONFIGURE_FUNCTION(ftdm_analog_em_configure_span)
//ftdm_status_t ftdm_analog_em_configure_span(ftdm_span_t *span, char *tonemap, uint32_t digit_timeout, uint32_t max_dialstr, fio_signal_cb_t sig_cb)
{
ftdm_analog_em_data_t *analog_data;
const char *tonemap = "us";
......@@ -519,12 +519,12 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
rlen = ftdm_buffer_read_loop(dt_buffer, frame, len);
if (ftdmchan->effective_codec != FTDM_CODEC_SLIN) {
zio_codec_t codec_func = NULL;
fio_codec_t codec_func = NULL;
if (ftdmchan->native_codec == FTDM_CODEC_ULAW) {
codec_func = zio_slin2ulaw;
codec_func = fio_slin2ulaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW) {
codec_func = zio_slin2alaw;
codec_func = fio_slin2alaw;
}
if (codec_func) {
......@@ -679,7 +679,7 @@ static void *ftdm_analog_em_run(ftdm_thread_t *me, void *obj)
* \brief FreeTDM analog EM module initialisation
* \return Success
*/
static ZIO_SIG_LOAD_FUNCTION(ftdm_analog_em_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_analog_em_init)
{
return FTDM_SUCCESS;
}
......
......@@ -60,7 +60,7 @@ struct ftdm_isdn_data {
ftdm_channel_t *dchan;
ftdm_channel_t *dchans[2];
struct ftdm_sigmsg sigmsg;
zio_signal_cb_t sig_cb;
fio_signal_cb_t sig_cb;
uint32_t flags;
int32_t mode;
int32_t digit_timeout;
......
......@@ -266,7 +266,7 @@ static ftdm_status_t writeQ931PacketToPcap(L3UCHAR* q931buf, L3USHORT q931size,
* \brief Unloads pcap IO
* \return Success or failure
*/
static ZIO_IO_UNLOAD_FUNCTION(close_pcap)
static FIO_IO_UNLOAD_FUNCTION(close_pcap)
{
#ifdef HAVE_LIBPCAP
return closePcapFile();
......@@ -292,7 +292,7 @@ static L2ULONG ftdm_time_now(void)
* \param ftdmchan Channel to initiate call on
* \return Success or failure
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
{
ftdm_status_t status = FTDM_SUCCESS;
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND);
......@@ -309,7 +309,7 @@ static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
* \param ftdmchan Channel to initialise
* \return Success or failure
*/
static ZIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request)
static FIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request)
{
Q931mes_Generic *gen = (Q931mes_Generic *) caller_data->raw_data;
Q931ie_BearerCap BearerCap;
......@@ -1767,12 +1767,12 @@ static void *ftdm_isdn_tones_run(ftdm_thread_t *me, void *obj)
rlen = ftdm_buffer_read_loop(dt_buffer, frame, len);
if (ftdmchan->effective_codec != FTDM_CODEC_SLIN) {
zio_codec_t codec_func = NULL;
fio_codec_t codec_func = NULL;
if (ftdmchan->native_codec == FTDM_CODEC_ULAW) {
codec_func = zio_slin2ulaw;
codec_func = fio_slin2ulaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW) {
codec_func = zio_slin2alaw;
codec_func = fio_slin2alaw;
}
if (codec_func) {
......@@ -1909,7 +1909,7 @@ static void *ftdm_isdn_run(ftdm_thread_t *me, void *obj)
* \brief FreeTDM ISDN signaling module initialisation
* \return Success
*/
static ZIO_SIG_LOAD_FUNCTION(ftdm_isdn_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_isdn_init)
{
Q931Initialize();
......@@ -2198,7 +2198,7 @@ static uint32_t parse_opts(const char *in)
* \param ap List of configuration variables
* \return Success or failure
*/
static ZIO_SIG_CONFIGURE_FUNCTION(ftdm_isdn_configure_span)
static FIO_SIG_CONFIGURE_FUNCTION(ftdm_isdn_configure_span)
{
uint32_t i, x = 0;
ftdm_channel_t *dchans[2] = {0};
......
......@@ -38,7 +38,7 @@
* \brief Unloads libpri IO module
* \return Success
*/
static ZIO_IO_UNLOAD_FUNCTION(ftdm_libpri_unload)
static FIO_IO_UNLOAD_FUNCTION(ftdm_libpri_unload)
{
return FTDM_SUCCESS;
}
......@@ -48,7 +48,7 @@ static ZIO_IO_UNLOAD_FUNCTION(ftdm_libpri_unload)
* \param ftdmchan Channel to initiate call on
* \return Success or failure
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
{
ftdm_status_t status = FTDM_SUCCESS;
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND);
......@@ -65,7 +65,7 @@ static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call)
* \param ftdmchan Channel to initialise (unused)
* \return Failure
*/
static ZIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request)
static FIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request)
{
return FTDM_FAIL;
}
......@@ -204,7 +204,7 @@ static ftdm_status_t ftdm_libpri_start(ftdm_span_t *span);
* \param data String containing argurments
* \return Flags
*/
static ZIO_API_FUNCTION(ftdm_libpri_api)
static FIO_API_FUNCTION(ftdm_libpri_api)
{
char *mycmd = NULL, *argv[10] = { 0 };
int argc = 0;
......@@ -270,28 +270,28 @@ static ZIO_API_FUNCTION(ftdm_libpri_api)
/**
* \brief Loads libpri IO module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success
*/
static ZIO_IO_LOAD_FUNCTION(ftdm_libpri_io_init)
static FIO_IO_LOAD_FUNCTION(ftdm_libpri_io_init)
{
assert(zio != NULL);
assert(fio != NULL);
memset(&ftdm_libpri_interface, 0, sizeof(ftdm_libpri_interface));
ftdm_libpri_interface.name = "libpri";
ftdm_libpri_interface.api = ftdm_libpri_api;
*zio = &ftdm_libpri_interface;
*fio = &ftdm_libpri_interface;
return FTDM_SUCCESS;
}
/**
* \brief Loads libpri signaling module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success
*/
static ZIO_SIG_LOAD_FUNCTION(ftdm_libpri_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_libpri_init)
{
pri_set_error(s_pri_error);
pri_set_message(s_pri_message);
......@@ -1237,7 +1237,7 @@ static int str2dp(char *dp)
* \param ap List of configuration variables
* \return Success or failure
*/
static ZIO_SIG_CONFIGURE_FUNCTION(ftdm_libpri_configure_span)
static FIO_SIG_CONFIGURE_FUNCTION(ftdm_libpri_configure_span)
{
uint32_t i, x = 0;
//ftdm_channel_t *dchans[2] = {0};
......
......@@ -55,7 +55,7 @@ struct ftdm_libpri_data {
ftdm_channel_t *dchan;
ftdm_channel_t *dchans[2];
struct ftdm_sigmsg sigmsg;
zio_signal_cb_t sig_cb;
fio_signal_cb_t sig_cb;
uint32_t flags;
int32_t mode;
ftdm_isdn_opts_t opts;
......
......@@ -150,7 +150,7 @@ static const char *pika_board_type_string(PK_UINT type)
* \param lineno Line number from configuration file (unused)
* \return Success
*/
static ZIO_CONFIGURE_FUNCTION(pika_configure)
static FIO_CONFIGURE_FUNCTION(pika_configure)
{
pika_channel_profile_t *profile = NULL;
int ok = 1;
......@@ -590,7 +590,7 @@ static unsigned pika_open_range(ftdm_span_t *span, unsigned boardno, unsigned sp
* \param number FreeTDM span number
* \return Success or failure
*/
static ZIO_CONFIGURE_SPAN_FUNCTION(pika_configure_span)
static FIO_CONFIGURE_SPAN_FUNCTION(pika_configure_span)
{
int items, i;
char *mydata, *item_list[10];
......@@ -678,7 +678,7 @@ static ZIO_CONFIGURE_SPAN_FUNCTION(pika_configure_span)
* \param ftdmchan Channel to open
* \return Success or failure
*/
static ZIO_OPEN_FUNCTION(pika_open)
static FIO_OPEN_FUNCTION(pika_open)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
......@@ -701,7 +701,7 @@ static ZIO_OPEN_FUNCTION(pika_open)
* \param ftdmchan Channel to close
* \return Success
*/
static ZIO_CLOSE_FUNCTION(pika_close)
static FIO_CLOSE_FUNCTION(pika_close)
{
return FTDM_SUCCESS;
}
......@@ -713,7 +713,7 @@ static ZIO_CLOSE_FUNCTION(pika_close)
* \param to Time to wait (in ms)
* \return Success, failure or timeout
*/
static ZIO_WAIT_FUNCTION(pika_wait)
static FIO_WAIT_FUNCTION(pika_wait)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
PK_STATUS status;
......@@ -752,7 +752,7 @@ static ZIO_WAIT_FUNCTION(pika_wait)
* \param datalen Size of data buffer
* \return Success or failure
*/
static ZIO_READ_FUNCTION(pika_read)
static FIO_READ_FUNCTION(pika_read)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
PK_STATUS status;
......@@ -793,7 +793,7 @@ static ZIO_READ_FUNCTION(pika_read)
* \param datalen Size of data buffer
* \return Success or failure
*/
static ZIO_WRITE_FUNCTION(pika_write)
static FIO_WRITE_FUNCTION(pika_write)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
PK_STATUS status;
......@@ -819,7 +819,7 @@ static ZIO_WRITE_FUNCTION(pika_write)
* \param obj Object (unused)
* \return Success or failure
*/
static ZIO_COMMAND_FUNCTION(pika_command)
static FIO_COMMAND_FUNCTION(pika_command)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
//pika_span_data_t *span_data = (pika_span_data_t *) ftdmchan->span->mod_data;
......@@ -954,7 +954,7 @@ static ZIO_COMMAND_FUNCTION(pika_command)
* \param ms Time to wait for event
* \return Success if event is waiting or failure if not
*/
static ZIO_SPAN_POLL_EVENT_FUNCTION(pika_poll_event)
static FIO_SPAN_POLL_EVENT_FUNCTION(pika_poll_event)
{
pika_span_data_t *span_data = (pika_span_data_t *) span->mod_data;
PK_STATUS status;
......@@ -1062,7 +1062,7 @@ static ZIO_SPAN_POLL_EVENT_FUNCTION(pika_poll_event)
* \param event FreeTDM event to return
* \return Success or failure
*/
static ZIO_SPAN_NEXT_EVENT_FUNCTION(pika_next_event)
static FIO_SPAN_NEXT_EVENT_FUNCTION(pika_next_event)
{
uint32_t i, event_id = 0;
......@@ -1205,7 +1205,7 @@ static ZIO_SPAN_NEXT_EVENT_FUNCTION(pika_next_event)
* \param span Span to destroy
* \return Success
*/
static ZIO_SPAN_DESTROY_FUNCTION(pika_span_destroy)
static FIO_SPAN_DESTROY_FUNCTION(pika_span_destroy)
{
pika_span_data_t *span_data = (pika_span_data_t *) span->mod_data;
......@@ -1222,7 +1222,7 @@ static ZIO_SPAN_DESTROY_FUNCTION(pika_span_destroy)
* \param ftdmchan Channel to destroy
* \return Success or failure
*/
static ZIO_CHANNEL_DESTROY_FUNCTION(pika_channel_destroy)
static FIO_CHANNEL_DESTROY_FUNCTION(pika_channel_destroy)
{
pika_chan_data_t *chan_data = (pika_chan_data_t *) ftdmchan->mod_data;
pika_span_data_t *span_data = (pika_span_data_t *) ftdmchan->span->mod_data;
......@@ -1271,7 +1271,7 @@ static ZIO_CHANNEL_DESTROY_FUNCTION(pika_channel_destroy)
* \param ftdmchan Channel to get alarms from
* \return Failure
*/
static ZIO_GET_ALARMS_FUNCTION(pika_get_alarms)
static FIO_GET_ALARMS_FUNCTION(pika_get_alarms)
{
return FTDM_FAIL;
}
......@@ -1280,10 +1280,10 @@ static ftdm_io_interface_t pika_interface;
/**
* \brief Loads Pika IO module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success or failure
*/
static ZIO_IO_LOAD_FUNCTION(pika_init)
static FIO_IO_LOAD_FUNCTION(pika_init)
{
PK_STATUS status;
......@@ -1293,7 +1293,7 @@ static ZIO_IO_LOAD_FUNCTION(pika_init)
PKH_TLogMasks m;
TPikaHandle tmpHandle;
assert(zio != NULL);
assert(fio != NULL);
memset(&pika_interface, 0, sizeof(pika_interface));
memset(&globals, 0, sizeof(globals));
globals.general_config.region = PKH_TRUNK_NA;
......@@ -1375,7 +1375,7 @@ static ZIO_IO_LOAD_FUNCTION(pika_init)
pika_interface.channel_destroy = pika_channel_destroy;
pika_interface.span_destroy = pika_span_destroy;
pika_interface.get_alarms = pika_get_alarms;
*zio = &pika_interface;
*fio = &pika_interface;
ftdm_log(FTDM_LOG_INFO, "Dumping Default configs:\n");
......@@ -1421,7 +1421,7 @@ static ZIO_IO_LOAD_FUNCTION(pika_init)
* \brief Unloads Pika IO module
* \return Success
*/
static ZIO_IO_UNLOAD_FUNCTION(pika_destroy)
static FIO_IO_UNLOAD_FUNCTION(pika_destroy)
{
uint32_t x;
PK_STATUS status;
......
......@@ -91,7 +91,7 @@ typedef struct ft_r2_conf_s {
/* r2 configuration stored in span->signal_data */
typedef struct ftdm_r2_data_s {
/* signaling callback */
zio_signal_cb_t sig_cb;
fio_signal_cb_t sig_cb;
/* span flags */
ftdm_r2_flag_t flags;
/* openr2 handle for the R2 variant context */
......@@ -159,7 +159,7 @@ static void ft_r2_answer_call(ftdm_channel_t *ftdmchan)
R2CALL(ftdmchan)->answer_pending = 0;
}
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(r2_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(r2_outgoing_call)
{
ftdm_status_t status;
ftdm_mutex_lock(ftdmchan->mutex);
......@@ -645,8 +645,8 @@ static openr2_io_interface_t ftdm_r2_io_iface = {
.get_oob_event = ftdm_r2_io_get_oob_event /* never called */
};
static ZIO_SIG_CONFIGURE_FUNCTION(ftdm_r2_configure_span)
//ftdm_status_t (ftdm_span_t *span, zio_signal_cb_t sig_cb, va_list ap)
static FIO_SIG_CONFIGURE_FUNCTION(ftdm_r2_configure_span)
//ftdm_status_t (ftdm_span_t *span, fio_signal_cb_t sig_cb, va_list ap)
{
int i = 0;
int conf_failure = 0;
......@@ -1176,7 +1176,7 @@ static void *ftdm_r2_run(ftdm_thread_t *me, void *obj)
}
static ZIO_API_FUNCTION(ftdm_r2_api)
static FIO_API_FUNCTION(ftdm_r2_api)
{
char *mycmd = NULL, *argv[10] = { 0 };
int argc = 0;
......@@ -1303,20 +1303,20 @@ done:
}
static ZIO_IO_LOAD_FUNCTION(ftdm_r2_io_init)
static FIO_IO_LOAD_FUNCTION(ftdm_r2_io_init)
{
assert(zio != NULL);
assert(fio != NULL);
memset(&g_ftdm_r2_interface, 0, sizeof(g_ftdm_r2_interface));
g_ftdm_r2_interface.name = "r2";
g_ftdm_r2_interface.api = ftdm_r2_api;
*zio = &g_ftdm_r2_interface;
*fio = &g_ftdm_r2_interface;
return FTDM_SUCCESS;
}
static ZIO_SIG_LOAD_FUNCTION(ftdm_r2_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_r2_init)
{
g_mod_data_hash = create_hashtable(10, ftdm_hash_hashfromstring, ftdm_hash_equalkeys);
if (!g_mod_data_hash) {
......@@ -1326,7 +1326,7 @@ static ZIO_SIG_LOAD_FUNCTION(ftdm_r2_init)
return FTDM_SUCCESS;
}
static ZIO_SIG_UNLOAD_FUNCTION(ftdm_r2_destroy)
static FIO_SIG_UNLOAD_FUNCTION(ftdm_r2_destroy)
{
ftdm_hash_iterator_t *i = NULL;
ftdm_r2_span_pvt_t *spanpvt = NULL;
......
......@@ -49,7 +49,7 @@ typedef struct ftdm_sangoma_boost_data {
fd_set rfds;
fd_set efds;
int iteration;
zio_signal_cb_t signal_cb;
fio_signal_cb_t signal_cb;
uint32_t flags;
boost_sigmod_interface_t *sigmod;
ftdm_queue_t *boost_queue;
......
......@@ -286,7 +286,7 @@ static int boost_media_ready(sangomabc_event_t *event)
* \param ftdmchan Channel to initialise
* \return Success or failure
*/
static ZIO_CHANNEL_REQUEST_FUNCTION(sangoma_boost_channel_request)
static FIO_CHANNEL_REQUEST_FUNCTION(sangoma_boost_channel_request)
{
ftdm_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
ftdm_status_t status = FTDM_FAIL;
......@@ -474,7 +474,7 @@ static ZIO_CHANNEL_REQUEST_FUNCTION(sangoma_boost_channel_request)
* \param ftdmchan Channel to initiate call on
* \return Success
*/
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(sangoma_boost_outgoing_call)
static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(sangoma_boost_outgoing_call)
{
ftdm_status_t status = FTDM_SUCCESS;
......@@ -1617,10 +1617,10 @@ end:
/**
* \brief Loads sangoma boost signaling module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success
*/
static ZIO_SIG_LOAD_FUNCTION(ftdm_sangoma_boost_init)
static FIO_SIG_LOAD_FUNCTION(ftdm_sangoma_boost_init)
{
g_boost_modules_hash = create_hashtable(10, ftdm_hash_hashfromstring, ftdm_hash_equalkeys);
if (!g_boost_modules_hash) {
......@@ -1633,7 +1633,7 @@ static ZIO_SIG_LOAD_FUNCTION(ftdm_sangoma_boost_init)
return FTDM_SUCCESS;
}
static ZIO_SIG_UNLOAD_FUNCTION(ftdm_sangoma_boost_destroy)
static FIO_SIG_UNLOAD_FUNCTION(ftdm_sangoma_boost_destroy)
{
ftdm_hash_iterator_t *i = NULL;
boost_sigmod_interface_t *sigmod = NULL;
......@@ -1839,7 +1839,7 @@ static BOOST_SIG_STATUS_CB_FUNCTION(ftdm_boost_sig_status_change)
return;
}
static ZIO_CHANNEL_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_channel_sig_status)
static FIO_CHANNEL_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_channel_sig_status)
{
ftdm_sangoma_boost_data_t *sangoma_boost_data = ftdmchan->span->signal_data;
if (!sangoma_boost_data->sigmod) {
......@@ -1853,7 +1853,7 @@ static ZIO_CHANNEL_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_channel_sig_status)
return sangoma_boost_data->sigmod->set_channel_sig_status(ftdmchan, status);
}
static ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_channel_sig_status)
static FIO_CHANNEL_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_channel_sig_status)
{
ftdm_sangoma_boost_data_t *sangoma_boost_data = ftdmchan->span->signal_data;
if (!sangoma_boost_data->sigmod) {
......@@ -1867,7 +1867,7 @@ static ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_channel_sig_status)
return sangoma_boost_data->sigmod->get_channel_sig_status(ftdmchan, status);
}
static ZIO_SPAN_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_span_sig_status)
static FIO_SPAN_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_span_sig_status)
{
ftdm_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
if (!sangoma_boost_data->sigmod) {
......@@ -1881,7 +1881,7 @@ static ZIO_SPAN_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_span_sig_status)
return sangoma_boost_data->sigmod->set_span_sig_status(span, status);
}
static ZIO_SPAN_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_span_sig_status)
static FIO_SPAN_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_span_sig_status)
{
ftdm_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
if (!sangoma_boost_data->sigmod) {
......@@ -1902,7 +1902,7 @@ static ZIO_SPAN_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_span_sig_status)
* \param ap List of configuration variables
* \return Success or failure
*/
static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_boost_configure_span)
static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_boost_configure_span)
{
#define FAIL_CONFIG_RETURN(retstatus) \
if (sangoma_boost_data) \
......
......@@ -35,76 +35,76 @@
#include "freetdm.h"
//#include "ftdm_skel.h"
static ZIO_CONFIGURE_FUNCTION(skel_configure)
static FIO_CONFIGURE_FUNCTION(skel_configure)
{
return FTDM_FAIL;
}
static ZIO_CONFIGURE_SPAN_FUNCTION(skel_configure_span)
static FIO_CONFIGURE_SPAN_FUNCTION(skel_configure_span)
{
return FTDM_FAIL;
}
static ZIO_OPEN_FUNCTION(skel_open)
static FIO_OPEN_FUNCTION(skel_open)
{
return FTDM_FAIL;
}
static ZIO_CLOSE_FUNCTION(skel_close)
static FIO_CLOSE_FUNCTION(skel_close)
{
return FTDM_FAIL;
}
static ZIO_WAIT_FUNCTION(skel_wait)
static FIO_WAIT_FUNCTION(skel_wait)
{
return FTDM_FAIL;
}
static ZIO_READ_FUNCTION(skel_read)
static FIO_READ_FUNCTION(skel_read)
{
return FTDM_FAIL;
}
static ZIO_WRITE_FUNCTION(skel_write)
static FIO_WRITE_FUNCTION(skel_write)
{
return FTDM_FAIL;
}
static ZIO_COMMAND_FUNCTION(skel_command)
static FIO_COMMAND_FUNCTION(skel_command)
{
return FTDM_FAIL;
}
static ZIO_SPAN_POLL_EVENT_FUNCTION(skel_poll_event)
static FIO_SPAN_POLL_EVENT_FUNCTION(skel_poll_event)
{
return FTDM_FAIL;
}
static ZIO_SPAN_NEXT_EVENT_FUNCTION(skel_next_event)
static FIO_SPAN_NEXT_EVENT_FUNCTION(skel_next_event)
{
return FTDM_FAIL;
}
static ZIO_CHANNEL_DESTROY_FUNCTION(skel_channel_destroy)
static FIO_CHANNEL_DESTROY_FUNCTION(skel_channel_destroy)
{
return FTDM_FAIL;
}
static ZIO_SPAN_DESTROY_FUNCTION(skel_span_destroy)
static FIO_SPAN_DESTROY_FUNCTION(skel_span_destroy)
{
return FTDM_FAIL;
}
static ZIO_GET_ALARMS_FUNCTION(skel_get_alarms)
static FIO_GET_ALARMS_FUNCTION(skel_get_alarms)
{
return FTDM_FAIL;
}
static ftdm_io_interface_t skel_interface;
static ZIO_IO_LOAD_FUNCTION(skel_init)
static FIO_IO_LOAD_FUNCTION(skel_init)
{
assert(zio != NULL);
assert(fio != NULL);
memset(&skel_interface, 0, sizeof(skel_interface));
skel_interface.name = "skel";
......@@ -121,12 +121,12 @@ static ZIO_IO_LOAD_FUNCTION(skel_init)
skel_interface.channel_destroy = skel_channel_destroy;
skel_interface.span_destroy = skel_span_destroy;
skel_interface.get_alarms = skel_get_alarms;
*zio = &skel_interface;
*fio = &skel_interface;
return FTDM_SUCCESS;
}
static ZIO_IO_UNLOAD_FUNCTION(skel_destroy)
static FIO_IO_UNLOAD_FUNCTION(skel_destroy)
{
return FTDM_SUCCESS;
}
......
......@@ -98,8 +98,8 @@ static struct {
/* a bunch of this stuff should go into the wanpipe_tdm_api_iface.h */
ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event);
ZIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event);
FIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event);
FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event);
#define WP_INVALID_SOCKET -1
......@@ -353,7 +353,7 @@ static unsigned wp_open_range(ftdm_span_t *span, unsigned spanno, unsigned start
* \param lineno Line number from configuration file
* \return Success
*/
static ZIO_CONFIGURE_FUNCTION(wanpipe_configure)
static FIO_CONFIGURE_FUNCTION(wanpipe_configure)
{
int num;
......@@ -394,7 +394,7 @@ static ZIO_CONFIGURE_FUNCTION(wanpipe_configure)
* \param number FreeTDM span number
* \return Success or failure
*/
static ZIO_CONFIGURE_SPAN_FUNCTION(wanpipe_configure_span)
static FIO_CONFIGURE_SPAN_FUNCTION(wanpipe_configure_span)
{
int items, i;
char *mydata, *item_list[10];
......@@ -468,7 +468,7 @@ static ZIO_CONFIGURE_SPAN_FUNCTION(wanpipe_configure_span)
* \param ftdmchan Channel to open
* \return Success or failure
*/
static ZIO_OPEN_FUNCTION(wanpipe_open)
static FIO_OPEN_FUNCTION(wanpipe_open)
{
wanpipe_tdm_api_t tdm_api;
......@@ -495,7 +495,7 @@ static ZIO_OPEN_FUNCTION(wanpipe_open)
* \param ftdmchan Channel to close
* \return Success
*/
static ZIO_CLOSE_FUNCTION(wanpipe_close)
static FIO_CLOSE_FUNCTION(wanpipe_close)
{
#ifdef LIBSANGOMA_VERSION
sangoma_wait_obj_t *waitobj = ftdmchan->mod_data;
......@@ -512,7 +512,7 @@ static ZIO_CLOSE_FUNCTION(wanpipe_close)
* \param obj Object (unused)
* \return Success or failure
*/
static ZIO_COMMAND_FUNCTION(wanpipe_command)
static FIO_COMMAND_FUNCTION(wanpipe_command)
{
wanpipe_tdm_api_t tdm_api;
int err = 0;
......@@ -647,7 +647,7 @@ static ZIO_COMMAND_FUNCTION(wanpipe_command)
* \param datalen Size of data buffer
* \return Success, failure or timeout
*/
static ZIO_READ_FUNCTION(wanpipe_read)
static FIO_READ_FUNCTION(wanpipe_read)
{
int rx_len = 0;
wp_tdm_api_rx_hdr_t hdrframe;
......@@ -677,7 +677,7 @@ static ZIO_READ_FUNCTION(wanpipe_read)
* \param datalen Size of data buffer
* \return Success or failure
*/
static ZIO_WRITE_FUNCTION(wanpipe_write)
static FIO_WRITE_FUNCTION(wanpipe_write)
{
int bsent;
wp_tdm_api_tx_hdr_t hdrframe;
......@@ -703,7 +703,7 @@ static ZIO_WRITE_FUNCTION(wanpipe_write)
* \return Success, failure or timeout
*/
static ZIO_WAIT_FUNCTION(wanpipe_wait)
static FIO_WAIT_FUNCTION(wanpipe_wait)
{
int32_t inflags = 0;
int result;
......@@ -754,7 +754,7 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait)
* \param ms Time to wait for event
* \return Success if event is waiting or failure if not
*/
ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
FIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
{
#ifdef LIBSANGOMA_VERSION
sangoma_status_t sangstatus;
......@@ -864,7 +864,7 @@ ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
* \param ftdmchan Channel to get alarms from
* \return Success or failure
*/
static ZIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms)
static FIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms)
{
wanpipe_tdm_api_t tdm_api;
unsigned int alarms = 0;
......@@ -899,7 +899,7 @@ static ZIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms)
* \param event FreeTDM event to return
* \return Success or failure
*/
ZIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event)
FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event)
{
uint32_t i,err;
ftdm_oob_event_t event_id;
......@@ -1062,7 +1062,7 @@ ZIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event)
* \param ftdmchan Channel to destroy
* \return Success
*/
static ZIO_CHANNEL_DESTROY_FUNCTION(wanpipe_channel_destroy)
static FIO_CHANNEL_DESTROY_FUNCTION(wanpipe_channel_destroy)
{
#ifdef LIBSANGOMA_VERSION
if (ftdmchan->mod_data) {
......@@ -1083,12 +1083,12 @@ static ZIO_CHANNEL_DESTROY_FUNCTION(wanpipe_channel_destroy)
/**
* \brief Loads wanpipe IO module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success
*/
static ZIO_IO_LOAD_FUNCTION(wanpipe_init)
static FIO_IO_LOAD_FUNCTION(wanpipe_init)
{
assert(zio != NULL);
assert(fio != NULL);
memset(&wanpipe_interface, 0, sizeof(wanpipe_interface));
wp_globals.codec_ms = 20;
......@@ -1109,7 +1109,7 @@ static ZIO_IO_LOAD_FUNCTION(wanpipe_init)
wanpipe_interface.next_event = wanpipe_next_event;
wanpipe_interface.channel_destroy = wanpipe_channel_destroy;
wanpipe_interface.get_alarms = wanpipe_get_alarms;
*zio = &wanpipe_interface;
*fio = &wanpipe_interface;
return FTDM_SUCCESS;
}
......@@ -1118,7 +1118,7 @@ static ZIO_IO_LOAD_FUNCTION(wanpipe_init)
* \brief Unloads wanpipe IO module
* \return Success
*/
static ZIO_IO_UNLOAD_FUNCTION(wanpipe_destroy)
static FIO_IO_UNLOAD_FUNCTION(wanpipe_destroy)
{
memset(&wanpipe_interface, 0, sizeof(wanpipe_interface));
return FTDM_SUCCESS;
......
......@@ -175,8 +175,8 @@ static const char zt_chanpath[] = "/dev/ftdm/channel";
static ftdm_socket_t CONTROL_FD = ZT_INVALID_SOCKET;
ZIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event);
ZIO_SPAN_POLL_EVENT_FUNCTION(zt_poll_event);
FIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event);
FIO_SPAN_POLL_EVENT_FUNCTION(zt_poll_event);
/**
* \brief Initialises codec, and rx/tx gains
......@@ -442,7 +442,7 @@ static unsigned zt_open_range(ftdm_span_t *span, unsigned start, unsigned end, f
* \param number FreeTDM span number
* \return Success or failure
*/
static ZIO_CONFIGURE_SPAN_FUNCTION(zt_configure_span)
static FIO_CONFIGURE_SPAN_FUNCTION(zt_configure_span)
{
int items, i;
......@@ -511,7 +511,7 @@ static ZIO_CONFIGURE_SPAN_FUNCTION(zt_configure_span)
* \param lineno Line number from configuration file
* \return Success
*/
static ZIO_CONFIGURE_FUNCTION(zt_configure)
static FIO_CONFIGURE_FUNCTION(zt_configure)
{
int num;
......@@ -576,7 +576,7 @@ static ZIO_CONFIGURE_FUNCTION(zt_configure)
* \param ftdmchan Channel to open
* \return Success or failure
*/
static ZIO_OPEN_FUNCTION(zt_open)
static FIO_OPEN_FUNCTION(zt_open)
{
ftdm_channel_set_feature(ftdmchan, FTDM_CHANNEL_FEATURE_INTERVAL);
......@@ -656,7 +656,7 @@ static ZIO_OPEN_FUNCTION(zt_open)
* \param ftdmchan Channel to close
* \return Success
*/
static ZIO_CLOSE_FUNCTION(zt_close)
static FIO_CLOSE_FUNCTION(zt_close)
{
return FTDM_SUCCESS;
}
......@@ -668,7 +668,7 @@ static ZIO_CLOSE_FUNCTION(zt_close)
* \param obj Object (unused)
* \return Success or failure
*/
static ZIO_COMMAND_FUNCTION(zt_command)
static FIO_COMMAND_FUNCTION(zt_command)
{
zt_params_t ztp;
int err = 0;
......@@ -838,7 +838,7 @@ static ZIO_COMMAND_FUNCTION(zt_command)
* \param ftdmchan Channel to get alarms from
* \return Success or failure
*/
static ZIO_GET_ALARMS_FUNCTION(zt_get_alarms)
static FIO_GET_ALARMS_FUNCTION(zt_get_alarms)
{
struct zt_spaninfo info;
......@@ -863,7 +863,7 @@ static ZIO_GET_ALARMS_FUNCTION(zt_get_alarms)
* \param to Time to wait (in ms)
* \return Success, failure or timeout
*/
static ZIO_WAIT_FUNCTION(zt_wait)
static FIO_WAIT_FUNCTION(zt_wait)
{
int32_t inflags = 0;
int result;
......@@ -929,7 +929,7 @@ static ZIO_WAIT_FUNCTION(zt_wait)
* \param ms Time to wait for event
* \return Success if event is waiting or failure if not
*/
ZIO_SPAN_POLL_EVENT_FUNCTION(zt_poll_event)
FIO_SPAN_POLL_EVENT_FUNCTION(zt_poll_event)
{
struct pollfd pfds[FTDM_MAX_CHANNELS_SPAN];
uint32_t i, j = 0, k = 0;
......@@ -972,7 +972,7 @@ ZIO_SPAN_POLL_EVENT_FUNCTION(zt_poll_event)
* \param event FreeTDM event to return
* \return Success or failure
*/
ZIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
FIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
{
uint32_t i, event_id = 0;
ftdm_oob_event_t zt_event_id = 0;
......@@ -1074,7 +1074,7 @@ ZIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
* \param datalen Size of data buffer
* \return Success, failure or timeout
*/
static ZIO_READ_FUNCTION(zt_read)
static FIO_READ_FUNCTION(zt_read)
{
ftdm_ssize_t r = 0;
int errs = 0;
......@@ -1107,7 +1107,7 @@ static ZIO_READ_FUNCTION(zt_read)
* \param datalen Size of data buffer
* \return Success or failure
*/
static ZIO_WRITE_FUNCTION(zt_write)
static FIO_WRITE_FUNCTION(zt_write)
{
ftdm_ssize_t w = 0;
ftdm_size_t bytes = *datalen;
......@@ -1132,7 +1132,7 @@ static ZIO_WRITE_FUNCTION(zt_write)
* \param ftdmchan Channel to destroy
* \return Success
*/
static ZIO_CHANNEL_DESTROY_FUNCTION(zt_channel_destroy)
static FIO_CHANNEL_DESTROY_FUNCTION(zt_channel_destroy)
{
close(ftdmchan->sockfd);
ftdmchan->sockfd = ZT_INVALID_SOCKET;
......@@ -1147,12 +1147,12 @@ static ftdm_io_interface_t zt_interface;
/**
* \brief Loads ftdmtel IO module
* \param zio FreeTDM IO interface
* \param fio FreeTDM IO interface
* \return Success or failure
*/
static ZIO_IO_LOAD_FUNCTION(zt_init)
static FIO_IO_LOAD_FUNCTION(zt_init)
{
assert(zio != NULL);
assert(fio != NULL);
struct stat statbuf;
memset(&zt_interface, 0, sizeof(zt_interface));
memset(&zt_globals, 0, sizeof(zt_globals));
......@@ -1195,7 +1195,7 @@ static ZIO_IO_LOAD_FUNCTION(zt_init)
zt_interface.next_event = zt_next_event;
zt_interface.channel_destroy = zt_channel_destroy;
zt_interface.get_alarms = zt_get_alarms;
*zio = &zt_interface;
*fio = &zt_interface;
return FTDM_SUCCESS;
}
......@@ -1204,7 +1204,7 @@ static ZIO_IO_LOAD_FUNCTION(zt_init)
* \brief Unloads ftdmtel IO module
* \return Success
*/
static ZIO_IO_UNLOAD_FUNCTION(zt_destroy)
static FIO_IO_UNLOAD_FUNCTION(zt_destroy)
{
close(CONTROL_FD);
memset(&zt_interface, 0, sizeof(zt_interface));
......
......@@ -512,7 +512,7 @@ struct ftdm_channel {
uint32_t buffer_delay;
ftdm_event_t event_header;
char last_error[256];
zio_event_cb_t event_callback;
fio_event_cb_t event_callback;
uint32_t skip_read_frames;
ftdm_buffer_t *dtmf_buffer;
ftdm_buffer_t *gen_dtmf_buffer;
......@@ -541,7 +541,7 @@ struct ftdm_channel {
void *call_data;
struct ftdm_caller_data caller_data;
struct ftdm_span *span;
struct ftdm_io_interface *zio;
struct ftdm_io_interface *fio;
ftdm_hash_t *variable_hash;
unsigned char rx_cas_bits;
uint32_t pre_buffer_size;
......@@ -568,8 +568,8 @@ struct ftdm_span {
uint32_t span_id;
uint32_t chan_count;
ftdm_span_flag_t flags;
struct ftdm_io_interface *zio;
zio_event_cb_t event_callback;
struct ftdm_io_interface *fio;
fio_event_cb_t event_callback;
ftdm_mutex_t *mutex;
ftdm_trunk_type_t trunk_type;
ftdm_analog_start_type_t start_type;
......@@ -581,12 +581,12 @@ struct ftdm_span {
teletone_tone_map_t tone_detect_map[FTDM_TONEMAP_INVALID+1];
teletone_multi_tone_t tone_finder[FTDM_TONEMAP_INVALID+1];
ftdm_channel_t *channels[FTDM_MAX_CHANNELS_SPAN+1];
zio_channel_outgoing_call_t outgoing_call;
zio_channel_set_sig_status_t set_channel_sig_status;
zio_channel_get_sig_status_t get_channel_sig_status;
zio_span_set_sig_status_t set_span_sig_status;
zio_span_get_sig_status_t get_span_sig_status;
zio_channel_request_t channel_request;
fio_channel_outgoing_call_t outgoing_call;
fio_channel_set_sig_status_t set_channel_sig_status;
fio_channel_get_sig_status_t get_channel_sig_status;
fio_span_set_sig_status_t set_span_sig_status;
fio_span_get_sig_status_t get_span_sig_status;
fio_channel_request_t channel_request;
ftdm_span_start_t start;
ftdm_span_stop_t stop;
void *mod_data;
......@@ -631,20 +631,20 @@ FT_DECLARE_DATA extern ftdm_memory_handler_t g_ftdm_mem_handler;
struct ftdm_io_interface {
const char *name;
zio_configure_span_t configure_span;
zio_configure_t configure;
zio_open_t open;
zio_close_t close;
zio_channel_destroy_t channel_destroy;
zio_span_destroy_t span_destroy;
zio_get_alarms_t get_alarms;
zio_command_t command;
zio_wait_t wait;
zio_read_t read;
zio_write_t write;
zio_span_poll_event_t poll_event;
zio_span_next_event_t next_event;
zio_api_t api;
fio_configure_span_t configure_span;
fio_configure_t configure;
fio_open_t open;
fio_close_t close;
fio_channel_destroy_t channel_destroy;
fio_span_destroy_t span_destroy;
fio_get_alarms_t get_alarms;
fio_command_t command;
fio_wait_t wait;
fio_read_t read;
fio_write_t write;
fio_span_poll_event_t poll_event;
fio_span_next_event_t next_event;
fio_api_t api;
};
typedef struct ftdm_queue ftdm_queue_t;
......@@ -735,17 +735,17 @@ FT_DECLARE(ftdm_time_t) ftdm_current_time_in_ms(void);
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms);
FT_DECLARE(ftdm_status_t) ftdm_span_next_event(ftdm_span_t *span, ftdm_event_t **event);
FT_DECLARE(ftdm_status_t) ftdm_span_find(uint32_t id, ftdm_span_t **span);
FT_DECLARE(ftdm_status_t) ftdm_span_create(ftdm_io_interface_t *zio, ftdm_span_t **span, const char *name);
FT_DECLARE(ftdm_status_t) ftdm_span_create(ftdm_io_interface_t *fio, ftdm_span_t **span, const char *name);
FT_DECLARE(ftdm_status_t) ftdm_span_close_all(void);
FT_DECLARE(ftdm_status_t) ftdm_span_add_channel(ftdm_span_t *span, ftdm_socket_t sockfd, ftdm_chan_type_t type, ftdm_channel_t **chan);
FT_DECLARE(ftdm_status_t) ftdm_span_set_event_callback(ftdm_span_t *span, zio_event_cb_t event_callback);
FT_DECLARE(ftdm_status_t) ftdm_span_set_event_callback(ftdm_span_t *span, fio_event_cb_t event_callback);
FT_DECLARE(ftdm_status_t) ftdm_channel_add_to_group(const char* name, ftdm_channel_t* ftdmchan);
FT_DECLARE(ftdm_status_t) ftdm_group_add_channels(const char* name, ftdm_span_t* span, const char* val);
FT_DECLARE(ftdm_status_t) ftdm_channel_remove_from_group(ftdm_group_t* group, ftdm_channel_t* ftdmchan);
FT_DECLARE(ftdm_status_t) ftdm_group_find(uint32_t id, ftdm_group_t **group);
FT_DECLARE(ftdm_status_t) ftdm_group_find_by_name(const char *name, ftdm_group_t **group);
FT_DECLARE(ftdm_status_t) ftdm_group_create(ftdm_group_t **group, const char *name);
FT_DECLARE(ftdm_status_t) ftdm_channel_set_event_callback(ftdm_channel_t *ftdmchan, zio_event_cb_t event_callback);
FT_DECLARE(ftdm_status_t) ftdm_channel_set_event_callback(ftdm_channel_t *ftdmchan, fio_event_cb_t event_callback);
FT_DECLARE(ftdm_status_t) ftdm_channel_open(uint32_t span_id, uint32_t chan_id, ftdm_channel_t **ftdmchan);
FT_DECLARE(ftdm_status_t) ftdm_channel_open_chan(ftdm_channel_t *ftdmchan);
FT_DECLARE(ftdm_status_t) ftdm_span_channel_use_count(ftdm_span_t *span, uint32_t *count);
......@@ -780,8 +780,8 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_complete_state(ftdm_channel_t *ftdmchan);
FT_DECLARE(ftdm_status_t) ftdm_channel_init(ftdm_channel_t *ftdmchan);
FT_DECLARE(int) ftdm_load_modules(void);
FT_DECLARE(ftdm_status_t) ftdm_unload_modules(void);
FT_DECLARE(ftdm_status_t) ftdm_configure_span(const char *type, ftdm_span_t *span, zio_signal_cb_t sig_cb, ...);
FT_DECLARE(ftdm_status_t) ftdm_configure_span_signaling(const char *type, ftdm_span_t *span, zio_signal_cb_t sig_cb, ftdm_conf_parameter_t *parameters);
FT_DECLARE(ftdm_status_t) ftdm_configure_span(const char *type, ftdm_span_t *span, fio_signal_cb_t sig_cb, ...);
FT_DECLARE(ftdm_status_t) ftdm_configure_span_signaling(const char *type, ftdm_span_t *span, fio_signal_cb_t sig_cb, ftdm_conf_parameter_t *parameters);
FT_DECLARE(ftdm_status_t) ftdm_span_start(ftdm_span_t *span);
FT_DECLARE(ftdm_status_t) ftdm_span_stop(ftdm_span_t *span);
FT_DECLARE(char *) ftdm_build_dso_path(const char *name, char *path, ftdm_size_t len);
......@@ -792,12 +792,12 @@ FT_DECLARE(ftdm_status_t) ftdm_span_find_by_name(const char *name, ftdm_span_t *
FT_DECLARE(char *) ftdm_api_execute(const char *type, const char *cmd);
FT_DECLARE(int) ftdm_vasprintf(char **ret, const char *fmt, va_list ap);
ZIO_CODEC_FUNCTION(zio_slin2ulaw);
ZIO_CODEC_FUNCTION(zio_ulaw2slin);
ZIO_CODEC_FUNCTION(zio_slin2alaw);
ZIO_CODEC_FUNCTION(zio_alaw2slin);
ZIO_CODEC_FUNCTION(zio_ulaw2alaw);
ZIO_CODEC_FUNCTION(zio_alaw2ulaw);
FIO_CODEC_FUNCTION(fio_slin2ulaw);
FIO_CODEC_FUNCTION(fio_ulaw2slin);
FIO_CODEC_FUNCTION(fio_slin2alaw);
FIO_CODEC_FUNCTION(fio_alaw2slin);
FIO_CODEC_FUNCTION(fio_ulaw2alaw);
FIO_CODEC_FUNCTION(fio_alaw2ulaw);
#ifdef DEBUG_LOCKS
#define ftdm_mutex_lock(_x) printf("++++++lock %s:%d\n", __FILE__, __LINE__) && _ftdm_mutex_lock(_x)
......
......@@ -100,7 +100,7 @@ typedef enum {
/*typedef struct m3ua_data {
m3uac_connection_t mcon;
m3uac_connection_t pcon;
zio_signal_cb_t signal_cb;
fio_signal_cb_t signal_cb;
uint32_t flags;
} m3ua_data_t;
......@@ -108,7 +108,7 @@ typedef enum {
/*typedef struct mu3a_link {
ss7bc_connection_t mcon;
ss7bc_connection_t pcon;
zio_signal_cb_t signal_cb;
fio_signal_cb_t signal_cb;
uint32_t flags;
} ftdm_m3ua_data_t;
*/
......
......@@ -33,7 +33,7 @@ typedef struct {
static call_info_t pidmap[SANGOMA_MAX_CHAN_PER_SPAN];
ZIO_EVENT_CB_FUNCTION(my_ftdm_event_handler)
FIO_EVENT_CB_FUNCTION(my_ftdm_event_handler)
{
if (event->e_type = FTDM_EVENT_DTMF) {
char *dtmf = event->data;
......
......@@ -41,7 +41,7 @@ static void *test_call(ftdm_thread_t *me, void *obj)
return NULL;
}
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
ftdm_log(FTDM_LOG_DEBUG, "got sig [%s]\n", ftdm_signal_event2str(sigmsg->event_id));
......
#include "freetdm.h"
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}
......
......@@ -2,7 +2,7 @@
#include <signal.h>
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}
......
......@@ -11,7 +11,7 @@
#include "freetdm.h"
#include "ftdm_m3ua.h"
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}
......
......@@ -33,7 +33,7 @@ static void *channel_run(ftdm_thread_t *me, void *obj)
bbytes = (size_t) bytes;
zio_slin2alaw(buf, sizeof(buf), &bbytes);
fio_slin2alaw(buf, sizeof(buf), &bbytes);
if (ftdm_channel_write(ftdmchan, buf, sizeof(buf), &bbytes) != FTDM_SUCCESS) {
break;
......@@ -55,7 +55,7 @@ static void *channel_run(ftdm_thread_t *me, void *obj)
return NULL;
}
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
ftdm_log(FTDM_LOG_DEBUG, "got sig %d:%d [%s]\n", sigmsg->channel->span_id, sigmsg->channel->chan_id, ftdm_signal_event2str(sigmsg->event_id));
......
......@@ -4,7 +4,7 @@
static int R = 0;
static ftdm_mutex_t *mutex = NULL;
static ZIO_SIGNAL_CB_FUNCTION(on_r2_signal)
static FIO_SIGNAL_CB_FUNCTION(on_r2_signal)
{
ftdm_log(FTDM_LOG_DEBUG, "Got R2 channel sig [%s] in channel\n", ftdm_signal_event2str(sigmsg->event_id), sigmsg->channel->physical_chan_id);
return FTDM_SUCCESS;
......
#include "freetdm.h"
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论