void usage (std::string &response) {
response += "\n\nInvalid arguments. Provide these ones:";
response += "\n";
- response += "\n<initial sequence>|<final sequence>|<digits>|<CCR-I xml file>[|CCR-T xml file]";
+ response += "\n<test timeout ms (0: no timeout step)><initial sequence>|<final sequence>|<digits>|<CCR-I xml file>[|CCR-T xml file]";
response += "\n";
response += "\nSequences are parsed when needed, over AVPs or internal values:";
response += "\n";
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: \"2000000|9000000|7|CCR-I.xml|CCR-T.xml\"";
+ response += "\nThen, you could provide these arguments: \"5000|2000000|9000000|7|CCR-I.xml|CCR-T.xml\"";
response += "\n";
}
}
anna::Tokenizer targs;
targs.apply(args, "|");
- if (targs.size() < 4) {
+ if (targs.size() < 5) {
usage(response);
return;
}
anna::Tokenizer::const_iterator tok_it = targs.begin();
+ std::string timeout = anna::Tokenizer::data(tok_it); tok_it++;
std::string seq_i = anna::Tokenizer::data(tok_it); tok_it++;
std::string seq_f = anna::Tokenizer::data(tok_it); tok_it++;
std::string digits = anna::Tokenizer::data(tok_it); tok_it++;
bool haveTermination = (ccr_t != "");
// Test cases cycles:
+ int i_timeout = std::atoi(timeout.c_str());
unsigned int ll_seq_i = std::atol(seq_i.c_str());
unsigned int ll_seq_f = std::atol(seq_f.c_str());
unsigned int ll_seq_size = ll_seq_f - ll_seq_i + 1;
}
unsigned int ll_seq, ll_index;
- anna::Millisecond timeout(5000);
+ anna::Millisecond timeoutMS(i_timeout);
// Load xml messages:
anna::diameter::codec::Message ccri, ccrt;
// test|__TESTID__|sendxml2e|ccr-t.xml
// test|__TESTID__|waitfe|272|0|||11111__SEQ8__;BAT004;esmdx0900.gxrel10plusrealm.com;90__SEQ8__|2001
- // Step 1: timeout 5000 ms:
- tc->addTimeout(timeout);
+ if (i_timeout != 0) {
+ // Step 1: timeout 5000 ms:
+ tc->addTimeout(timeoutMS);
+ }
// Step 2: sendxml2e: CCR-Initial
tc->addSendxml2e(ccri.code(), oh, -1 /* 'wait for request' step number for answers */);
and a file called 'dynamic.suffix' used to complete the dynamic operation
in this way:
- dynamic|<initial sequence>|<final sequence>|<dynamic.suffix content>
+ dynamic|<timeout ms>|<initial sequence>|<final sequence>|<dynamic.suffix content>
For example, you could have this content for 'dynamic.suffix':
- 7|CCR-I.xml|CCR-T.xml
+ 0|7|CCR-I.xml|CCR-T.xml (0 for timeout means no timeout step)
in order to generate the operation:
- dynamic|<initial sequence>|<final sequence>|7|CCR-I.xml|CCR-T.xml
+ dynamic|0|<initial sequence>|<final sequence>|7|CCR-I.xml|CCR-T.xml
which would be parsed for the specific ADML instance programmed:
- dynamic|2000001|2001000|7|CCR-I.xml|CCR-T.xml
+ dynamic|0|2000001|2001000|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.