Commit Graph

85 Commits

Author SHA1 Message Date
Matthew Jordan
60a67b96f5 ARI: Fix endpoint/channel subscription issues; allow for subscriptions to tech
This patch serves two purposes:
(1) It fixes some bugs with endpoint subscriptions not reporting all of the
    channel events
(2) It serves as the preliminary work needed for ASTERISK-23692, which allows
    for sending/receiving arbitrary out of call text messages through ARI in a
    technology agnostic fashion.

The messaging functionality described on ASTERISK-23692 requires two things:
(1) The ability to send/receive messages associated with an endpoint. This is
    relatively straight forwards with the endpoint core in Asterisk now.
(2) The ability to send/receive messages associated with a technology and an
    arbitrary technology defined URI. This is less straight forward, as
    endpoints are formed from a tech + resource pair. We don't have a
    mechanism to note that a technology that *may* have endpoints exists.

This patch provides such a mechanism, and fixes a few bugs along the way.

The first major bug this patch fixes is the forwarding of channel messages
to their respective endpoints. Prior to this patch, there were two problems:
(1) Channel caching messages weren't forwarded. Thus, the endpoints missed
    most of the interesting bits (such as channel creation, destruction, state
    changes, etc.)
(2) Channels weren't associated with their endpoint until after creation.
    This resulted in endpoints missing the channel creation message, which
    limited the usefulness of the subscription in the first place (a major use
    case being 'tell me when this endpoint has a channel'). Unfortunately,
    this meant another parameter to ast_channel_alloc. Since not all channel
    technologies support an ast_endpoint, this patch makes such a call
    optional and opts for a new function, ast_channel_alloc_with_endpoint.

When endpoints are created, they will implicitly create a technology endpoint
for their technology (if one does not already exist). A technology endpoint is
special in that it has no state, cannot have channels created for it, cannot
be created explicitly, and cannot be destroyed except on shutdown. It does,
however, have all messages from other endpoints in its technology forwarded to
it.

Combined with the bug fixes, we now have Stasis messages being properly
forwarded. Consider the following scenario: two PJSIP endpoints (foo and bar),
where bar has a single channel associated with it and foo has two channels
associated with it. The messages would be forwarded as follows:

channel PJSIP/foo-1 --
                      \
                       --> endpoint PJSIP/foo --
                      /                         \
channel PJSIP/foo-2 --                           \
                                                  ---- > endpoint PJSIP
                                                /
channel PJSIP/bar-1 -----> endpoint PJSIP/bar --

ARI, through the applications resource, can:
 - subscribe to endpoint:PJSIP/foo and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2 and endpoint PJSIP/foo
 - subscribe to endpoint:PJSIP/bar and get notifications for channels
   PJSIP/bar-1 and endpoint PJSIP/bar
 - subscribe to endpoint:PJSIP and get notifications for channels
   PJSIP/foo-1,PJSIP/foo-2,PJSIP/bar-1 and endpoints PJSIP/foo,PJSIP/bar

Note that since endpoint PJSIP never changes, it never has events itself. It
merely provides an aggregation point for all other endpoints in its technology
(which in turn aggregate all channel messages associated with that endpoint).

This patch also adds endpoints to res_xmpp and chan_motif, because the actual
messaging work will need it (messaging without XMPP is just sad).

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

ASTERISK-23692



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@419196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22 16:12:49 +00:00
Matthew Jordan
29ca8a873b ari: Add a copy operation for stored recordings
This patch adds a new operation for stored recordings, copy. It takes an
existing stored recording and makes a copy of it in the same directory
or a relative directory under the stored recording directory.

/ari/recordings/stored/{recordingName}/copy?destinationRecordingName={copy_name}

This is particularly useful for voicemail-esque applications, which may need to
copy or move recordings around a directory structure.

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

ASTERISK-24036 #close
Reported by: Sam Galarneau
Tested by: Sam Galarneau


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@419021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-18 21:25:59 +00:00
Matthew Jordan
36719cba20 manager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txt
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@418182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-08 14:47:46 +00:00
Sam Galarneau
f3715608db ARI: Improvements to body parameters documentation
The variables body parameter under the originate and originate with id
operations of the channel resource showed invalid JSON in its description.

