asterisk/apps
Matthew Jordan 7e9febbf86 app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state
When doing the rework of the CDR engine that pushed all of the logic into cdr.c
and made it respond to changes in channel state over Stasis, we knew that
accessing the CDR engine from the dialplan would be "slightly"
non-deterministic. Dialplan threads would be accessing CDRs while Stasis
threads would be updating the state of said CDRs - whereas in the past,
everything happened on the dialplan threads. Tests have shown that "slightly"
is in reality "very".

This patch synchronizes things by making the dialplan applications/functions
that manipulate CDRs do so over Stasis. ForkCDR, NoCDR, ResetCDR, CDR, and
CDR_PROP now all use Stasis to send their requests over to the CDR engine,
and synchronize on the channel Stasis topic via a subscription so that they
return their values/control to the dialplan at the appropriate time.

While going through this, the following changes were also made:
 * DISA, which can reset the CDR when a user successfully authenticates, now
   just uses the ResetCDR app to do this. This prevents having to duplicate
   the same Stasis synchronization logic in that application.
 * Answer no longer disables CDRs. It actually didn't work anyway - calling
   DISABLE on the channel's CDR doesn't stop the CDR from getting the Answer
   time - it just kills all CDRs on that channel, which isn't what the caller
   would intend.

(closes issue ASTERISK-22884)
(closes issue ASTERISK-22886)

Review: https://reviewboard.asterisk.org/r/3057/
........

