Added *sipcid field type

This commit is contained in:
Trial97
2021-07-05 08:16:00 +03:00
committed by Dan Christian Bogos
parent ddc1474e41
commit 2c426ff2de
4 changed files with 496 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ package engine
import (
"fmt"
"math"
"sort"
"strconv"
"strings"
"time"
@@ -505,6 +506,15 @@ func ParseAttribute(dp utils.DataProvider, attrType, path string, value config.R
reqNr = 0
}
return usedCCTime + time.Duration(debitItvl.Nanoseconds()*reqNr), nil
case utils.MetaSIPCID:
values := make([]string, len(value))
for i, val := range value {
if values[i], err = val.ParseDataProvider(dp); err != nil {
return
}
}
sort.Strings(values[1:])
out = strings.Join(values, utils.InfieldSep)
default:
return utils.EmptyString, fmt.Errorf("unsupported type: <%s>", attrType)
}