Yeah, i copied dialog and cnxcc params from your kamailio-cnxcc-basic.cfg

#!define DLG_FLAG 28
#!define CC_FLAG 29
modparam("dialog", "hash_size", 2048)
modparam("dialog", "default_timeout", 3600)
modparam("dialog", "db_mode", 0)
modparam("dialog", "dlg_flag", DLG_FLAG)
modparam("cnxcc", "dlg_flag", CC_FLAG)
modparam("cnxcc", "credit_check_period", 1) #check every 1 second

these are my params;
#!define FLD_DLG 4
#!define FLD_CNXCC 5
modparam("dialog", "dlg_flag", FLD_DLG)
modparam("dialog", "default_timeout", 7200)
modparam("dialog", "timeout_avp", "$avp(dlg_timeout)")
modparam("dialog", "ka_timer", 3)
modparam("dialog", "ka_interval", 10)
modparam("dialog", "profiles_with_value",
"concurrent;carrier;ingress;egress")          # concurrent = did --
fix this
modparam("dialog", "send_bye", 1)
modparam("dialog", "hash_size", 2048)
modparam("cnxcc", "dlg_flag", FLD_CNXCC)
modparam("cnxcc", "credit_check_period", 1)


then i use this snippet to test:

$var(client) = "customer1";
xlog("L_INFO", "Setting up money based credit control");

$var(credit) = "10"; # 10$ of credit
$var(cost_per_sec) = "1";  # 1$ per sec
$var(i_pulse) = "1";  # 1$ to establish the call
$var(f_pulse) = "1";  # 1$ per second

# if only one call is established, that call should last 9 seconds.

if (!cnxcc_set_max_credit("$var(client)",
 "$var(credit)",
 "$var(cost_per_sec)",
 "$var(i_pulse)",
 "$var(f_pulse)")) {
xlog("Error setting up credit control");
return;
}

I am currently using plain dialog module to limit concurrent calls and
it's working perfectly
just wanted to check out cnxcc for prepaid control. could the dialog
profiles be interfering with
cnxcc?  btw, i'm using kamailio 4.1.2

this can wait, not in hurry or anything, it might ruin your tour, your
wife will kill me lol

Kelvin Chua


