maxusage help via cgr-console using tutorial data

111 views
Skip to first unread message

Gavin Henry

unread,
Mar 22, 2018, 12:35:14 PM3/22/18
to CGRateS
Hi all,

I've cleared everything and am testing below using the data at https://github.com/cgrates/cgrates/tree/master/data/tariffplans/tutorial


cgr> maxusage RequestType="*prepaid" Category="call" Tenant="cgrates.org" Subject="1001" Account="1001" Destination="1002" AnswerTime="2018-03-22T16:23:00Z"
0.0000108


T 2018/03/22 16:33:58.986974 127.0.0.1:42183 -> 127.0.0.1:2012 [AP]
{"method":"ApierV1.GetMaxUsage","params":[{"ToR":"","RequestType":"*prepaid","Tenant":"cgrates.org","Category":"call","Account":"1001","Subject":"1001","Destination":"1002","SetupTime":"","AnswerTime":"2018-03-22T16:23:00Z","Usage":"","ExtraFields":null}],"id":20}

#
T 2018/03/22 16:33:58.990209 127.0.0.1:2012 -> 127.0.0.1:42183 [AP]
{"id":20,"result":0.0000108,"error":null}


Now I think I should expect a time Duration as a result?

As per http://cgrates.readthedocs.io/en/latest/tut_cgrates_usage.html it states:

Account 1001 will receive a special deal for 1002 and 1003 destinations during peak times with RT_20CNT, otherwise having default rating.

1001 will receive 5 units of general *monetary, 5 units of shared balance in the shared group “SHARED_A” and 90 seconds of calling destination 1002 with special rates RT_1CNT.

So I'm in the PEAK timing and no actual calls have been rated, so I should have full access to 5 units of money, 5 units of shared and 90s to play with, right?

Can anyone correct me here or explain what I'm doing wrong?

Thanks,
Gavin.

DanB

unread,
Mar 23, 2018, 3:53:49 AM3/23/18
to cgr...@googlegroups.com
Hey Gavin,

Since GetMaxUsage is designed to deal with calls, we will return the
duration as seconds/float64 for user-friendliness.
The small number shows that you have most probably set up the bundle
wrong (nanoseconds instead of seconds).

DanB
> --
> 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 post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/5db46533-9ac5-46bb-a8b1-9d6d918cec2d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

Gavin Henry

unread,
Mar 23, 2018, 11:53:51 AM3/23/18
to CGRateS

On Friday, March 23, 2018 at 7:53:49 AM UTC, DanB wrote:
Hey Gavin,

Since GetMaxUsage is designed to deal with calls, we will return the
duration as seconds/float64 for user-friendliness.
The small number shows that you have most probably set up the bundle
wrong (nanoseconds instead of seconds).


Hi Dan,

This is just the default data from the git repo. I'll check cgrates.json though. What should the result be with all the stock config and stock data from https://github.com/cgrates/cgrates/tree/master/data/tariffplans/tutorial

Thanks.

DanB

unread,
Mar 24, 2018, 3:21:50 AM3/24/18
to cgr...@googlegroups.com
Hey Gavin,

Sorry, I was in a rush last days. The reason you are getting small
number is related to the fact that you are not passing any Usage.
MaxUsage is designed around the idea that you are asking some usage
from the engine and the engine allows complete or less from the usage
you are asking.
You can try with a query similar to this:
"""
cgr> maxusage RequestType="*prepaid" Category="call"
Tenant="cgrates.org" Subject="1001" Account="1001" Destination="1002"
AnswerTime="2018-03-22T16:23:00Z" Usage="6h"
18120
"""

DanB
> --
> 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 post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/5fc07319-8bcf-4d85-ad96-6c10cad37d05%40googlegroups.com
Reply all
Reply to author
Forward
0 new messages