From d4f512083f14b0ff7058df292a16424be758d3ac Mon Sep 17 00:00:00 2001 From: Arnaldo Pereira Date: Tue, 7 Dec 2010 13:58:44 -0200 Subject: [PATCH 1/4] freetdm: ftmod_r2 - added cast to properly malloc io dump buffer on win64 --- libs/freetdm/src/ftdm_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index 3b46394709..3e4cce676d 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -163,7 +163,7 @@ static ftdm_status_t start_chan_io_dump(ftdm_channel_t *chan, ftdm_io_dump_t *du return FTDM_FAIL; } memset(dump, 0, sizeof(*dump)); - dump->buffer = ftdm_malloc(size); + dump->buffer = ftdm_malloc((uint32_t)size); if (!dump->buffer) { return FTDM_FAIL; } @@ -2814,7 +2814,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_command(ftdm_channel_t *ftdmchan, ftdm_co GOTO_STATUS(done, FTDM_FAIL); } dump_chan_io_to_file(ftdmchan, &ftdmchan->rxdump, obj); - ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Dumped input of size %zd to file %p\n", ftdmchan->rxdump.size, obj); + ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Dumped input of size %d to file %p\n", ftdmchan->rxdump.size, obj); GOTO_STATUS(done, FTDM_SUCCESS); } break; From 5d288a9a4f3feee2eb2bcb536a6a131309d2c71d Mon Sep 17 00:00:00 2001 From: Arnaldo Pereira Date: Tue, 7 Dec 2010 14:18:38 -0200 Subject: [PATCH 2/4] freetdm: fix testsangomaboost compilation --- libs/freetdm/src/testsangomaboost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/freetdm/src/testsangomaboost.c b/libs/freetdm/src/testsangomaboost.c index 85b5332635..84ff287830 100644 --- a/libs/freetdm/src/testsangomaboost.c +++ b/libs/freetdm/src/testsangomaboost.c @@ -49,7 +49,9 @@ #include #include #ifdef __linux__ +#ifndef __USE_BSD #define __USE_BSD +#endif #include #endif #include "freetdm.h" From b4cb165115eec01a83cd2ce9c00cb1b8cefd5e20 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 7 Dec 2010 11:33:51 -0500 Subject: [PATCH 3/4] freetdm:Changes to transmit facilityStr in PROGRESS and ALERT messages --- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c | 8 ++++++-- .../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c index 08b14a08ce..752ac40641 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c @@ -341,6 +341,7 @@ void sngisdn_snd_progress(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ memset(&cnStEvnt, 0, sizeof(cnStEvnt)); set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind); + set_facility_ie(ftdmchan, &cnStEvnt.facilityStr); ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending PROGRESS (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces); if(sng_isdn_con_status(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId,&cnStEvnt, MI_PROGRESS, signal_data->dchan_id, sngisdn_info->ces)) { @@ -366,6 +367,7 @@ void sngisdn_snd_alert(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_ind memset(&cnStEvnt, 0, sizeof(cnStEvnt)); set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind); + set_facility_ie(ftdmchan, &cnStEvnt.facilityStr); ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending ALERT (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces); @@ -424,6 +426,7 @@ void sngisdn_snd_connect(ftdm_channel_t *ftdmchan) } set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind); + set_facility_ie(ftdmchan, &cnStEvnt.facilityStr); ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending CONNECT (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces); if (sng_isdn_con_response(signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, &cnStEvnt, signal_data->dchan_id, sngisdn_info->ces)) { @@ -522,7 +525,8 @@ void sngisdn_snd_disconnect(ftdm_channel_t *ftdmchan) memset(&discEvnt, 0, sizeof(discEvnt)); - /* Fill discEvnt here */ + /* Fill discEvnt here */ + /* TODO move this to set_cause_ie function */ discEvnt.causeDgn[0].eh.pres = PRSNT_NODEF; discEvnt.causeDgn[0].location.pres = PRSNT_NODEF; discEvnt.causeDgn[0].location.val = IN_LOC_PRIVNETLU; @@ -559,7 +563,7 @@ void sngisdn_snd_release(ftdm_channel_t *ftdmchan, uint8_t glare) memset(&relEvnt, 0, sizeof(relEvnt)); - /* Fill discEvnt here */ + /* Fill relEvnt here */ relEvnt.causeDgn[0].eh.pres = PRSNT_NODEF; relEvnt.causeDgn[0].location.pres = PRSNT_NODEF; relEvnt.causeDgn[0].location.val = IN_LOC_PRIVNETLU; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c index 42bcd1e20a..565781aa41 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c @@ -560,9 +560,8 @@ ftdm_status_t set_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr ftdm_status_t set_facility_ie_str(ftdm_channel_t *ftdmchan, uint8_t *data, ftdm_size_t *data_len) { ftdm_caller_data_t *caller_data = &ftdmchan->caller_data; - - if (caller_data->raw_data_len > 0 && caller_data->raw_data[0] == SNGISDN_Q931_FACILITY_IE_ID) { + if (caller_data->raw_data_len > 0 && caller_data->raw_data[0] == SNGISDN_Q931_FACILITY_IE_ID) { *data_len = caller_data->raw_data[1]; memcpy(data, &caller_data->raw_data[2], *data_len); return FTDM_SUCCESS; From a40f92674f8fc7c07d531c5d6d11688c4b2aec05 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 7 Dec 2010 11:42:36 -0500 Subject: [PATCH 4/4] Fix for compile error --- .../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c index 16b22a5da1..086354a993 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c @@ -328,8 +328,6 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event) sngisdn_chan_data_t *sngisdn_info = sngisdn_event->sngisdn_info; ftdm_channel_t *ftdmchan = sngisdn_info->ftdmchan; - sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data; - CnStEvnt *cnStEvnt = &sngisdn_event->event.cnStEvnt; ISDN_FUNC_TRACE_ENTER(__FUNCTION__);