The variables body parameter under the userEvent operation of the event
resource made no mention that the custom key/value pairs should be wrapped
in a variables key in order to be added to the custom user event.

ASTERISK-23975 #close

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@417878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03 16:07:43 +00:00
Matthew Jordan
d0d19b1b90 TALK_DETECT: A channel function that raises events when talking is detected
This patch adds a new channel function TALK_DETECT that, when set on a
channel, causes events indicating the start/stop of talking on a channel to be
emitted to both AMI and ARI clients. 

The function allows setting both the silence threshold (the length of silence
after which we decide no one is talking) as well as the talking threshold (the
amount of energy that counts as talking). Parameters can be updated on a channel
after talk detection has been enabled, and talk detection can be removed at
any time.

The events raised by the function use a nomenclature similar to existing AMI/ARI
events.
For AMI: ChannelTalkingStart/ChannelTalkingStop
For ARI: ChannelTalkingStarted/ChannelTalkingFinished

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

ASTERISK-23786 #close
Reported by: Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-30 12:39:36 +00:00
Matthew Jordan
21281af657 AMI/ARI: Update version numbers
Update the semantic versioning of ARI to 1.3.0 and AMI to 2.3.0 to account for
backwards compatible changes going from 12.2.0 to 12.3.0.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28 17:45:49 +00:00
Scott Griepentrog
3c34202363 ARI: Add ability to raise arbitrary User Events
User events can now be generated from ARI.  Events can be signalled with
arbitrary json variables, and include one or more of channel, bridge, or
endpoint snapshots.  An application must be specified which will receive
the event message (other applications can subscribe to it).  The message
will also be delivered via AMI provided a channel is attached.  Dialplan
generated user event messages are still transmitted via the channel, and
will only be received by a stasis application they are attached to or if
the channel is subscribed to.

This change also introduces the multi object blob mechanism used to send
multiple snapshot types in a single message.  The dialplan app UserEvent
was also changed to use multi object blob, and a new stasis message type
created to handle them.

ASTERISK-22697 #close
Review: https://reviewboard.asterisk.org/r/3494/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22 16:08:55 +00:00
Jonathan Rose
032b1a3276 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@412639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18 18:54:53 +00:00
Jonathan Rose
a365f9100f 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@412535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-17 21:47:10 +00:00
Matthew Jordan
c6e15a8e34 Update API versions and UPGRADE/CHANGES for 12.2.0
This patch does the following:
 * It updates the AMI version to 2.2.0 to indicate backwards compatible
   changes have been made since the last release
 * It updates the ARI version to 1.2.0 to indicate backwards compatible
   changes have been made since the last release
 * It updates the UPGRADE/CHANGES files with changes that were not
   mentioned


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@411529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-28 17:35:48 +00:00
Joshua Colp
b5ae8e1fce res_stasis: Extend bridge type to be a comma separated list of bridge attributes.
This change turns the bridge type field into a comma separated list of attributes.
These attributes include: mixing, holding, dtmf_events, and proxy_media. By setting
the various attributes a user can control the type of bridge created with the
behavior they need for their application.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-19 12:52:55 +00:00
Scott Griepentrog
7bcf69eaad 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/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:46:32 +00:00
Joshua Colp
b7326c2be7 res_stasis_recording: Add a "target_uri" field to recording events.
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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 18:18:16 +00:00
Matthew Jordan
0365b85a35 ARI/AMI: Update versions; update UPGRADE/CHANGES notes for 12.1.0 changes
Due to backwards compatible changes made to AMI/ARI, the version needs to
be bumped to 1.1.0/2.1.0, respectively.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@407402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-05 14:22:16 +00:00
Joshua Colp
f0fb4acc75 res_stasis: Enable transfers and provide events when they occur.
This change enables transfers within ARI created bridges and adds events
for when they occur. Unlike other events these will be received if *any*
subscribed object is involved in the transfer.

