Added "netindicator" setting for linksets so it's no longer required to restrict types using netind2pctype.

git-svn-id: http://voip.null.ro/svn/yate@4220 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2011-03-28 11:19:22 +00:00
parent 23fa2df067
commit 3a6bb55910
4 changed files with 47 additions and 3 deletions

View File

@ -468,6 +468,10 @@
; netind2pctype=ANSI8,ITU,ANSI,ITU
;netind2pctype=
; netindicator: keyword: Default value of Network Indicator bits
; Allowed values: international, spareinternational, national, reservednational
;netindicator=national
; route: string: Build a destination route for the SS7 network
; The format of this option is pointcodetype,label,priority
; This parameter can be repeated to build multiple destination routes
@ -629,6 +633,14 @@
; Example: local=ITU,2-2-4
;local=
; priority: keyword: Value of the Priority bits in the Service Information Octet
; Allowed values: regular, special, circuit, facility
;priority=regular
; netindicator: keyword: Default value of Network Indicator bits in the SIO
; Allowed values: international, spareinternational, national, reservednational
;netindicator=national
; changemsgs: boolean: Emit and process changeover and changeback messages
; Disabling these messages forces always using time controlled diversion
;changemsgs=yes

View File

@ -59,7 +59,7 @@ SS7Layer3::SS7Layer3(SS7PointCode::Type type)
: SignallingComponent("SS7Layer3"),
m_routeMutex(true,"SS7Layer3::route"),
m_l3userMutex(true,"SS7Layer3::l3user"),
m_l3user(0)
m_l3user(0), m_defNI(SS7MSU::National)
{
for (unsigned int i = 0; i < YSS7_PCTYPE_COUNT; i++)
m_local[i] = 0;
@ -69,6 +69,8 @@ SS7Layer3::SS7Layer3(SS7PointCode::Type type)
// Initialize the Layer 3 component
bool SS7Layer3::initialize(const NamedList* config)
{
if (config)
setNI(SS7MSU::getNetIndicator(config->getValue("netindicator"),SS7MSU::National));
if (engine() && !user()) {
NamedList params("ss7router");
if (config)
@ -145,6 +147,13 @@ unsigned char SS7Layer3::getNI(SS7PointCode::Type pcType, unsigned char defNI) c
return defNI;
}
void SS7Layer3::setNI(unsigned char defNI)
{
if ((defNI & 0xc0) == 0)
defNI <<= 6;
m_defNI = defNI & 0xc0;
}
bool SS7Layer3::hasType(SS7PointCode::Type pcType) const
{
if (SS7PointCode::Other == pcType)

View File

@ -376,6 +376,7 @@ bool SS7Router::initialize(const NamedList* config)
m_transferSilent = (*tr == "silent");
m_transfer = !m_transferSilent && tr->toBoolean(m_transfer);
}
setNI(SS7MSU::getNetIndicator(config->getValue("netindicator"),SS7MSU::National));
m_autoAllowed = config->getBoolValue("autoallow",m_autoAllowed);
m_sendUnavail = config->getBoolValue("sendupu",m_sendUnavail);
m_sendProhibited = config->getBoolValue("sendtfp",m_sendProhibited);

View File

@ -5727,7 +5727,28 @@ public:
* @param defNI Default Network Indicator bits to use
* @return Network Indicator bits matching the Point Code type
*/
virtual unsigned char getNI(SS7PointCode::Type pcType, unsigned char defNI = SS7MSU::National) const;
virtual unsigned char getNI(SS7PointCode::Type pcType, unsigned char defNI) const;
/**
* Get the Network Indicator bits that would match a Point Code type
* @param pcType Point Code type to search for
* @return Network Indicator bits matching the Point Code type
*/
inline unsigned char getNI(SS7PointCode::Type pcType) const
{ return getNI(pcType,m_defNI); }
/**
* Get the default Network Indicator bits
* @return Default Network Indicator bits for this layer
*/
inline unsigned char getNI() const
{ return m_defNI; }
/**
* Set the default Network Indicator bits
* @param defNI Network Indicator bits to set as defaults
*/
void setNI(unsigned char defNI);
/**
* Build the list of outgoing routes serviced by this network. Clear the list before re-building it.
@ -5946,6 +5967,7 @@ private:
SS7PointCode::Type m_cpType[4]; // Map incoming MSUs net indicators to point code type
// or the routing table of a message router
unsigned int m_local[YSS7_PCTYPE_COUNT];
unsigned char m_defNI; // Default Network Indicator
};
/**
@ -6251,7 +6273,7 @@ public:
* @param defNI Default Network Indicator bits to use
* @return Network Indicator bits matching the Point Code type
*/
virtual unsigned char getNI(SS7PointCode::Type pcType, unsigned char defNI = SS7MSU::National) const;
virtual unsigned char getNI(SS7PointCode::Type pcType, unsigned char defNI) const;
/**
* Retrieve the default local Point Code for a specific Point Code type