[asterisk-bugs] [JIRA] (ASTERISK-28636) app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.

Frederic LE FOLL (JIRA) noreply at issues.asterisk.org
Wed Nov 27 11:22:31 CST 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248905#comment-248905 ] 

Frederic LE FOLL commented on ASTERISK-28636:
---------------------------------------------

Analysis:

ChanIsAvail creates a temporary Channel in order to check outgoing resource availability and hangs up immediately. Temporary channel lifespan is extremely short.

cdr.c:ast_cdr_set_property(), called before ast_hangup(), will fail if it does not find CDR structure in active_cdrs_master container.

The problem here is:
1) CDR insertion into active_cdrs_master container depends on a Stasis message processing (message triggered by channel creation): it occurs upon a call to cdr.c:handle_channel_cache_message(), when processing a Stasis message of type ast_channel_snapshot_type(): this is processed by a dedicated thread that executes handle_channel_cache_message().
2) AST_CDR_FLAG_DISABLE_ALL flag activation uses the straight path, with a direct function call from app_chanisavail.c:chanavail_exec() to cdr.c:ast_cdr_set_property(), and it may be processed before CDR is present in active_cdrs_master container.

Conclusion: we have two different pathes for two different actions, with second path being faster that first path.

Proposal :
Is there any possibility to serialize both operations (1 - CDR insertion in CDR list, 2 - flag activation) ?
If not, I see no better solution that implement a retry. But since this would come with a performance cost, probably CDR deactivation should become an option ("n" for "no cdr" ?).

> app_chanisavail/cdr: ChanIsAvail sometimes fails to deactivate CDR.
> -------------------------------------------------------------------
>
>                 Key: ASTERISK-28636
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28636
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_chanisavail, CDR/General
>    Affects Versions: 16.6.0
>            Reporter: Frederic LE FOLL
>            Severity: Minor
>
> ChanIsAvail application calls ast_cdr_set_property() in in order to set AST_CDR_FLAG_DISABLE_ALL on temporary channel used to test outgoing resource (ASTERISK-28527).
> Despite this CDR deactivation request, CDR are sometimes generated for the temporary channel.
> The problem is visible in endurance tests, even under moderate call load, and it affects approx. 1% of calls.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list