summaryrefslogtreecommitdiff
path: root/rest-api
AgeCommit message (Collapse)Author
2014-08-07Stasis: Convey transfer information to applicationsKinsey Moore
This fixes a class of issues where Stasis applications were not made aware that their channels were being manipulated or replaced by external entitiessuch as transfers, AMI commands, or dialplan applications such as Bridge(). Inconsistent information such as StasisEnd events with unknown channels as a result of masquerades has also been corrected. To accomplish these fixes, several new fields were added to blind and attended transfer messages as well as StasisStart and BridgeAttendedTransfer Stasis events. ASTERISK-23941 #close Review: https://reviewboard.asterisk.org/r/3865/ Review: https://reviewboard.asterisk.org/r/3857/ Review: https://reviewboard.asterisk.org/r/3852/ Review: https://reviewboard.asterisk.org/r/3816/ Review: https://reviewboard.asterisk.org/r/3731/ Review: https://reviewboard.asterisk.org/r/3729/ Review: https://reviewboard.asterisk.org/r/3728/ ........ Merged revisions 420325 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-05Multiple revisions 420089-420090,420097Matthew Jordan
........ r420089 | mjordan | 2014-08-05 15:10:52 -0500 (Tue, 05 Aug 2014) | 72 lines ARI: Add channel technology agnostic out of call text messaging This patch adds the ability to send and receive text messages from various technology stacks in Asterisk through ARI. This includes chan_sip (sip), res_pjsip_messaging (pjsip), and res_xmpp (xmpp). Messages are sent using the endpoints resource, and can be sent directly through that resource, or to a particular endpoint. For example, the following would send the message "Hello there" to PJSIP endpoint alice with a display URI of sip:asterisk@mycooldomain.org: ari/endpoints/sendMessage?to=pjsip:alice&from=sip:asterisk@mycooldomain.org&body=Hello+There This is equivalent to the following as well: ari/endpoints/PJSIP/alice/sendMessage?from=sip:asterisk@mycooldomain.org&body=Hello+There Both forms are available for message technologies that allow for arbitrary destinations, such as chan_sip. Inbound messages can now be received over ARI as well. An ARI application that subscribes to endpoints will receive messages from those endpoints: { "type": "TextMessageReceived", "timestamp": "2014-07-12T22:53:13.494-0500", "endpoint": { "technology": "PJSIP", "resource": "alice", "state": "online", "channel_ids": [] }, "message": { "from": "\"alice\" <sip:alice@127.0.0.1>", "to": "pjsip:asterisk@127.0.0.1", "body": "Watson, come here.", "variables": [] }, "application": "testsuite" } The above was made possible due to some rather major changes in the message core. This includes (but is not limited to): - Users of the message API can now register message handlers. A handler has two callbacks: one to determine if the handler has a destination for the message, and another to handle it. - All dialplan functionality of handling a message was moved into a message handler provided by the message API. - Messages can now have the technology/endpoint associated with them. Various other properties are also now more easily accessible. - A number of ao2 containers that weren't really needed were replaced with vectors. Iteration over ao2_containers is expensive and pointless when the lifetime of things is well defined and the number of things is very small. res_stasis now has a new file that makes up its structure, messaging. The messaging functionality implements a message handler, and passes received messages that match an interested endpoint over to the app for processing. Note that inadvertently while testing this, I reproduced ASTERISK-23969. res_pjsip_messaging was incorrectly parsing out the 'to' field, such that arbitrary SIP URIs mangled the endpoint lookup. This patch includes the fix for that as well. Review: https://reviewboard.asterisk.org/r/3726 ASTERISK-23692 #close Reported by: Matt Jordan ASTERISK-23969 #close Reported by: Andrew Nagy ........ r420090 | mjordan | 2014-08-05 15:16:37 -0500 (Tue, 05 Aug 2014) | 2 lines Remove automerge properties :-( ........ r420097 | mjordan | 2014-08-05 16:36:25 -0500 (Tue, 05 Aug 2014) | 2 lines test_message: Fix strict-aliasing compilation issue ........ Merged revisions 420089-420090,420097 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420098 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-07-22ARI: Fix endpoint/channel subscription issues; allow for subscriptions to techMatthew Jordan
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 ........ Merged revisions 419196 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-18ari: Add a copy operation for stored recordingsMatthew Jordan
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 ........ Merged revisions 419021 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-08manager/ARI: Update version to 2.4.0/1.4.0; Update UPGRADE.txtMatthew Jordan
........ Merged revisions 418182 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-03ARI: Improvements to body parameters documentationSam Galarneau
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/ ........ Merged revisions 417878 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-30TALK_DETECT: A channel function that raises events when talking is detectedMatthew Jordan
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 ........ Merged revisions 414934 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-28AMI/ARI: Update version numbersMatthew Jordan
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. ........ Merged revisions 414765 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-22ARI: Add ability to raise arbitrary User EventsScott Griepentrog
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/ ........ Merged revisions 414405 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@414406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-18ARI: Make bridges/{bridgeID}/play queue sound filesJonathan Rose
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-17ARI: Add tones playback resourceJonathan Rose
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-03-28Update API versions and UPGRADE/CHANGES for 12.2.0Matthew Jordan
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 ........ Merged revisions 411529 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-19res_stasis: Extend bridge type to be a comma separated list of bridge ↵Joshua Colp
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/ ........ Merged revisions 410904 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07uniqueid: channel linkedid, ami, ari object creation with id'sScott Griepentrog
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-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-02-05ARI/AMI: Update versions; update UPGRADE/CHANGES notes for 12.1.0 changesMatthew Jordan
Due to backwards compatible changes made to AMI/ARI, the version needs to be bumped to 1.1.0/2.1.0, respectively. ........ Merged revisions 407402 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-01res_stasis: Enable transfers and provide events when they occur.Joshua Colp
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/ ........ Merged revisions 407153 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-21ARI: Support channel variables in originateKinsey Moore
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 ........ Merged revisions 406003 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14ARI: Add mailboxes resource for controlling and polling external MWIJonathan Rose
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/ ........ Merged revisions 405553 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-20ari: Remove support for specifying channel vars during origination.David M. Lee
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 ........ Merged revisions 404509 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18ari: Bump the version of ARI to 1.0.0Matthew Jordan
(closes issue ASTERISK-23007) ........ Merged revisions 404184 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-17bridging: Give bridges a name and a known creatorJonathan Rose
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/ ........ Merged revisions 404042 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-14res_stasis: Expose event for call forwarding and follow forwarded channel.Joshua Colp
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/ ........ Merged revisions 403808 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-13ARI: Allow specifying channel variables during a POST /channelsKevin Harwell
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/ ........ Merged revisions 403752 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403757 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-30res_ari: Add Recording events to the validator.Joshua Colp
........ Merged revisions 403240 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-23ARI: Implement device state APIKevin Harwell
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/ ........ Merged revisions 403134 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403135 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-11-23ari: Add Snoop operation for spying/whispering on channels.Joshua Colp
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/ ........ Merged revisions 403117 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-21ari: Add silence generator controlsDavid M. Lee
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/ ........ Merged revisions 402926 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-13res_ari_channels: Add the ability to stop locally generated ringing on a ↵Joshua Colp
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. ........ Merged revisions 402804 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-12ari endpoints: GET /ari/endpoints/{invalid-tech} should return a 404Kevin Harwell
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 ........ Merged revisions 402787 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-12Fixed a typ.David M. Lee
........ Merged revisions 402738 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-08ARI playback: Rename ARI Playback to PlaybacksKevin Harwell
Before playback was the only non plural resource. It has been renamed to playbacks for consistency. (closes issue ASTERISK-22737) Reported by: Paul Belanger ........ Merged revisions 402560 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-07ari: User better nicknames for ARI operationsDavid M. Lee
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/ ........ Merged revisions 402528 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-01res_ari_channels: Add ring operation, dtmf operation, hangup reasons, and ↵Joshua Colp
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-10-29ARI: Remove channels/{channelId}/dialKinsey Moore
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/ ........ Merged revisions 402152 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-29res_ari_playback: Add missing 404 error response for GET and DELETE.Joshua Colp
(closes issue ASTERISK-22722) Reported by: Richard Mudgett ........ Merged revisions 402139 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25ARI: channel/bridge recording errors when invalid format specifiedJonathan Rose
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/ ........ Merged revisions 402001 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402002 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-10-24The Swagger 1.2 specification for type extension ended up beingDavid M. Lee
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/ ........ Merged revisions 401701 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-21Fixing r401281; the model name is Channel, with a capital CDavid M. Lee
........ Merged revisions 401315 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-19Return a channel snapshot when originating using ARI, and subscribe the ↵Joshua Colp
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/ ........ Merged revisions 401281 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16Oops. Leftover /stasis referenceDavid M. Lee
........ Merged revisions 401096 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16Clarify documentation for channel and bridge listKinsey Moore
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 ........ Merged revisions 401087 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-16Use POST / DELETE to toggle ARI bridge mohPaul Belanger
Review: https://reviewboard.asterisk.org/r/2911/ ........ Merged revisions 401040 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15Ensure bridge record error responses validateKinsey Moore
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 ........ Merged revisions 401018 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-15Use POST / DELETE to toggle hold / moh for ARI channelsPaul Belanger
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/ ........ Merged revisions 400999 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-11Multiple revisions 400508,400842-400843,400848David M. Lee
........ r400508 | dlee | 2013-10-03 23:54:51 -0500 (Thu, 03 Oct 2013) | 1 line Corrected response class for stopPlayback ........ r400842 | dlee | 2013-10-10 14:23:24 -0500 (Thu, 10 Oct 2013) | 1 line Correct some ARI wiki rendering errors ........ r400843 | dlee | 2013-10-10 14:26:19 -0500 (Thu, 10 Oct 2013) | 1 line Updated /play resource docs. The playback of http: resources isn't implemented... yet ........ r400848 | dlee | 2013-10-11 11:18:46 -0500 (Fri, 11 Oct 2013) | 5 lines Fix a stupid copy/paste error in ARI docs. Patches: ari-doc-patch.txt uploaded by jbigelow (license 5091) ........ Merged revisions 400508,400842-400843,400848 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400852 65c4cc65-6c06-0410-ace0-fbb531ad65f3