If you enable acc module to log CDR data into a database a user can send an infinite number of BYE requests to the server and all of them will be logged into the database as "481 Call/transaction does not exist"! How can we prevent this?
On 11/01/2016 02:43 AM, Gholamreza Sabery wrote:
If you enable acc module to log CDR data into a database a user can send an infinite number of BYE requests to the server and all of them will be logged into the database as "481 Call/transaction does not exist"! How can we prevent this?
Don't do accounting for BYEs if they don't correspond to a tracked dialog, or add a composote unique constraint on Call-ID + some other column in your database to prevent the insertion of additional events.
Is there an option in the ACC module for this, or I should handle dialog tracking using dialog module?
On Tue, Nov 1, 2016 at 10:24 AM, Alex Balashov abalashov@evaristesys.com wrote:
On 11/01/2016 02:43 AM, Gholamreza Sabery wrote:
If you enable acc module to log CDR data into a database a user can send
an infinite number of BYE requests to the server and all of them will be logged into the database as "481 Call/transaction does not exist"! How can we prevent this?
Don't do accounting for BYEs if they don't correspond to a tracked dialog, or add a composote unique constraint on Call-ID + some other column in your database to prevent the insertion of additional events.
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 (direct) / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
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
On 11/01/2016 02:58 AM, Gholamreza Sabery wrote:
Is there an option in the ACC module for this, or I should handle dialog tracking using dialog module?
No, there's no option for it in the ACC module.
Using dialog tracking is one option. Adding a database constraint or trigger that would prevent it is another; that's my preferred approach.
The ACC module is stateless. Think of it as a relatively unintelligent logger. As with all loggers, it's your choice what to log, and to devise means by which to prevent certain things from being logged.
An alternative, which I haven't tried it to be 100% sure, but it should work as the accounting should happen when a reply is sent out -- anyhow, the idea is:
- set an onreply_route for the BYE requests and inside it, if the code is 481, the reset the accounting flag(ie., resetflag(FLT_ACC)).
If someone tries it, would be good to know the results whether it works or not.
Cheers, Daniel
On 01/11/16 09:32, Alex Balashov wrote:
On 11/01/2016 02:58 AM, Gholamreza Sabery wrote:
Is there an option in the ACC module for this, or I should handle dialog tracking using dialog module?
No, there's no option for it in the ACC module.
Using dialog tracking is one option. Adding a database constraint or trigger that would prevent it is another; that's my preferred approach.
The ACC module is stateless. Think of it as a relatively unintelligent logger. As with all loggers, it's your choice what to log, and to devise means by which to prevent certain things from being logged.
Thank you so much. I will test it!
On Tue, Nov 1, 2016 at 1:55 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
An alternative, which I haven't tried it to be 100% sure, but it should work as the accounting should happen when a reply is sent out -- anyhow, the idea is:
- set an onreply_route for the BYE requests and inside it, if the code
is 481, the reset the accounting flag(ie., resetflag(FLT_ACC)).
If someone tries it, would be good to know the results whether it works or not.
Cheers, Daniel
On 01/11/16 09:32, Alex Balashov wrote:
On 11/01/2016 02:58 AM, Gholamreza Sabery wrote:
Is there an option in the ACC module for this, or I should handle dialog tracking using dialog module?
No, there's no option for it in the ACC module.
Using dialog tracking is one option. Adding a database constraint or trigger that would prevent it is another; that's my preferred approach.
The ACC module is stateless. Think of it as a relatively unintelligent logger. As with all loggers, it's your choice what to log, and to devise means by which to prevent certain things from being logged.
-- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
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