int addChild(Avp *avp) throw() { return Avp::addChild(a_avps, a_insertionPositionForChilds, avp); }
const anna::diameter::stack::Command *getStackCommand(CommandId id) const throw(anna::RuntimeException);
- void setFailedAvp(const parent_t &parent, AvpId wrong) throw(anna::RuntimeException);
+ void setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName = NULL) throw(anna::RuntimeException);
// During message decoding and validation, the first wrong avp is stored and all the tracking is managed to find out its
// nested path for the case of grouped avps with wrong avps inside. Remember the RFC 6733, section 7.5:
//
if(answer) {
answer->setResultCode(helpers::base::AVPVALUES__Result_Code::DIAMETER_INVALID_AVP_BITS);
- answer->setFailedAvp(parent, a_id); // RFC 6733 says nothing about Failed-AVP in this case...
+ answer->setFailedAvp(parent, a_id, stackAvp->getName().c_str()); // RFC 6733 says nothing about Failed-AVP in this case...
}
getEngine()->validationAnomaly(anna::functions::asString("The AVP %s flags (%d) does not fulfill the defined flag rules: %s", STRING_WITH_QUOTATION_MARKS__C_STR(me.asString()), (int)a_flags, STRING_WITH_QUOTATION_MARKS__C_STR(stackAvp->getFlagRulesDescription())));
if(answer) {
answer->setResultCode(helpers::base::AVPVALUES__Result_Code::DIAMETER_INVALID_AVP_VALUE);
- answer->setFailedAvp(parent, a_id);
+ answer->setFailedAvp(parent, a_id, stackAvp->getName().c_str());
}
getEngine()->validationAnomaly(anna::functions::asString("Enumerated AVP %s with value %d does not comply to restriction: %s", STRING_WITH_QUOTATION_MARKS__C_STR(me.asString()), a_Enumerated->getValue(), stackAvp->getEnums()));
//------------------------------------------------------------------------------
//------------------------------------------------------ Message::setFailedAvp()
//------------------------------------------------------------------------------
-void Message::setFailedAvp(const parent_t &parent, AvpId wrong) throw(anna::RuntimeException) {
+void Message::setFailedAvp(const parent_t &parent, AvpId wrong, const char *wrongName) throw(anna::RuntimeException) {
if(isRequest()) return;
LOGDEBUG(
std::string msg = "Adding to Failed-AVP, the wrong avp ";
- msg += anna::diameter::functions::avpIdAsPairString(wrong);
+ msg += wrongName ? wrongName : (anna::diameter::functions::avpIdAsPairString(wrong));
msg += " found inside ";
msg += parent.asString();