From bdad30af20ea24102db5cf439fd2eb7e2ac9b0c5 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Sat, 15 Apr 2017 16:16:30 +0200 Subject: [PATCH] Fix timeout order in procedure dynamic operation and program for ST --- dynamic/launcher/gx/00001/Procedure.cpp | 79 +- dynamic/launcher/gx/00001/dictionary.xml | 2818 +++++++++++++++++ .../launcher/deployments/st-client/program.sh | 6 +- 3 files changed, 2858 insertions(+), 45 deletions(-) create mode 100644 dynamic/launcher/gx/00001/dictionary.xml diff --git a/dynamic/launcher/gx/00001/Procedure.cpp b/dynamic/launcher/gx/00001/Procedure.cpp index 63b4ef1..b74f362 100644 --- a/dynamic/launcher/gx/00001/Procedure.cpp +++ b/dynamic/launcher/gx/00001/Procedure.cpp @@ -27,7 +27,7 @@ namespace { void usage (std::string &response) { response += "\n\nInvalid arguments. Provide these ones:"; response += "\n"; - response += "\n|||[|CCR-T xml file]"; + response += "\n||||[|CCR-T xml file]"; response += "\n"; response += "\nSequences are parsed when needed, over AVPs or internal values:"; response += "\n"; @@ -42,7 +42,7 @@ namespace { response += "\nThe same will be done in MSISDN and IMSI (Subscription-Data AVPs)."; response += "\nFramed-IP-Address will be sequenced with a direct correspondence to hex value."; response += "\n"; - response += "\nThen, you could provide these arguments: \"5000|2000000|9000000|7|CCR-I.xml|CCR-T.xml\""; + response += "\nThen, you could provide these arguments: \"2000000|9000000|5000|7|CCR-I.xml|CCR-T.xml\""; response += "\n"; } } @@ -94,56 +94,51 @@ void Procedure::execute(const std::string &args, std::string &response, anna::di anna::diameter::codec::Avp *ccri_sessionId, *ccrt_sessionId, *ccri_framedIPAddress, *ccrt_framedIPAddress, *ccri_msisdn, *ccri_imsi; anna::diameter::codec::Avp *si1, *si2, *sidata1, *sidata2, *sitype1, *sitype2; - try { + ///////// CCR-Initial: + ccri.loadXML(ccr_i); - ///////// CCR-Initial: - ccri.loadXML(ccr_i); + // Session-Id & Framed-Ip-Address AVPs + ccri_sessionId = ccri.getAvp("Session-Id"); + ccri_framedIPAddress = ccri.getAvp("Framed-IP-Address"); - // Session-Id & Framed-Ip-Address AVPs - ccri_sessionId = ccri.getAvp("Session-Id"); - ccri_framedIPAddress = ccri.getAvp("Framed-IP-Address"); - - // Subscription-Id AVPs - if (ccri.countAvp("Subscription-Id") != 2) { - response += "Both Subscription-Id MSISDN & IMSI Avps must be present in the CCR-Initial provided !"; - return; - } + // Subscription-Id AVPs + if (ccri.countAvp("Subscription-Id") != 2) { + response += "Both Subscription-Id MSISDN & IMSI Avps must be present in the CCR-Initial provided !"; + return; + } - si1 = ccri.getAvp("Subscription-Id", 1, anna::Exception::Mode::Ignore); - si2 = ccri.getAvp("Subscription-Id", 2, anna::Exception::Mode::Ignore); + si1 = ccri.getAvp("Subscription-Id", 1, anna::Exception::Mode::Ignore); + si2 = ccri.getAvp("Subscription-Id", 2, anna::Exception::Mode::Ignore); - if (!si1 || !si2) { - response += "Cannot found Subscription-Id MSISDN & IMSI Avps !" ; - return; - } + if (!si1 || !si2) { + response += "Cannot found Subscription-Id MSISDN & IMSI Avps !" ; + return; + } - sidata1 = si1->getAvp("Subscription-Id-Data"); - sidata2 = si2->getAvp("Subscription-Id-Data"); - sitype1 = si1->getAvp("Subscription-Id-Type"); - //sitype2 = si2->getAvp("Subscription-Id-Type"); + sidata1 = si1->getAvp("Subscription-Id-Data"); + sidata2 = si2->getAvp("Subscription-Id-Data"); + sitype1 = si1->getAvp("Subscription-Id-Type"); + //sitype2 = si2->getAvp("Subscription-Id-Type"); - if (sitype1->getEnumerated()->getValue() == anna::diameter::helpers::dcca::AVPVALUES__Subscription_Id_Type::END_USER_E164) { - ccri_msisdn = sidata1; - ccri_imsi = sidata2; - } - else { - ccri_msisdn = sidata2; - ccri_imsi = sidata1; - } + if (sitype1->getEnumerated()->getValue() == anna::diameter::helpers::dcca::AVPVALUES__Subscription_Id_Type::END_USER_E164) { + ccri_msisdn = sidata1; + ccri_imsi = sidata2; + } + else { + ccri_msisdn = sidata2; + ccri_imsi = sidata1; + } - ///////// CCR-Termination: - if (haveTermination) { - ccrt.loadXML(ccr_t); + ///////// CCR-Termination: + if (haveTermination) { + ccrt.loadXML(ccr_t); - // Session-Id & Framed-Ip-Address AVPs - ccrt_sessionId = ccrt.getAvp("Session-Id"); - ccrt_framedIPAddress = ccrt.getAvp("Framed-IP-Address"); - } - } - catch(anna::RuntimeException &ex) { - ex.trace(); + // Session-Id & Framed-Ip-Address AVPs + ccrt_sessionId = ccrt.getAvp("Session-Id"); + ccrt_framedIPAddress = ccrt.getAvp("Framed-IP-Address"); } + // Prepare session-id string: std::string sessionId = ccri_sessionId->getUTF8String()->getValue(); std::size_t last_semicolon = sessionId.rfind(";"); diff --git a/dynamic/launcher/gx/00001/dictionary.xml b/dynamic/launcher/gx/00001/dictionary.xml new file mode 100644 index 0000000..0aeb974 --- /dev/null +++ b/dynamic/launcher/gx/00001/dictionary.xml @@ -0,0 +1,2818 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/diameter/launcher/deployments/st-client/program.sh b/example/diameter/launcher/deployments/st-client/program.sh index 31eb97d..5d1fa45 100755 --- a/example/diameter/launcher/deployments/st-client/program.sh +++ b/example/diameter/launcher/deployments/st-client/program.sh @@ -53,7 +53,7 @@ Usage: $0 [-s] and a file called 'dynamic.suffix' used to complete the dynamic operation in this way: - dynamic|||| + dynamic||| For example, you could have this content for 'dynamic.suffix': @@ -61,11 +61,11 @@ Usage: $0 [-s] in order to generate the operation: - dynamic|0|||7|CCR-I.xml|CCR-T.xml + dynamic|||0|7|CCR-I.xml|CCR-T.xml which would be parsed for the specific ADML instance programmed: - dynamic|0|2000001|2001000|7|CCR-I.xml|CCR-T.xml + dynamic|2000001|2001000|0|7|CCR-I.xml|CCR-T.xml The file 'dynamic.suffix' could have several lines for several scenaries. In this case, this script will prompt for the desired one. -- 2.20.1