Commit Graph

41 Commits

Author SHA1 Message Date
Josh Soref 9ae9893c63 res: Spelling fixes
Correct typos of the following word families:

identifying
structures
actcount
initializer
attributes
statement
enough
locking
declaration
userevent
provides
unregister
session
execute
searches
verification
suppressed
prepared
passwords
recipients
event
because
brief
unidentified
redundancy
character
the
module
reload
operation
backslashes
accurate
incorrect
collision
initializing
instance
interpreted
buddies
omitted
manually
requires
queries
generator
scheduler
configuration has
owner
resource
performed
masquerade
apparently
routable

ASTERISK-29714

Change-Id: I88485116d2c59b776aa2e1f8b4ce8239a21decda
2021-11-15 16:37:34 -06:00
Andre Barbosa f4d3f021f9 res_stasis_playback: Check for chan hangup on play_on_channels
Verify `ast_check_hangup` before looping to the next sound file.
If the call is already hangup we just break the cycle.
It also ensures that the PlaybackFinished event is sent if the call was hangup.

This is also use-full when we are playing a big list of file for a channel that is hangup.
Before this patch Asterisk will give a warning for every sound not played and fire a PlaybackStart for every sound file on the list tried to be played.

With the patch we just break the playback cycle when the chan is hangup.

ASTERISK-29501 #close

Change-Id: Ic4e1c01b974c9a1f2d9678c9d6b380bcfc69feb8
2021-07-20 13:18:40 -05:00
Andre Barbosa a47308ccb2 res_stasis_playback: Send PlaybackFinish event only once for errors
When we try to play a list of sound files in the same Play command,
we get only one PlaybackFinish event, after all sounds are played.

But in the case where the Play fails (because channel is destroyed
for example), Asterisk will send one PlaybackFinish event for each
sound file still to be played. If the list is big, Asterisk is
sending many events.

This patch adds a failed state so we can understand that the play
failed. On that case we don't send the event, if we still have a
list of sounds to be played.

When we reach the last sound, we send the PlaybackFinish with
the failed state.

ASTERISK-29464 #close

Change-Id: I4c2e5921cc597702513af0d7c6c2c982e1798322
2021-06-24 10:43:19 -05:00
Sungtae Kim 91fc57f56b res_ari: Fix wrong media uri handle for channel play
Fixed wrong null object handle in
/channels/<channel_id>/play request handler.

ASTERISK-29188

Change-Id: I6691c640247a51ad15f23e4a203ca8430809bafe
2020-12-17 11:06:48 -06:00
Sean Bright 31dc904380 res_stasis_playback: Prevent media_index from going out of bounds
Incrementing stasis_app_playback.media_index directly in our playback
loop means that when we reach the end of our playlist the index into
the vector will be outside of the bounds of the vector.

Instead use a temporary variable and only assign when we're sure that
we are in bounds.

ASTERISK-28713 #close
Reported by: Sébastien Duthil

Change-Id: Ib53f7f156097e0607eb5871d9d78d246ed274928
2020-01-29 07:15:49 -06:00
sungtae kim e2eb19b363 res/res_ari: Added timestamp as a requirement for all ARI events
Changed to requirement to having timestamp for all of ARI events.
The below ARI events were changed to having timestamp.
PlaybackStarted, PlaybackContinuing, PlaybackFinished,
RecordingStarted, RecordingFinished, RecordingFailed,
ApplicationReplaced, ApplicationMoveFailed

ASTERISK-28326

Change-Id: I382c2fef58f5fe107e1074869a6d05310accb41f
2019-03-11 23:57:01 +01:00
Corey Farrell 021ce938ca
astobj2: Remove legacy ao2_container_alloc routine.
Replace usage of ao2_container_alloc with ao2_container_alloc_hash or
ao2_container_alloc_list.  Remove ao2_container_alloc macro.

Change-Id: I0907d78bc66efc775672df37c8faad00f2f6c088
2018-11-21 09:56:16 -05:00
Corey Farrell 93777faf36
json: Take advantage of new API's.
* Use "o*" format specifier for optional fields in ast_json_party_id.
* Stop using ast_json_deep_copy on immutable objects, it is now thread
  safe to just use ast_json_ref.

Additional changes to ast_json_pack calls in the vicinity:
* Use "O" when an object needs to be bumped.  This was previously
  avoided as it was not thread safe.
* Use "o?" and "O?" to replace NULL with ast_json_null().  The
  "?" is a new feature of ast_json_pack starting with Asterisk 16.

Change-Id: I8382d28d7d83ee0ce13334e51ae45dbc0bdaef48
2018-09-24 15:47:37 -04:00
Corey Farrell 9cfdb81e91 loader: Add dependency fields to module structures.
* Declare 'requires' and 'enhances' text fields on module info structure.
* Rename 'nonoptreq' to 'optional_modules'.
* Update doxygen comments.

Still need to investigate dependencies among modules I cannot compile.

