Added explicit keyword to create routes to adjacent point codes (A/E or F links). Regular routes now have a default priority of 100.

git-svn-id: http://voip.null.ro/svn/yate@3186 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-04-12 18:01:41 +00:00
parent b20e23e0a5
commit 2753c9faee
2 changed files with 19 additions and 7 deletions

View File

@ -356,9 +356,18 @@
; The format of this option is pointcodetype,label,priority
; This parameter can be repeated to build multiple destination routes
; The network will notify the router about its destination(s) and priority
; Example: route=ITU,2-2-2,0
; If not specified the priority is 100. A zero priority creates an adjacent route
; Example: route=ITU,2-2-2,100
;route=
; adjacent: string: Build an adjacent route for the SS7 network (A, E and F links)
; The format of this option is pointcodetype,label
; This parameter can be repeated to declare multiple adjacent routers
; The network will notify the router about its destination(s) and priority
; The priority is always zero so an adjacent route will always match first.
; Example: route=ANSI,40-50-60
;adjacent=
; autostart: bool: Automatically enable the linkset at startup
;autostart=yes

View File

@ -99,18 +99,21 @@ bool SS7Layer3::buildRoutes(const NamedList& params)
for (unsigned int i = 0; i < YSS7_PCTYPE_COUNT; i++)
m_route[i].clear();
unsigned int n = params.length();
const char* param = "route";
bool added = false;
for (unsigned int i= 0; i < n; i++) {
NamedString* ns = params.getParam(i);
if (!(ns && ns->name() == param))
if (!ns)
continue;
unsigned int prio = 0;
if (ns->name() == "route")
prio = 100;
else if (ns->name() != "adjacent")
continue;
// Get & check the route
ObjList* route = ns->split(',',true);
ObjList* obj = route->skipNull();
SS7PointCode* pc = new SS7PointCode(0,0,0);
SS7PointCode::Type type = SS7PointCode::Other;
unsigned int prio = 0;
while (true) {
if (!obj)
break;
@ -119,8 +122,8 @@ bool SS7Layer3::buildRoutes(const NamedList& params)
if (!(obj && pc->assign(obj->get()->toString(),type)))
break;
obj = obj->skipNext();
if (obj)
prio = obj->get()->toString().toInteger(0);
if (obj && prio)
prio = obj->get()->toString().toInteger(prio);
break;
}
TelEngine::destruct(route);
@ -128,7 +131,7 @@ bool SS7Layer3::buildRoutes(const NamedList& params)
TelEngine::destruct(pc);
if ((unsigned int)type > YSS7_PCTYPE_COUNT || !packed) {
Debug(this,DebugNote,"Invalid %s='%s' (invalid point code%s) [%p]",
param,ns->safe(),type == SS7PointCode::Other ? " type" : "",this);
ns->name().c_str(),ns->safe(),type == SS7PointCode::Other ? " type" : "",this);
continue;
}
if (findRoute(type,packed))