(closes issue ASTERISK-22984)
Reported by: David M. Lee

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@407153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-01 16:23:56 +00:00
Kinsey Moore
bf97a4c8d7 ARI: Support channel variables in originate
This adds back in support for specifying channel variables during an
originate without compromising the ability to specify query parameters
in the JSON body. This was accomplished by generating the body-parsing
code in a separate function instead of being integrated with the URI
query parameter parsing code such that it could be called by paths with
body parameters. This is transparent to the user of the API and
prevents manual duplication of code or data structures.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@406003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21 14:15:21 +00:00
Jonathan Rose
1859c07f4f ARI: Add mailboxes resource for controlling and polling external MWI
Adds the following AMI commands:
PUT mailboxes/mailboxName
    modifies mailbox state and implicitly creates new mailboxes
GET mailboxes/mailboxName
    retrieves a JSON representation of a single mailbox if it exists
GET mailboxes
    retrieves a JSON array of all mailboxes
DELETE mailbox/mailboxName
    deletes a mailbox
Note that res_mwi_external must be loaded for these functions to
actually do anything.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@405553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 23:26:40 +00:00
David M. Lee
5f48de6336 ari: Remove support for specifying channel vars during origination.
When we added support for specifying channel variables for an
origination, we didn't consider how that would interact with another
feature, namely specifying request parameters in a JSON request body.

The method of specifying channel variables (as a flat JSON object passed
in the JSON body) interferes with parsing parameters out of the request
body.

Unfortunately, fixing this would be a backward incompatible change. In
the interest of keeping the API sane and keeping our release schedule,
we're dropping the feature for specifying channel variables in the
origination request.

We will bring the feature back soon, as a backward compatible addition
to the API.

(closes issue ASTERISK-23051)
Review: https://reviewboard.asterisk.org/r/3088


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@404509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-20 22:02:11 +00:00
Matthew Jordan
8385e4ba61 ari: Bump the version of ARI to 1.0.0
(closes issue ASTERISK-23007)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@404184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 12:36:40 +00:00
Jonathan Rose
93a096fe9f bridging: Give bridges a name and a known creator
Bridges have two new optional properties, a creator and a name.
Certain consumers of bridges will automatically provide bridges that
they create with these properties. Examples include app_bridgewait,
res_parking, app_confbridge, and app_agent_pool. In addition, a name
may now be provided as an argument to the POST function for creating
new bridges via ARI.

(closes issue AFS-47)
Review: https://reviewboard.asterisk.org/r/3070/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@404042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-17 23:17:32 +00:00
Joshua Colp
6e7d64c79d res_stasis: Expose event for call forwarding and follow forwarded channel.
This change adds an event for when an originated call is redirected to
another target. This event contains the original channel and the newly
created channel. If a stasis subscription exists on the original originated
channel for a stasis application then a new subscription will also be
created on the stasis application to the redirected channel. This allows
the application to follow the call path completely.

(closes issue ASTERISK-22719)
Reported by: Joshua Colp

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-14 17:15:54 +00:00
Kevin Harwell
0948170edb ARI: Allow specifying channel variables during a POST /channels
Added the ability to specify channel variables when creating/originating a
channel in ARI.  The variables are sent in the body of the request and should
be formatted as a single level JSON object.  No nested objects allowed.
For example: {"variable1": "foo", "variable2": "bar"}.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13 17:17:48 +00:00
Kevin Harwell
010983be91 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13 16:32:53 +00:00
Joshua Colp
021f49bad7 res_ari: Add Recording events to the validator.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-30 14:11:55 +00:00
Kevin Harwell
99d5cb8555 ARI: Implement device state API
Created a data model and implemented functionality for an ARI device state
resource.  The following operations have been added that allow a user to
manipulate an ARI controlled device:

Create/Change the state of an ARI controlled device
PUT    /deviceStates/{deviceName}&{deviceState}

Retrieve all ARI controlled devices
GET    /deviceStates

