I am new to cgrates, and the cgrates is too complicate for me to understand.
I studied for a week, but failed to setup billing by *voice type with minutes deduct method.
The billing requirement is simple, i have 10XX extensions, and I want to arrange 10 min for each exten, once the minutes running out, then stop the call.
root@ec29afbd3af1:/etc/asterisk# cat extensions.conf
[internal]
exten => _XXXX,1,NoOp()
same => n,Set(CGRMaxSessionTime=0); use it to disconnect automatically the call if CGRateS is not active
same => n,Set(LIMIT_WARNING_FILE=/var/lib/asterisk/sounds/en/beep)
same => n,Set(LIMIT_PLAYAUDIO_CALLER=YES)
same => n,Set(LIMIT_PLAYAUDIO_CALLEE=YES)
same => n,DumpChan()
same => n,Stasis(cgrates_auth,cgr_reqtype=*prepaid,cgr_flags=*accounts+*attributes+*resources+*stats+*routes+*thresholds,cgr_tenant=
cgrates.org,cgr_account=${CALLERID(num)},cgr_destination=${EXTEN},cgr_category=call)
same => n,Set(CHANNEL(hangup_handler_push)=hangUp,hUP,1)
same => n,Dial(SIP/${EXTEN},30,L(${CGRMaxSessionTime}:10000))
same => n,Hangup()
[hangUp]
exten => hUP, 1, NoOp(Hang Up)
exten => hUP, 2, GotoIf($["${ANSWEREDTIME}000" != "${CGRMaxSessionTime}"]?exitHangUP:logHangUP)
exten => hUP, 3(logHangUP),Log(WARNING,"Was closed because the max session time")
exten => hUP, 4(exitHangUP),Return()
root@ec29afbd3af1:/etc/asterisk# cat ari.conf
[general]
enabled = yes
allowed_origins = *
channelvars = cgr_reqtype,cgr_flags,cgr_tenant,cgr_account,cgr_destination,cgr_category,CDR(answer),CDR(billsec)
[cgrates]
type = user
read_only = no
password = CGRateS.org
and the csv files attached.
Can anyone help me to understand what is wrong with the csv settings? thanks so much!