Add CEA on server session configuration for services
[anna.git] / example / diameter / launcher / Launcher.cpp
index aaa80be..f58157f 100644 (file)
@@ -60,40 +60,54 @@ const char *ServicesDTD = "\
 -->\n\
 \n\
 <!ELEMENT node EMPTY>\n\
-<!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED originRealm CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>\n\
+<!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED originRealm CDATA #IMPLIED cer CDATA #IMPLIED dwr CDATA #IMPLIED cea CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>\n\
 <!--\n\
    Node record\n\
 \n\
    originHost:                              Node identifier as diameter application host name.\n\
    applicationId:                           The Application-Id provided must exists as a registered 'stack id'.\n\
    originRealm:                             Origin-Realm (domain-name internally used by default).\n\
+\n\
+\n\
+   - Diameter clients:\n\
+\n\
+   entity:                                  Target diameter entity (comma-separated '<address>:<port>' format).\n\
+                                            For example: 10.20.30.40:3868,10.20.30.41:3868. If missing, no entity will be enabled.\n\
+   entityServerSessions:                    Diameter entity server sessions (0: diameter entity disabled). Default value of 1.\n\
    cer:                                     User defined CER path file to be encoded to establish diameter connections.\n\
                                             If missing, will be harcoded.\n\
    dwr:                                     User defined DWR path file to be encoded for diameter protocol keep alive.\n\
                                             If missing, will be harcoded.\n\
-   allowedInactivityTime:                   Milliseconds for the maximum allowed inactivity time on server sessions born over the\n\
-                                            local server before being reset. If missing, default value of 90000 will be assigned.\n\
    tcpConnectDelay:                         Milliseconds to wait TCP connect to any server. If missing, default value of 200 will\n\
                                             be assigned\n\
-   answersTimeout:                          Milliseconds to wait pending application answers from diameter peers. If missing,\n\
-                                            default value of 10000 will be assigned.\n\
    ceaTimeout:                              Milliseconds to wait CEA from diameter server. If missing, default value of 'answersTimeout'\n\
                                             will be assigned.\n\
    watchdogPeriod:                          Milliseconds for watchdog timer (Tw) for diameter keep-alive procedure. If missing, default\n\
                                             value of 30000 will be assigned.\n\
-   entity:                                  Target diameter entity (comma-separated '<address>:<port>' format).\n\
-                                            For example: 10.20.30.40:3868,10.20.30.41:3868. If missing, no entity will be enabled.\n\
-   entityServerSessions:                    Diameter entity server sessions (0: diameter entity disabled). Default value of 1.\n\
-   diameterServer:                          Diameter own server address in '<address>:<port>' format. For example: 10.20.30.40:3868.\n\
-                                            If missing, no local server will be enabled.\n\
-   diameterServerSessions:                  Diameter own server available connections (0: diameter server disabled). Default value of 1.\n\
-                                            Negative value implies no limit accepting incoming connections.\n\
    balance:                                 Balance over entity servers instead of doing standard behaviour (first primary, secondary\n\
                                             if fails, etc.). Default value 'no'.\n\
    sessionBasedModelsClientSocketSelection: By default, round-robin will be applied for IEC model (SMS/MMS), and Session-Id Low Part\n\
                                             will be analyzed for ECUR/SCUR model (data, voice and content). You could change ECUR/SCUR\n\
                                             analysis behaviour providing 'SessionIdHighPart', 'SessionIdOptionalPart' (atoi applied;\n\
                                             usually subscriber id data, i.e. MSISDN or IMSI) and 'RoundRobin' (also 'SessionIdLowPart').\n\
+\n\
+\n\
+   - Diameter servers:\n\
+\n\
+   diameterServer:                          Diameter own server address in '<address>:<port>' format. For example: 10.20.30.40:3868.\n\
+                                            If missing, no local server will be enabled.\n\
+   diameterServerSessions:                  Diameter own server available connections (0: diameter server disabled). Default value of 1.\n\
+                                            Negative value implies no limit accepting incoming connections.\n\
+   cea:                                     User defined CEA path file to be encoded to answer client CERs.\n\
+                                            If missing, will be harcoded.\n\
+   allowedInactivityTime:                   Milliseconds for the maximum allowed inactivity time on server sessions born over the\n\
+                                            local server before being reset. If missing, default value of 90000 will be assigned.\n\
+\n\
+\n\
+   - General:\n\
+\n\
+   answersTimeout:                          Milliseconds to wait pending application answers from diameter peers. If missing,\n\
+                                            default value of 10000 will be assigned.\n\
    retries:                                 Expired responses will cause a number of request retransmissions. Disabled by default (0 retries).\n\
    log:                                     Process log file (operations result, traffic log, etc.). By default '<originHost>.launcher.log'.\n\
                                             Empty string or \"null\" name, to disable. Warning: there is no rotation for log files\n\
@@ -148,7 +162,7 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp
   const anna::xml::Attribute *id, *dictionary;
 
   // <!ATTLIST node originHost CDATA #REQUIRED applicationId CDATA #REQUIRED cer CDATA #IMPLIED dwr CDATA #IMPLIED allowedInactivityTime CDATA #IMPLIED tcpConnectDelay CDATA #IMPLIED answersTimeout CDATA #IMPLIED ceaTimeout CDATA #IMPLIED watchdogPeriod CDATA #IMPLIED entity CDATA #IMPLIED entityServerSessions CDATA #IMPLIED diameterServer CDATA #IMPLIED diameterServerSessions CDATA #IMPLIED balance (yes | no) #IMPLIED sessionBasedModelsClientSocketSelection (SessionIdLowPart | SessionIdHighPart | SessionIdOptionalPart | RoundRobin) #IMPLIED retries CDATA #IMPLIED log CDATA #IMPLIED splitLog (yes | no) #IMPLIED detailedLog (yes | no) #IMPLIED dumpLog (yes | no) #IMPLIED burstLog (yes | no) #IMPLIED>
