The Diameter entities that are dynamically learned from a peer using Capability Exchange are:
the received origin realm name (via origin-realm AVP)
the App-ID
These entities are used to populate the realm table (<realm, app-id> to peer mapping) on which the routing decisions are based.
The origin-host AVP from CEA is used to cross check the peer name in the peer table. A mismatch between the configured and learned (origin-host AVP in CEA) peer names causes the TCP connection to close.
The destination hostname is initially learned on the application level (Gx and Gy) using CCA-I messages and the destination hostname can be re-learned through subsequent incoming application level messages. For example, the origin hostname in incoming application level messages become the destination hostname in outgoing application level messages.
The destination realm, although initially configured, can also be learned on the application level using incoming application level messages (Gx and Gy). Dynamic learning is enabled per message, and the learned value is used in subsequent request messages.