Retrieve the current state of a device
GET    /deviceStates/{deviceName}

Destroy a device-state controlled by ARI
DELETE /deviceStates/{deviceName}

The ARI controlled device must begin with 'Stasis:'.  An example controlled
device name would be Stasis:Example.  A 'DeviceStateChanged' event has also
been added so that an application can subscribe and receive device change
events.  Any device state, ARI controlled or not, can be subscribed to.

While adding the event, the underlying subscription control mechanism was
refactored so that all current and future resource subscriptions would be
the same.  Each event resource must now register itself in order to be able
to properly handle [un]subscribes.

(issue ASTERISK-22838)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3025/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23 17:38:29 +00:00
Joshua Colp
22f800d14e 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23 12:51:31 +00:00
Joshua Colp
60e700565a ari: Add Snoop operation for spying/whispering on channels.
The Snoop operation can be invoked on a channel to spy or
whisper on it. It returns a channel that any channel operations
can then be invoked on (such as record to do monitoring).

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23 12:38:04 +00:00
David M. Lee
4fd244e273 ari: Add silence generator controls
This patch adds the ability to start a silence generator on a channel
via ARI. This generator will play silence on the channel (avoiding audio
timeouts on the peer) until it is stopped, or some other media operation
is started (like playing media, starting music on hold, etc.).

(closes issue ASTERISK-22514)
Review: https://reviewboard.asterisk.org/r/3019/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-21 15:55:33 +00:00
Joshua Colp
0f7db6c413 res_ari_channels: Add the ability to stop locally generated ringing on a channel.
Using the 'ring' operation it is possible to start locally generated ringback if
the channel is answered. This change adds the ability to stop it by using DELETE.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-13 23:09:38 +00:00
Kevin Harwell
59dc668622 ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404
Implementation listing endpoints by technology returned an empty array if no
matching endpoints were found.  Fixed so a "404 Not Found" will be returned
instead.

(closes issue ASTERISK-22803)
Reported by: David M. Lee


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-12 22:15:41 +00:00
David M. Lee
1432a9d59d Fixed a typ.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-12 15:26:26 +00:00
Kevin Harwell
952cd73827 ARI playback: Rename ARI Playback to Playbacks
Before playback was the only non plural resource.  It has been renamed to
playbacks for consistency.

(closes issue ASTERISK-22737)
Reported by: Paul Belanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-08 17:39:43 +00:00
David M. Lee
2f92695c22 ari: User better nicknames for ARI operations
While working on building client libraries from the Swagger API, I
noticed a problem with the nicknames.

    channel.deleteChannel()
    channel.answerChannel()
    channel.muteChannel()

Etc. We put the object name in the nickname (since we were generating C
code), but it makes OO generators redundant.

This patch makes the nicknames more OO friendly. This resulted in a lot
of name changing within the res_ari_*.so modules, but not much else.

There were a couple of other fixed I made in the process.

 * When reversible operations (POST /hold, POST /unhold) were made more
   RESTful (POST /hold, DELETE /unhold), the path for the second operation
   was left in the API declaration. This worked, but really the two
   operations should have been on the same API.
 * The POST /unmute operation had still not been REST-ified.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-07 21:09:18 +00:00
Joshua Colp
26458aa615 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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-01 14:37:00 +00:00
Kinsey Moore
e81d1ab8cd ARI: Remove channels/{channelId}/dial
This removes the /ari/channels/{channelId}/dial URI since it is
redundant, overly complex, is likely to become more externally complex
over time, and is too high-level compared with other ARI operations.
See the following for further information:
http://lists.digium.com/pipermail/asterisk-app-dev/2013-October/000002.html

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-29 12:51:15 +00:00
Joshua Colp
8de298e17b res_ari_playback: Add missing 404 error response for GET and DELETE.
(closes issue ASTERISK-22722)
Reported by: Richard Mudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-29 11:15:16 +00:00
Jonathan Rose
0bdbdbf3fc ARI: channel/bridge recording errors when invalid format specified
Asterisk will now issue 422 if recording is requested against channels
or bridges with an unknown format

