From 689375a37c099bfb11b5313e4274e6a54083f910 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 9 Jun 2011 16:40:26 -0400 Subject: [PATCH 1/7] Changed default value of MTP2 T7 timer --- .../freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c index a891c50108..8e327ea759 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c @@ -2205,7 +2205,7 @@ static int ftmod_ss7_fill_in_mtp2_link(sng_mtp2_link_t *mtp2Link) if ( mtp2Link->t7 != 0 ) { g_ftdm_sngss7_data.cfg.mtp2Link[i].t7 = mtp2Link->t7; }else { - g_ftdm_sngss7_data.cfg.mtp2Link[i].t7 = 40; + g_ftdm_sngss7_data.cfg.mtp2Link[i].t7 = 20; } return FTDM_SUCCESS; From acc1e1c9d05be14aaf6d285a2a22cc98ea2312b3 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 9 Jun 2011 16:41:28 -0400 Subject: [PATCH 2/7] Fix for sending ServInfoA on ANSI --- .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h | 4 ++++ .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h index f88202b1a8..11ff2318bb 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h @@ -60,6 +60,10 @@ #define MAX_SIZEOF_SUBADDR_IE 24 /* as per Q931 4.5.9 */ +#define SNGSS7_SWITCHTYPE_ANSI(switchtype) (switchtype == LSI_SW_ANS88) || \ + (switchtype == LSI_SW_ANS92) || \ + (switchtype == LSI_SW_ANS95) + typedef struct ftdm2trillium { uint8_t ftdm_val; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c index 91b8900fef..47249c2f5a 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c @@ -92,8 +92,10 @@ void ft_to_sngss7_iam (ftdm_channel_t * ftdmchan) /* Transmission medium requirements */ copy_txMedReq_to_sngss7(ftdmchan, &iam.txMedReq); - /* User Service Info A */ - copy_usrServInfoA_to_sngss7(ftdmchan, &iam.usrServInfoA); + if (SNGSS7_SWITCHTYPE_ANSI(g_ftdm_sngss7_data.cfg.isupCkt[sngss7_info->circuit->id].switchType)) { + /* User Service Info A */ + copy_usrServInfoA_to_sngss7(ftdmchan, &iam.usrServInfoA); + } /* Called Number information */ copy_cdPtyNum_to_sngss7(ftdmchan, &iam.cdPtyNum); From b7e99e9677109dc8801caec08367da1b2a46cfca Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 9 Jun 2011 16:42:17 -0400 Subject: [PATCH 3/7] Fix for sending ServInfoA on ANSI --- .../ftmod_sangoma_ss7_support.c | 53 ++++++++----------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c index e61153c8e7..8631421fe6 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_support.c @@ -641,39 +641,32 @@ ftdm_status_t copy_txMedReq_to_sngss7(ftdm_channel_t *ftdmchan, SiTxMedReq *txMe ftdm_status_t copy_usrServInfoA_to_sngss7(ftdm_channel_t *ftdmchan, SiUsrServInfo *usrServInfoA) { - sngss7_chan_data_t *sngss7_info = ftdmchan->call_data; - - if ((g_ftdm_sngss7_data.cfg.isupCkt[sngss7_info->circuit->id].switchType == LSI_SW_ANS88) || - (g_ftdm_sngss7_data.cfg.isupCkt[sngss7_info->circuit->id].switchType == LSI_SW_ANS92) || - (g_ftdm_sngss7_data.cfg.isupCkt[sngss7_info->circuit->id].switchType == LSI_SW_ANS95)) { + usrServInfoA->eh.pres = PRSNT_NODEF; - usrServInfoA->eh.pres = PRSNT_NODEF; + usrServInfoA->infoTranCap.pres = PRSNT_NODEF; - usrServInfoA->infoTranCap.pres = PRSNT_NODEF; - - usrServInfoA->infoTranCap.val = get_trillium_val(bc_cap_codes, ftdmchan->caller_data.bearer_capability, ITC_SPEECH); + usrServInfoA->infoTranCap.val = get_trillium_val(bc_cap_codes, ftdmchan->caller_data.bearer_capability, ITC_SPEECH); - usrServInfoA->cdeStand.pres = PRSNT_NODEF; - usrServInfoA->cdeStand.val = 0x0; /* ITU-T standardized coding */ - usrServInfoA->tranMode.pres = PRSNT_NODEF; - usrServInfoA->tranMode.val = 0x0; /* circuit mode */ - usrServInfoA->infoTranRate0.pres = PRSNT_NODEF; - usrServInfoA->infoTranRate0.val = 0x10; /* 64kbps origination to destination */ - usrServInfoA->infoTranRate1.pres = PRSNT_NODEF; - usrServInfoA->infoTranRate1.val = 0x10; /* 64kbps destination to origination */ - usrServInfoA->chanStruct.pres = PRSNT_NODEF; - usrServInfoA->chanStruct.val = 0x1; /* 8kHz integrity */ - usrServInfoA->config.pres = PRSNT_NODEF; - usrServInfoA->config.val = 0x0; /* point to point configuration */ - usrServInfoA->establish.pres = PRSNT_NODEF; - usrServInfoA->establish.val = 0x0; /* on demand */ - usrServInfoA->symmetry.pres = PRSNT_NODEF; - usrServInfoA->symmetry.val = 0x0; /* bi-directional symmetric */ - usrServInfoA->usrInfLyr1Prot.pres = PRSNT_NODEF; - usrServInfoA->usrInfLyr1Prot.val = 0x2; /* G.711 ulaw */ - usrServInfoA->rateMultiplier.pres = PRSNT_NODEF; - usrServInfoA->rateMultiplier.val = 0x1; /* 1x rate multipler */ - } /* if ANSI */ + usrServInfoA->cdeStand.pres = PRSNT_NODEF; + usrServInfoA->cdeStand.val = 0x0; /* ITU-T standardized coding */ + usrServInfoA->tranMode.pres = PRSNT_NODEF; + usrServInfoA->tranMode.val = 0x0; /* circuit mode */ + usrServInfoA->infoTranRate0.pres = PRSNT_NODEF; + usrServInfoA->infoTranRate0.val = 0x10; /* 64kbps origination to destination */ + usrServInfoA->infoTranRate1.pres = PRSNT_NODEF; + usrServInfoA->infoTranRate1.val = 0x10; /* 64kbps destination to origination */ + usrServInfoA->chanStruct.pres = PRSNT_NODEF; + usrServInfoA->chanStruct.val = 0x1; /* 8kHz integrity */ + usrServInfoA->config.pres = PRSNT_NODEF; + usrServInfoA->config.val = 0x0; /* point to point configuration */ + usrServInfoA->establish.pres = PRSNT_NODEF; + usrServInfoA->establish.val = 0x0; /* on demand */ + usrServInfoA->symmetry.pres = PRSNT_NODEF; + usrServInfoA->symmetry.val = 0x0; /* bi-directional symmetric */ + usrServInfoA->usrInfLyr1Prot.pres = PRSNT_NODEF; + usrServInfoA->usrInfLyr1Prot.val = 0x2; /* G.711 ulaw */ + usrServInfoA->rateMultiplier.pres = PRSNT_NODEF; + usrServInfoA->rateMultiplier.val = 0x1; /* 1x rate multipler */ return FTDM_SUCCESS; } From 408244b0c5d16c04b9e0b0b9793f20f5f47d534a Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 9 Jun 2011 16:42:33 -0400 Subject: [PATCH 4/7] Changed error print to debug --- .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c index d3828fe0e3..4e8aefe17c 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c @@ -532,9 +532,9 @@ move_along: /**************************************************************************/ default: if (g_ftdm_sngss7_data.cfg.isupCkt[circuit].type != VOICE) { - SS7_ERROR("Rx %s on circuit that is not a voice CIC (%d)\n", + ftdm_log(FTDM_LOG_DEBUG, "Rx %s on circuit that is not a voice CIC (%d) (circuit:%d)\n", DECODE_LCC_EVENT(evntType), - g_ftdm_sngss7_data.cfg.isupCkt[circuit].cic); + g_ftdm_sngss7_data.cfg.isupCkt[circuit].cic, circuit); SS7_FUNC_TRACE_EXIT(__FUNCTION__); return; } From 1fe877be9d90de37f673afd2f9d1ff72bf251bd7 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 9 Jun 2011 16:48:27 -0400 Subject: [PATCH 5/7] Change error print to debug --- .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c index 0520e9d163..5deb9b0fc1 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c @@ -1267,7 +1267,7 @@ ftdm_status_t handle_resume(uint32_t suInstId, uint32_t spInstId, uint32_t circu /* confirm that the circuit is active on our side otherwise move to the next circuit */ if (!sngss7_test_flag(&g_ftdm_sngss7_data.cfg.isupCkt[i], SNGSS7_ACTIVE)) { - SS7_ERROR("[CIC:%d]Circuit is not active yet, skipping!\n",g_ftdm_sngss7_data.cfg.isupCkt[i].cic); + ftdm_log(FTDM_LOG_DEBUG, "[CIC:%d]Circuit is not active yet, skipping!\n",g_ftdm_sngss7_data.cfg.isupCkt[i].cic); i++; continue; } From a8abef1013684953fcb25f563f3a190243984b5c Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 14 Jun 2011 13:15:17 -0400 Subject: [PATCH 6/7] Changed libsng_isdn and libsng_ss7 include paths --- libs/freetdm/Makefile.am | 8 -------- .../src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h | 2 +- .../src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/libs/freetdm/Makefile.am b/libs/freetdm/Makefile.am index ef63120dfb..b4eb76d6fd 100644 --- a/libs/freetdm/Makefile.am +++ b/libs/freetdm/Makefile.am @@ -40,14 +40,6 @@ library_includedir = $(prefix)/include INCS = -I$(FT_SRCDIR)/$(SRC)/include -I$(FT_SRCDIR)/$(SRC)/include/private -if HAVE_SNG_SS7 -INCS += -I/usr/include/sng_ss7 -endif - -if HAVE_SNG_ISDN -INCS += -I/usr/include/sng_isdn -endif - # we needed to separate CFLAGS in FTDM_COMPAT_CFLAGS and FTDM_CFLAGS due to -c99 which causes problems with wanpipe headers FTDM_COMPAT_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_COMPAT_CFLAGS@ @DEFS@ FTDM_CFLAGS = $(INCS) -DFTDM_CONFIG_DIR=\"@confdir@\" -DFTDM_MOD_DIR=\"$(moddir)\" @COMP_VENDOR_CFLAGS@ @DEFS@ diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h index 7559fec675..08adc6ef6b 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h @@ -49,7 +49,7 @@ #include "private/ftdm_core.h" #include "ftmod_sangoma_isdn_user.h" -#include +#include /* Theoretical limit for MAX_SPANS_PER_NFAS_LINK is 31, but set to 8 for now to save some memory */ diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h index 11ff2318bb..10160aa47b 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h @@ -45,7 +45,7 @@ #include "private/ftdm_core.h" -#include "sng_ss7.h" +#include "sng_ss7/sng_ss7.h" /******************************************************************************/ From 55db4ce54c1717345801b6b12d05b9500532d0e8 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 16 Jun 2011 13:40:36 -0400 Subject: [PATCH 7/7] freetdm: OPENZAP-151 --resolved SS7 ANM and REL message collision --- .../ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c index 5deb9b0fc1..6fb9c82895 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c @@ -584,6 +584,20 @@ ftdm_status_t handle_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circ break; /**************************************************************************/ + case FTDM_CHANNEL_STATE_HANGUP_COMPLETE: + + /* already hangup complete, just ignore it */ + /* + * i.e. collision REL & ANM + * IAM -> + * <- ACM + * REL -> <- ANM (if REL gets processed first, ANM needs to be ignored) + * <- RLC + */ + SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Rx ANM/CON Ignoring it because we already hung up\n", sngss7_info->circuit->cic); + + break; + /**************************************************************************/ default: /* incorrect state...reset the CIC */ SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Rx ANM/CON\n", sngss7_info->circuit->cic);