cgr-console number of calls per tenant

138 views
Skip to first unread message

Kristína Hrivíková

unread,
Apr 21, 2021, 2:17:25 PM4/21/21
to CGRateS
Hi,

I would like to ask whether cgr-console contains option to display number of calls per tenant for defined period of time (one day). 
Or maybe option to show total call duration for defined period of time (one day).

I have tried to check all possible commands which cgr-console supports but I was not able to find the right one.

My goal is not to use DB for getting that information (calls count per day / total call duration per day) .

Thank you.

Andrei-Sebastian Andronache

unread,
Apr 22, 2021, 10:54:44 AM4/22/21
to cgr...@googlegroups.com
In order to achieve what you want you will need to follow these steps:
-Load a TariffPlan where the Stats.csv(ex: https://github.com/cgrates/cgrates/blob/master/data/tariffplans/tutorial/Stats.csv) has the fields "TTL" set to "1d" (1 day)  and the "Metrics" field set as "*tcd" (total call duration) or "*sum#1" (number of calls).
-Enable Stats in config file (ex: https://github.com/cgrates/cgrates/blob/0d281ae5c993c974a41290182670624a0ec3e928/data/conf/samples/tutmysql/cgrates.json#L70).
-Make the connection between Sessions and Stats (ex: https://github.com/cgrates/cgrates/blob/master/data/conf/samples/tutmysql/cgrates.json#L70)
-The command for cgr-console is : " stats_metrics Tenant="" ID="" " .

You can do a lot using Stats.




--
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 on the web visit https://groups.google.com/d/msgid/cgrates/26735fa9-72b9-4787-8a8e-618c1e815082n%40googlegroups.com.

Kristína Hrivíková

unread,
May 4, 2021, 4:01:45 AM5/4/21
to CGRateS
Thank you so much.

Dátum: štvrtok 22. apríla 2021, čas: 16:54:44 UTC+2, odosielateľ: andrei.a...@itsyscom.com

Kristína Hrivíková

unread,
May 5, 2021, 3:26:56 AM5/5/21
to CGRateS
Hi, 

could anyone help me what can cause PARTIALLY_EXECUTED error when making calls?


May  5 08:54:57 localhost CGRateS <CGRKamailio> [82093]: <SessionS> error: PARTIALLY_EXECUTED processing event &{Tenant:1234567890 ID:6658f67 Time:2021-05-05 08:54:57 +0200 CEST Event:map[Account:default CGRID:c132628753d1177aafafdfcea658f09d3eff107e Category:cat_customer_from Customer_from_branch:SK Customer_to_branch:SK Destination:421235894899 Destination_date:2021-05-05 Destination_time:2021-05-05T08:54:57+02:00 EvapiConnID:0 Gateway_callid:3d457fc25ffdb51e54837bb15f42 OriginHost:192.168.1.3:8448 OriginID:4b10aa1d-20e1-483a-a957-b66ef26c726a;HSt78Z9pQgKyD Origination:42123456789 Origination_date:2021-05-05 Origination_time:2021-05-05T08:54:57+02:00 RequestType:*prepaid SetupTime:2021-05-05T08:54:57+02:00 Source:KamailioAgent Subject:custom Tenant:1234567890 Usage:7200s call_owner:366 billing_scenario_dialplan_12:standard customer_call_request:true filename:1620197697.873648.csv]} with StatS.



My stats are configured as follow:

"stats": {                                                                   
        "enabled": true,                                               
        "store_interval": "",                                 
        "store_uncompressed_limit": 0,                               
        "thresholds_conns": ["*internal"],
        "indexed_selects":true,                                
        //"string_indexed_fields": ["Account"],               
        "prefix_indexed_fields": ["Destination"],                      
        "nested_fields": false,                                
},

statsprofile:

{
 "ActivationInterval": {
  "ActivationTime": "2014-01-14T00:00:00Z",
  "ExpiryTime": "0001-01-01T00:00:00Z"
 },
 "Blocker": false,
 "FilterIDs": [
  "customer_stats_filter"
 ],
 "ID": "foreign_stats_test",
 "Metrics": [
  {
   "FilterIDs": null,
   "MetricID": "*tcd"
  },
  {
   "FilterIDs": null,
   "MetricID": "*tcc"
  },
  {
   "FilterIDs": null,
   "MetricID": "*distinct:~*req.OriginID"
  }
 ],
 "MinItems": 0,
 "QueueLength": 2000,
 "Stored": false,
 "TTL": "1h0m0s",
 "Tenant": "1234567890",
 "ThresholdIDs": [
  "*none"
 ],
 "Weight": 10
}

Thank you.


Dátum: utorok 4. mája 2021, čas: 10:01:45 UTC+2, odosielateľ: Kristína Hrivíková

Andrei-Sebastian Andronache

unread,
May 10, 2021, 5:46:42 AM5/10/21
to cgr...@googlegroups.com
Hi,

Could you please send us the version you are on? We will also need the ngrep of the api call and the full syslog to better understand your problem.

Thank you.

Andrei-Sebastian Andronache

unread,
May 11, 2021, 7:46:11 AM5/11/21
to cgr...@googlegroups.com
Hello, 

Can you please send me the statsprofile matching this tenant:"1533192137" as the one you provided doesn't match the one I found.
Also please put the "thresholds_conns" as "*localhost" and capture the ngrep again.

Thank you.

Andrei-Sebastian Andronache

unread,
May 17, 2021, 6:55:02 AM5/17/21
to cgr...@googlegroups.com
Hello, 

From the ngrep you have sent me, I can say that the event matching the stats profile you have sent me lacks the "Cost" field.
Because of this, the total call cost ("*tcc") defined in the metrics of your stats profile can't be calculated. This is the reason you received the "PARTIALLY_EXECUTED" error.
You should maybe try to use filters, or remove that metric for now.

Thanks.
Reply all
Reply to author
Forward
0 new messages