(closes issue ASTERISK-22626)
Reported by: Joshua Colp
Review: https://reviewboard.asterisk.org/r/2939/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@402001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 21:53:31 +00:00
Jonathan Rose
f503fc5673 ARI recordings: Issue HTTP failures for recording requests with file conflicts
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/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 21:20:42 +00:00
David M. Lee
5f31d0b182 The Swagger 1.2 specification for type extension ended up being
slightly different than my proposal. Instead of putting an 'extends'
field on the subtype, the base type has a 'subTypes' field, which is a
list of the subTypes. Given that its a messaging model and not an
object model, kinda makes sense.

This patch changes the events.json api-doc, and the python translators
to take the new format into account.

Other changes that are in Swagger 1.2 were not adopted, since the spec
is still in flux, and could change before it's finalized.

A summary of changes to the Swagger-1.2 spec can be found at
https://github.com/wordnik/swagger-core/wiki/1.2-transition.

(closes issue ASTERISK-22440)
Review: https://reviewboard.asterisk.org/r/2909/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-24 03:12:06 +00:00
David M. Lee
222e34644f Fixing r401281; the model name is Channel, with a capital C
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-21 18:58:37 +00:00
Joshua Colp
abcc1c0c15 Return a channel snapshot when originating using ARI, and subscribe the Stasis application to it.
This change allows a user of ARI to know what channel it has originated and also follow any
progress. If a Stasis application is provided it will be automatically subscribed to the
originated channel immediately.

(closes issue ASTERISK-22485)
Reported by: David Lee

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-19 14:43:41 +00:00
Kinsey Moore
24fe1d52fb Clarify documentation for channel and bridge list
This makes it clear that the ARI API calls for listing channels and
bridges will list all channels or bridges in the system and not just
those that are in or are controlled by a Stasis application.

(closes issue ASTERISK-22635)
Reported by: Kevin Harwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16 14:01:04 +00:00
Paul Belanger
c76d5392f5 Use POST / DELETE to toggle ARI bridge moh
Review: https://reviewboard.asterisk.org/r/2911/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16 00:02:45 +00:00
Kinsey Moore
8dbc1d6f30 Ensure bridge record error responses validate
This adds the list of expected errors to the /bridges/{bridgeId}/record
ARI documentation so that outbound 4xx errors validate properly.
Previously, this would result in a response validation failure.

(closes issue ASTERISK-22627)
Reported by: Joshua Colp


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15 20:02:08 +00:00
Paul Belanger
56757b114b Use POST / DELETE to toggle hold / moh for ARI channels
This change updates how we handle toggle events, rather then create two
different function names, we'll just use POST / DELETE from HTTP to handle it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15 15:26:17 +00:00
David M. Lee
1af791acb0 Fix a stupid copy/paste error in ARI docs.
Patches:
    ari-doc-patch.txt uploaded by jbigelow (license 5091)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-11 16:18:46 +00:00
David M. Lee
945108058c Updated /play resource docs. The playback of http: resources isn't implemented... yet
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-10 19:26:19 +00:00
David M. Lee
cd2ddccaf2 Added missing file from r400522
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 19:31:35 +00:00
Matthew Jordan
7fc567bd76 ARI: Add subscription support
This patch adds an /applications API to ARI, allowing explicit management of
Stasis applications.

 * GET /applications - list current applications
 * GET /applications/{applicationName} - get details of a specific application
 * POST /applications/{applicationName}/subscription - explicitly subscribe to
   a channel, bridge or endpoint
 * DELETE /applications/{applicationName}/subscription - explicitly unsubscribe
   from a channel, bridge or endpoint

Subscriptions work by a reference counting mechanism: if you subscript to an
event source X number of times, you must unsubscribe X number of times to stop
receiveing events for that event source.

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

(issue ASTERISK-22451)
Reported by: Matt Jordan




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 15:54:57 +00:00
David M. Lee
096ce6c5b7 Corrected response class for stopPlayback
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-04 04:54:51 +00:00