mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 05:09:54 +05:00
DiameterAgent config - message_templates option added
This commit is contained in:
@@ -78,6 +78,7 @@ func (self *DiameterAgent) handlers() diam.Handler {
|
||||
return dSM
|
||||
}
|
||||
|
||||
// handleALL is the handler of all messages coming in via Diameter
|
||||
func (self *DiameterAgent) handleALL(c diam.Conn, m *diam.Message) {
|
||||
utils.Logger.Warning(fmt.Sprintf("<%s> received unexpected message from %s:\n%s", utils.DiameterAgent, c.RemoteAddr(), m))
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ type DiameterAgentCfg struct {
|
||||
OriginRealm string
|
||||
VendorId int
|
||||
ProductName string
|
||||
MessageTemplates map[string][]*FCTemplate
|
||||
RequestProcessors []*DARequestProcessor
|
||||
}
|
||||
|
||||
@@ -66,6 +67,14 @@ func (da *DiameterAgentCfg) loadFromJsonCfg(jsnCfg *DiameterAgentJsonCfg) error
|
||||
if jsnCfg.Product_name != nil {
|
||||
da.ProductName = *jsnCfg.Product_name
|
||||
}
|
||||
if jsnCfg.Message_templates != nil {
|
||||
if da.MessageTemplates == nil {
|
||||
da.MessageTemplates = make(map[string][]*FCTemplate)
|
||||
}
|
||||
for k, jsnTpls := range jsnCfg.Message_templates {
|
||||
da.MessageTemplates[k] = FCTemplatesFromFCTemapltesJsonCfg(jsnTpls)
|
||||
}
|
||||
}
|
||||
if jsnCfg.Request_processors != nil {
|
||||
for _, reqProcJsn := range *jsnCfg.Request_processors {
|
||||
rp := new(DARequestProcessor)
|
||||
|
||||
@@ -335,6 +335,7 @@ type DiameterAgentJsonCfg struct {
|
||||
Origin_realm *string
|
||||
Vendor_id *int
|
||||
Product_name *string
|
||||
Message_templates map[string][]*FcTemplateJsonCfg
|
||||
Request_processors *[]*DARequestProcessorJsnCfg
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user