-  const anna::xml::Attribute *originHost, *appId, *originRealm, *cer, *dwr, *allowedInactivityTime, *tcpConnectDelay,
+  const anna::xml::Attribute *originHost, *appId, *originRealm, *cer, *dwr, *cea, *allowedInactivityTime, *tcpConnectDelay,
   *answersTimeout, *ceaTimeout, *watchdogPeriod, *entity, *entityServerSessions,
   *diameterServer, *diameterServerSessions, *balance, *sessionBasedModelsClientSocketSelection,
   *retries, *log, *splitLog, *detailedLog, *dumpLog, *burstLog;
@@ -264,6 +278,7 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp
       originRealm = (*it)->getAttribute("originRealm", false /* no exception */);
       cer = (*it)->getAttribute("cer", false /* no exception */);
       dwr = (*it)->getAttribute("dwr", false /* no exception */);
+      cea = (*it)->getAttribute("cea", false /* no exception */);
       allowedInactivityTime = (*it)->getAttribute("allowedInactivityTime", false /* no exception */);
       tcpConnectDelay = (*it)->getAttribute("tcpConnectDelay", false /* no exception */);
       answersTimeout = (*it)->getAttribute("answersTimeout", false /* no exception */);
@@ -359,8 +374,11 @@ void Launcher::servicesFromXML(const anna::xml::Node* servicesNode, bool eventOp
 
       // Diameter Server:
       if(diameterServer) {
+        // Server CEA
+        std::string ceaPathfile = cea ? cea->getValue() : "";
+
         int sessions = diameterServerSessions ? diameterServerSessions->getIntegerValue() : 1;
-        a_workingNode->startDiameterServer(diameterServer->getValue(), sessions, allowedInactivityTimeMs);
+        a_workingNode->startDiameterServer(diameterServer->getValue(), sessions, allowedInactivityTimeMs, answersTimeoutMs, ceaPathfile);
       }
 
       // Logs: