### Start Recording Bridge Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Bridges_REST_API Start a recording of a bridge. ```APIDOC ## POST /bridges/{bridgeId}/record ### Description Start a recording of a bridge. ### Method POST ### Endpoint /bridges/{bridgeId}/record ### Parameters #### Path Parameters - **bridgeId** (string) - Required - Bridge's id #### Query Parameters - **name** (string) - Required - Name of the recording. - **format** (string) - Optional - Recording format (e.g., \"wav\", \"mp3\"). Defaults to \"wav\". - **maxDurationSeconds** (integer) - Optional - Maximum duration of the recording in seconds. - **maxSilenceSeconds** (integer) - Optional - Maximum duration of silence in seconds before stopping the recording. - **stopDtmfDigit** (string) - Optional - DTMF digit to stop the recording. ### Request Example ```json { "example": "POST /bridges/bridgeId1/record?name=myRecording&format=mp3" } ``` ### Response #### Success Response (200) - **LiveRecording** - The live recording object. #### Response Example ```json { "example": "{\n \"id\": \"recordingId1\",\n \"name\": \"myRecording\",\n \"format\": \"mp3\",\n \"target_uri\": \"bridge:bridgeId1\"\n}" } ``` #### Error Responses - **404** - Bridge not found - **409** - Bridge not in Stasis application ``` -------------------------------- ### Start Playback on Bridge Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Bridges_REST_API Start playback of media on a bridge. ```APIDOC ## POST /bridges/{bridgeId}/play ### Description Start playback of media on a bridge. ### Method POST ### Endpoint /bridges/{bridgeId}/play ### Parameters #### Path Parameters - **bridgeId** (string) - Required - Bridge's id #### Request Body - **media_uri** (string) - Required - URI of the media to play. - **lang** (string) - Optional - Language of the media. - **loop** (integer) - Optional - Number of times to loop the playback. ### Request Example ```json { "example": "{\"media_uri\": \"sound:abc\", \"loop\": 1}" } ``` ### Response #### Success Response (200) - **Playback** - The playback object. #### Response Example ```json { "example": "{\n \"id\": \"playbackId1\",\n \"media_uri\": \"sound:abc\",\n \"lang\": \"en\",\n \"loop\": 1,\n \"skip_dtmf\": \"*\",\n \"target_uri\": \"bridge:bridgeId1\"\n}" } ``` #### Error Responses - **404** - Bridge not found ``` -------------------------------- ### GET /asterisk/modules Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Asterisk_REST_API Lists all available Asterisk modules. ```APIDOC ## GET /asterisk/modules ### Description List Asterisk modules. ### Method GET ### Endpoint /asterisk/modules ### Response #### Success Response (200) - **List[Module]** - A list of Asterisk modules. ``` -------------------------------- ### Dial() with PJSIP and pre-dial subroutines Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/Dial This extensive example showcases the use of pre-dial subroutines with the Dial() application. It defines two subroutines, 'callee_channel' and 'called_channel', which are executed before and after the outbound channel is initiated, respectively. This allows for complex call setup logic and dynamic parameter passing. ```asterisk dialplan [default] exten => callee_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2}) same => n,Log(NOTICE, I'm called on channel ${CHANNEL} prior to it starting the dial attempt) same => n,Return() exten => called_channel,1,NoOp(ARG1=${ARG1} ARG2=${ARG2}) same => n,Log(NOTICE, I'm called on outbound channel ${CHANNEL} prior to it being used to dial someone) same => n,Return() exten => _X.,1,NoOp() same => n,Dial(PJSIP/alice,,b(default^called_channel^1(my_gosub_arg1^my_gosub_arg2))B(default^callee_channel^1(my_gosub_arg1^my_gosub_arg2))) same => n,Hangup() ``` -------------------------------- ### Start Recording a Channel Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Channels_REST_API Initiates the recording of audio from a specific communication channel. ```APIDOC ## POST /channels/{channelId}/record ### Description Start a recording. ### Method POST ### Endpoint /channels/{channelId}/record ### Parameters #### Path Parameters - **channelId** (string) - Required - The unique identifier of the channel to record. #### Query Parameters None specified in the provided text. #### Request Body - **name** (string) - Required - The name of the recording file. - **format** (string) - Optional - The audio format for the recording (e.g., "wav", "sln"). Defaults to "wav". - **max_duration_seconds** (integer) - Optional - Maximum duration of the recording in seconds. - **if_available** (boolean) - Optional - If true, does not proceed if the channel is not available. - **terminate_on** (string) - Optional - DTMF sequence to terminate the recording. ### Request Example ```json { "name": "/var/spool/asterisk/recordings/my_recording.wav", "format": "wav", "max_duration_seconds": 60, "terminate_on": "#" } ``` ### Response #### Success Response (200) - **LiveRecording**: Information about the ongoing recording. #### Response Example ```json { "example": "{ \"id\": \"rec123\", \"name\": \"/var/spool/asterisk/recordings/my_recording.wav\", \"format\": \"wav\" }" } ``` ``` -------------------------------- ### Start Playback of Media Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Channels_REST_API Starts playing media (e.g., audio files) on a specific communication channel. ```APIDOC ## POST /channels/{channelId}/play ### Description Start playback of media. ### Method POST ### Endpoint /channels/{channelId}/play ### Parameters #### Path Parameters - **channelId** (string) - Required - The unique identifier of the channel. #### Query Parameters None specified in the provided text. #### Request Body - **media_uri** (string) - Required - The URI of the media to play (e.g., "sound:abc"). - **offset_ms** (integer) - Optional - Offset in milliseconds to start playback from. - **skip_dtmf** (string) - Optional - DTMF key to interrupt playback. ### Request Example ```json { "media_uri": "sound:your_sound_file", "offset_ms": 5000, "skip_dtmf": "#" } ``` ### Response #### Success Response (200) - **Playback**: Information about the playback operation, including a playback ID. #### Response Example ```json { "example": "{ \"playbackId\": \"12345\", \"media_uri\": \"sound:your_sound_file\" }" } ``` ``` -------------------------------- ### Start Playback on Bridge (with Playback ID) Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Bridges_REST_API Start playback of media on a bridge using a specific playback ID. ```APIDOC ## POST /bridges/{bridgeId}/play/{playbackId} ### Description Start playback of media on a bridge using a specific playback ID. ### Method POST ### Endpoint /bridges/{bridgeId}/play/{playbackId} ### Parameters #### Path Parameters - **bridgeId** (string) - Required - Bridge's id - **playbackId** (string) - Required - The ID of the playback. #### Request Body - **media_uri** (string) - Required - URI of the media to play. - **lang** (string) - Optional - Language of the media. - **loop** (integer) - Optional - Number of times to loop the playback. ### Request Example ```json { "example": "POST /bridges/bridgeId1/play/playbackId1 { \"media_uri\": \"sound:abc\", \"loop\": 1 }" } ``` ### Response #### Success Response (200) - **Playback** - The playback object. #### Response Example ```json { "example": "{\n \"id\": \"playbackId1\",\n \"media_uri\": \"sound:abc\",\n \"lang\": \"en\",\n \"loop\": 1,\n \"skip_dtmf\": \"*\",\n \"target_uri\": \"bridge:bridgeId1\"\n}" } ``` #### Error Responses - **404** - Bridge or Playback not found ``` -------------------------------- ### POST /channels/externalMedia Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Channels_REST_API Starts an External Media session, creating a channel to an External Media source/sink. ```APIDOC ## POST /channels/externalMedia ### Description Start an External Media session. Create a channel to an External Media source/sink. ### Method POST ### Endpoint /channels/externalMedia ### Parameters #### Query Parameters - **channelId** (string) - Optional - The unique id to assign the channel on creation. - **app** (string) - Required - Stasis Application to place channel into - **external_host** (string) - Required - Hostname/ip:port of external host - **encapsulation** (string) - Optional - Payload encapsulation protocol. Allowed values: rtp, audiosocket. Default: rtp - **transport** (string) - Optional - Transport protocol. Allowed values: udp, tcp. Default: udp - **connection_type** (string) - Optional - Connection type. Allowed values: client. Default: client - **format** (string) - Required - Format to encode audio in - **direction** (string) - Optional - External media direction. Allowed values: both. Default: both - **data** (string) - Optional - An arbitrary data field #### Request Body - **variables** (object) - Optional - 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 Responses - 400 - Invalid parameters - 409 - Channel is not in a Stasis application; Channel is already bridged ``` -------------------------------- ### GET /asterisk/info Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Asterisk_REST_API Gets Asterisk system information, with options to filter the returned data. ```APIDOC ## GET /asterisk/info ### Description Gets Asterisk system information. ### Method GET ### Endpoint /asterisk/info ### Parameters #### Query Parameters - **only** (string) - Optional - Filter information returned. Allowed values: build, system, config, status. Allows comma separated values. ### Response #### Success Response (200) - **AsteriskInfo** - An object containing Asterisk system information. ``` -------------------------------- ### Asterisk GET OPTION Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AGI_Commands/get_option Defines the syntax for the GET OPTION application in Asterisk dialplan. It requires a filename for the audio prompt, escape digits to terminate input, and a timeout value in seconds. ```asterisk GET OPTION FILENAME ESCAPE_DIGITS TIMEOUT ``` -------------------------------- ### Get Application Details Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Applications_REST_API Retrieves detailed information about a specific application. ```APIDOC ## GET /applications/{applicationName} ### Description Get details of an application. ### Method GET ### Endpoint /applications/{applicationName} ### Parameters #### Path Parameters - **applicationName** (string) - Required - Application's name #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **application** (Application) - An object representing the application. #### Response Example ```json { "name": "string", "description": "string", " 100rel": "string", " 100rel_dial": "string", " 100rel_dtmf": "string", " 100rel_media": "string", " 100rel_progress": "string", " 100rel_progress_media": "string", " 100rel_session_description": "string", " 100rel_session_description_media": "string", " 100rel_session_description_progress": "string", " 100rel_session_description_progress_media": "string", " 100rel_session_description_update": "string", " 100rel_session_description_update_media": "string", " 100rel_update": "string", " 100rel_update_media": "string", "bridge": "string", "deviceState": "string", "endpoint": "string", "eventFilter": { "allowed": [ { "type": "string" } ], "disallowed": [ { "type": "string" } ] }, "id": "string", "subscription": { "event_source": "string" } } ``` #### Error Responses - 404 - Application does not exist. ``` -------------------------------- ### POST /bridges/{bridgeId}/record Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Bridges_REST_API Start a recording. This records the mixed audio from all channels participating in this bridge. ```APIDOC ## record ### Description Start a recording. This records the mixed audio from all channels participating in this bridge. ### Method POST ### Endpoint /bridges/{bridgeId}/record #### Path Parameters - **bridgeId** (string) - Required - Bridge's id #### Query Parameters - **name** (string) - Required - Recording's filename - **format** (string) - Required - Format to encode audio in - **maxDurationSeconds** (int) - Optional - Maximum duration of the recording, in seconds. 0 for no limit. Allowed range: Min: 0; Max: None - **maxSilenceSeconds** (int) - Optional - Maximum duration of silence, in seconds. 0 for no limit. Allowed range: Min: 0; Max: None - **ifExists** (string) - Optional - Action to take if a recording with the same name already exists. Default: fail. Allowed values: fail, overwrite, append - **beep** (boolean) - Optional - Play beep when recording begins - **terminateOn** (string) - Optional - DTMF input to terminate recording. Default: none. Allowed values: none, any, *, # ### Error Responses - **400** - Invalid parameters - **404** - Bridge not found - **409** - Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail - **422** - The format specified is unknown on this system ``` -------------------------------- ### DialBegin Event Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AMI_Events/DialBegin This section details the DialBegin event, which signifies the start of a dial action in Asterisk. It includes the event syntax, a list of all possible arguments, and descriptions for each argument. ```APIDOC ## DialBegin Event ### Description Raised when a dial action has started. ### Method Event ### Endpoint N/A (This is an event, not an API endpoint) ### Parameters #### Event Parameters - **Channel** (string) - Description of the channel involved in the dial action. - **ChannelState** (integer) - A numeric code for the channel's current state. - **ChannelStateDesc** (string) - Description of the channel's current state (e.g., Down, Ring, Up, Busy). - **CallerIDNum** (string) - The Caller ID number associated with the channel. - **CallerIDName** (string) - The Caller ID name associated with the channel. - **ConnectedLineNum** (string) - The Caller ID number of the connected line. - **ConnectedLineName** (string) - The Caller ID name of the connected line. - **Language** (string) - The language setting for the channel. - **AccountCode** (string) - The account code associated with the channel. - **Context** (string) - The dialplan context where the call originated. - **Exten** (string) - The extension the call is directed to. - **Priority** (integer) - The priority within the dialplan context. - **Uniqueid** (string) - The unique identifier for the channel. - **Linkedid** (string) - Uniqueid of the oldest channel associated with this channel. - **DestChannel** (string) - Description of the destination channel. - **DestChannelState** (integer) - A numeric code for the destination channel's current state. - **DestChannelStateDesc** (string) - Description of the destination channel's current state. - **DestCallerIDNum** (string) - The Caller ID number of the destination channel. - **DestCallerIDName** (string) - The Caller ID name of the destination channel. - **DestConnectedLineNum** (string) - The Caller ID number of the connected line on the destination channel. - **DestConnectedLineName** (string) - The Caller ID name of the connected line on the destination channel. - **DestLanguage** (string) - The language setting for the destination channel. - **DestAccountCode** (string) - The account code associated with the destination channel. - **DestContext** (string) - The dialplan context for the destination. - **DestExten** (string) - The extension for the destination. - **DestPriority** (integer) - The priority within the destination dialplan context. - **DestUniqueid** (string) - The unique identifier for the destination channel. - **DestLinkedid** (string) - Uniqueid of the oldest channel associated with the destination channel. - **DialString** (string) - The non-technology specific device being dialed. ### Request Example N/A (This is an event) ### Response #### Success Response (Event Notification) - **Event** (string) - Always 'DialBegin'. - All parameters listed under 'Event Parameters' are included in the event notification. #### Response Example ``` Event: DialBegin Channel: SIP/testing-00000001 ChannelState: 5 ChannelStateDesc: Ring CallerIDNum: 1234 CallerIDName: Test Caller ConnectedLineNum: 9876 ConnectedLineName: Test Callee Language: en AccountCode: account1 Context: default Exten: 500 Priority: 1 Uniqueid: 1678886400.1 Linkedid: 1678886400.1 DestChannel: SIP/callee-00000002 DestChannelState: 4 DestChannelStateDesc: Dialing DestCallerIDNum: 9876 DestCallerIDName: Test Callee DestConnectedLineNum: 1234 DestConnectedLineName: Test Caller DestLanguage: en DestAccountCode: account2 DestContext: default DestExten: 1000 DestPriority: 2 DestUniqueid: 1678886401.2 DestLinkedid: 1678886400.1 DialString: SIP/callee/1000 ``` ### See Also - Dialplan Applications Dial - Dialplan Applications Originate - AMI Actions Originate - AMI Events DialEnd ``` -------------------------------- ### Asterisk Dialplan CHANNEL() PJSIP Specific Examples Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/CHANNEL Illustrates how to access PJSIP-specific channel information using the CHANNEL() dialplan function, including retrieving the Call-ID and RTP destination address, and setting CDR fields based on RTCP round-trip time. These examples are tailored for Asterisk environments using the PJSIP channel driver. ```asterisk-dialplan same => n,Log(NOTICE, ${CHANNEL(pjsip,call-id)}) same => n,Log(NOTICE, ${CHANNEL(rtp,dest)}) same => n,Set(CDR(video-rtt)=${CHANNEL(rtcp,rtt,video)}) ``` -------------------------------- ### Asterisk Dialplan Hint Example Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/HINT Demonstrates how to use the HINT() function within an Asterisk dialplan to retrieve the hint for a specific extension. ```asterisk same => n,NoOp(Hint for Extension 1234 is ${HINT(1234)}) ``` -------------------------------- ### Get Device State - Asterisk Dialplan Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/DEVICE_STATE Retrieves the current state of a specified device using the DEVICE_STATE() function. This example shows how to check the state of a SIP peer and a MeetMe conference. ```asterisk-dialplan NoOp(SIP/mypeer has state ${DEVICE_STATE(SIP/mypeer)}) NoOp(Conference number 1234 has state ${DEVICE_STATE(MeetMe:1234)}) ``` -------------------------------- ### ConfbridgeStart Event Documentation Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AMI_Events/ConfbridgeStart This section details the ConfbridgeStart event, which is raised when a conference begins. It outlines the event's synopsis, syntax, and the arguments it carries. ```APIDOC ## ConfbridgeStart Event ### Description Raised when a conference starts. ### Synopsis Event: ConfbridgeStart ### Arguments * `Conference` (string) - The name of the Confbridge conference. * `BridgeUniqueid` (string) - Unique identifier for the bridge. * `BridgeType` (string) - The type of bridge. * `BridgeTechnology` (string) - Technology in use by the bridge. * `BridgeCreator` (string) - Entity that created the bridge if applicable. * `BridgeName` (string) - Name used to refer to the bridge by its BridgeCreator if applicable. * `BridgeNumChannels` (integer) - Number of channels in the bridge. * `BridgeVideoSourceMode` (string) - The video source mode for the bridge. Possible values: `none`, `talker`, `single`. * `BridgeVideoSource` (string) - If there is a video source for the bridge, the unique ID of the channel that is the video source. ### Class CALL ### See Also * AMI Events ConfbridgeEnd * Dialplan Applications ConfBridge ### Generated Version This documentation was generated from Asterisk branch certified/18.9 using version GIT ``` -------------------------------- ### PJSIP Phoneprov Provider Configuration Example Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Module_Configuration/res_pjsip_phoneprov_provider This snippet demonstrates the configuration of a user within pjsip.conf for the PJSIP Phoneprov Provider. It shows how to define the 'phoneprovr' type, associate an endpoint, and provide essential parameters like MAC address and profile, along with optional variables for template substitution. ```asterisk [1000] type = phoneprovr endpoint = ep1000 MAC = deadbeef4dad PROFILE = grandstream2 LINEKEYS = 2 LINE = 1 OTHERVAR = othervalue ``` -------------------------------- ### Asterisk Dialplan: Retrieve File with CURL() Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/CURL This example shows how to use the CURL() function in Asterisk's dialplan to download a file from a remote URL using an HTTP GET request and save it to a local destination. This is useful for fetching external resources. ```asterisk exten => s,1,Set(CURL(http://localhost:8088/static/astman.css)=/var/spool/asterisk/tmp/astman.css)) ``` -------------------------------- ### Asterisk Dialplan: Display Page Content with CURL() Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/CURL This example demonstrates how to use the CURL() function in Asterisk's dialplan to retrieve and display the content of a remote URL using an HTTP GET request. It's useful for fetching configuration files or dynamic content. ```asterisk exten => s,1,Verbose(0, ${CURL(http://localhost:8088/static/astman.css)}) ``` -------------------------------- ### Create a New Channel (Originate) Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Channels_REST_API Creates a new communication channel, typically used to originate a call. Supports various parameters for call setup, including endpoint, context, application, and channel variables. ```APIDOC ## POST /channels (Originate) ### Description 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 channel for further events and updates. ### Method POST ### Endpoint /channels ### Parameters #### Query Parameters - **endpoint** (string) - Required - Endpoint to call. - **extension** (string) - Optional - The extension to dial after the endpoint answers. Mutually exclusive with 'app'. - **context** (string) - Optional - The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. - **priority** (long) - Optional - The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. - **label** (string) - Optional - The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. - **app** (string) - Optional - 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) - Optional - The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. - **callerId** (string) - Optional - CallerID to use when dialing the endpoint or extension. - **timeout** (int) - Optional - Timeout (in seconds) before giving up dialing, or -1 for no timeout. Default: 30. - **channelId** (string) - Optional - The unique id to assign the channel on creation. - **otherChannelId** (string) - Optional - The unique id to assign the second channel when using local channels. - **originator** (string) - Optional - The unique id of the channel which is originating this one. - **formats** (string) - Optional - The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". #### Request Body - **variables** (object) - Optional - 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" } } ### Request Example ```json { "endpoint": "SIP/bob", "callerId": "Alice <1234>", "variables": { "CALLERID(name)": "Alice", "recording_file": "/var/spool/asterisk/recording/test.wav" } } ``` ### Response #### Success Response (200) - **Channel**: Details of the newly created channel. #### Response Example ```json { "example": "{ \"id\": \"1403700107.5\", \"name\": \"SIP/bob-00000002\", ... }" } ``` ### Error Responses - **400**: Invalid parameters for originating a channel. - **409**: Channel with given unique ID already exists. ``` -------------------------------- ### Drop ANSWER Frames TX - Asterisk Dialplan Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/FRAME_DROP This example shows how to configure Asterisk to drop ANSWER control frames in the transmit (TX) direction for a channel. Dropping ANSWER frames can affect call setup; it's recommended to use 'Progress()' explicitly when dropping these frames to avoid undesired call behavior. ```asterisk exten => 1,1,Set(FRAME_DROP(TX)=ANSWER) ``` -------------------------------- ### Page() Dialplan Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/Page This snippet shows the general syntax for the Page() dialplan application. It includes placeholders for the technology/resource to dial, optional arguments, and a timeout. The 'options' argument allows for advanced configurations like Gosub execution, duplex audio, quiet operation, recording, and playing announcements. ```asterisk_dialplan Page(Technology/Resource&[Technology2/Resource2[&...]],[options,[timeout]]) ``` -------------------------------- ### FollowMe() Application Syntax - Asterisk Dialplan Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/FollowMe This snippet shows the basic syntax for the FollowMe() application within the Asterisk dialplan. It defines the required 'followmeid' argument and optional 'options' for customizing its behavior. ```asterisk FollowMe(followmeid,[options]) ``` -------------------------------- ### SKINNYdevices Action Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AMI_Actions/SKINNYdevices Lists Skinny devices in text format with details on current status. Devicelist will follow as separate events, followed by a final event called DevicelistComplete. ```APIDOC ## SKINNYdevices Action ### Description Lists Skinny devices in text format with details on current status. Devicelist will follow as separate events, followed by a final event called DevicelistComplete. ### Method POST ### Endpoint /actions #### Query Parameters - **Action** (string) - Required - Must be set to "SKINNYdevices". - **ActionID** (string) - Optional - ActionID for this transaction. Will be returned. ### Request Example ```json { "Action": "SKINNYdevices", "ActionID": "12345" } ``` ### Response #### Success Response (200) - **event** (string) - The type of event. - **devicename** (string) - The name of the device. - **status** (string) - The current status of the device. - **ActionID** (string) - The ActionID of the request. #### Response Example ```json { "event": "Devicelist", "devicename": "Skinny/1001", "status": "InUse", "ActionID": "12345" } ``` ```json { "event": "DevicelistComplete", "ActionID": "12345" } ``` ``` -------------------------------- ### Get Bridge Details Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Bridges_REST_API Get bridge details. ```APIDOC ## GET /bridges/{bridgeId} ### Description Get bridge details. ### Method GET ### Endpoint /bridges/{bridgeId} ### Parameters #### Path Parameters - **bridgeId** (string) - Required - Bridge's id ### Request Example None ### Response #### Success Response (200) - **Bridge** - The bridge object. #### Response Example ```json { "example": "{\n \"id\": \"bridgeId1\",\n \"name\": \"bridgeName1\",\n \"technology\": \"internal\",\n \"state\": \"active\",\n \"creationtime\": 1678886400.123,\n \"channels\": [\n {\n \"id\": \"channelId1\",\n \"name\": \"SIP/user1\",\n \"state\": \"Up\",\n \"caller_id\": \"\"\n }\n ]\n}" } ``` #### Error Responses - **404** - Bridge not found ``` -------------------------------- ### BuildInfo Data Model Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Asterisk_REST_Data_Models Provides detailed information about how Asterisk was built, including the operating system, kernel version, compilation options, machine architecture, build date, and the user who performed the build. This is useful for troubleshooting and understanding the environment Asterisk is running in. ```json { "id": "BuildInfo", "description": "Info about how Asterisk was built", "properties": { "os": { "required": true, "type": "string", "description": "OS Asterisk was built on." }, "kernel": { "required": true, "type": "string", "description": "Kernel version Asterisk was built on." }, "options": { "required": true, "type": "string", "description": "Compile time options, or empty string if default." }, "machine": { "required": true, "type": "string", "description": "Machine architecture (x86_64, i686, ppc, etc.)" }, "date": { "required": true, "type": "string", "description": "Date and time when Asterisk was built." }, "user": { "required": true, "type": "string", "description": "Username that build Asterisk" } } } ``` -------------------------------- ### GET /asterisk/variable Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Asterisk_REST_API Gets the value of a global Asterisk variable. ```APIDOC ## GET /asterisk/variable ### Description Get the value of a global variable. ### Method GET ### Endpoint /asterisk/variable ### Query Parameters - **variable** (string) - Required - The name of the global variable. ### Response #### Success Response (200) - **Variable** - An object containing the value of the global variable. ``` -------------------------------- ### ShowDialPlan API Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AMI_Actions/ShowDialPlan Retrieves dialplan contexts and extensions. Use with caution as displaying the entire dialplan can consume significant resources. ```APIDOC ## POST /ari/dialplan/show ### Description Retrieves dialplan contexts and extensions. Be aware that showing the full dialplan may take a lot of capacity. ### Method POST ### Endpoint /ari/dialplan/show ### Parameters #### Query Parameters - **ActionID** (string) - Required - ActionID for this transaction. Will be returned. - **Extension** (string) - Optional - Show a specific extension. - **Context** (string) - Optional - Show a specific context. ### Request Example ```json { "Action": "ShowDialPlan", "ActionID": "12345", "Extension": "101", "Context": "default" } ``` ### Response #### Success Response (200) - **Output** (string) - The dialplan information. #### Response Example ```json { "ActionID": "12345", "Output": "[default]\n exten => 101,1,NoOp(Hello World)" } ``` ``` -------------------------------- ### OSPLookup() Dialplan Application Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/OSPLookup This snippet shows the basic syntax for using the OSPLookup() dialplan application. It outlines the required and optional arguments, including the extension, provider, and specific options for generating call IDs. ```asterisk OSPLookup(exten,[provider,[options]]) ``` -------------------------------- ### SKINNYshowdevice Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AMI_Actions/SKINNYshowdevice Show one SKINNY device with details on current status. ```APIDOC ## SKINNYshowdevice ### Description Show one SKINNY device with details on current status. ### Method POST ### Endpoint /asterisk/action ### Parameters #### Query Parameters - **Action** (string) - Required - SKINNYshowdevice - **ActionID** (string) - Optional - ActionID for this transaction. Will be returned. - **Device** (string) - Required - The device name you want to check. ### Request Example ```json { "Action": "SKINNYshowdevice", "ActionID": "123", "Device": "SIP/101" } ``` ### Response #### Success Response (200) - **Response** (string) - Acknowledge or error message. - **ActionID** (string) - ActionID for this transaction. - **Device** (string) - The device name. - **Status** (string) - The status of the device. #### Response Example ```json { "Response": "Success", "ActionID": "123", "Device": "SIP/101", "Status": "In Use" } ``` ``` -------------------------------- ### Start Playback of Media with Playback ID Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Channels_REST_API Starts playing media on a channel and assigns a specific ID to this playback operation. ```APIDOC ## POST /channels/{channelId}/play/{playbackId} ### Description Start playback of media and specify the playbackId. ### Method POST ### Endpoint /channels/{channelId}/play/{playbackId} ### Parameters #### Path Parameters - **channelId** (string) - Required - The unique identifier of the channel. - **playbackId** (string) - Required - The unique identifier for this playback operation. #### Query Parameters None specified in the provided text. #### Request Body - **media_uri** (string) - Required - The URI of the media to play (e.g., "sound:abc"). - **offset_ms** (integer) - Optional - Offset in milliseconds to start playback from. - **skip_dtmf** (string) - Optional - DTMF key to interrupt playback. ### Request Example ```json { "media_uri": "sound:another_sound", "offset_ms": 0, "skip_dtmf": "*" } ``` ### Response #### Success Response (200) - **Playback**: Information about the playback operation. #### Response Example ```json { "example": "{ \"playbackId\": \"12346\", \"media_uri\": \"sound:another_sound\" }" } ``` ``` -------------------------------- ### ParkAndAnnounce Dialplan Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/ParkAndAnnounce This snippet shows the syntax for the ParkAndAnnounce() dialplan application. It defines the order of arguments for parking lot name, options, announcement templates, and the dial command. ```asterisk-dialplan ParkAndAnnounce([parking_lot_name,[options,announce:[announce1[:...]],]]dial) ``` -------------------------------- ### Set Custom Presence State - Dialplan Example Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/PRESENCE_STATE This example illustrates how to set custom presence states using the PRESENCE_STATE() function with the 'CustomPresence:' prefix. It shows setting the state to 'away', 'dnd', and 'xa', including optional subtype and message parameters, with an example of Base64 encoding. ```asterisk Set(PRESENCE_STATE(CustomPresence:lamp1)=away,temporary,Out to lunch) Set(PRESENCE_STATE(CustomPresence:lamp2)=dnd,,Trying to get work done) Set(PRESENCE_STATE(CustomPresence:lamp3)=xa,T24gdmFjYXRpb24=,,e) ``` -------------------------------- ### QueueLog() Application Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/QueueLog Provides the general syntax for the QueueLog() dialplan application in Asterisk. This defines the available parameters for logging queue-related events. ```asterisk QueueLog(queuename,uniqueid,agent,event,[additionalinfo]) ``` -------------------------------- ### List All Applications Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Asterisk_REST_Interface/Applications_REST_API Retrieves a list of all applications. ```APIDOC ## GET /applications ### Description List all applications. ### Method GET ### Endpoint /applications ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **applications** (List[Application]) - A list of application objects. #### Response Example ```json [ { "name": "string", "description": "string", " 100rel": "string", " 100rel_dial": "string", " 100rel_dtmf": "string", " 100rel_media": "string", " 100rel_progress": "string", " 100rel_progress_media": "string", " 100rel_session_description": "string", " 100rel_session_description_media": "string", " 100rel_session_description_progress": "string", " 100rel_session_description_progress_media": "string", " 100rel_session_description_update": "string", " 100rel_session_description_update_media": "string", " 100rel_update": "string", " 100rel_update_media": "string", "bridge": "string", "deviceState": "string", "endpoint": "string", "eventFilter": { "allowed": [ { "type": "string" } ], "disallowed": [ { "type": "string" } ] }, "id": "string", "subscription": { "event_source": "string" } } ] ``` ``` -------------------------------- ### Geolocation Location Info Examples Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Module_Configuration/res_geolocation Examples of 'location_info' parameter values based on the specified 'format' for geolocation. ```asterisk-conf ; civicAddress format example location_info = country=US,A1="New York",city_district=Manhattan, A3="New York", house_number=1633, street=46th, street_suffix = Street, postal_code=10222,floor=20,room=20A2 ; GML format example location_info = Shape=Sphere, pos3d="39.12345 -105.98766 1920", radius=200 ; URI format example location_info = URI=https:/something.com?exten=${EXTEN} ``` -------------------------------- ### Get Channel Variable using Asterisk AGI Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/AGI_Commands/get_variable Retrieves the value of a specified channel variable using the Asterisk AGI GET VARIABLE command. Returns '0' if the variable is not set, or '1' followed by the variable's value in parentheses if it is set. This command is useful for dynamically accessing channel-specific information within Asterisk. ```asterisk_agi GET VARIABLE VARIABLENAME ``` -------------------------------- ### Asterisk Dialplan: Directory Application Syntax Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Applications/Directory Defines the syntax for using the Asterisk Directory application within the dialplan. It specifies the application name and its optional arguments: vm-context, dial-context, and options. The description clarifies the purpose of each argument and lists available options with their specific functionalities and requirements. ```asterisk-dialplan Directory([vm-context,[dial-context,[options]]]) ``` -------------------------------- ### STIR_SHAKEN() Function Usage Example Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/STIR_SHAKEN Demonstrates how to use the STIR_SHAKEN() function to retrieve the count of STIR/SHAKEN identities and specific identity details. This example assumes a context where STIR/SHAKEN data is available on the channel. ```asterisk dialplan same => n,NoOp(Number of STIR/SHAKEN identities: ${STIR_SHAKEN(count)}) same => n,NoOp(Identity ${STIR_SHAKEN(0, identity)} has attestation level ${STIR_SHAKEN(0, attestation)}) ``` -------------------------------- ### Retrieve Presence State - Dialplan Example Source: https://docs.asterisk.org/Certified-Asterisk_18.9_Documentation/API_Documentation/Dialplan_Functions/PRESENCE_STATE This example demonstrates how to retrieve the presence state of a SIP peer and a MeetMe conference using the PRESENCE_STATE() function in the Asterisk dialplan. It shows how to access the 'value' and 'message' fields. ```asterisk NoOp(SIP/mypeer has presence ${PRESENCE_STATE(SIP/mypeer,value)}) NoOp(Conference number 1234 has presence message ${PRESENCE_STATE(MeetMe:1234,message)}) ```