Change-Id: I3ad9547a0a6442409ff4e352a6d897bef2cc04bf
2018-01-15 13:25:51 -05:00
Corey Farrell 4016884ef3 res_stasis_playback: Check for failure to append vector.
Free resources and return error if we fail to append the vector in
stasis_app_control_play_uri.

Change-Id: I22c4a90dd859b253f2850c6511de48b25609422b
2017-11-06 18:38:35 -05:00
George Joseph 747beb1ed1 modules: change module LOAD_FAILUREs to LOAD_DECLINES
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
2017-04-12 15:57:21 -06:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
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-10-27 09:53:55 -04:00
Matt Jordan e769c19a31 res/res_stasis_playback: Cancel the entire playlist when a stop occurs
Prior to this patch, a stop issued by a delete of a Playback resource
(indicated by the control frame AST_CONTROL_STREAM_STOP) would only stop
the current media URI playing. Subsequent URIs specified by a playback
operation would then proceed on, even though we had just indicated to
the User that the Playback was finished *and* after they had just
'deleted' the resource. Whoops.

This patch corrects it by bailing out of the sequence of URIs to play if
one of them is terminated with an AST_CONTROL_STREAM_STOP indication.

ASTERISK-26341 #close

Change-Id: I2da9ec43545ba46cdfffe287c7e4907eae7fca42
2016-09-06 15:34:36 -05:00
Matt Jordan 03d88b5656 ARI: Add the ability to play multiple media URIs in a single operation
Many ARI applications will want to play multiple media files in a row to
a resource. The most common use case is when building long-ish IVR prompts
made up of multiple, smaller sound files. Today, that requires building a
small state machine, listening for each PlaybackFinished event, and triggering
the next sound file to play. While not especially challenging, it is tedious
work. Since requiring developers to write tedious code to do normal activities
stinks, this patch adds the ability to play back a list of media files to a
resource.

Each of the 'play' operations on supported resources (channels and bridges)
now accepts a comma delineated list of media URIs to play. A single Playback
resource is created as a handle to the entire list. The operation of playing
a list is identical to playing a single media URI, save that a new event,
PlaybackContinuing, is raised instead of a PlaybackFinished for each non-final
media URI. When the entire list is finished being played, a PlaybackFinished
event is raised.

In order to help inform applications where they are in the list playback, the
Playback resource now includes a new, optional attribute, 'next_media_uri',
that contains the next URI in the list to be played.

It's important to note the following:
 - If an offset is provided to the 'play' operations, it only applies to the
   first media URI, as it would be weird to skip n seconds forward in every
   media resource.
 - Operations that control the position of the media only affect the current
   media being played. For example, once a media resource in the list
   completes, a 'reverse' operation on a subsequent media resource will not
   start a previously completed media resource at the appropiate offset.
 - This patch does not add any new operations to control the list. Hopefully,
   user feedback and/or future patches would add that if people want it.

ASTERISK-26022 #close

Change-Id: Ie1ea5356573447b8f51f2e7964915ea01792f16f
2016-05-17 14:01:22 -03:00
Richard Mudgett 0ea742d33a res_stasis: Add control ref to playback and recording structs.
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-30 16:36:20 -05:00
Joshua Colp d17d9a9288 json: Audit ast_json_* usage for thread safety.
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-12-16 15:21:14 -06:00
Rodrigo Ramírez Norambuena eec010829a AST_MODULE_INFO: Format corrections to the usages of AST_MODULE_INFO macro.
Change-Id: Icf88f9f861c6b2a16e5f626ff25795218a6f2723
2015-05-13 16:34:23 -05:00
Diederik de Groot ca7193167e Clang: change previous tautological-compare fixes.
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-23 11:39:13 -05:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
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-13 03:48:57 -04:00
Matthew Jordan ea0098724e clang compiler warnings: Fix autological comparisons
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
2015-04-09 12:57:21 +00:00
Jonathan Rose 33835e17a0 ARI: Fix a crash caused by hanging during playback to a channel in a bridge
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-08-22 16:52:51 +00:00
Mark Michelson dcf1ad14da Add module support level to ast_module_info structure. Print it in CLI "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-25 16:47:17 +00:00
Kinsey Moore abd3e4040b Allow Asterisk to compile under GCC 4.10
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-05-09 22:49:26 +00:00
Jonathan Rose b9d7dfcc62 ARI: Make bridges/{bridgeID}/play queue sound files
Previously multiple play actions against a bridge at one time would cause
the sounds to play simultaneously on the bridge. Now if a sound is already
playing, the play action will queue playback to occur after the completion
of other sounds currently on the queue.

