diff --git a/utils/cgrevent.go b/utils/cgrevent.go index 716342692..546793b58 100644 --- a/utils/cgrevent.go +++ b/utils/cgrevent.go @@ -97,7 +97,7 @@ func (ev *CGREvent) FieldAsDuration(fldName string) (d time.Duration, err error) // OptAsDuration returns an option as Duration instance func (ev *CGREvent) OptAsDuration(optName string) (d time.Duration, err error) { - iface, has := ev.Event[optName] + iface, has := ev.APIOpts[optName] if !has { err = ErrNotFound return diff --git a/utils/cgrevent_test.go b/utils/cgrevent_test.go index c247a8b29..1d08265c4 100644 --- a/utils/cgrevent_test.go +++ b/utils/cgrevent_test.go @@ -510,7 +510,7 @@ func TestCGREventOptAsDurationEmpty(t *testing.T) { func TestCGREventOptAsDuration(t *testing.T) { ev := &CGREvent{ - Event: map[string]interface{}{ + APIOpts: map[string]interface{}{ "testKey": 30, }, }