Analytics

187 views
Skip to first unread message

Amor klich

unread,
Mar 6, 2025, 4:12:13 PMMar 6
to CGRateS
Hello 

I'am looking for the best way to get some analytics for an account from date to date like for exp :
Total call cost by destinations
Total call duration by destinations
Total calls by destinations

Are we supposed to do this with sql requests from cdr table or with Stats or some API calls
is there any examples

Thank you

Armir Veliaj

unread,
Mar 7, 2025, 9:47:15 AMMar 7
to CGRateS
Hi Amor,

We recommend using Stats. You can find possible metrics here: https://cgrates.readthedocs.io/en/latest/stats.html.  
For your use case, you want to look at *tcd, *tcc. You can group metrics by destination using filters. For reference, you can check this CSV example for Stats: https://github.com/cgrates/cgrates/blob/master/data/tariffplans/tutorial2/Stats.csv

Thanks,
Armir

Amor klich

unread,
Mar 10, 2025, 9:17:45 AMMar 10
to cgr...@googlegroups.com

Hello Armir

Thank you i got it working with some filters but i couldn't find a way to filter from date to date 


--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cgrates/608769d9-363f-463a-a33f-06019eeddb4en%40googlegroups.com.

Armir Veliaj

unread,
Mar 11, 2025, 1:00:04 PMMar 11
to CGRateS
Hi Amor,

For filtering Stats from date to date on an interval, you can get use of ActivationInterval filter type by defining a StatS Profile as in this example : "stats_profile_set  Tenant="cgrates.org" ID="Stats2" FilterIDs=["*ai:~*req.CustomTime:2023-06-01T00:00:00Z|2023-09-01T00:00:00Z"] Metrics=[{"MetricID":"*tcc"}]"
which you can try in cgr-console  or also by APIerSv1.SetStatQueueProfile API .

Thanks,
Armir

Amor klich

unread,
Mar 11, 2025, 5:11:52 PMMar 11
to CGRateS
Hello Armir

Thank you i will give it a try .

selim jabou

unread,
Jun 17, 2025, 12:00:58 PMJun 17
to CGRateS
Hi, i ve tried this put it didnt work for me, i want to get the analytics from date to date using Stats, for example, from January 2025 to March 2025. i ve tried ActivationInterval, Filters, SetTPTiming, but nothing worked. 

Armir Veliaj

unread,
Jun 20, 2025, 8:45:08 AMJun 20
to CGRateS
Hi Selim,

We need to have your full scenario to identify where the issue is. If the problem is that statsv1.processevent doesn't match the desired statqueue, this could be due to having filters that are not indexable while also having indexed_selects set to true.
You need to either specify an indexable filter (types *string, *prefix, *suffix), or disable indexed_selects by setting it to false in the json config.

For further investigation, please send us your CGRateS JSON config, your StatProfile, and the ngrep output after ensuring that stas_conss is set to *localhost.

Thanks,
Armir

selim jabou

unread,
Jun 20, 2025, 9:41:15 AMJun 20
to CGRateS
STATS works fine with other filters, however in the string_indexed_fields i have these  ["*req.Account", "*req.RunID", "*req.Destination"]. does this affect the filter?  
here is the whole JSON config : 
{
    "general": {
        "log_level": 15,
        "node_id": "DIGIVOIP BILLING SYSTEM",
        "default_tenant": "DIGIVOIP",
        "poster_attempts": 1
    },
    "listen": {
        "rpc_json": ":2012",
        "rpc_gob": ":2013",
        "http": ":2080",
        "http_tls": ":2280"
    },
    "tls": {
        "server_certificate": "/etc/cgrates/ssl/fullchain.pem",
        "server_key": "/etc/cgrates/ssl/privkey.pem",
        "client_certificate" : "",
        "client_key":"",
        "ca_certificate":"" ,
        "server_policy":0,
        "server_name":"cg.digivoip.fr"
    },
    "stor_db": {
        "db_password": "PASS"
    },
    "schedulers": {
        "enabled": true,
        "cdrs_conns": ["*localhost"]
    },

    "rals": {
        "enabled": true,
        "thresholds_conns": ["*localhost"],
        "stats_conns": ["*localhost"]
    },
    "cdrs": {
        "enabled": true,
        "stats_conns": ["*localhost"],
        "chargers_conns": ["*localhost"],
        "attributes_conns": ["*localhost"],
        "rals_conns": ["*localhost"],
        "sessions_cost_retries": 5
    },
   
    "chargers": {
        "enabled": true,
        "attributes_conns": ["*localhost"]
    },
    "sessions": {
        "enabled": true,
        "rals_conns": ["*localhost"],
        "cdrs_conns": ["*localhost"],
        "resources_conns": ["*localhost"],
        "routes_conns": ["*localhost"],
        "attributes_conns": ["*localhost"],
        "stats_conns": ["*localhost"],
        "thresholds_conns": ["*localhost"],
        "chargers_conns": ["*localhost"],
        "debit_interval": "5s",
        "channel_sync_interval": "5s"
    },
    "freeswitch_agent": {
        "enabled": true,
        "event_socket_conns": [
            {"address": "IP", "password": "PASS", "reconnects": -1, "alias": ""},
            {"address": "IP", "password": "PASS", "reconnects": -1, "alias": ""}
        ],
        "sessions_conns": ["*birpc_internal"],
        "extra_fields": [
            "~*req.Caller-Caller-ID-Name",
            "~*req.Caller-Callee-ID-Number",
            "~*req.variable_caller_id_name",
            "~*req.variable_caller_id_number",
            "~*req.Caller-Channel-Hangup-Time",
            "~*req.Call-Direction"
        ],
        "create_cdr": true
    },

    "filters": {                                                            // Filters configuration (*new)
        "enabled": true,
        "apiers_conns": ["*localhost"]                                         // added this line.
},


    "attributes": {
        "enabled": true,
        "stats_conns": ["*localhost"],
        "resources_conns": ["*localhost"],
        "apiers_conns": ["*localhost"]
    },
    "resources": {
        "enabled": true,
        "string_indexed_fields": ["*req.Account"]
    },
    "stats": {
        "enabled": true,
        "store_interval": "0",
        "string_indexed_fields": ["*req.Account", "*req.RunID", "*req.Destination"]
    },
    "thresholds": {
        "enabled": true,
        "string_indexed_fields": ["*req.Account"]
    },
    "routes": {
        "enabled": true,
        "resources_conns": ["*localhost"],
        "stats_conns": ["*localhost"],
        "rals_conns": ["*localhost"],
        "string_indexed_fields": ["*req.Account"]
    },
    "apiers": {
        "enabled": true,
        "scheduler_conns": ["*localhost"],
        "ees_conns": ["*localhost"]
    },
    "ees": {
        "enabled": true,
        "attributes_conns": ["*localhost"],
        "cache": {
            "*file_csv": {
                "limit": -1,
                "ttl": "1s",
                "static_ttl": false
            }
        },
        "exporters": [
            {
                "id": "CSVExporter",
                "type": "*file_csv",
                "filters": [],
                "synchronous": true,

                "export_path": "/home/export",
                "opts": {
                    "csvFileName": "CSVExporter_works.csv",
                    "csvAppend": false,
                    "csvFieldSeparator": ","
                },
                "fields": [
                    {"tag": "CGCRID", "path": "*hdr.CGRID", "type": "*constant", "value": "callid"},
                    {"tag": "Category", "path": "*hdr.Category", "type": "*constant", "value": "Category"},
                    {"tag": "Account", "path": "*hdr.Account", "type": "*constant", "value": "Account"},
                    {"tag": "Subject", "path": "*hdr.Subject", "type": "*constant", "value": "Subject"},
                    {"tag": "Destination", "path": "*hdr.Destination", "type": "*constant", "value": "Destination"},
                    {"tag": "SetupTime", "path": "*hdr.SetupTime", "type": "*constant", "value": "SetupTime"},
                    {"tag": "AnswerTime", "path": "*hdr.AnswerTime", "type": "*constant", "value": "AnswerTime"},
                    {"tag": "Usage", "path": "*hdr.Usage", "type": "*constant", "value": "Usage"},
                    {"tag": "Cost", "path": "*hdr.Cost", "type": "*constant", "value": "Cost"},
                    {"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
                    {"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
                    {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
                    {"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
                    {"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
                    {"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime{*time_string:2006-01-02T15:04:05Z}"},
                    {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime{*time_string:2006-01-02T15:04:05Z}"},
                    {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage{*duration_seconds}"},
                    {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}
                ]
            }
                 ]
    }

}

here are the STATS+ngrep in two scenarios ( 1. works fine (with account filtre), 2. dosent work ) 
{
    "method": "APIerSv1.SetStatQueueProfile",
    "params": [
        {
            "Tenant": "DIGIVOIP",
            "ID": "stats",
            "FilterIDs": [
               
                "FLTR_ACNT_MIRACALL"
            ],
            "ActivationInterval": {
                "ActivationTime": "2014-07-29T15:00:00Z",
                "ExpiryTime": "0001-01-01T00:00:00Z"
            },
            "QueueLength": 10,
            "TTL": -1,
            "MinItems": 0,
            "Metrics": [
                {
                    "FilterIDs": [
                        "FLTR_ACNT_MIRACALL"
                    ],
                    "MetricID": "*tcd"
                },
                {
                    "FilterIDs": [
                        "FLTR_ACNT_MIRACALL"
                    ],
                    "MetricID": "*tcc"
                },
                {
                    "FilterIDs": [
                        "FLTR_ACNT_MIRACALL"
                    ],
                    "MetricID": "*sum#1"
                }
            ],
            "Stored": false,
            "Blocker": true,
            "Weight": 100,
            "ThresholdIDs": [
                "*none"
            ]
        }
    ]
}

NGREP : 
filter: ( port 2012 or 2014 or 2013 or 2080 ) and ((ip || ip6) || (vlan && (ip || ip6)))
#####
T 2025/06/20 14:34:18.657841 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #5
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"ee888dc","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":193}

#
T 2025/06/20 14:34:18.660306 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #6
{"id":193,"result":null,"error":"NOT_FOUND"}

##
T 2025/06/20 14:34:18.660343 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #8
{"method":"ChargerSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"ee888dc","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":194}

#
T 2025/06/20 14:34:18.661570 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #9
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"ee888dc","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":195}

##
T 2025/06/20 14:34:18.661624 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #11
{"id":195,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:34:18.661656 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #12
{"id":194,"result":[{"ChargerSProfile":"SupplierCharger-OUT","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"ee888dc","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}},{"ChargerSProfile":"CustomerCharger","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"ee888dc","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}}],"error":null}

##
T 2025/06/20 14:34:18.675239 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #14
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":196}

#
T 2025/06/20 14:34:18.676552 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #15
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"cc56340c-5d4e-42e6-ba37-7ce06c9ea2b0","Time":"2025-06-20T14:34:18.676527366+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":10.501,"Value":9.5008,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":197}

##
T 2025/06/20 14:34:18.676609 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #17
{"id":197,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:34:18.676633 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #18
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"cc56340c-5d4e-42e6-ba37-7ce06c9ea2b0","Time":"2025-06-20T14:34:18.676527366+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":10.501,"Value":9.5008,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":198}

#
T 2025/06/20 14:34:18.676677 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #19
{"id":198,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:34:18.677840 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #20
{"id":196,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":9.5008,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":10.501,"Value":9.5008,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 14:34:18.690893 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #22
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":199}

#
T 2025/06/20 14:34:18.692130 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #23
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"e439b698-c99a-4186-bb05-b902579d9303","Time":"2025-06-20T14:34:18.692110014+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":9.5008,"Value":8.5006,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":200}

##
T 2025/06/20 14:34:18.692178 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #25
{"id":200,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:34:18.692200 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #26
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"e439b698-c99a-4186-bb05-b902579d9303","Time":"2025-06-20T14:34:18.692110014+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":9.5008,"Value":8.5006,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":201}

#
T 2025/06/20 14:34:18.692241 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #27
{"id":201,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:34:18.693383 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #28
{"id":199,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":8.5006,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":9.5008,"Value":8.5006,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 14:34:18.694157 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #30
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"6c6e3a0","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"ae","RunID":"SupplierCharger-OUT","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"bd3c3c2","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"a603d44","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":10.501,"Value":9.5008,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"bd3c3c2":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"dd5449a","RatesID":"b099bd9","RatingFiltersID":"65bfc8b"}},"Accounting":{"a603d44":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"65bfc8b":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"b099bd9":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"dd5449a":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":202}

#
T 2025/06/20 14:34:18.694255 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #31
{"id":202,"result":["stats"],"error":null}

#
T 2025/06/20 14:34:18.694300 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #32
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"e4fe64e","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"ae","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"ae","RunID":"*default","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"4e41df4","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"b82e419","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":9.5008,"Value":8.5006,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"4e41df4":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"5c0d804","RatesID":"f13b334","RatingFiltersID":"8e933cc"}},"Accounting":{"b82e419":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"8e933cc":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"f13b334":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"5c0d804":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":203}

#
T 2025/06/20 14:34:18.694381 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #33
{"id":203,"result":["stats"],"error":null}



/////////////////////////////////////////////////// second scenario //////////////////////////////////////////////////////////////

STATS : 
{
    "method": "APIerSv1.SetStatQueueProfile",
    "params": [
        {
            "Tenant": "DIGIVOIP",
            "ID": "stats2",
            "FilterIDs": [
               
                "*ai:~*req.CustomTime:2025-06-01T00:00:00Z|2025-09-09T00:00:00Z"
            ],
            "ActivationInterval": {
                "ActivationTime": "2014-07-29T15:00:00Z",
                "ExpiryTime": "0001-01-01T00:00:00Z"
            },
            "QueueLength": 10,
            "TTL": -1,
            "MinItems": 0,
            "Metrics": [
                {
                    "FilterIDs": [
                        "*ai:~*req.CustomTime:2025-06-01T00:00:00Z|2025-09-09T00:00:00Z"
                    ],
                    "MetricID": "*tcd"
                },
                {
                    "FilterIDs": [
                        "*ai:~*req.CustomTime:2025-06-01T00:00:00Z|2025-09-09T00:00:00Z"
                    ],
                    "MetricID": "*tcc"
                },
                {
                    "FilterIDs": [
                        "*ai:~*req.CustomTime:2025-06-01T00:00:00Z|2025-09-09T00:00:00Z"
                    ],
                    "MetricID": "*sum#1"
                }
            ],
            "Stored": false,
            "Blocker": true,
            "Weight": 100,
            "ThresholdIDs": [
                "*none"
            ]
        }
    ]
}

NGREP : 
T 2025/06/20 14:40:30.579429 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #5
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"108b128","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":229}

#
T 2025/06/20 14:40:30.581873 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #6
{"id":229,"result":null,"error":"NOT_FOUND"}

##
T 2025/06/20 14:40:30.581920 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #8
{"method":"ChargerSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"108b128","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":230}

#
T 2025/06/20 14:40:30.583156 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #9
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"108b128","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":231}

##
T 2025/06/20 14:40:30.583218 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #11
{"id":231,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.583257 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #12
{"id":230,"result":[{"ChargerSProfile":"SupplierCharger-OUT","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"108b128","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}},{"ChargerSProfile":"CustomerCharger","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"108b128","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}}],"error":null}

##
T 2025/06/20 14:40:30.596482 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #14
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":232}

#
T 2025/06/20 14:40:30.597770 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #15
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"c81cf0a5-e60d-4393-9763-774be7aa639c","Time":"2025-06-20T14:40:30.597742862+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4.4998,"Value":3.4996,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":233}

##
T 2025/06/20 14:40:30.597827 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #17
{"id":233,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.597849 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #18
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"c81cf0a5-e60d-4393-9763-774be7aa639c","Time":"2025-06-20T14:40:30.597742862+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4.4998,"Value":3.4996,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":234}

#
T 2025/06/20 14:40:30.597888 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #19
{"id":234,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.599065 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #20
{"id":232,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":3.4996,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4.4998,"Value":3.4996,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 14:40:30.612201 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #22
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":235}

#
T 2025/06/20 14:40:30.613479 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #23
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"42a62640-05c3-4a59-a71c-77d81c17b40a","Time":"2025-06-20T14:40:30.61345888+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":3.4996,"Value":2.4994,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":236}

##
T 2025/06/20 14:40:30.613543 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #25
{"id":236,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.613565 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #26
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"42a62640-05c3-4a59-a71c-77d81c17b40a","Time":"2025-06-20T14:40:30.61345888+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":3.4996,"Value":2.4994,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":237}

#
T 2025/06/20 14:40:30.613604 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #27
{"id":237,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.614753 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #28
{"id":235,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":2.4994,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":3.4996,"Value":2.4994,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 14:40:30.615597 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #30
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"72ab84b","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"aeeeaae","RunID":"SupplierCharger-OUT","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"1b93391","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"2e02270","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4.4998,"Value":3.4996,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"1b93391":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"4632975","RatesID":"f3d5d87","RatingFiltersID":"0af51f6"}},"Accounting":{"2e02270":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"0af51f6":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"f3d5d87":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"4632975":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":238}

#
T 2025/06/20 14:40:30.615679 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #31
{"id":238,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 14:40:30.615725 127.0.0.1:54190 -> 127.0.0.1:2012 [AP] #32
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"f2ecd5e","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"aeeeaae","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"aeeeaae","RunID":"*default","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"aa92612","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"f9a078f","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":3.4996,"Value":2.4994,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"aa92612":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"291a9c9","RatesID":"0597269","RatingFiltersID":"10ce6b0"}},"Accounting":{"f9a078f":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"10ce6b0":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"0597269":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"291a9c9":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":239}

#
T 2025/06/20 14:40:30.615791 127.0.0.1:2012 -> 127.0.0.1:54190 [AP] #33
{"id":239,"result":null,"error":"NOT_FOUND"}

Armir Veliaj

unread,
Jun 20, 2025, 11:05:31 AMJun 20
to CGRateS
Hi Selim,

Based on your two scenarios, with and without the account filter, it seems that the issue is related to indexes in the config.
By default, "indexed_selects" is enabled, and each FilterProfile needs to have at least one *string or *prefix type in order for the filter profile to pass. On the other hand, when indexed_selects is disabled, the indexes will not be used at all and profiles will be checked one by one.You can check and our FilterS documentation: https://cgrates.readthedocs.io/en/latest/filters.html

So, in your case, you can either disable indexed_selects or  you can work around with "enabled"  by adding another filter that's indexable (such as account/destination) as in this example API which also has an interval filter for calls with setup times between certain dates,(you need to modify it according to your case):


{
    "method": "ApierV1.SetStatQueueProfile",
    "params": [{
        "Tenant": "cgrates.org",
        "ID": "STAT_TEST",
        "FilterIDs": [
            "*ai:~*req.SetUpTime:2025-01-25T00:00:00Z|2022-03-25T00:00:00Z",
            "*string:~*req.Account:1001"
        ],
        "ActivationInterval": {

        },
        "QueueLength": 10000000,

        "TTL": -1,
        "MinItems": 0,
        "Metrics": [
            {
                "FilterIDs": null,
                "MetricID": "*tcd"
            },
            {
                "FilterIDs": null,
                "MetricID": "*tcd"
            },
            {
                "FilterIDs": null,
                "MetricID": "*asr"
            },
            {
                "FilterIDs": null,
                "MetricID": "*acd"
            }
        ],
        "Stored": true,
        "Blocker": true,
        "Weight": 10
    }]
}


Thanks,
Armir

selim jabou

unread,
Jun 20, 2025, 11:37:12 AMJun 20
to CGRateS
Hello Armir, thank you for your quick response, still it didnt work, first i ve tried adding an account filter to the filter so it matches the event, but it didnt work, neither did changing the "indexed_selects" to false in Stats in the JSON config.

here is the stats config : 
 "stats": {
        "enabled": true,
        "store_interval": "0",
        "indexed_selects": false
    }

and here is the api : 
{
    "method": "APIerSv1.SetStatQueueProfile",
    "params": [
        {
            "Tenant": "DIGIVOIP",
            "ID": "stats2",
            "FilterIDs": [
               
                "*ai:~*req.SetUpTime:2025-01-01T00:00:00Z|2025-09-09T00:00:00Z",
                "*string:~*req.Account:MIRACALL"
            ],
            "ActivationInterval": {
                "ActivationTime": "2014-07-29T15:00:00Z",
                "ExpiryTime": "0001-01-01T00:00:00Z"
            },
            "QueueLength": 1000000,
            "TTL": -1,
            "MinItems": 0,
            "Metrics": [
                {
                    "FilterIDs": [
                        "*ai:~*req.SetUpTime:2025-01-01T00:00:00Z|2025-09-09T00:00:00Z",
                "*string:~*req.Account:MIRACALL"
                    ],
                    "MetricID": "*tcd"
                },
                {
                    "FilterIDs": [
                        "*ai:~*req.SetUpTime:2025-01-01T00:00:00Z|2025-09-09T00:00:00Z",
                "*string:~*req.Account:MIRACALL"
                    ],
                    "MetricID": "*tcc"
                },
                {
                    "FilterIDs": [
                        "*ai:~*req.SetUpTime:2025-01-01T00:00:00Z|2025-09-09T00:00:00Z",
                "*string:~*req.Account:MIRACALL"
                    ],
                    "MetricID": "*sum#1"
                }
            ],
            "Stored": true,
            "Blocker": true,
            "Weight": 100,
            "ThresholdIDs": [
                "*none"
            ]
        }
    ]
}

and here is the ngrep : 
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"8be94da","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":72}

#
T 2025/06/20 16:34:39.045322 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #2
{"id":72,"result":null,"error":"NOT_FOUND"}

##
T 2025/06/20 16:34:39.045357 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #4
{"method":"ChargerSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"8be94da","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*cdrs"}}],"id":73}

#
T 2025/06/20 16:34:39.046570 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #5
{"method":"AttributeSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"8be94da","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":74}

##
T 2025/06/20 16:34:39.046624 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #7
{"id":74,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.046655 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #8
{"id":73,"result":[{"ChargerSProfile":"SupplierCharger-OUT","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"8be94da","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}},{"ChargerSProfile":"CustomerCharger","AttributeSProfiles":null,"AlteredFields":["*req.RunID"],"CGREvent":{"Tenant":"DIGIVOIP","ID":"8be94da","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":0,"CostSource":"","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}}],"error":null}

##
T 2025/06/20 16:34:39.059971 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #10
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":75}

#
T 2025/06/20 16:34:39.061269 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #11
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"58f4f815-505e-4b95-b7b3-dac196b629bb","Time":"2025-06-20T16:34:39.061242726+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4989.998,"Value":4988.9978,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":76}

##
T 2025/06/20 16:34:39.061351 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #13
{"id":76,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.061376 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #14
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"58f4f815-505e-4b95-b7b3-dac196b629bb","Time":"2025-06-20T16:34:39.061242726+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4989.998,"Value":4988.9978,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":77}

#
T 2025/06/20 16:34:39.062622 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #15
{"id":77,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.063785 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #16
{"id":75,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":4988.9978,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4989.998,"Value":4988.9978,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 16:34:39.076927 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #18
{"method":"Responder.Debit","params":[{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","LoopIndex":0,"DurationIndex":60000000000,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"*voice","ExtraFields":{},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"","RunID":"","ForceDuration":false,"PerformRounding":true,"DenyNegativeAccount":false,"DryRun":false,"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":78}

#
T 2025/06/20 16:34:39.078167 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #19
{"method":"ThresholdSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"898f350a-0081-49e0-b306-f71aa4d37fda","Time":"2025-06-20T16:34:39.078146963+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4988.9978,"Value":4987.9976,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":79}

##
T 2025/06/20 16:34:39.078216 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #21
{"id":79,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.078244 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #22
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"898f350a-0081-49e0-b306-f71aa4d37fda","Time":"2025-06-20T16:34:39.078146963+01:00","Event":{"AllowNegative":false,"BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4988.9978,"Value":4987.9976,"Disabled":false}],"Disabled":false,"ID":"MIRACALL","Tenant":"DIGIVOIP"},"APIOpts":{"*eventType":"AccountUpdate"}}],"id":80}

#
T 2025/06/20 16:34:39.079409 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #23
{"id":80,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.080553 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #24
{"id":78,"result":{"Category":"CALL-OUT","Tenant":"DIGIVOIP","Subject":"FRANCE_STANDARD_PACK1","Account":"MIRACALL","Destination":"33184140118","ToR":"*voice","Cost":1.0002,"Timespans":[{"TimeStart":"2025-03-20T13:01:53.668+01:00","TimeEnd":"2025-03-20T13:02:53.668+01:00","Cost":1.0002,"RateInterval":{"Timing":{"ID":"*any","Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00","EndTime":""},"Rating":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","Rates":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Weight":10},"DurationIndex":60000000000,"Increments":[{"Duration":1000000000,"Cost":0.01667,"BalanceInfo":{"Unit":null,"Monetary":{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Value":4987.9976,"RateInterval":null},"AccountID":"DIGIVOIP:MIRACALL"},"CompressFactor":60}],"RoundIncrement":null,"MatchedSubject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1","MatchedPrefix":"3318","MatchedDestId":"France-Geographic","RatingPlanId":"FRANCE_STANDARD","CompressFactor":1}],"RatedUsage":60000000000,"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4988.9978,"Value":4987.9976,"Disabled":false}],"AllowNegative":false,"Disabled":false}},"error":null}

##
T 2025/06/20 16:34:39.081340 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #26
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"e224f36","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"azezzeaazzeaazeeaaeazze","RunID":"SupplierCharger-OUT","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"aa338fa","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"e67e71f","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4989.998,"Value":4988.9978,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"aa338fa":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"00fa0e7","RatesID":"09cea90","RatingFiltersID":"ad2d8db"}},"Accounting":{"e67e71f":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"ad2d8db":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"09cea90":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"00fa0e7":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"SupplierCharger-OUT","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*attrProfileIDs":["ATTR_SUPPLIER_OUT"],"*context":"*cdrs","*subsys":"*chargers"}}],"id":81}

#
T 2025/06/20 16:34:39.082551 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #27
{"id":81,"result":null,"error":"NOT_FOUND"}

#
T 2025/06/20 16:34:39.082590 127.0.0.1:48792 -> 127.0.0.1:2012 [AP] #28
{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"8ab2907","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"azezzeaazzeaazeeaaeazze","RunID":"*default","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"908e852","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"3ea55cb","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4988.9978,"Value":4987.9976,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"908e852":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"9b16204","RatesID":"88eb63c","RatingFiltersID":"a18d497"}},"Accounting":{"3ea55cb":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"a18d497":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"88eb63c":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"9b16204":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":82}

#
T 2025/06/20 16:34:39.083778 127.0.0.1:2012 -> 127.0.0.1:48792 [AP] #29
{"id":82,"result":null,"error":"NOT_FOUND"}

Armir Veliaj

unread,
Jun 23, 2025, 10:48:37 AMJun 23
to CGRateS
Hi Selim,


I reproduced your scenario by using the same StatSv1.ProcessEvent that you had, and the stats are shown as expected.
Only a change in the API for SetStatQueueProfile is needed (there was a typo in SetupTime field, and the filters inside Metrics are redundant):


{
"method": "APIerSv1.SetStatQueueProfile",
"params": [{
"Tenant": "DIGIVOIP",
"ID": "stats6",
"FilterIDs": [

"*ai:~*req.SetupTime:2025-01-01T00:00:00Z|2025-09-09T00:00:00Z",

"*string:~*req.Account:MIRACALL"
],
"ActivationInterval": {
"ActivationTime": "2014-07-29T15:00:00Z",
"ExpiryTime": "0001-01-01T00:00:00Z"
},
"QueueLength": 1000000,
"TTL": -1,
"MinItems": 0,
"Metrics": [{
"FilterIDs": null,
"MetricID": "*tcd"
},
{
"FilterIDs": null,
"MetricID": "*tcd"
},
{
"FilterIDs": null,
"MetricID": "*asr"
},
{
"FilterIDs": null,
"MetricID": "*acd"
}
],
"Stored": true,
"Blocker": true,
"Weight": 100,
"ThresholdIDs": [
"*none"
]
}]
}
{"id":null,"result":"OK","error":null}




{"method":"StatSv1.ProcessEvent","params":[{"Tenant":"DIGIVOIP","ID":"8ab2907","Time":null,"Event":{"Account":"MIRACALL","AnswerTime":"2025-03-20T13:01:53.668+01:00","CGRID":"azezzeaazzeaazeeaaeazze","Category":"CALL-OUT","Cost":1.0002,"CostDetails":{"CGRID":"azezzeaazzeaazeeaaeazze","RunID":"*default","StartTime":"2025-03-20T13:01:53.668+01:00","Usage":60000000000,"Cost":1.0002,"Charges":[{"RatingID":"908e852","Increments":[{"Usage":1000000000,"Cost":0.01667,"AccountingID":"3ea55cb","CompressFactor":60}],"CompressFactor":1}],"AccountSummary":{"Tenant":"DIGIVOIP","ID":"MIRACALL","BalanceSummaries":[{"UUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","ID":"*default","Type":"*monetary","Initial":4988.9978,"Value":4987.9976,"Disabled":false}],"AllowNegative":false,"Disabled":false},"Rating":{"908e852":{"ConnectFee":0,"RoundingMethod":"","RoundingDecimals":4,"MaxCost":10,"MaxCostStrategy":"*disconnect","TimingID":"9b16204","RatesID":"88eb63c","RatingFiltersID":"a18d497"}},"Accounting":{"3ea55cb":{"AccountID":"DIGIVOIP:MIRACALL","BalanceUUID":"5282c681-2805-44a5-937a-5fb9c7a076f8","RatingID":"","Units":0.01667,"ExtraChargeID":""}},"RatingFilters":{"a18d497":{"DestinationID":"France-Geographic","DestinationPrefix":"3318","RatingPlanID":"FRANCE_STANDARD","Subject":"*out:DIGIVOIP:CALL-OUT:FRANCE_STANDARD_PACK1"}},"Rates":{"88eb63c":[{"GroupIntervalStart":0,"Value":1,"RateIncrement":1000000000,"RateUnit":60000000000}]},"Timings":{"9b16204":{"Years":[],"Months":[],"MonthDays":[],"WeekDays":[],"StartTime":"00:00:00"}}},"CostSource":"*cdrs","Destination":"33184140118","ExtraInfo":"","OrderID":0,"OriginHost":"","OriginID":"testRpLateCDRProcessEvent","Partial":false,"PreRated":false,"RequestType":"*prepaid","RunID":"*default","SetupTime":"2025-03-20T13:01:53.668+01:00","Source":"testRpLateCDRProcessEvent","Subject":"FRANCE_STANDARD_PACK1","Tenant":"DIGIVOIP","ToR":"*voice","Usage":60000000000},"APIOpts":{"*context":"*cdrs","*subsys":"*chargers"}}],"id":82}
{"id":82,"result":["stats6"],"error":null}



{
"method": "StatSv1.GetQueueStringMetrics",
"params": [
{
"Tenant": "DIGIVOIP",
"id": "stats6"
}
]
}
{"id":null,"result":{"*acd":"1m0s","*asr":"100%","*tcd":"1m0s"},"error":null}


Thanks,
Armir

selim jabou

unread,
Jun 27, 2025, 6:01:57 AMJun 27
to CGRateS
Thank you armir, it works now.
Reply all
Reply to author
Forward
0 new messages