Skip to content
Snippets Groups Projects
Commit 629000dc authored by Yalu Zhang's avatar Yalu Zhang
Browse files

Prevent generating false call logs (CDR's)

parent 4764ca4a
No related branches found
No related tags found
No related merge requests found
......@@ -3524,6 +3524,20 @@ static void post_cdr(struct ast_cdr *cdr)
continue;
}
/*
* When Asterisk receives an SIP-INVITE from an unknown source, a CDR is generated. The workaround below
* is trying to skip this kind of CDR. Otherwise a large number of invalid CDRs will be generated.
*
* TODO: In future, SIP user agent will receive requests from the configured source(s) only, i.e. proxy
* or registrar only. SIP request messages from unwanted sources will be dropped silently without any
* further processing.
*/
if (strcasecmp(cdr->dcontext, "call_line") == 0 && strcasecmp(cdr->lastapp, "Goto") == 0 &&
cdr->disposition == AST_CDR_FAILED) {
ast_debug(1, "Skipping CDR because it might be caused by an incoming call from an unwanted source\n");
continue;
}
/* Modify CDR's */
AST_RWLIST_RDLOCK(&mo_list);
AST_RWLIST_TRAVERSE(&mo_list, i, list) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment