From 7b1da2316bc933d807a19812fe1e3b4354343f39 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 18 Feb 2011 13:21:05 -0500 Subject: [PATCH] freetdm: Updated signalling modules to not set channel state to DIALING on OUTGOING_CALL_FUNCTION --- .../freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c | 24 +++++++++++++++++-- .../src/ftmod/ftmod_libpri/ftmod_libpri.c | 3 +-- libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c | 3 --- .../ftmod_sangoma_ss7_main.c | 5 ++-- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c index 5b4ce7196a..f9674a5046 100644 --- a/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c +++ b/libs/freetdm/src/ftmod/ftmod_isdn/ftmod_isdn.c @@ -287,7 +287,6 @@ static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call) { ftdm_status_t status = FTDM_SUCCESS; ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND); - ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DIALING); return status; } @@ -300,7 +299,14 @@ static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call) #ifdef __TODO__ static FIO_CHANNEL_REQUEST_FUNCTION(isdn_channel_request) { +#if 1 /* FIXME caller_data.raw_data does not exist anymore, see docs/variables.txt for more info */ + Q931mes_Generic empty_gen; + Q931mes_Generic *gen = &empty_gen; + + memset(&empty_gen, 0, sizeof(empty_gen)) ; +#else Q931mes_Generic *gen = (Q931mes_Generic *) caller_data->raw_data; +#endif Q931ie_BearerCap BearerCap; Q931ie_ChanID ChanID = { 0 }; Q931ie_CallingNum CallingNum; @@ -1095,12 +1101,16 @@ static L3INT ftdm_isdn_931_34(void *pvt, struct Q931_Call *call, Q931mes_Generic #ifdef __TODO_OR_REMOVE__ ftdmchan->caller_data.CRV = gen->CRV; #endif +#if 0 /* FIXME */ if (cplen > sizeof(caller_data->raw_data)) { cplen = sizeof(caller_data->raw_data); } +#endif gen->CRVFlag = !(gen->CRVFlag); +#if 0 /* FIXME */ memcpy(caller_data->raw_data, msg, cplen); caller_data->raw_data_len = cplen; +#endif fail = 0; } } @@ -1298,12 +1308,20 @@ static int ftdm_isdn_921_21(void *pvt, L2UCHAR *msg, L2INT mlen) static __inline__ void state_advance(ftdm_channel_t *ftdmchan) { - Q931mes_Generic *gen = (Q931mes_Generic *) ftdmchan->caller_data.raw_data; ftdm_isdn_data_t *isdn_data = ftdmchan->span->signal_data; ftdm_span_t *span = ftdm_channel_get_span(ftdmchan); ftdm_sigmsg_t sig; ftdm_status_t status; +#if 1 /* FIXME caller_data.raw_data does not exist anymore, see docs/variables.txt for more info */ + Q931mes_Generic empty_gen; + Q931mes_Generic *gen = &empty_gen; + + memset(&empty_gen, 0, sizeof(empty_gen)) ; +#else + Q931mes_Generic *gen = (Q931mes_Generic *) ftdmchan->caller_data.raw_data; +#endif + ftdm_log(FTDM_LOG_DEBUG, "%d:%d STATE [%s]\n", ftdm_channel_get_span_id(ftdmchan), ftdm_channel_get_id(ftdmchan), @@ -1431,7 +1449,9 @@ static __inline__ void state_advance(ftdm_channel_t *ftdmchan) gen->MesType = Q931mes_CONNECT; gen->BearerCap = 0; gen->CRVFlag = 1; /* inbound call */ +#if 0 /* FIXME */ Q931Rx43(&isdn_data->q931, gen, ftdmchan->caller_data.raw_data_len); +#endif } } break; diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index 2f9c70a48d..5f0ae716e1 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -94,8 +94,7 @@ static FIO_SPAN_GET_SIG_STATUS_FUNCTION(isdn_get_span_sig_status) static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(isdn_outgoing_call) { ftdm_status_t status = FTDM_SUCCESS; - ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND); - ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_DIALING); + ftdm_set_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND); return status; } diff --git a/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c b/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c index 540d7cb6e9..eb7df35ba0 100644 --- a/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c +++ b/libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c @@ -471,12 +471,9 @@ static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(r2_outgoing_call) return FTDM_FAIL; } - ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_DIALING); - ftdm_channel_set_feature(ftdmchan, FTDM_CHANNEL_FEATURE_IO_STATS); ftdm_channel_command(ftdmchan, FTDM_COMMAND_FLUSH_TX_BUFFERS, NULL); ftdm_channel_command(ftdmchan, FTDM_COMMAND_FLUSH_RX_BUFFERS, NULL); - return FTDM_SUCCESS; } diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c index 48579ada85..976d43f3d6 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c @@ -1272,9 +1272,8 @@ static FIO_CHANNEL_OUTGOING_CALL_FUNCTION(ftdm_sangoma_ss7_outgoing_call) switch (ftdmchan->state){ /**************************************************************************/ case FTDM_CHANNEL_STATE_DOWN: - /* inform the monitor thread that we want to make a call */ - ftdm_set_state_locked (ftdmchan, FTDM_CHANNEL_STATE_DIALING); - + /* inform the monitor thread that we want to make a call by returning FTDM_SUCCESS */ + /* unlock the channel */ ftdm_mutex_unlock (ftdmchan->mutex);