Make Origin-Host the node identifier instead of origin-realm
[anna.git] / source / diameter.comm / Entity.cpp
index 17c1ebf..23b8a31 100644 (file)
@@ -335,12 +335,13 @@ void Entity::eventRequestRetransmission(const ClientSession* clientSession, Mess
 
 std::string Entity::asString() const throw() {
   std::string result("diameter::comm::Entity { ");
-  std::string realm = a_engine->getRealm();
+  std::string originRealm = a_engine->getOriginRealm();
+  std::string originHost = a_engine->getOriginHost();
 
-  if(realm != "") {
-    result += "Parent Engine (realm): ";
-    result += realm;
-  }
+  result += "Parent Engine Origin-Realm: ";
+  result += (originRealm != "") ? originRealm:"<not configured>";
+  result += " | Parent Engine Origin-Host: ";
+  result += (originHost != "") ? originHost:"<not configured>";
 
   result += " | Category: ";
   result += anna::functions::asString(a_category);
@@ -377,9 +378,11 @@ std::string Entity::asString() const throw() {
 
 anna::xml::Node* Entity::asXML(anna::xml::Node* parent) const throw() {
   anna::xml::Node* result = parent->createChild("diameter.Entity");
-  std::string realm = a_engine->getRealm();
+  std::string originRealm = a_engine->getOriginRealm();
+  std::string originHost = a_engine->getOriginHost();
 
-  if(realm != "") result->createAttribute("ParentEngineRealm", realm);
+  if(originRealm != "") result->createAttribute("ParentEngineOriginRealm", originRealm);
+  if(originHost != "") result->createAttribute("ParentEngineOriginHost", originHost);
 
   result->createAttribute("Category", anna::functions::asString(a_category));