diff --git a/conf.d/ysigchan.conf.sample b/conf.d/ysigchan.conf.sample index cdca000c..6ee68619 100644 --- a/conf.d/ysigchan.conf.sample +++ b/conf.d/ysigchan.conf.sample @@ -860,6 +860,11 @@ ; A section with the name given here must exist in order to configure the SCCP level ;sccp= +; default_hopcounter: HopCounter provided to SCCP if the application does not provide one +; Values range 1-15, 0 or boolean false disables, boolean true sets to 15 +; A non-zero value will force using XUDT or LUDT instead of UDT messages +;default_hopcounter=false + ; transact_timeout: Time in seconds to timeout a TCAP transaction after no more activity was registered on it ; Defaults to 300 seconds ;transact_timeout=300 diff --git a/libs/ysig/tcap.cpp b/libs/ysig/tcap.cpp index 6deba267..cc8082d1 100644 --- a/libs/ysig/tcap.cpp +++ b/libs/ysig/tcap.cpp @@ -112,13 +112,14 @@ struct PrimitiveMapping { static bool s_extendedDbg = false; static bool s_printMsgs = false; static const String s_checkAddr = "tcap.checkAddress"; -static const char* s_localPC = "LocalPC"; -static const char* s_remotePC = "RemotePC"; -static const char* s_callingPA = "CallingPartyAddress"; -static const char* s_callingSSN = "CallingPartyAddress.ssn"; -static const char* s_callingRoute = "CallingPartyAddress.route"; -static const char* s_calledPA = "CalledPartyAddress"; -static const char* s_calledSSN = "CalledPartyAddress.ssn"; +static const String s_localPC = "LocalPC"; +static const String s_remotePC = "RemotePC"; +static const String s_callingPA = "CallingPartyAddress"; +static const String s_callingSSN = "CallingPartyAddress.ssn"; +static const String s_callingRoute = "CallingPartyAddress.route"; +static const String s_calledPA = "CalledPartyAddress"; +static const String s_calledSSN = "CalledPartyAddress.ssn"; +static const String s_HopCounter = "HopCounter"; // TCAP message parameters static const String s_tcapUser = "tcap.user"; @@ -258,6 +259,7 @@ SS7TCAP::SS7TCAP(const NamedList& params) m_inQueueMtx(true,"TCAPPendingMsg"), m_SSN(0), m_defaultRemoteSSN(0), + m_defaultHopCounter(0), m_defaultRemotePC(0), m_remoteTypePC(SS7PointCode::Other), m_trTimeout(300), @@ -303,6 +305,9 @@ bool SS7TCAP::initialize(const NamedList* config) // read local point code and default remote point code m_SSN = config->getIntValue(YSTRING("local_SSN"),-1); m_defaultRemoteSSN = config->getIntValue(YSTRING("default_remote_SSN"),-1); + m_defaultHopCounter = config->getIntValue(YSTRING("default_hopcounter"),0); + if (m_defaultHopCounter > 15 || config->getBoolValue(YSTRING("default_hopcounter"))) + m_defaultHopCounter = 15; const char* code = config->getValue(YSTRING("default_remote_pointcode")); m_remoteTypePC = SS7PointCode::lookup(config->getValue(YSTRING("pointcodetype"),"")); @@ -338,6 +343,8 @@ bool SS7TCAP::sendData(DataBlock& data, NamedList& params) if (!params.getParam(s_callingRoute)) params.addParam(s_callingRoute,"ssn"); } + if (m_defaultHopCounter && !params.getParam(s_HopCounter)) + params.addParam(s_HopCounter,String(m_defaultHopCounter)); } #ifdef DEBUG if (s_printMsgs && debugAt(DebugInfo)) diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index 6ce274c5..4114a165 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -10752,6 +10752,7 @@ protected: unsigned int m_SSN; unsigned int m_defaultRemoteSSN; + unsigned int m_defaultHopCounter; SS7PointCode m_defaultRemotePC; SS7PointCode::Type m_remoteTypePC; u_int64_t m_trTimeout;