예제 #1
0
// Creates a new LcrRules profile within a tariff plan
func (self *ApierV1) SetTPLcrRule(attrs utils.TPLcrRules, reply *string) error {
	if missing := utils.MissingStructFields(&attrs, []string{"TPid", "Direction", "Tenant", "Category", "Account", "Subject"}); len(missing) != 0 {
		return utils.NewErrMandatoryIeMissing(missing...)
	}
	tm := engine.APItoModelLcrRule(&attrs)
	if err := self.StorDb.SetTpLCRs(tm); err != nil {
		return utils.NewErrServerError(err)
	}
	*reply = "OK"
	return nil
}
예제 #2
0
// Creates a new LcrRules profile within a tariff plan
func (self *ApierV1) SetTPLcrRule(attrs utils.TPLcrRules, reply *string) error {
	if missing := utils.MissingStructFields(&attrs, []string{"TPid", "LcrRulesId", "Identifier", "Weight"}); len(missing) != 0 {
		return utils.NewErrMandatoryIeMissing(missing...)
	}
	tm := engine.APItoModelLcrRule(&attrs)
	if err := self.StorDb.SetTpLCRs(tm); err != nil {
		return utils.NewErrServerError(err)
	}
	*reply = "OK"
	return nil
}