Merged revisions 404294 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 00:50:01 +00:00
..
confbridge channels: Return allocated channels locked. 2013-12-18 19:28:05 +00:00
Makefile Moved core logic from app_stasis to res_stasis 2013-04-15 16:43:47 +00:00
app_adsiprog.c Doxygen Updates - Title update 2012-10-14 21:45:16 +00:00
app_agent_pool.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_alarmreceiver.c Fix XML Document Validation Failure 2012-10-18 20:31:05 +00:00
app_amd.c Doxygen Updates - Title update 2012-10-14 21:45:16 +00:00
app_authenticate.c Update Asterisk's CDRs for the new bridging framework 2013-06-17 03:00:38 +00:00
app_bridgewait.c bridging: Give bridges a name and a known creator 2013-12-17 23:25:49 +00:00
app_cdr.c app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state 2013-12-19 00:50:01 +00:00
app_celgenuserevent.c CELGenUserEvent: Fix error message from ast_json_pack 2013-11-12 16:34:31 +00:00
app_chanisavail.c app_chanisavail: Fix use of uninitialized variable. 2012-03-14 23:29:32 +00:00
app_channelredirect.c Merge in the bridge_construction branch to make the system use the Bridging API. 2013-05-21 18:00:22 +00:00
app_chanspy.c Several components: fixing Typos in comments and code, "avaliable" instead of "available" 2013-12-17 23:38:02 +00:00
app_confbridge.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_controlplayback.c Add ControlPlayback manager action 2013-01-22 15:16:20 +00:00
app_dahdibarge.c Opaquify ast_channel typedefs, fd arrays, and softhangup flag 2012-03-01 22:09:18 +00:00
app_dahdiras.c app_dahdiras: Use waitpid instead of wait4. 2013-11-08 14:58:13 +00:00
app_db.c Don't throw a spurious error when using DBdeltree 2013-02-14 03:49:52 +00:00
app_dial.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_dictate.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
app_directed_pickup.c PickupChan: Add ability to specify channel uniqueids as well as channel names. 2013-11-22 16:43:21 +00:00
app_directory.c app_directory: Set variable indicating reason directory exited 2013-11-21 22:38:31 +00:00
app_disa.c app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state 2013-12-19 00:50:01 +00:00
app_dumpchan.c Verbose logging discrepancies 2013-08-29 22:49:24 +00:00
app_echo.c Prevent Echo() from relaying control, null, and modem frames 2012-03-20 20:42:34 +00:00
app_exec.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_externalivr.c Remove declaration of eivr_connect_socket because it no longer exists. 2012-06-20 11:47:12 +00:00
app_fax.c Resolve a merge conflict 2013-05-29 02:26:17 +00:00
app_festival.c Doxygen Updates - Title update 2012-10-14 21:45:16 +00:00
app_flash.c Opaquify ast_channel typedefs, fd arrays, and softhangup flag 2012-03-01 22:09:18 +00:00
app_followme.c Minor tweaks with ast_moh_start() callers. 2013-08-22 23:15:14 +00:00
app_forkcdr.c app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state 2013-12-19 00:50:01 +00:00
app_getcpeid.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
app_ices.c Doxygen Updates - janitor work 2012-09-21 17:14:59 +00:00
app_image.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_ivrdemo.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_jack.c Multiple revisions 375993-375994 2012-11-07 19:15:26 +00:00
app_macro.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
app_meetme.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_milliwatt.c Replace GNU old-style field designator extensions to fix clang warnings 2012-04-04 18:08:28 +00:00
app_minivm.c ARI: Add recording controls 2013-08-06 14:44:45 +00:00
app_mixmonitor.c Several components: fixing Typos in comments and code, "avaliable" instead of "available" 2013-12-17 23:38:02 +00:00
app_morsecode.c Merged revisions 336717 via svnmerge from 2011-09-19 20:23:29 +00:00
app_mp3.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
app_nbscat.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
app_originate.c Cache string values of formats on ast_format_cap() to save processing. 2013-10-03 14:58:16 +00:00
app_osplookup.c Update Asterisk's CDRs for the new bridging framework 2013-06-17 03:00:38 +00:00
app_page.c app_page: Add predial handlers for app_page. 2013-12-09 22:17:14 +00:00
app_playback.c Check result of ast_var_assign() calls for memory allocation failure. 2013-08-06 08:36:15 +00:00
app_playtones.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_privacy.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
app_queue.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_read.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_readexten.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
app_readfile.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_record.c app_record: Add an option that allows DTMF '0' to act as an additional terminator 2013-12-05 23:40:38 +00:00
app_saycounted.c Merged revisions 336717 via svnmerge from 2011-09-19 20:23:29 +00:00
app_sayunixtime.c Say: If SAY_DTMF_INTERRUPT is set to an ast_true value, jump on DTMF 2013-11-14 20:32:45 +00:00
app_senddtmf.c Add pause one second W dial modifier. 2012-09-28 18:27:02 +00:00
app_sendtext.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_setcallerid.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
app_skel.c Add CLI configuration documentation 2013-02-15 13:38:12 +00:00
app_sms.c app_sms: BufferOverflow when receiving odd length 16 bit message 2013-12-16 15:30:18 +00:00
app_softhangup.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_speech_utils.c app_speech_utils: Fix unresolved symbol ast_speech_get_setting(). 2013-09-16 18:00:32 +00:00
app_stack.c MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled. 2013-10-02 17:12:49 +00:00
app_stasis.c Fix menuselect display for stasis modules. 2013-06-24 21:40:52 +00:00
app_system.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
app_talkdetect.c Finalize ast_channel opaquification 2012-03-13 18:20:34 +00:00
app_test.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
app_transfer.c Fix the display of documentation for Transfer 2012-04-03 20:14:01 +00:00
app_url.c Merged revisions 339777 via svnmerge from 2011-10-07 19:37:33 +00:00
app_userevent.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00:00
app_verbose.c Verbose logging discrepancies 2013-08-29 22:49:24 +00:00
app_voicemail.c channel locking: Add locking for channel snapshot creation 2013-12-18 20:33:37 +00: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 Multiple revisions 375993-375994 2012-11-07 19:15:26 +00:00
app_waitforsilence.c Opaquification for ast_format structs in struct ast_channel 2012-02-24 00:32:20 +00:00
app_waituntil.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_while.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
app_zapateller.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00: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