Asterisk ari-request: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
m (Pchero moved page Asterisk ari to Asterisk ari-request without leaving a redirect)
Line 56: Line 56:


== Channels ==
== Channels ==
=== POST /channels ===
Create a new channel(originate). The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated for further events and updates.
Query parameters
* endpoint: string - (required) Endpoint to call.
* extension: string - The extension to dial after the endpoint answers. Mutually exclusive with 'app'.
* context: string - The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.
* priority: long - The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.
* label: string - The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.
* app: string - The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority' and 'label'.
* appArgs: string - The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.
* callerid: string - CallerID to use when dialing the endpoint or extension.
* timeout: int - Timeout(in seconds) before giving up dialing, or -1 for no timeout.
: Default: 30
* channelId: string - The unique id to assign the channel on creation.
* otherChannelId: string - The unique id to assign the second channel when using local channels.
* originator: string - The unique id of the channel which is originating this one.
* formats: string - The format name capability list to use if originator is not specified. Ex. "ulaw, slin16". Format names can be found with "core show codecs".
Body parameter
* variables: containers - The "variables" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { "endpoint": "SIP/Alice", "variables": {"CALLERID(name)": "Alice"}}
Error response
* 400 : Invalid parameters for originating a channel.
* 409 : Channel with given unique ID already exists.


== Devicestates ==
== Devicestates ==

Revision as of 20:33, 2 December 2018

Overview

Asterisk ARI(Asterisk REST Interface) 내용 정리.

Basic

Asterisk-12 버전부터는 ARI(Asterisk REST Interface) 를 지원한다.

Applications

/applications

GET

List all applications. Request

GET /applications

Return List[Application]


GET


/applications/{applicationName}


Application


Get details of an application.

POST


/applications/{applicationName}/subscription


Application


Subscribe an application to a event source.

DELETE


/applications/{applicationName}/subscription


Application


Unsubscribe an application from an event source.

Asterisk

Bridges

Channels

POST /channels

Create a new channel(originate). The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated for further events and updates.

Query parameters

  • endpoint: string - (required) Endpoint to call.
  • extension: string - The extension to dial after the endpoint answers. Mutually exclusive with 'app'.
  • context: string - The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.
  • priority: long - The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.
  • label: string - The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.
  • app: string - The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority' and 'label'.
  • appArgs: string - The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.
  • callerid: string - CallerID to use when dialing the endpoint or extension.
  • timeout: int - Timeout(in seconds) before giving up dialing, or -1 for no timeout.
Default: 30
  • channelId: string - The unique id to assign the channel on creation.
  • otherChannelId: string - The unique id to assign the second channel when using local channels.
  • originator: string - The unique id of the channel which is originating this one.
  • formats: string - The format name capability list to use if originator is not specified. Ex. "ulaw, slin16". Format names can be found with "core show codecs".

Body parameter

  • variables: containers - The "variables" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { "endpoint": "SIP/Alice", "variables": {"CALLERID(name)": "Alice"}}

Error response

  • 400 : Invalid parameters for originating a channel.
  • 409 : Channel with given unique ID already exists.

Devicestates

Endpoints

Events

Mailboxes

Playbacks

Recordings

REST Data Models

Sounds

See also