asterisk/apps
Ivan Poddubny 045dbcc2d6 app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON
There are 2 places in app_queue.c that log EXITEMPTY event: one in
wait_our_turn, and another one in queue_exec in the loop trying to
call an agent after wait_our_turn.

In most cases it leads to logging EXITEMPTY twice.

ABANDON is also logged on two places, and in the rare case when an agent
and caller hang up simultaneously it's also possible to get duplicates
in queue_log.

This commit changes wait_our_turn to return -1 ("the caller should exit
the queue") instead of 0 ("the caller's turn has arrived") in case of
leaving when empty, so queue_exec skips the agent calling loop.

Also, leave_queue is now executed only once in this case, because 2nd
time is just a noop when the queue entry has already been removed.

Also, it sets qe->handled to -1 to indicate that the call was not
answered by an agent, but the necessary handling has already been done
in order to avoid logging an extra ABANDON entry.

ASTERISK-25665 #close
Reported by: Ove Aursand

Change-Id: I4578dd383bf2ac41589cf167865e8aaebcd4c11e
2017-05-11 08:32:40 +02:00
..
confbridge app_confbridge: Fix reference to cfg in menu_template_handler 2017-05-04 20:13:55 -05:00
app_adsiprog.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_agent_pool.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_alarmreceiver.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_amd.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_authenticate.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_bridgeaddchan.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_bridgewait.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_cdr.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_celgenuserevent.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_chanisavail.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_channelredirect.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_chanspy.c autochan/mixmonitor/chanspy: Fix unsafe channel locking and references. 2017-03-15 17:18:55 -06:00
app_confbridge.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_controlplayback.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_dahdiras.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_db.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_dial.c channel: Add ability to request an outgoing channel with stream topology. 2017-04-27 10:39:46 +00:00
app_dictate.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_directed_pickup.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_directory.c realtime: Fix ast_load_realtime_multientry handling 2017-02-21 13:06:29 -06:00
app_disa.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_dumpchan.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_echo.c apps/app_echo: Only relay a single video source change frame 2016-11-14 17:03:32 -05:00
app_exec.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_externalivr.c Implement internal abstraction for iostreams 2016-11-15 22:25:14 +02:00
app_fax.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_festival.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_flash.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_followme.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_forkcdr.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
app_getcpeid.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_ices.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_image.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_ivrdemo.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_jack.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_macro.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_meetme.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_milliwatt.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_minivm.c cleanup: Fix fread() and fwrite() error handling 2017-04-25 16:24:15 -05:00
app_mixmonitor.c autochan/mixmonitor/chanspy: Fix unsafe channel locking and references. 2017-03-15 17:18:55 -06:00
app_morsecode.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_mp3.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_nbscat.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_originate.c manager: Restore Originate failure behavior from Asterisk 11 2017-02-10 18:04:41 -05:00
app_osplookup.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_page.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_playback.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_playtones.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_privacy.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_queue.c app_queue: Fix duplicate queue_log entries for EXITEMPTY and ABANDON 2017-05-11 08:32:40 +02:00
app_read.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_readexten.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_record.c app_record: Add option to prevent silence from being truncated 2017-02-14 09:35:18 -05:00
app_saycounted.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_sayunixtime.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_senddtmf.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_sendtext.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_setcallerid.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_skel.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_sms.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_softhangup.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_speech_utils.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_stack.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_stasis.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_statsd.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_system.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_talkdetect.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_test.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_transfer.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_url.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_userevent.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_verbose.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_voicemail.c cleanup: Fix fread() and fwrite() error handling 2017-04-25 16:24:15 -05:00
app_voicemail.exports.in Remove some symbol exports that got missed in the removal of global symbols. 2012-06-15 15:33:41 +00:00
app_waitforring.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_waitforsilence.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_waituntil.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_while.c Remove ASTERISK_REGISTER_FILE. 2016-10-27 09:53:55 -04:00
app_zapateller.c modules: change module LOAD_FAILUREs to LOAD_DECLINES 2017-04-12 15:57:21 -06:00
enter.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
leave.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
Makefile Build System: Create Makefile macro MOD_ADD_SOURCE. 2015-04-14 12:53:03 -04:00