On Wed, Apr 9, 2014 at 10:52 AM, Carlos Ruiz Díaz
<carlos.ruizd...@gmail.com> wrote:
>
> Hi Kelvin,
>
> this looks a lot like the classic dialog matching problem. Have you tried to 
> use the example conf file that is provided with the module? Please try that 
> as is, and copy the params of both dialog and cnxcc modparams to your script.
>
> I will try to reply when i'm not touring around ;-).
>
> Regards,
> Carlos
>
> On Apr 8, 2014 9:18 PM, "Kelvin Chua" <kel...@gmail.com> wrote:
>>
>> Wow rome! great choice carlos! enjoy your honeymoon! :)
>>
>> here is what i did:
>>
>> #!define FLD_CNXCC 5
>> modparam("cnxcc", "dlg_flag", FLD_CNXCC)
>> cnxcc_set_max_credit(1 , 196.9485 , 0.011000 , 6 , 6);
>>
>>
>> number_of_calls increments for every call and i never see max_amount going 
>> non-zero
>> client_id:6,number_of_calls:2,concurrent_calls:0,type:1,max_amount:0.000000,consumed_amount:0.000000;
>>
>> Kelvin Chua
>>
>>
>> On Tue, Apr 8, 2014 at 5:19 AM, Daniel Grotti <dgro...@sipwise.com> wrote:
>>>
>>> Rome!
>>> Great choice! :)
>>>
>>> Daniel
>>>
>>>
>>>
>>> On 04/08/2014 10:31 AM, Carlos Ruiz Díaz wrote:
>>> > Hi Carsten,
>>> >
>>> > that's right, I'm replying to this while I wait for a tour to the
>>> > Vatican City :-D ;-)
>>> >
>>> > Cheers,
>>> >
>>> >
>>> > On Tue, Apr 8, 2014 at 3:27 AM, Carsten Bock <cars...@ng-voice.com
>>> > <mailto:cars...@ng-voice.com>> wrote:
>>> >
>>> >     Hi Carlos,
>>> >
>>> >     please remember: You're on your Honeymoon! :-)
>>> >
>>> >     Enjoy Rome,
>>> >     Carsten
>>> >
>>> >     2014-04-08 10:26 GMT+02:00 Carlos Ruiz Díaz
>>> >     <carlos.ruizd...@gmail.com <mailto:carlos.ruizd...@gmail.com>>:
>>> >     > Hi Kelvin,
>>> >     >
>>> >     > probably the dialog matching parameter is wrong, or something in the
>>> >     > parameter configuration of cnxcc.
>>> >     >
>>> >     > The value of max_amount is 0, because the call wasn't established
>>> >     or was
>>> >     > established and cnxcc couldn't detect it  (probably because of the 
>>> > dlg
>>> >     > matching, as I mentioned). It will retain this value for as long
>>> >     as the call
>>> >     > is in the "early" state.
>>> >     >
>>> >     > Check this example [1], it may help you.
>>> >     >
>>> >     > [1]
>>> >     >
>>> >     
>>> > http://caruizdiaz.com/2014/04/04/cnxcc-prepaid-module-workshop-kamailio-world/
>>> >     >
>>> >     > Regards,
>>> >     >
>>> >     >
>>> >     >
>>> >     >
>>> >     > On Tue, Apr 8, 2014 at 3:04 AM, Kelvin Chua <kel...@gmail.com
>>> >     <mailto:kel...@gmail.com>> wrote:
>>> >     >>
>>> >     >> i am trying to use cnxcc for the first time.
>>> >     >>
>>> >     >> kamctl kamcmd cnxcc.active_clients
>>> >     >>
>>> >     >>
>>> >     >>
>>> >     
>>> > client_id:6,number_of_calls:1,concurrent_calls:0,type:1,max_amount:0.000000,consumed_amount:0.000000;
>>> >     >>
>>> >     >> i don't think this is correct, seems like the dialog is not
>>> >     disengaging
>>> >     >> after i hang up.
>>> >     >> i created dialogs alongside cnxcc just to compare, all dialogs were
>>> >     >> disengaged.
>>> >     >> is this an expected behavior?
>>> >     >>
>>> >     >> It's also weird that the max_amount is 0 while i checked that
>>> >     there is a
>>> >     >> value for credit being passed as an argument.
>>> >     >>
>>> >     >>
>>> >     >> Kelvin Chua
>>> >     >>
>>> >     >> _______________________________________________
>>> >     >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
>>> >     mailing list
>>> >     >> sr-users@lists.sip-router.org 
>>> > <mailto:sr-users@lists.sip-router.org>
>>> >     >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>> >     >>
>>> >     >
>>> >     >
>>> >     >
>>> >     > --
>>> >     > Carlos
>>> >     > http://caruizdiaz.com
>>> >     > http://ngvoice.com
>>> >     > +595981146623 <tel:%2B595981146623>
>>> >     >
>>> >     > _______________________________________________
>>> >     > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>> >     list
>>> >     > sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
>>> >     > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>> >     >
>>> >
>>> >
>>> >
>>> >     --
>>> >     Carsten Bock
>>> >     CEO (Geschäftsführer)
>>> >
>>> >     ng-voice GmbH
>>> >     Schomburgstr. 80
>>> >     D-22767 Hamburg / Germany
>>> >
>>> >     http://www.ng-voice.com
>>> >     mailto:cars...@ng-voice.com <mailto:cars...@ng-voice.com>
>>> >
>>> >     Office +49 40 34927219 <tel:%2B49%2040%2034927219>
>>> >     Fax +49 40 34927220 <tel:%2B49%2040%2034927220>
>>> >
>>> >     Sitz der Gesellschaft: Hamburg
>>> >     Registergericht: Amtsgericht Hamburg, HRB 120189
>>> >     Geschäftsführer: Carsten Bock
>>> >     Ust-ID: DE279344284
>>> >
>>> >     Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
>>> >     http://www.ng-voice.com/imprint/
>>> >
>>> >     _______________________________________________
>>> >     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
>>> > list
>>> >     sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
>>> >     http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Carlos
>>> > http://caruizdiaz.com
>>> > http://ngvoice.com
>>> > +595981146623
>>> >
>>> >
>>> > _______________________________________________
>>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> > sr-users@lists.sip-router.org
>>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>> >
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users@lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to