more freetdm changes

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@974 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva committed 2010-01-15 20:35:11 +00:00
1 parent a5bd5142da
commit a8ddece1b6
29 files changed
+372 -372

No files matched your search

@@ -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;
+18 -18
View File
@@ -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;
+10 -10
View File
@@ -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) \
+17 -17
View File
@@ -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;
+19 -19
View File
@@ -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));