(closes issue ASTERISK-22677)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/3379/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18 20:09:24 +00:00
Jonathan Rose a8742e327f ARI: Add tones playback resource
Adds a tones URI type to the playback resource. The tone can be specified by
name (from indications.conf) or by a tone pattern. In addition, tonezone can
be specified in the URI (by appending ;tonezone=<zone>). Tones must be
stopped manually in order for a stasis control to move on from playback of
the tone. Tones may be paused, resumed, restarted, and stopped. They may
not be rewound or fast forwarded (tones can't be controlled in a way that
lets you skip around from note to note and pausing and resuming will also
restart the tone from the beginning). Tests are currently in development
for this feature (https://reviewboard.asterisk.org/r/3428/).

(closes issue ASTERISK-23433)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3427/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-17 21:57:36 +00:00
Richard Mudgett 45ade68cb4 Remove unused RAII_VAR() declarations.
* 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-04-15 18:01:47 +00:00
Mark Michelson d44aefeef4 Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 17:22:12 +00:00
Scott Griepentrog 80ef9a21b9 uniqueid: channel linkedid, ami, ari object creation with id's
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it.  Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation.  This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first.  In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.

Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.

(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:47:55 +00:00
Kinsey Moore 761d7271d4 res_stasis_playback: Correct error argument order
Several of the playback error messages for invalid media input in
res_stasis_playback.c had the media name and channel name reversed.
They now correctly identify the channel name and media name.

Reported by: skrusty
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 14:01:07 +00:00
Kevin Harwell ce18946de4 ARI: Adding a channel to a bridge while a live recording is active blocks
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-12-13 16:38:57 +00:00
Joshua Colp 6019353ad6 res_stasis_playback: Add 'number', 'digits', and 'characters' URI scheme implementations.
This change adds new URI scheme implementations for playing numbers, digits,
and characters. This is done as part of the normal playback mechanism and can
be used with queueing to create a combined sentence.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-28 00:54:37 +00:00
Joshua Colp 14a7452934 ari: Add events for playback and recording.
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-11-23 12:52:54 +00:00
Joshua Colp 7678fd040e res_ari_channels: Add ring operation, dtmf operation, hangup reasons, and tweak early media.
The ring operation sends ringing to the specified channel it is invoked on.
The dtmf operation can be used to send DTMF digits to the specified channel
of a specific length with a wait time in between. Finally hangup reasons
allow you to specify why a channel is being hung up (busy, congestion).

Early media behavior has also been tweaked slightly. When playing media to a channel
it will no longer automatically answer. If it has not been answered a progress indication
is sent instead.

(closes issue ASTERISK-22701)
Reported by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-01 14:38:21 +00:00
David M. Lee 7f547872e4 ARI: Implement /recordings/stored API's
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-30 13:28:50 +00:00
David M. Lee 987fdfb444 ARI: allow other operations to happen while bridged
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-13 15:27:32 +00:00
Jonathan Rose 17c546173f ARI: Bridge Playback, Bridge Record
Adds a new channel driver for creating channels for specific purposes
in bridges, primarily to act as either recorders or announcers. Adds
ARI commands for playing announcements to ever participant in a bridge
as well as for recording a bridge. This patch also includes some
documentation/reponse fixes to related ARI models such as playback
controls.

(closes issue ASTERISK-21592)
Reported by: Matt Jordan

(closes issue ASTERISK-21593)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-19 19:35:21 +00:00
David M. Lee a75fd32212 ARI - channel recording support
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
2013-07-03 17:58:45 +00:00
Richard Mudgett b5f18d1677 Fix menuselect display for stasis modules.
The menuselect parser is very simple.  It looks for AST_MODULE_INFO and
uses any quoted string on that line as the module summary display.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-24 21:40:52 +00:00
David M. Lee 32a86f902a stasis-http: Provide a response body for 201 created responses
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-23 21:46:38 +00:00
David M. Lee 557125664d This patch adds support for controlling a playback operation from the
Asterisk REST interface.

This adds the /playback/{playbackId}/control resource, which may be
POSTed to to pause, unpause, reverse, forward or restart the media
playback.

Attempts to control a playback that is not currently playing will
either return a 404 Not Found (because the playback object no longer
exists) or a 409 Conflict (because the playback object is still in the
queue to be played).

This patch also adds skipms and offsetms parameters to the
/channels/{channelId}/play resource.

(closes issue ASTERISK-21587)
Review: https://reviewboard.asterisk.org/r/2559


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-23 20:21:16 +00:00
David M. Lee 10ba6bf8a8 This patch implements the REST API's for POST /channels/{channelId}/play
and GET /playback/{playbackId}.

This allows an external application to initiate playback of a sound on a
channel while the channel is in the Stasis application.

/play commands are issued asynchronously, and return immediately with
the URL of the associated /playback resource. Playback commands queue up,
playing in succession. The /playback resource shows the state of a
playback operation as enqueued, playing or complete. (Although the
operation will only be in the 'complete' state for a very short time,
since it is almost immediately freed up).

(closes issue ASTERISK-21283)
(closes issue ASTERISK-21586)
Review: https://reviewboard.asterisk.org/r/2531/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-23 20:11:35 +00:00