Create APIOpts if null before exporting event

This commit is contained in:
ionutboangiu
2022-02-25 14:11:15 +02:00
committed by Dan Christian Bogos
parent 3471d868b6
commit 0635eb5130

View File

@@ -85,6 +85,12 @@ func (e *RPCee) GetMetrics() (mp *utils.SafeMapStorage) {
}
func (e *RPCee) PrepareMap(mp *utils.CGREvent) (interface{}, error) {
if mp == nil {
return nil, nil
}
if mp.APIOpts == nil {
mp.APIOpts = make(map[string]interface{})
}
for i, v := range e.Cfg().Opts.RPCAPIOpts {
mp.APIOpts[i] = v
}