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 2010-01-15 20:35:11 +00:00
parent a5bd5142da
commit a8ddece1b6
29 changed files with 372 additions and 372 deletions

View File

@ -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;

View File

@ -311,9 +311,9 @@ static ftdm_status_t ftdm_channel_destroy(ftdm_channel_t *ftdmchan)
}
if (ftdmchan->span->zio->channel_destroy) {
if (ftdmchan->span->fio->channel_destroy) {
ftdm_log(FTDM_LOG_INFO, "Closing channel %s:%u:%u fd:%d\n", ftdmchan->span->type, ftdmchan->span_id, ftdmchan->chan_id, ftdmchan->sockfd);
if (ftdmchan->span->zio->channel_destroy(ftdmchan) == FTDM_SUCCESS) {
if (ftdmchan->span->fio->channel_destroy(ftdmchan) == FTDM_SUCCESS) {
ftdm_clear_flag_locked(ftdmchan, FTDM_CHANNEL_CONFIGURED);
} else {
ftdm_log(FTDM_LOG_ERROR, "Error Closing channel %u:%u fd:%d\n", ftdmchan->span_id, ftdmchan->chan_id, ftdmchan->sockfd);
@ -353,9 +353,9 @@ static ftdm_status_t ftdm_span_destroy(ftdm_span_t *span)
}
/* destroy the I/O for the span */
if (span->zio && span->zio->span_destroy) {
if (span->fio && span->fio->span_destroy) {
ftdm_log(FTDM_LOG_INFO, "Destroying span %u type (%s)\n", span->span_id, span->type);
if (span->zio->span_destroy(span) != FTDM_SUCCESS) {
if (span->fio->span_destroy(span) != FTDM_SUCCESS) {
status = FTDM_FAIL;
}
ftdm_safe_free(span->type);
@ -375,8 +375,8 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_get_alarms(ftdm_channel_t *ftdmchan)
ftdm_status_t status = FTDM_FAIL;
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_CONFIGURED)) {
if (ftdmchan->span->zio->get_alarms) {
if ((status = ftdmchan->span->zio->get_alarms(ftdmchan)) == FTDM_SUCCESS) {
if (ftdmchan->span->fio->get_alarms) {
if ((status = ftdmchan->span->fio->get_alarms(ftdmchan)) == FTDM_SUCCESS) {
*ftdmchan->last_error = '\0';
if (ftdm_test_alarm_flag(ftdmchan, FTDM_ALARM_RED)) {
snprintf(ftdmchan->last_error + strlen(ftdmchan->last_error), sizeof(ftdmchan->last_error) - strlen(ftdmchan->last_error), "RED/");
@ -452,12 +452,12 @@ FT_DECLARE(ftdm_status_t) ftdm_span_stop(ftdm_span_t *span)
return FTDM_FAIL;
}
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)
{
ftdm_span_t *new_span = NULL;
ftdm_status_t status = FTDM_FAIL;
assert(zio != NULL);
assert(fio != NULL);
ftdm_mutex_lock(globals.mutex);
@ -470,7 +470,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_create(ftdm_io_interface_t *zio, ftdm_span_t
ftdm_set_flag(new_span, FTDM_SPAN_CONFIGURED);
new_span->span_id = ++globals.span_index;
new_span->zio = zio;
new_span->fio = fio;
ftdm_copy_string(new_span->tone_map[FTDM_TONEMAP_DIAL], "%(1000,0,350,440)", FTDM_TONEMAP_LEN);
ftdm_copy_string(new_span->tone_map[FTDM_TONEMAP_RING], "%(2000,4000,440,480)", FTDM_TONEMAP_LEN);
ftdm_copy_string(new_span->tone_map[FTDM_TONEMAP_BUSY], "%(500,500,480,620)", FTDM_TONEMAP_LEN);
@ -650,7 +650,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_add_channel(ftdm_span_t *span, ftdm_socket_t
new_chan->type = type;
new_chan->sockfd = sockfd;
new_chan->zio = span->zio;
new_chan->fio = span->fio;
new_chan->span_id = span->span_id;
new_chan->chan_id = span->chan_count;
new_chan->span = span;
@ -737,7 +737,7 @@ FT_DECLARE(ftdm_status_t) ftdm_span_find(uint32_t id, ftdm_span_t **span)
}
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)
{
ftdm_mutex_lock(span->mutex);
span->event_callback = event_callback;
@ -748,12 +748,12 @@ FT_DECLARE(ftdm_status_t) ftdm_span_set_event_callback(ftdm_span_t *span, zio_ev
FT_DECLARE(ftdm_status_t) ftdm_span_poll_event(ftdm_span_t *span, uint32_t ms)
{
assert(span->zio != NULL);
assert(span->fio != NULL);
if (span->zio->poll_event) {
return span->zio->poll_event(span, ms);
if (span->fio->poll_event) {
return span->fio->poll_event(span, ms);
} else {
ftdm_log(FTDM_LOG_ERROR, "poll_event method not implemented in module %s!", span->zio->name);
ftdm_log(FTDM_LOG_ERROR, "poll_event method not implemented in module %s!", span->fio->name);
}
return FTDM_NOTIMPL;
@ -761,12 +761,12 @@ 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)
{
assert(span->zio != NULL);
assert(span->fio != NULL);
if (span->zio->next_event) {
return span->zio->next_event(span, event);
if (span->fio->next_event) {
return span->fio->next_event(span, event);
} else {
ftdm_log(FTDM_LOG_ERROR, "next_event method not implemented in module %s!", span->zio->name);
ftdm_log(FTDM_LOG_ERROR, "next_event method not implemented in module %s!", span->fio->name);
}
return FTDM_NOTIMPL;
@ -802,7 +802,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_send_fsk_data(ftdm_channel_t *ftdmchan, f
}
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)
{
ftdm_mutex_lock(ftdmchan->mutex);
ftdmchan->event_callback = event_callback;
@ -1153,7 +1153,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_group(uint32_t group_id, ftdm_dir
break;
}
status = check->zio->open(check);
status = check->fio->open(check);
if (status == FTDM_SUCCESS) {
ftdm_set_flag(check, FTDM_CHANNEL_INUSE);
@ -1271,7 +1271,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_span(uint32_t span_id, ftdm_direc
break;
}
status = check->zio->open(check);
status = check->fio->open(check);
if (status == FTDM_SUCCESS) {
ftdm_set_flag(check, FTDM_CHANNEL_INUSE);
@ -1365,7 +1365,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_chan(ftdm_channel_t *ftdmchan)
status = FTDM_FAIL;
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_READY)) {
status = ftdmchan->span->zio->open(ftdmchan);
status = ftdmchan->span->fio->open(ftdmchan);
if (status == FTDM_SUCCESS) {
ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OPEN | FTDM_CHANNEL_INUSE);
}
@ -1415,7 +1415,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open(uint32_t span_id, uint32_t chan_id,
if (ftdm_test_flag(check, FTDM_CHANNEL_READY) && (!ftdm_test_flag(check, FTDM_CHANNEL_INUSE) ||
(check->type == FTDM_CHAN_TYPE_FXS && check->token_count == 1))) {
if (!ftdm_test_flag(check, FTDM_CHANNEL_OPEN)) {
status = check->zio->open(check);
status = check->fio->open(check);
if (status == FTDM_SUCCESS) {
ftdm_set_flag(check, FTDM_CHANNEL_OPEN);
}
@ -1571,7 +1571,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_close(ftdm_channel_t **ftdmchan)
if (ftdm_test_flag(check, FTDM_CHANNEL_CONFIGURED)) {
ftdm_mutex_lock(check->mutex);
if (ftdm_test_flag(check, FTDM_CHANNEL_OPEN)) {
status = check->zio->close(check);
status = check->fio->close(check);
if (status == FTDM_SUCCESS) {
ftdm_clear_flag(check, FTDM_CHANNEL_INUSE);
ftdm_channel_reset(check);
@ -1623,7 +1623,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_command(ftdm_channel_t *ftdmchan, ftdm_co
ftdm_status_t status = FTDM_FAIL;
assert(ftdmchan != NULL);
assert(ftdmchan->zio != NULL);
assert(ftdmchan->fio != NULL);
ftdm_mutex_lock(ftdmchan->mutex);
@ -1930,13 +1930,13 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_command(ftdm_channel_t *ftdmchan, ftdm_co
break;
}
if (!ftdmchan->zio->command) {
if (!ftdmchan->fio->command) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "method not implemented");
ftdm_log(FTDM_LOG_ERROR, "no command function defined by the I/O freetdm module!\n");
GOTO_STATUS(done, FTDM_FAIL);
}
status = ftdmchan->zio->command(ftdmchan, command, obj);
status = ftdmchan->fio->command(ftdmchan, command, obj);
if (status == FTDM_NOTIMPL) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "I/O command %d not implemented in backend", command);
@ -1951,24 +1951,24 @@ done:
FT_DECLARE(ftdm_status_t) ftdm_channel_wait(ftdm_channel_t *ftdmchan, ftdm_wait_flag_t *flags, int32_t to)
{
assert(ftdmchan != NULL);
assert(ftdmchan->zio != NULL);
assert(ftdmchan->fio != NULL);
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OPEN)) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "channel not open");
return FTDM_FAIL;
}
if (!ftdmchan->zio->wait) {
if (!ftdmchan->fio->wait) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "method not implemented");
return FTDM_FAIL;
}
return ftdmchan->zio->wait(ftdmchan, flags, to);
return ftdmchan->fio->wait(ftdmchan, flags, to);
}
/*******************************/
ZIO_CODEC_FUNCTION(zio_slin2ulaw)
FIO_CODEC_FUNCTION(fio_slin2ulaw)
{
int16_t sln_buf[512] = {0}, *sln = sln_buf;
uint8_t *lp = data;
@ -1992,7 +1992,7 @@ ZIO_CODEC_FUNCTION(zio_slin2ulaw)
}
ZIO_CODEC_FUNCTION(zio_ulaw2slin)
FIO_CODEC_FUNCTION(fio_ulaw2slin)
{
int16_t *sln = data;
uint8_t law[1024] = {0}, *lp = law;
@ -2014,7 +2014,7 @@ ZIO_CODEC_FUNCTION(zio_ulaw2slin)
return FTDM_SUCCESS;
}
ZIO_CODEC_FUNCTION(zio_slin2alaw)
FIO_CODEC_FUNCTION(fio_slin2alaw)
{
int16_t sln_buf[512] = {0}, *sln = sln_buf;
uint8_t *lp = data;
@ -2038,7 +2038,7 @@ ZIO_CODEC_FUNCTION(zio_slin2alaw)
}
ZIO_CODEC_FUNCTION(zio_alaw2slin)
FIO_CODEC_FUNCTION(fio_alaw2slin)
{
int16_t *sln = data;
uint8_t law[1024] = {0}, *lp = law;
@ -2060,7 +2060,7 @@ ZIO_CODEC_FUNCTION(zio_alaw2slin)
return FTDM_SUCCESS;
}
ZIO_CODEC_FUNCTION(zio_ulaw2alaw)
FIO_CODEC_FUNCTION(fio_ulaw2alaw)
{
ftdm_size_t len = *datalen;
uint32_t i;
@ -2078,7 +2078,7 @@ ZIO_CODEC_FUNCTION(zio_ulaw2alaw)
return FTDM_SUCCESS;
}
ZIO_CODEC_FUNCTION(zio_alaw2ulaw)
FIO_CODEC_FUNCTION(fio_alaw2ulaw)
{
ftdm_size_t len = *datalen;
uint32_t i;
@ -2263,13 +2263,13 @@ static ftdm_status_t handle_dtmf(ftdm_channel_t *ftdmchan, ftdm_size_t datalen)
if (ftdmchan->native_codec != FTDM_CODEC_SLIN) {
if (ftdmchan->native_codec == FTDM_CODEC_ULAW) {
zio_slin2ulaw(auxbuf, max, &dlen);
fio_slin2ulaw(auxbuf, max, &dlen);
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW) {
zio_slin2alaw(auxbuf, max, &dlen);
fio_slin2alaw(auxbuf, max, &dlen);
}
}
return ftdmchan->zio->write(ftdmchan, auxbuf, &dlen);
return ftdmchan->fio->write(ftdmchan, auxbuf, &dlen);
}
return FTDM_SUCCESS;
@ -2303,24 +2303,24 @@ FT_DECLARE(void) ftdm_generate_sln_silence(int16_t *data, uint32_t samples, uint
FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data, ftdm_size_t *datalen)
{
ftdm_status_t status = FTDM_FAIL;
zio_codec_t codec_func = NULL;
fio_codec_t codec_func = NULL;
ftdm_size_t max = *datalen;
unsigned i = 0;
assert(ftdmchan != NULL);
assert(ftdmchan->zio != NULL);
assert(ftdmchan->fio != NULL);
if (!ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OPEN)) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "channel not open");
return FTDM_FAIL;
}
if (!ftdmchan->zio->read) {
if (!ftdmchan->fio->read) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "method not implemented");
return FTDM_FAIL;
}
status = ftdmchan->zio->read(ftdmchan, data, datalen);
status = ftdmchan->fio->read(ftdmchan, data, datalen);
if (ftdmchan->fds[0] > -1) {
int dlen = (int) *datalen;
if (write(ftdmchan->fds[0], data, dlen) != dlen) {
@ -2342,13 +2342,13 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
if (status == FTDM_SUCCESS && ftdm_test_flag(ftdmchan, FTDM_CHANNEL_TRANSCODE) && ftdmchan->effective_codec != ftdmchan->native_codec) {
if (ftdmchan->native_codec == FTDM_CODEC_ULAW && ftdmchan->effective_codec == FTDM_CODEC_SLIN) {
codec_func = zio_ulaw2slin;
codec_func = fio_ulaw2slin;
} else if (ftdmchan->native_codec == FTDM_CODEC_ULAW && ftdmchan->effective_codec == FTDM_CODEC_ALAW) {
codec_func = zio_ulaw2alaw;
codec_func = fio_ulaw2alaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW && ftdmchan->effective_codec == FTDM_CODEC_SLIN) {
codec_func = zio_alaw2slin;
codec_func = fio_alaw2slin;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW && ftdmchan->effective_codec == FTDM_CODEC_ULAW) {
codec_func = zio_alaw2ulaw;
codec_func = fio_alaw2ulaw;
}
if (codec_func) {
@ -2469,7 +2469,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
teletone_dtmf_get(&ftdmchan->dtmf_detect, digit_str, sizeof(digit_str));
if(*digit_str) {
zio_event_cb_t event_callback = NULL;
fio_event_cb_t event_callback = NULL;
if (ftdmchan->state == FTDM_CHANNEL_STATE_CALLWAITING && (*digit_str == 'D' || *digit_str == 'A')) {
ftdmchan->detected_tones[FTDM_TONEMAP_CALLWAITING_ACK]++;
@ -2533,12 +2533,12 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
FT_DECLARE(ftdm_status_t) ftdm_channel_write(ftdm_channel_t *ftdmchan, void *data, ftdm_size_t datasize, ftdm_size_t *datalen)
{
ftdm_status_t status = FTDM_FAIL;
zio_codec_t codec_func = NULL;
fio_codec_t codec_func = NULL;
ftdm_size_t max = datasize;
unsigned int i = 0;
assert(ftdmchan != NULL);
assert(ftdmchan->zio != NULL);
assert(ftdmchan->fio != NULL);
if (!ftdmchan->buffer_delay &&
((ftdmchan->dtmf_buffer && ftdm_buffer_inuse(ftdmchan->dtmf_buffer)) ||
@ -2553,20 +2553,20 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_write(ftdm_channel_t *ftdmchan, void *dat
return FTDM_FAIL;
}
if (!ftdmchan->zio->write) {
if (!ftdmchan->fio->write) {
snprintf(ftdmchan->last_error, sizeof(ftdmchan->last_error), "method not implemented");
return FTDM_FAIL;
}
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_TRANSCODE) && ftdmchan->effective_codec != ftdmchan->native_codec) {
if (ftdmchan->native_codec == FTDM_CODEC_ULAW && ftdmchan->effective_codec == FTDM_CODEC_SLIN) {
codec_func = zio_slin2ulaw;
codec_func = fio_slin2ulaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ULAW && ftdmchan->effective_codec == FTDM_CODEC_ALAW) {
codec_func = zio_alaw2ulaw;
codec_func = fio_alaw2ulaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW && ftdmchan->effective_codec == FTDM_CODEC_SLIN) {
codec_func = zio_slin2alaw;
codec_func = fio_slin2alaw;
} else if (ftdmchan->native_codec == FTDM_CODEC_ALAW && ftdmchan->effective_codec == FTDM_CODEC_ULAW) {
codec_func = zio_ulaw2alaw;
codec_func = fio_ulaw2alaw;
}
if (codec_func) {
@ -2592,7 +2592,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_write(ftdm_channel_t *ftdmchan, void *dat
wdata[i] = ftdmchan->txgain_table[wdata[i]];
}
}
status = ftdmchan->zio->write(ftdmchan, data, datalen);
status = ftdmchan->fio->write(ftdmchan, data, datalen);
return status;
}
@ -2644,7 +2644,7 @@ static struct {
FT_DECLARE(char *) ftdm_api_execute(const char *type, const char *cmd)
{
ftdm_io_interface_t *zio = NULL;
ftdm_io_interface_t *fio = NULL;
char *dup = NULL, *p;
char *rval = NULL;
@ -2659,19 +2659,19 @@ FT_DECLARE(char *) ftdm_api_execute(const char *type, const char *cmd)
}
ftdm_mutex_lock(globals.mutex);
if (!(zio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, (void *)type))) {
if (!(fio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, (void *)type))) {
ftdm_load_module_assume(type);
if ((zio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, (void *)type))) {
if ((fio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, (void *)type))) {
ftdm_log(FTDM_LOG_INFO, "auto-loaded '%s'\n", type);
}
}
ftdm_mutex_unlock(globals.mutex);
if (zio && zio->api) {
if (fio && fio->api) {
ftdm_stream_handle_t stream = { 0 };
ftdm_status_t status;
FTDM_STANDARD_STREAM(stream);
status = zio->api(&stream, cmd);
status = fio->api(&stream, cmd);
if (status != FTDM_SUCCESS) {
ftdm_safe_free(stream.data);
@ -2697,7 +2697,7 @@ static ftdm_status_t load_config(void)
char name[80] = "";
char number[25] = "";
char group_name[80] = "default";
ftdm_io_interface_t *zio = NULL;
ftdm_io_interface_t *fio = NULL;
ftdm_analog_start_type_t tmp;
ftdm_size_t len = 0;
@ -2734,27 +2734,27 @@ static ftdm_status_t load_config(void)
}
ftdm_mutex_lock(globals.mutex);
if (!(zio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, type))) {
if (!(fio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, type))) {
ftdm_load_module_assume(type);
if ((zio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, type))) {
if ((fio = (ftdm_io_interface_t *) hashtable_search(globals.interface_hash, type))) {
ftdm_log(FTDM_LOG_INFO, "auto-loaded '%s'\n", type);
}
}
ftdm_mutex_unlock(globals.mutex);
if (!zio) {
if (!fio) {
ftdm_log(FTDM_LOG_CRIT, "failure creating span, no such type '%s'\n", type);
span = NULL;
continue;
}
if (!zio->configure_span) {
if (!fio->configure_span) {
ftdm_log(FTDM_LOG_CRIT, "failure creating span, no configure_span method for '%s'\n", type);
span = NULL;
continue;
}
if (ftdm_span_create(zio, &span, name) == FTDM_SUCCESS) {
if (ftdm_span_create(fio, &span, name) == FTDM_SUCCESS) {
span->type = ftdm_strdup(type);
d = 0;
@ -2804,7 +2804,7 @@ static ftdm_status_t load_config(void)
ftdm_analog_start_type2str(span->start_type));
}
if (span->trunk_type == FTDM_TRUNK_FXO) {
configured += zio->configure_span(span, val, FTDM_CHAN_TYPE_FXO, name, number);
configured += fio->configure_span(span, val, FTDM_CHAN_TYPE_FXO, name, number);
} else {
ftdm_log(FTDM_LOG_WARNING, "Cannot add FXO channels to an FXS trunk!\n");
}
@ -2815,7 +2815,7 @@ static ftdm_status_t load_config(void)
ftdm_analog_start_type2str(span->start_type));
}
if (span->trunk_type == FTDM_TRUNK_FXS) {
configured += zio->configure_span(span, val, FTDM_CHAN_TYPE_FXS, name, number);
configured += fio->configure_span(span, val, FTDM_CHAN_TYPE_FXS, name, number);
} else {
ftdm_log(FTDM_LOG_WARNING, "Cannot add FXS channels to an FXO trunk!\n");
}
@ -2826,12 +2826,12 @@ static ftdm_status_t load_config(void)
ftdm_analog_start_type2str(span->start_type));
}
if (span->trunk_type == FTDM_TRUNK_EM) {
configured += zio->configure_span(span, val, FTDM_CHAN_TYPE_EM, name, number);
configured += fio->configure_span(span, val, FTDM_CHAN_TYPE_EM, name, number);
} else {
ftdm_log(FTDM_LOG_WARNING, "Cannot add EM channels to a non-EM trunk!\n");
}
} else if (!strcasecmp(var, "b-channel")) {
configured += zio->configure_span(span, val, FTDM_CHAN_TYPE_B, name, number);
configured += fio->configure_span(span, val, FTDM_CHAN_TYPE_B, name, number);
ftdm_group_add_channels(group_name, span, val);
} else if (!strcasecmp(var, "d-channel")) {
if (d) {
@ -2844,11 +2844,11 @@ static ftdm_status_t load_config(void)
} else {
qtype = FTDM_CHAN_TYPE_DQ921;
}
configured += zio->configure_span(span, val, qtype, name, number);
configured += fio->configure_span(span, val, qtype, name, number);
d++;
}
} else if (!strcasecmp(var, "cas-channel")) {
configured += zio->configure_span(span, val, FTDM_CHAN_TYPE_CAS, name, number);
configured += fio->configure_span(span, val, FTDM_CHAN_TYPE_CAS, name, number);
} else if (!strcasecmp(var, "dtmf_hangup")) {
span->dtmf_hangup = ftdm_strdup(val);
span->dtmf_hangup_len = strlen(val);
@ -2874,18 +2874,18 @@ static ftdm_status_t load_config(void)
return configured ? FTDM_SUCCESS : FTDM_FAIL;
}
static ftdm_status_t process_module_config(ftdm_io_interface_t *zio)
static ftdm_status_t process_module_config(ftdm_io_interface_t *fio)
{
ftdm_config_t cfg;
char *var, *val;
char filename[256] = "";
ftdm_assert_return(zio != NULL, FTDM_FAIL, "zio argument is null\n");
ftdm_assert_return(fio != NULL, FTDM_FAIL, "fio argument is null\n");
snprintf(filename, sizeof(filename), "%s.conf", zio->name);
snprintf(filename, sizeof(filename), "%s.conf", fio->name);
if (!zio->configure) {
ftdm_log(FTDM_LOG_DEBUG, "Module %s does not support configuration.\n", zio->name);
if (!fio->configure) {
ftdm_log(FTDM_LOG_DEBUG, "Module %s does not support configuration.\n", fio->name);
return FTDM_FAIL;
}
@ -2895,7 +2895,7 @@ static ftdm_status_t process_module_config(ftdm_io_interface_t *zio)
}
while (ftdm_config_next_pair(&cfg, &var, &val)) {
zio->configure(cfg.category, var, val, cfg.lineno);
fio->configure(cfg.category, var, val, cfg.lineno);
}
ftdm_config_close_file(&cfg);
@ -3085,7 +3085,7 @@ FT_DECLARE(ftdm_status_t) ftdm_unload_modules(void)
return FTDM_SUCCESS;
}
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(const char *type, ftdm_span_t *span, fio_signal_cb_t sig_cb, ...)
{
ftdm_module_t *mod = (ftdm_module_t *) hashtable_search(globals.module_hash, (void *)type);
ftdm_status_t status = FTDM_FAIL;
@ -3110,7 +3110,7 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span(const char *type, ftdm_span_t *spa
return status;
}
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_signaling(const char *type, ftdm_span_t *span, fio_signal_cb_t sig_cb, ftdm_conf_parameter_t *parameters)
{
ftdm_module_t *mod = (ftdm_module_t *) hashtable_search(globals.module_hash, (void *)type);
ftdm_status_t status = FTDM_FAIL;

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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};

View File

@ -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};

View File

@ -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;

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;

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;

View File

@ -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;

View File

@ -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) \

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;
}

View File

@ -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;

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));

View File

@ -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)

View File

@ -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;
*/

View File

@ -471,106 +471,106 @@ typedef struct ftdm_stream_handle ftdm_stream_handle_t;
typedef ftdm_status_t (*ftdm_stream_handle_raw_write_function_t) (ftdm_stream_handle_t *handle, uint8_t *data, ftdm_size_t datalen);
typedef ftdm_status_t (*ftdm_stream_handle_write_function_t) (ftdm_stream_handle_t *handle, const char *fmt, ...);
#define ZIO_CHANNEL_REQUEST_ARGS (ftdm_span_t *span, uint32_t chan_id, ftdm_direction_t direction, ftdm_caller_data_t *caller_data, ftdm_channel_t **ftdmchan)
#define ZIO_CHANNEL_OUTGOING_CALL_ARGS (ftdm_channel_t *ftdmchan)
#define ZIO_CHANNEL_SET_SIG_STATUS_ARGS (ftdm_channel_t *ftdmchan, ftdm_signaling_status_t status)
#define ZIO_CHANNEL_GET_SIG_STATUS_ARGS (ftdm_channel_t *ftdmchan, ftdm_signaling_status_t *status)
#define ZIO_SPAN_SET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t status)
#define ZIO_SPAN_GET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t *status)
#define ZIO_SPAN_POLL_EVENT_ARGS (ftdm_span_t *span, uint32_t ms)
#define ZIO_SPAN_NEXT_EVENT_ARGS (ftdm_span_t *span, ftdm_event_t **event)
#define ZIO_SIGNAL_CB_ARGS (ftdm_sigmsg_t *sigmsg)
#define ZIO_EVENT_CB_ARGS (ftdm_channel_t *ftdmchan, ftdm_event_t *event)
#define ZIO_CODEC_ARGS (void *data, ftdm_size_t max, ftdm_size_t *datalen)
#define ZIO_CONFIGURE_SPAN_ARGS (ftdm_span_t *span, const char *str, ftdm_chan_type_t type, char *name, char *number)
#define ZIO_CONFIGURE_ARGS (const char *category, const char *var, const char *val, int lineno)
#define ZIO_OPEN_ARGS (ftdm_channel_t *ftdmchan)
#define ZIO_CLOSE_ARGS (ftdm_channel_t *ftdmchan)
#define ZIO_CHANNEL_DESTROY_ARGS (ftdm_channel_t *ftdmchan)
#define ZIO_SPAN_DESTROY_ARGS (ftdm_span_t *span)
#define ZIO_COMMAND_ARGS (ftdm_channel_t *ftdmchan, ftdm_command_t command, void *obj)
#define ZIO_WAIT_ARGS (ftdm_channel_t *ftdmchan, ftdm_wait_flag_t *flags, int32_t to)
#define ZIO_GET_ALARMS_ARGS (ftdm_channel_t *ftdmchan)
#define ZIO_READ_ARGS (ftdm_channel_t *ftdmchan, void *data, ftdm_size_t *datalen)
#define ZIO_WRITE_ARGS (ftdm_channel_t *ftdmchan, void *data, ftdm_size_t *datalen)
#define ZIO_IO_LOAD_ARGS (ftdm_io_interface_t **zio)
#define ZIO_IO_UNLOAD_ARGS (void)
#define ZIO_SIG_LOAD_ARGS (void)
#define ZIO_SIG_CONFIGURE_ARGS (ftdm_span_t *span, zio_signal_cb_t sig_cb, va_list ap)
#define ZIO_CONFIGURE_SPAN_SIGNALING_ARGS (ftdm_span_t *span, zio_signal_cb_t sig_cb, ftdm_conf_parameter_t *ftdm_parameters)
#define ZIO_SIG_UNLOAD_ARGS (void)
#define ZIO_API_ARGS (ftdm_stream_handle_t *stream, const char *data)
#define FIO_CHANNEL_REQUEST_ARGS (ftdm_span_t *span, uint32_t chan_id, ftdm_direction_t direction, ftdm_caller_data_t *caller_data, ftdm_channel_t **ftdmchan)
#define FIO_CHANNEL_OUTGOING_CALL_ARGS (ftdm_channel_t *ftdmchan)
#define FIO_CHANNEL_SET_SIG_STATUS_ARGS (ftdm_channel_t *ftdmchan, ftdm_signaling_status_t status)
#define FIO_CHANNEL_GET_SIG_STATUS_ARGS (ftdm_channel_t *ftdmchan, ftdm_signaling_status_t *status)
#define FIO_SPAN_SET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t status)
#define FIO_SPAN_GET_SIG_STATUS_ARGS (ftdm_span_t *span, ftdm_signaling_status_t *status)
#define FIO_SPAN_POLL_EVENT_ARGS (ftdm_span_t *span, uint32_t ms)
#define FIO_SPAN_NEXT_EVENT_ARGS (ftdm_span_t *span, ftdm_event_t **event)
#define FIO_SIGNAL_CB_ARGS (ftdm_sigmsg_t *sigmsg)
#define FIO_EVENT_CB_ARGS (ftdm_channel_t *ftdmchan, ftdm_event_t *event)
#define FIO_CODEC_ARGS (void *data, ftdm_size_t max, ftdm_size_t *datalen)
#define FIO_CONFIGURE_SPAN_ARGS (ftdm_span_t *span, const char *str, ftdm_chan_type_t type, char *name, char *number)
#define FIO_CONFIGURE_ARGS (const char *category, const char *var, const char *val, int lineno)
#define FIO_OPEN_ARGS (ftdm_channel_t *ftdmchan)
#define FIO_CLOSE_ARGS (ftdm_channel_t *ftdmchan)
#define FIO_CHANNEL_DESTROY_ARGS (ftdm_channel_t *ftdmchan)
#define FIO_SPAN_DESTROY_ARGS (ftdm_span_t *span)
#define FIO_COMMAND_ARGS (ftdm_channel_t *ftdmchan, ftdm_command_t command, void *obj)
#define FIO_WAIT_ARGS (ftdm_channel_t *ftdmchan, ftdm_wait_flag_t *flags, int32_t to)
#define FIO_GET_ALARMS_ARGS (ftdm_channel_t *ftdmchan)
#define FIO_READ_ARGS (ftdm_channel_t *ftdmchan, void *data, ftdm_size_t *datalen)
#define FIO_WRITE_ARGS (ftdm_channel_t *ftdmchan, void *data, ftdm_size_t *datalen)
#define FIO_IO_LOAD_ARGS (ftdm_io_interface_t **fio)
#define FIO_IO_UNLOAD_ARGS (void)
#define FIO_SIG_LOAD_ARGS (void)
#define FIO_SIG_CONFIGURE_ARGS (ftdm_span_t *span, fio_signal_cb_t sig_cb, va_list ap)
#define FIO_CONFIGURE_SPAN_SIGNALING_ARGS (ftdm_span_t *span, fio_signal_cb_t sig_cb, ftdm_conf_parameter_t *ftdm_parameters)
#define FIO_SIG_UNLOAD_ARGS (void)
#define FIO_API_ARGS (ftdm_stream_handle_t *stream, const char *data)
typedef ftdm_status_t (*zio_channel_request_t) ZIO_CHANNEL_REQUEST_ARGS ;
typedef ftdm_status_t (*zio_channel_outgoing_call_t) ZIO_CHANNEL_OUTGOING_CALL_ARGS ;
typedef ftdm_status_t (*zio_channel_set_sig_status_t) ZIO_CHANNEL_SET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*zio_channel_get_sig_status_t) ZIO_CHANNEL_GET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*zio_span_set_sig_status_t) ZIO_SPAN_SET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*zio_span_get_sig_status_t) ZIO_SPAN_GET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*zio_span_poll_event_t) ZIO_SPAN_POLL_EVENT_ARGS ;
typedef ftdm_status_t (*zio_span_next_event_t) ZIO_SPAN_NEXT_EVENT_ARGS ;
typedef ftdm_status_t (*zio_signal_cb_t) ZIO_SIGNAL_CB_ARGS ;
typedef ftdm_status_t (*zio_event_cb_t) ZIO_EVENT_CB_ARGS ;
typedef ftdm_status_t (*zio_codec_t) ZIO_CODEC_ARGS ;
typedef ftdm_status_t (*zio_configure_span_t) ZIO_CONFIGURE_SPAN_ARGS ;
typedef ftdm_status_t (*zio_configure_t) ZIO_CONFIGURE_ARGS ;
typedef ftdm_status_t (*zio_open_t) ZIO_OPEN_ARGS ;
typedef ftdm_status_t (*zio_close_t) ZIO_CLOSE_ARGS ;
typedef ftdm_status_t (*zio_channel_destroy_t) ZIO_CHANNEL_DESTROY_ARGS ;
typedef ftdm_status_t (*zio_span_destroy_t) ZIO_SPAN_DESTROY_ARGS ;
typedef ftdm_status_t (*zio_get_alarms_t) ZIO_GET_ALARMS_ARGS ;
typedef ftdm_status_t (*zio_command_t) ZIO_COMMAND_ARGS ;
typedef ftdm_status_t (*zio_wait_t) ZIO_WAIT_ARGS ;
typedef ftdm_status_t (*zio_read_t) ZIO_READ_ARGS ;
typedef ftdm_status_t (*zio_write_t) ZIO_WRITE_ARGS ;
typedef ftdm_status_t (*zio_io_load_t) ZIO_IO_LOAD_ARGS ;
typedef ftdm_status_t (*zio_sig_load_t) ZIO_SIG_LOAD_ARGS ;
typedef ftdm_status_t (*zio_sig_configure_t) ZIO_SIG_CONFIGURE_ARGS ;
typedef ftdm_status_t (*zio_configure_span_signaling_t) ZIO_CONFIGURE_SPAN_SIGNALING_ARGS ;
typedef ftdm_status_t (*zio_io_unload_t) ZIO_IO_UNLOAD_ARGS ;
typedef ftdm_status_t (*zio_sig_unload_t) ZIO_SIG_UNLOAD_ARGS ;
typedef ftdm_status_t (*zio_api_t) ZIO_API_ARGS ;
typedef ftdm_status_t (*fio_channel_request_t) FIO_CHANNEL_REQUEST_ARGS ;
typedef ftdm_status_t (*fio_channel_outgoing_call_t) FIO_CHANNEL_OUTGOING_CALL_ARGS ;
typedef ftdm_status_t (*fio_channel_set_sig_status_t) FIO_CHANNEL_SET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*fio_channel_get_sig_status_t) FIO_CHANNEL_GET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*fio_span_set_sig_status_t) FIO_SPAN_SET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*fio_span_get_sig_status_t) FIO_SPAN_GET_SIG_STATUS_ARGS;
typedef ftdm_status_t (*fio_span_poll_event_t) FIO_SPAN_POLL_EVENT_ARGS ;
typedef ftdm_status_t (*fio_span_next_event_t) FIO_SPAN_NEXT_EVENT_ARGS ;
typedef ftdm_status_t (*fio_signal_cb_t) FIO_SIGNAL_CB_ARGS ;
typedef ftdm_status_t (*fio_event_cb_t) FIO_EVENT_CB_ARGS ;
typedef ftdm_status_t (*fio_codec_t) FIO_CODEC_ARGS ;
typedef ftdm_status_t (*fio_configure_span_t) FIO_CONFIGURE_SPAN_ARGS ;
typedef ftdm_status_t (*fio_configure_t) FIO_CONFIGURE_ARGS ;
typedef ftdm_status_t (*fio_open_t) FIO_OPEN_ARGS ;
typedef ftdm_status_t (*fio_close_t) FIO_CLOSE_ARGS ;
typedef ftdm_status_t (*fio_channel_destroy_t) FIO_CHANNEL_DESTROY_ARGS ;
typedef ftdm_status_t (*fio_span_destroy_t) FIO_SPAN_DESTROY_ARGS ;
typedef ftdm_status_t (*fio_get_alarms_t) FIO_GET_ALARMS_ARGS ;
typedef ftdm_status_t (*fio_command_t) FIO_COMMAND_ARGS ;
typedef ftdm_status_t (*fio_wait_t) FIO_WAIT_ARGS ;
typedef ftdm_status_t (*fio_read_t) FIO_READ_ARGS ;
typedef ftdm_status_t (*fio_write_t) FIO_WRITE_ARGS ;
typedef ftdm_status_t (*fio_io_load_t) FIO_IO_LOAD_ARGS ;
typedef ftdm_status_t (*fio_sig_load_t) FIO_SIG_LOAD_ARGS ;
typedef ftdm_status_t (*fio_sig_configure_t) FIO_SIG_CONFIGURE_ARGS ;
typedef ftdm_status_t (*fio_configure_span_signaling_t) FIO_CONFIGURE_SPAN_SIGNALING_ARGS ;
typedef ftdm_status_t (*fio_io_unload_t) FIO_IO_UNLOAD_ARGS ;
typedef ftdm_status_t (*fio_sig_unload_t) FIO_SIG_UNLOAD_ARGS ;
typedef ftdm_status_t (*fio_api_t) FIO_API_ARGS ;
#define ZIO_CHANNEL_REQUEST_FUNCTION(name) ftdm_status_t name ZIO_CHANNEL_REQUEST_ARGS
#define ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(name) ftdm_status_t name ZIO_CHANNEL_OUTGOING_CALL_ARGS
#define ZIO_CHANNEL_SET_SIG_STATUS_FUNCTION(name) ftdm_status_t name ZIO_CHANNEL_SET_SIG_STATUS_ARGS
#define ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(name) ftdm_status_t name ZIO_CHANNEL_GET_SIG_STATUS_ARGS
#define ZIO_SPAN_SET_SIG_STATUS_FUNCTION(name) ftdm_status_t name ZIO_SPAN_SET_SIG_STATUS_ARGS
#define ZIO_SPAN_GET_SIG_STATUS_FUNCTION(name) ftdm_status_t name ZIO_SPAN_GET_SIG_STATUS_ARGS
#define ZIO_SPAN_POLL_EVENT_FUNCTION(name) ftdm_status_t name ZIO_SPAN_POLL_EVENT_ARGS
#define ZIO_SPAN_NEXT_EVENT_FUNCTION(name) ftdm_status_t name ZIO_SPAN_NEXT_EVENT_ARGS
#define ZIO_SIGNAL_CB_FUNCTION(name) ftdm_status_t name ZIO_SIGNAL_CB_ARGS
#define ZIO_EVENT_CB_FUNCTION(name) ftdm_status_t name ZIO_EVENT_CB_ARGS
#define ZIO_CODEC_FUNCTION(name) FT_DECLARE_NONSTD(ftdm_status_t) name ZIO_CODEC_ARGS
#define ZIO_CONFIGURE_SPAN_FUNCTION(name) ftdm_status_t name ZIO_CONFIGURE_SPAN_ARGS
#define ZIO_CONFIGURE_FUNCTION(name) ftdm_status_t name ZIO_CONFIGURE_ARGS
#define ZIO_OPEN_FUNCTION(name) ftdm_status_t name ZIO_OPEN_ARGS
#define ZIO_CLOSE_FUNCTION(name) ftdm_status_t name ZIO_CLOSE_ARGS
#define ZIO_CHANNEL_DESTROY_FUNCTION(name) ftdm_status_t name ZIO_CHANNEL_DESTROY_ARGS
#define ZIO_SPAN_DESTROY_FUNCTION(name) ftdm_status_t name ZIO_SPAN_DESTROY_ARGS
#define ZIO_GET_ALARMS_FUNCTION(name) ftdm_status_t name ZIO_GET_ALARMS_ARGS
#define ZIO_COMMAND_FUNCTION(name) ftdm_status_t name ZIO_COMMAND_ARGS
#define ZIO_WAIT_FUNCTION(name) ftdm_status_t name ZIO_WAIT_ARGS
#define ZIO_READ_FUNCTION(name) ftdm_status_t name ZIO_READ_ARGS
#define ZIO_WRITE_FUNCTION(name) ftdm_status_t name ZIO_WRITE_ARGS
#define ZIO_IO_LOAD_FUNCTION(name) ftdm_status_t name ZIO_IO_LOAD_ARGS
#define ZIO_SIG_LOAD_FUNCTION(name) ftdm_status_t name ZIO_SIG_LOAD_ARGS
#define ZIO_SIG_CONFIGURE_FUNCTION(name) ftdm_status_t name ZIO_SIG_CONFIGURE_ARGS
#define ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(name) ftdm_status_t name ZIO_CONFIGURE_SPAN_SIGNALING_ARGS
#define ZIO_IO_UNLOAD_FUNCTION(name) ftdm_status_t name ZIO_IO_UNLOAD_ARGS
#define ZIO_SIG_UNLOAD_FUNCTION(name) ftdm_status_t name ZIO_SIG_UNLOAD_ARGS
#define ZIO_API_FUNCTION(name) ftdm_status_t name ZIO_API_ARGS
#define FIO_CHANNEL_REQUEST_FUNCTION(name) ftdm_status_t name FIO_CHANNEL_REQUEST_ARGS
#define FIO_CHANNEL_OUTGOING_CALL_FUNCTION(name) ftdm_status_t name FIO_CHANNEL_OUTGOING_CALL_ARGS
#define FIO_CHANNEL_SET_SIG_STATUS_FUNCTION(name) ftdm_status_t name FIO_CHANNEL_SET_SIG_STATUS_ARGS
#define FIO_CHANNEL_GET_SIG_STATUS_FUNCTION(name) ftdm_status_t name FIO_CHANNEL_GET_SIG_STATUS_ARGS
#define FIO_SPAN_SET_SIG_STATUS_FUNCTION(name) ftdm_status_t name FIO_SPAN_SET_SIG_STATUS_ARGS
#define FIO_SPAN_GET_SIG_STATUS_FUNCTION(name) ftdm_status_t name FIO_SPAN_GET_SIG_STATUS_ARGS
#define FIO_SPAN_POLL_EVENT_FUNCTION(name) ftdm_status_t name FIO_SPAN_POLL_EVENT_ARGS
#define FIO_SPAN_NEXT_EVENT_FUNCTION(name) ftdm_status_t name FIO_SPAN_NEXT_EVENT_ARGS
#define FIO_SIGNAL_CB_FUNCTION(name) ftdm_status_t name FIO_SIGNAL_CB_ARGS
#define FIO_EVENT_CB_FUNCTION(name) ftdm_status_t name FIO_EVENT_CB_ARGS
#define FIO_CODEC_FUNCTION(name) FT_DECLARE_NONSTD(ftdm_status_t) name FIO_CODEC_ARGS
#define FIO_CONFIGURE_SPAN_FUNCTION(name) ftdm_status_t name FIO_CONFIGURE_SPAN_ARGS
#define FIO_CONFIGURE_FUNCTION(name) ftdm_status_t name FIO_CONFIGURE_ARGS
#define FIO_OPEN_FUNCTION(name) ftdm_status_t name FIO_OPEN_ARGS
#define FIO_CLOSE_FUNCTION(name) ftdm_status_t name FIO_CLOSE_ARGS
#define FIO_CHANNEL_DESTROY_FUNCTION(name) ftdm_status_t name FIO_CHANNEL_DESTROY_ARGS
#define FIO_SPAN_DESTROY_FUNCTION(name) ftdm_status_t name FIO_SPAN_DESTROY_ARGS
#define FIO_GET_ALARMS_FUNCTION(name) ftdm_status_t name FIO_GET_ALARMS_ARGS
#define FIO_COMMAND_FUNCTION(name) ftdm_status_t name FIO_COMMAND_ARGS
#define FIO_WAIT_FUNCTION(name) ftdm_status_t name FIO_WAIT_ARGS
#define FIO_READ_FUNCTION(name) ftdm_status_t name FIO_READ_ARGS
#define FIO_WRITE_FUNCTION(name) ftdm_status_t name FIO_WRITE_ARGS
#define FIO_IO_LOAD_FUNCTION(name) ftdm_status_t name FIO_IO_LOAD_ARGS
#define FIO_SIG_LOAD_FUNCTION(name) ftdm_status_t name FIO_SIG_LOAD_ARGS
#define FIO_SIG_CONFIGURE_FUNCTION(name) ftdm_status_t name FIO_SIG_CONFIGURE_ARGS
#define FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(name) ftdm_status_t name FIO_CONFIGURE_SPAN_SIGNALING_ARGS
#define FIO_IO_UNLOAD_FUNCTION(name) ftdm_status_t name FIO_IO_UNLOAD_ARGS
#define FIO_SIG_UNLOAD_FUNCTION(name) ftdm_status_t name FIO_SIG_UNLOAD_ARGS
#define FIO_API_FUNCTION(name) ftdm_status_t name FIO_API_ARGS
#include "ftdm_dso.h"
typedef struct {
char name[256];
zio_io_load_t io_load;
zio_io_unload_t io_unload;
zio_sig_load_t sig_load;
zio_sig_configure_t sig_configure;
zio_sig_unload_t sig_unload;
fio_io_load_t io_load;
fio_io_unload_t io_unload;
fio_sig_load_t sig_load;
fio_sig_configure_t sig_configure;
fio_sig_unload_t sig_unload;
/*!
\brief configure a given span signaling
\see sig_configure
@ -579,7 +579,7 @@ typedef struct {
I'd like to deprecate sig_configure and move
all modules to use sigparam_configure
*/
zio_configure_span_signaling_t configure_span_signaling;
fio_configure_span_signaling_t configure_span_signaling;
ftdm_dso_lib_t lib;
char path[256];
} ftdm_module_t;

View File

@ -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;

View File

@ -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));

View File

@ -1,6 +1,6 @@
#include "freetdm.h"
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}

View File

@ -2,7 +2,7 @@
#include <signal.h>
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}

View File

@ -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;
}

View File

@ -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));

View File

@ -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;

View File

@ -1,6 +1,6 @@
#include "freetdm.h"
static ZIO_SIGNAL_CB_FUNCTION(on_signal)
static FIO_SIGNAL_CB_FUNCTION(on_signal)
{
return FTDM_FAIL;
}