[asterisk-bugs] [JIRA] (ASTERISK-30437) app_queue ability to start periodic announcements at a different time than the playing interval (frequency)

Jonathan Rose (JIRA) noreply at issues.asterisk.org
Tue Apr 11 14:35:03 CDT 2023


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

Jonathan Rose edited comment on ASTERISK-30437 at 4/11/23 2:33 PM:
-------------------------------------------------------------------

This patch has a problem that was revealed to me by clang-tidy.

https://github.com/asterisk/asterisk/blob/edd7f1b0605e2840b2e21bf45afa67950dd3f9fe/apps/app_queue.c#L8529

At this line, qe.parent is assumed non-null and it's actually impossible for it to be anything *other* than null at this point. This results in a null pointer dereference and I'm pretty sure that's going to cause a crash (and if it doesn't, it won't work as intended anyway).

There's actually an assert for qe.parent being not null a little further down the line, but that's only after qe has been consumed by join_queue. This is where qe.parent actually gets set.


was (Author: jonathanrrose):
This patch has a problem that was revealed to me by clang-tidy.

https://github.com/asterisk/asterisk/blob/edd7f1b0605e2840b2e21bf45afa67950dd3f9fe/apps/app_queue.c#L8529

At this line, qe.parent is assumed non-null and it's actually impossible for it to be anything *other* than null at this point. This results in a null pointer dereference and I'm pretty sure that's going to cause a crash.

There's actually an assert for qe.parent being not null a little further down the line, but that's only after qe has been consumed by join_queue. This is where qe.parent actually gets set.

> app_queue ability to start periodic announcements at a different time than the playing interval (frequency)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-30437
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30437
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Applications/app_queue
>    Affects Versions: 16.30.0, 18.16.0, 19.8.0, 20.1.0
>            Reporter: Jaco Kroon
>            Assignee: Jaco Kroon
>            Severity: Trivial
>
> We have a client that wants a periodic announcement to play immediately upon entering the queue and then at the requested interval.
> After code inspection it seems that whilst playing the announcement it doesn't ring through to agents regardless and vice versa (which means we could just do Playback(), but that would also play the announcement even when the call is immediately without waiting queued to an agent).
> Upon raising this internally we realized that this would also benefit other customers, after engaging with a few of them the request was to be able to play an announcement a few seconds into a call (typically 10 to 45 has been the feedback) and then repeat at anything from 30 to 120s intervals.
> Since the repeating mechanism is already in place, we've implemented code to just control the start time for the first announcement by manipulating the last_periodic_announce_time upon entering the queue, setting it to a value in the past (or the future if startdelay > frequency) such that the periodic announcement will only commence playing at startdelay seconds into the call.



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



More information about the asterisk-bugs mailing list