summaryrefslogtreecommitdiff
path: root/res/res_stasis_recording.c
AgeCommit message (Collapse)Author
2017-04-12modules: change module LOAD_FAILUREs to LOAD_DECLINESGeorge Joseph
In all non-pbx modules, AST_MODULE_LOAD_FAILURE has been changed to AST_MODULE_LOAD_DECLINE. This prevents asterisk from exiting if a module can't be loaded. If the user wishes to retain the FAILURE behavior for a specific module, they can use the "require" or "preload-require" keyword in modules.conf. A new API was added to logger: ast_is_logger_initialized(). This allows asterisk.c/check_init() to print to the error log once the logger subsystem is ready instead of just to stdout. If something does fail before the logger is initialized, we now print to stderr instead of stdout. Change-Id: I5f4b50623d9b5a6cb7c5624a8c5c1274c13b2b25
2016-10-27Remove ASTERISK_REGISTER_FILE.Corey Farrell
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-03-31Merge "res_stasis: Add control ref to playback and recording structs."zuul
2016-03-30res_stasis: Add control ref to playback and recording structs.Richard Mudgett
The stasis_app_playback and stasis_app_recording structs need to have a struct stasis_app_control ref. Other threads can get a reference to the playback and recording structs from their respective global container. These other threads can then use the control pointer they contain after the control struct has gone. * Add control ref to stasis_app_playback and stasis_app_recording structs. With the refs added, the control command queue can now have a circular control reference which will cause the control struct to never get released if the control's command queue is not flushed when the channel leaves the Stasis application. Also the command queue needs better protection from adding commands if the control->is_done flag is set. * Flush the control command queue on exit. ASTERISK-25882 #close Change-Id: I3cf1fb59cbe6f50f20d9e35a2c07ac07d7f4320d
2016-03-30res_stasis_recording.c: Cleanup stasis_app_recording_find_by_name().Richard Mudgett
Change-Id: Ic7d93c402c498677a122505558859c853d4e5ac7
2015-12-16json: Audit ast_json_* usage for thread safety.Joshua Colp
The JSON library Asterisk uses, jansson, is not thread safe for us in a few ways. To help with this wrappers for JSON object reference count increasing and decreasing were added which use a global lock to ensure they don't clobber over each other. This does not extend to reference count manipulation within the jansson library itself. This means you can't safely use the object borrowing specifier (O) in ast_json_pack and you can't share JSON instances between objects. This change removes uses of the O specifier and replaces them with the o specifier and an explicit ast_json_ref. Some cases of instance sharing have also been removed. ASTERISK-25601 #close Change-Id: I06550d8b0cc1bfeb56cab580a4e608ae4f1ec7d1
2015-05-13AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.Rodrigo Ramírez Norambuena
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-04-23Clang: change previous tautological-compare fixes.Diederik de Groot
clang can warn about a so called tautological-compare, when it finds comparisons which are logically always true, and are therefor deemed unnecessary. Exanple: unsigned int x = 4; if (x > 0) // x is always going to be bigger than 0 Enum Case: Each enumeration is its own type. Enums are an integer type but they do not have to be *signed*. C leaves it up to the compiler as an implementation option what to consider the integer type of a particu- lar enumeration is. Gcc treats an enum without negative values as an int while clang treats this enum as an unsigned int. rmudgett & mmichelson: cast the enum to (unsigned int) in assert. The cast does have an effect. For gcc, which seems to treat all enums as int, the cast to unsigned int will eliminate the possibility of negative values being allowed. For clang, which seems to treat enums without any negative members as unsigned int, the cast will have no effect. If for some reason in the future a negative value is ever added to the enum the assert will still catch the negative value. ASTERISK-24917 Change-Id: I0557ae0154a0b7de68883848a609309cdf0aee6a
2015-04-13git migration: Refactor the ASTERISK_FILE_VERSION macroMatt Jordan
Git does not support the ability to replace a token with a version string during check-in. While it does have support for replacing a token on clone, this is somewhat sub-optimal: the token is replaced with the object hash, which is not particularly easy for human consumption. What's more, in practice, the source file version was often not terribly useful. Generally, when triaging bugs, the overall version of Asterisk is far more useful than an individual SVN version of a file. As a result, this patch removes Asterisk's support for showing source file versions. Specifically, it does the following: * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and remove passing the version in with the macro. Other facilities than 'core show file version' make use of the file names, such as setting a debug level only on a specific file. As such, the act of registering source files with the Asterisk core still has use. The macro rename now reflects the new macro purpose. * main/asterisk: - Refactor the file_version structure to reflect that it no longer tracks a version field. - Remove the "core show file version" CLI command. Without the file version, it is no longer useful. - Remove the ast_file_version_find function. The file version is no longer tracked. - Rename ast_register_file_version/ast_unregister_file_version to ast_register_file/ast_unregister_file, respectively. * main/manager: Remove value from the Version key of the ModuleCheck Action. The actual key itself has not been removed, as doing so would absolutely constitute a backwards incompatible change. However, since the file version is no longer tracked, there is no need to attempt to include it in the Version key. * UPGRADE: Add notes for: - Modification to the ModuleCheck AMI Action - Removal of the "core show file version" CLI command Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-09clang compiler warnings: Fix autological comparisonsMatthew Jordan
This fixes autological comparison warnings in the following: * chan_skinny: letohl may return a signed or unsigned value, depending on the macro chosen * func_curl: Provide a specific cast to CURLoption to prevent mismatch * cel: Fix enum comparisons where the enum can never be negative * enum: Fix comparison of return result of dn_expand, which returns a signed int value * event: Fix enum comparisons where the enum can never be negative * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be negative * presencestate: Use the actual enum value for INVALID state * security_events: Fix enum comparisons where the enum can never be negative * udptl: Don't bother to check if the return value from encode_length is less than 0, as it returns an unsigned int * translate: Since the parameters are unsigned int, don't bother checking to see if they are negative. The cast to unsigned int would already blow past the matrix bounds. * res_pjsip_exten_state: Use a temporary value to cache the return of ast_hint_presence_state * res_stasis_playback: Fix enum comparisons where the enum can never be negative * res_stasis_recording: Add an enum value for the case where the recording operation is in error; fix enum comparisons * resource_bridges: Use enum value as opposed to -1 * resource_channels: Use enum value as opposed to -1 Review: https://reviewboard.asterisk.org/r/4533 ASTERISK-24917 Reported by: dkdegroot patches: rb4533.patch submitted by dkdegroot (License 6600) ........ Merged revisions 434469 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 434470 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-22ARI: Fix a crash caused by hanging during playback to a channel in a bridgeJonathan Rose
ASTERISK-24147 #close Reported by: Edvin Vidmar Review: https://reviewboard.asterisk.org/r/3908/ ........ Merged revisions 421879 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421880 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25Add module support level to ast_module_info structure. Print it in CLI ↵Mark Michelson
"module show" . ASTERISK-23919 #close Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/3802 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-25Multiple revisions 419565-419566Matthew Jordan
........ r419565 | mjordan | 2014-07-25 09:41:23 -0500 (Fri, 25 Jul 2014) | 21 lines ARI: report duration values in LiveRecording objects This patch adds three new fields to the LiveRecording model: - total_duration: the total length of the live recording - talking_duration: optional. The duration of talking energy that was detected while the recording was made. - silence_duration: optional. The duration of silence that was detected while the recording was made. These values are reported in the RecordingFinished ARI event. When a DSP is enabled on the channel during the recording - which occurs when the recording is created with max_silence_seconds (indicating that the user actually cares about how much silence is in the file), we will report the talking_duration and silence_duration in addition to the total_duration. Review: https://reviewboard.asterisk.org/r/3770/ ASTERISK-24037 #close Reported by: Samuel Galarneau ........ r419566 | mjordan | 2014-07-25 09:46:15 -0500 (Fri, 25 Jul 2014) | 1 line Update CHANGES for r419565 ........ Merged revisions 419565-419566 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15Remove unused RAII_VAR() declarations.Richard Mudgett
* Remove unused RAII_VAR() declarations. The compiler cannot catch these because the cleanup function "references" the unused variable. Some actually allocated and released resources that were never used. * Fixed some whitespace issues in stasis_bridges.c. ........ Merged revisions 412399 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06res_stasis_recording: Add a "target_uri" field to recording events.Joshua Colp
This change adds a target_uri field to the live recording object. It contains the URI of what is being recorded. (closes issue ASTERISK-23258) Reported by: Ben Merrills Review: https://reviewboard.asterisk.org/r/3299/ ........ Merged revisions 410025 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-03res_stasis_recording: Fix memory leak of the absolute name.Joshua Colp
........ Merged revisions 409422 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-21json: Fix off-nominal json ref counting issues.Richard Mudgett
* Fixed off-nominal json ref counting issue with using the following API calls: ast_json_object_set() and ast_json_array_append(). * Fixed off-nominal error reporting in ast_ari_endpoints_list(). * Fixed some miscellaneous off-nominal json ref counting issues in report_receive_fax_status() and dial_to_json(). ........ Merged revisions 408713 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13ARI: Adding a channel to a bridge while a live recording is active blocksKevin Harwell
Added the ability to have rules that are checked when adding and/or removing channels to/from a bridge. In this case, if a channel is currently recording and someone attempts to add it to a bridge an "is recording" rule is checked, fails, and a 409 conflict is returned. Also command functions now return an integer value that can be descriptive of what kind of problems, if any, occurred before or during execution. (closes issue ASTERISK-22624) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2947/ ........ Merged revisions 403749 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23ari: Add events for playback and recording.Joshua Colp
While there were events defined for playback and recording these were not actually sent. This change implements the to_json handlers which produces them. (closes issue ASTERISK-22710) Reported by: Jonathan Rose Review: https://reviewboard.asterisk.org/r/3026/ ........ Merged revisions 403119 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25ARI recordings: Issue HTTP failures for recording requests with file conflictsJonathan Rose
If a file already exists in the recordings directory with the same name as what we would record, issue a 422 instead of relying on the internal failure and issuing success. (closes issue ASTERISK-22623) Reported by: Joshua Colp Review: https://reviewboard.asterisk.org/r/2922/ ........ Merged revisions 401973 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30ARI: Implement /recordings/stored API'sDavid M. Lee
his patch implements the ARI API's for stored recordings. While the original task only specified deleting a recording, it was simple enough to implement the GET for all recordings, and for an individual recording. The recording playback operation was modified to use the same code for accessing the recording as the REST API, so that they will behave consistently. There were several problems with the api-docs that were also fixed, bringing the ARI spec in line with the implementation. There were some 'wishful thinking' fields on the stored recording model (duration and timestamp) that were removed, because I ended up not implementing a metadata file to go along with the recording to store such information. The GET /recordings/live operation was removed, since it's not really that useful to get a list of all recordings that are currently going on in the system. (At least, if we did that, we'd probably want to also list all of the current playbacks. Which seems weird.) (closes issue ASTERISK-21582) Review: https://reviewboard.asterisk.org/r/2693/ ........ Merged revisions 397985 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-13ARI: allow other operations to happen while bridgedDavid M. Lee
This patch changes ARI bridging to allow other channel operations to happen while the channel is bridged. ARI channel operations are designed to queue up and execute sequentially. This meant, though, that while a channel was bridged, any other channel operations would queue up and execute only after the channel left the bridge. This patch changes ARI bridging so that channel commands can execute while the channel is bridged. For most operations, things simply work as expected. The one thing that ended up being a bit odd is recording. The current recording implementation will fail when one attempts to record a channel that's in a bridge. Note that the bridge itself may be recording; it's recording a specific channel in the bridge that fails. While this is an annoying limitation, channel recording is still very useful for use cases such as voice mail, and bridge recording makes up much of the difference for other use cases. (closes issue ASTERISK-22084) Review: https://reviewboard.asterisk.org/r/2726/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06ARI: Add recording controlsDavid M. Lee
This patch implements the controls from ARI recordings. The controls are: * DELETE /recordings/live/{recordingName} - stop recording and discard it * POST /recordings/live/{recordingName}/stop - stop recording * POST /recordings/live/{recordingName}/pause - pause recording * POST /recordings/live/{recordingName}/unpause - resume recording * POST /recordings/live/{recordingName}/mute - mute recording (record silence to the file) * POST /recordings/live/{recordingName}/unmute - unmute recording. Since this underlying functionality did not already exist, is was added to app.c by a set of control frames, similar to how playback control works. The pause/mute control frames are toggles, even though the ARI controls are idempotent, to be consistent with the playback control frames. (closes issue ASTERISK-22181) Review: https://reviewboard.asterisk.org/r/2697/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-08Oh menuconfig, why do you hate margins?David M. Lee
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03ARI - channel recording supportDavid M. Lee
This patch is the first step in adding recording support to the Asterisk REST Interface. Recordings are stored in /var/spool/recording. Since recordings may be destructive (overwriting existing files), the API rejects attempts to escape the recording directory (avoiding issues if someone attempts to record to ../../lib/sounds/greeting, for example). (closes issue ASTERISK-21594) (closes issue ASTERISK-21581) Review: https://reviewboard.asterisk.org/r/2612/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393550 65c4cc65-6c06-0410-ace0-fbb531ad65f3