From 2753c9faee81be0bedbf1ea5f24235aea8db529b Mon Sep 17 00:00:00 2001 From: paulc Date: Mon, 12 Apr 2010 18:01:41 +0000 Subject: [PATCH] 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 --- conf.d/ysigchan.conf.sample | 11 ++++++++++- libs/ysig/layer3.cpp | 15 +++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/conf.d/ysigchan.conf.sample b/conf.d/ysigchan.conf.sample index 53d2460d..b9821317 100644 --- a/conf.d/ysigchan.conf.sample +++ b/conf.d/ysigchan.conf.sample @@ -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 diff --git a/libs/ysig/layer3.cpp b/libs/ysig/layer3.cpp index 88f7531c..97d4cb18 100644 --- a/libs/ysig/layer3.cpp +++ b/libs/ysig/layer3.cpp @@ -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))