Asterisk ami-action

From 탱이의 잡동사니
Jump to navigation Jump to search

Overview

Asterisk ami(Asteriskk Manager Interface) 명령어 정리.

Basic

Telnet 접속

/etc/asterisk/manager.conf 파일에 설정한 IP 주소 및 포트 번호를 이용하면 telnet 으로도 접속이 가능하다.

$ telnet 127.0.0.1 5038
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Asterisk Call Manager/1.0

Help

Action 도움말 확인법

vpbx120*CLI> manager show command Logoff 
[Syntax]
Action: Logoff
[ActionID:] <value>

[Synopsis]
Logoff Manager. 

[Description]
Logoff the current manager session.

[Arguments]
ActionID
    ActionID for this transaction. Will be returned.

[See Also]
Not available

AbsoluteTimeout

Absolute timeout 을 설정한다.

지정된 시간(초) 이후에 자동으로 채널을 종료한다.

Action: AbsoluteTimeout
ActionID: <value>
Channel: <value>
Timeout: <value>
  • ActionID
  • Channel : Channel name to hangup.
  • Timeout : Maximum duration of the call (sec).

Example

Action: AbsoluteTimeout
ActionID: 66a9dbf0-dfb1-4382-8055-c5caed9bddb7
Channel: SIP/agent-01-00000003
Timeout: 30

Response: Success
ActionID: 66a9dbf0-dfb1-4382-8055-c5caed9bddb7
Message: Timeout Set

See also

AgentLogoff

Sets an agent as no longer logged in.

Agent 를 logoff 한다.

Action: AgentLogoff
ActionID: <value>
Agent: <value>
Soft: <value>
  • ActionID
  • Agent : ID of the agent to log off.
  • Soft : Set to true to not hangup existing calls.

See also

Agents

등록되어 있는 모든 agent 와 status 를 보여준다.

Action: Agents
ActionID: <value>
  • ActionID

Example

Action: Agents

Response: Success
EventList: start
Message: Agents will follow

Event: AgentsComplete
EventList: Complete
ListItems: 0

See also

AGI

Add an AGI command to execute by Async AGI.

Add an AGI command to the execute queue of the channel in Async AGI.

Action: AGI
ActionID: <value>
Channel: <value>
Command: <value>
CommandID: <value>
  • ActionID
  • Channel : Channel that is currently in Async AGI.
  • Command : Application to execute
  • CommandID : This will be sent back in CommandID header of AsyncAGI exec event notification.

Example

Error case

Action: AGI
Channel: SIP/agent-01-00000007
Command: Hangup

Response: Error
Message: Failed to add AGI command to channel SIP/agent-01-00000007 queue

See also

AOCMessage

Generate an Advice of Charge message on a channel.

Generates an AOC-D or AOC-E message on a channel.

Action: AOCMessage
ActionID: <value>
Channel: <value>
ChannelPrefix: <value>
MsgType: <value>
ChargeType: <value>
UnitAmount(0): <value>
UnitType(0): <value>
CurrencyName: <value>
CurrencyAmount: <value>
CurrencyMultiplier: <value>
TotalType: <value>
AOCBillingId: <value>
ChargingAssociationId: <value>
ChargingAssociationNumber: <value>
ChargingAssociationPlan: <value>
  • ActionID
  • Channel : Channel name to generate the AOC message on.
  • ChannelPrefix : Partial channel prefix. By using this option one can match the beginning part of a channel name without having to put the entire name in. For example if a channel name is SIP/snom-00000001 and this value is set to SIP/snom, then that channel matches and the message will be sent. Note however that only the first matched channel has the message sent on it.
  • MsgType : Defines what type of AOC message to create, AOC-D or AOC-E.
D : 통화 중에 전송되는 AOC Message(Advice of Charge message is sent during a call).
E : 통화가 완료된 후에 전송되는 AOC Message(Advice of Charge message is sent at the end of a call).
  • ChargeType : Defines what kind of charge this message represents.
NA
FREE
Currency
Unit
  • UnitAmount(0) : This represents the amount of units charged. The ETSI AOC standard specifies that this value along with the optional UnitType value are entries in a list. To accommodate this these values take an index value starting at 0 which can be used to generate this list of until entries. For Example, if two unit entries were required this could be achieved by setting the parameter UnitAmount(0)=1234 and UnitAmount(1)=5678. Note that UnitAmount at index 0 is required when ChargeType=Unit, all other entries in the list are optional.
  • UnitType(0) : Defines the type of unit. ETSI AOC standard specifies this as an integer value between 1 and 16, but this value is left open to accept any positive integer. Like the UnitAmount parameter, this value represents a list entry and has an index parameter that starts at 0.
  • CurrencyName : Specifies the currency's name. Note that this value is truncated after 10 characters.
  • CurrencyAmount : Specifies the charge unit amount as a positive integer. This value is required when ChargeType==Currency.
  • CurrencyMultiplier : Specifies the currency multiplier. This value is required when ChargeType==Currency.
OneThousandth
OneHundredth
OneTenth
One
Ten
Hundred
Thousand
  • TotalType : Defines what kind of AOC-D total is represented.
Total
SubTotal
  • AOCBillingId : Represents a billing ID associated with an AOC-D or AOC-E message. Note that only the first 3 items of the enum are valid AOC-D billing IDs.
Normal
ReverseChage
CreditCard
CallFwdUnconditional
CallFwdBusy
CallFwdNoReply
CallDeflection
CallTransfer
  • ChargingAssociationId : Charging association identifier. This is optional for AOC-E and can be set to any value between -32768 and 32767.
  • ChargingAssociationNumber : Represents the charging association party number. This value is optional for AOC-E.
  • ChargingAssociationPlan : Integer representing the charging plan associated with the ChargingAssociationNumber. The value is bits 7 through 1 of the Q.931 octet containing the type-of-number and numbering-plan-identification fields.

Example

Action: AOCMessage
Channel: SIP/agent-01-00000008
MsgType: D
ChargeType: Currency
UnitAmout(0): 1000
UnitType(0): 1
CurrencyName: USD
CurrencyAmount: 132
CurrencyMultiplier: One
TotalType: SubTotal

Response: Success
Message: AOC Message successfully queued on channel

See also

Atxfer

Attended transfer.

Action: Atxfer
ActionID: <value>
Channel: <value>
Exten: <value>
Context: <value>
  • ActionID
  • Channel : Transfer's channel.
  • Exten : Extension to transfer to.
  • Context : Context to transfer to.

See also

BlindTransfer

Blind transfer channel(s) to the given destination.

Redirect all channels currently bridged to the specified channel to the specified destination.

Action: BlindTransfer
Channel: <value>
Context: <value>
Exten: <value>
  • Channel
  • Context
  • Exten

Example

Success

Action: BlindTransfer
Channel: SIP/agent-01-00000005
Context: sample_musiconhold
Exten: s


Response: Success
Message: Transfer succeeded


Event: BlindTransfer
Privilege: call,all
Result: Success
TransfererChannel: SIP/agent-01-00000005
TransfererChannelState: 6
TransfererChannelStateDesc: Up
TransfererCallerIDNum: agent-01
TransfererCallerIDName: <unknown>
TransfererConnectedLineNum: <unknown>
TransfererConnectedLineName: <unknown>
TransfererLanguage: en
TransfererAccountCode: 
TransfererContext: park-dial
TransfererExten: SIP_agent-01
TransfererPriority: 1
TransfererUniqueid: 1481706048.11
TransfererLinkedid: 1481706048.11
TransfereeChannel: SIP/agent-01-00000006
TransfereeChannelState: 6
TransfereeChannelStateDesc: Up
TransfereeCallerIDNum: SIP_agent-01
TransfereeCallerIDName: <unknown>
TransfereeConnectedLineNum: agent-01
TransfereeConnectedLineName: <unknown>
TransfereeLanguage: en
TransfereeAccountCode: 
TransfereeContext: public
TransfereeExten: 
TransfereePriority: 1
TransfereeUniqueid: 1481706093.12
TransfereeLinkedid: 1481706048.11
BridgeUniqueid: b9ad516f-984d-4dce-a465-d95690edc656
BridgeType: basic
BridgeTechnology: native_rtp
BridgeCreator: <unknown>
BridgeName: <unknown>
BridgeNumChannels: 2
IsExternal: Yes
Context: sample_musiconhold
Extension: s

Fail

Action: BlindTransfer
Channel: SIP/agent-01-00000002
Exten: s
Context: sample_musiconhold

Response: Error
Message: Transfer invalid

Event: BlindTransfer
Privilege: call,all
Result: Invalid
TransfererChannel: SIP/agent-01-00000002
TransfererChannelState: 6
TransfererChannelStateDesc: Up
TransfererCallerIDNum: agent-01
TransfererCallerIDName: <unknown>
TransfererConnectedLineNum: <unknown>
TransfererConnectedLineName: <unknown>
TransfererLanguage: en
TransfererAccountCode: 
TransfererContext: sample_park
TransfererExten: s
TransfererPriority: 2
TransfererUniqueid: 1481705835.4
TransfererLinkedid: 1481705835.4
BridgeUniqueid: 299de6ea-1dc7-4144-9e46-d6513723333e
BridgeType: parking
BridgeTechnology: holding_bridge
BridgeCreator: Parking
BridgeName: default
BridgeNumChannels: 1
IsExternal: Yes
Context: sample_musiconhold
Extension: s

See also

Bridge

2 개의 채널을 연결시킨다.

Action: Bridge
ActionID: <value>
Channel1: <value>
Channel2: <value>
Tone: <value>
  • ActionID : ActionID for this transaction. Will be returned.
  • Channel1 : Channel to Bridge to Channel2.
  • Channel2 : Channel to Bridge to Channel1.
  • Tone : Play courtesy tone to Channel2.
no
Channel1
Channel2
Both

Example

Action: Bridge
Channel1: SIP/agent-01-00000000
Channel2: SIP/agent-02-00000001
ActionID: 61187bf7-6ef3-4fb5-aab6-42ac52ff0878

Response: Success
ActionID: 61187bf7-6ef3-4fb5-aab6-42ac52ff0878
Message: Channels have been bridged

See also

BridgeDestroy

Destroy a bridge.

Deletes the bridge, causing channels to continue or hang up.

Action: BridgeDestroy
ActionID: <value>
BridgeUniqueid: <value>
  • ActionID
  • BridgeUniqueid : The unique ID of the bridge to destroy.

See also

BridgeInfo

지정한 Bridge 의 상세 정보를 요청한다.

Get information about a bridge. Returns detailed information about a bridge and the channels in it.

Action: BridgeInfo
ActionID: <value>
BridgeUniqueid: <value>
  • ActionID
  • BridgeUniqueid : The unique ID of the bridge about which to retrieve information.

Example

Success

Action: BridgeInfo
BridgeUniqueid: 299de6ea-1dc7-4144-9e46-d6513723333e
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1

Response: Success
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1
EventList: start
Message: Bridge channel listing will follow

Event: BridgeInfoChannel
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1
Channel: SIP/agent-01-0000000a
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: agent-01
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode: 
Context: sample_park
Exten: s
Priority: 2
Uniqueid: 1481708311.23
Linkedid: 1481708311.23

Event: BridgeInfoComplete
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1
EventList: Complete
ListItems: 1
BridgeUniqueid: 299de6ea-1dc7-4144-9e46-d6513723333e
BridgeType: parking
BridgeTechnology: holding_bridge
BridgeCreator: Parking
BridgeName: default
BridgeNumChannels: 1

Fail

Action: BridgeInfo
BridgeUniqueid: 299de6ea-1dc7-4144-9e46-d6513723333eddd
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1

Response: Error
ActionID: d3bb2f6b-7e92-45c7-b01b-72d45143b8d1
Message: Specified BridgeUniqueid not found

BridgeKick

Kick a channel from a bridge.

The channel is removed from the bridge.

Action: BridgeKick
ActionID: <value>
[BridgeUniqueid:] <value>
Channel: <value>
  • ActionID
  • BridgeUniqueid : The unique ID of the bridge containing the channel to destroy. This parameter can be omitted, or supplied to insure that the channel is not removed from the wrong bridge.
  • Channel : The channel to kick out of a bridge.

See also

BridgeList

Get a list of bridges in the system.

Returns a list of bridges, optionally filtering on a bridge type.

Action: BridgeList
ActionID: <value>
BridgeType: <value>
  • ActionID
  • BridgeType : Optional type for filtering the resulting list of bridges.

Example

Action: BridgeList
ActionID: 692667eb-6c9b-4b7a-bb49-30c6ade671e3

Response: Success
ActionID: 692667eb-6c9b-4b7a-bb49-30c6ade671e3
EventList: start
Message: Bridge listing will follow

Event: BridgeListItem
ActionID: 692667eb-6c9b-4b7a-bb49-30c6ade671e3
BridgeUniqueid: 299de6ea-1dc7-4144-9e46-d6513723333e
BridgeType: parking
BridgeTechnology: holding_bridge
BridgeCreator: Parking
BridgeName: default
BridgeNumChannels: 0

Event: BridgeListComplete
ActionID: 692667eb-6c9b-4b7a-bb49-30c6ade671e3
EventList: Complete
ListItems: 1

See also

BridgeTechnologyList

List available bridging technologies and their statuses.

Returns detailed information about the available bridging technologies.

Action: BridgeTechnologyList
ActionID: <value>

Example

Action: BridgeTechnologyList
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b

Response: Success
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b
EventList: start
Message: Bridge technology listing will follow

Event: BridgeTechnologyListItem
BridgeTechnology: holding_bridge
BridgeType: Holding
BridgePriority: 50
BridgeSuspended: No
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b

Event: BridgeTechnologyListItem
BridgeTechnology: simple_bridge
BridgeType: 1to1Mix
BridgePriority: 50
BridgeSuspended: No
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b

Event: BridgeTechnologyListItem
BridgeTechnology: softmix
BridgeType: MultiMix
BridgePriority: 10
BridgeSuspended: No
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b

Event: BridgeTechnologyListItem
BridgeTechnology: native_rtp
BridgeType: Native
BridgePriority: 90
BridgeSuspended: No
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b

Event: BridgeTechnologyListComplete
ActionID: 049b03bf-3a2b-493c-a2b1-0616293fe08b
EventList: Complete
ListItems: 4

See also

BridgeTechnologySuspend

Suspend a bridging technology.

Marks a bridging technology as suspended, which prevents subsequently created bridges from using it.

Action: BridgeTechnologySuspend
ActionID: <value>
BridgeTechnology: <value>
  • BridgeTechnology : The name of the bridging technology to suspend.

Example

Action: BridgeTechnologySuspend
ActionID: 58284e65-4cec-48e3-ba8f-203517974bc3
BridgeTechnology: softmix

Response: Success
ActionID: 58284e65-4cec-48e3-ba8f-203517974bc3
Message: Suspended bridge technology

See also

BridgeTechnologyUnsuspend

Unsuspend a bridging technology.

Clears a previously suspended bridging technology, which allows subsequently created bridges to use it.

Action: BridgeTechnologyUnsuspend
ActionID: <value>
BridgeTechnology: <value>
  • ActionID
  • BridgeTechnology : The name of the bridging technology to unsuspend.

Example

Action: BridgeTechnologyUnsuspend
ActionID: 9bb6fb44-e605-4b4b-8c3b-d12c9821f926
BridgeTechnology: softmix

Response: Success
ActionID: 9bb6fb44-e605-4b4b-8c3b-d12c9821f926
Message: Unsuspended bridge technology

See also

Challenge

Generate Challenge for MD5 Auth.

Generate a challenge for MD5 authentication.

Action: Challenge
ActionID: <value>
AuthType: <value>
  • ActionID
  • AuthType : Digest algorithm to use in the challenge.
MD5

Example

Action: Challenge
ActionID: 8189894c-80c9-4566-b4f6-6e542abdc169
AuthType: MD5

Response: Success
ActionID: 8189894c-80c9-4566-b4f6-6e542abdc169
Challenge: 576396885

See also

ChangeMonitor

Change monitoring filename of a channel.

This action may be used to change the file started by a previous "Monitor" action.

Action: ChangeMonitor
ActionID: <value>
Channel: <value>
File: <value>
  • ActionID
  • Channel : Used to specify the channel to record.
  • File : Is the new name of the file created in the monitor spool directory.

See also

Command

Asterisk CLI 명령어를 실행한다.

Action: Command
ActionID: <value>
Command: <value>
  • ActionID
  • Command : 실행하고자 하는 Asterisk CLI 명령어.

Example

Action: Command
Command: sip show peers

Response: Success
Message: Command output follows
Output: Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description                      
Output: 200/200                   (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: 201/201                   (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: 202/202                   (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: 300/300                   (Unspecified)                            D  Auto (No)  No             0        UNKNOWN                                      
Output: 301/301                   (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: 302/302                   (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: agent-01/agent-01         (Unspecified)                            D  Auto (No)  No             0        UNKNOWN                                      
Output: agent-02/agent-02         (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: agent-03/agent-03         (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: client-01                 (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: client-02                 (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: client-03                 (Unspecified)                            D  Auto (No)  No             0        Unmonitored                                  
Output: 12 sip peers [Monitored: 0 online, 2 offline Unmonitored: 0 online, 10 offline]

See also

ConfbridgeKick

Kick a Confbridge user.

Action: ConfbridgeKick
ActionID: <value>
Conference: <value>
Channel: <value>
  • ActionID
  • Conference
  • Channel : If this parameter is "all", all channels will be kicked from the conference. If this parameter is "paricipants", all non-admin channels will be kicked from the conference.

See also

ConfbridgeList

List prticipants in a conference.

Lists all users in a particular ConfBridge conference. ConfbridgeList will follow as separate events, followed by a final event called ConfbridgeListComplete.

Action: ConfbridgeList
ActionID: <value>
Conference: <value>

Example

Error

Action: ConfbridgeList

Response: Error
Message: No Conference name provided.

See also

ConfbridgeListRooms

현재 사용중인 conference 의 목록을 보여준다.

Lists data about all active conferences. ConfbridgeListRooms will follow as separate events, followed by a final event called ConfbridgeListRoomsComplete.

Action: ConfbridgeListRooms
ActionID: <value>

Example

Error

Action: ConfbridgeListRooms

Response: Error
Message: No active conferences.

ConfbridgeLock

Lock a Confbridge conference.

Action: ConfbridgeLock
ActionID: <value>
Conference: <value>
  • ActionID
  • Conference

Example

Error

Action: ConfbridgeLock

Response: Error
Message: No Conference name provided.

See also

ConfbridgeMute

Mute a Confbridge user.

Action: ConfbridgeMute
ActionID: <value>
Conference: <value>
Channel: <value>
  • ActionID
  • Conference
  • Channel : If this parameter is not a complete channel name, the first channel with this prefix will be used. If this parameter is "all", all channels will be muted. If this parameter is "participants", all non-admin channels will be muted.

Example

Error

Action: ConfbridgeMute

Response: Error
Message: No Conference name provided.

See also

ConfbridgeSetSingleVideoSrc

Set a conference user as the single video source distributed to all other pariticipants.

Action: ConfbridgeSetSingleVideoSrc
ActionID: <value>
Conference: <value>
Channel: <value>
  • ActionID
  • Conference
  • Channel : If this parameter is not a complete channel name, the first channel with this prefix will be used.

Example

Error

Action: ConfbridgeSetSingleVideoSrc

Response: Error
Message: No Conference name provided.

See also

ConfbridgeStartRecord

Start recording a Confbrige conference.

Start recording a conference. If recording is already present an error will be returned. If RecordFile is not provided, the default record file specified in the conference's bridge profile will be used, if that is not present either a file will automatically be generated in the monitor directory.

Action: ConfbridgeStartRecord
ActionID: <value>
Conference: <value>
[RecordFile:] <value>
  • ActionID
  • Conference
  • RecordFile

Example

Error

Action: ConfbridgeStartRecord

Response: Error
Message: No Conference name provided.

See also

DialplanExtensionAdd

Enable since Asterisk-13

Dialplan 에 Extension 을 추가한다.

Action: DialplanExtensionAdd
ActionID: <value>
Context: <value>
Extension: <value>
Priority: <value>
Application: <value>
[ApplicationData:] <value>
[Replace:] <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Context - Context where the extension will be created. The context will be created if it does not already exist.
  • Extension - Name of the extension that will be created (may include callerid match by separating with '/')
  • Priority - Priority being added to this extension. Must be either hint or a numerical value.
  • Application - The application to use for this extension at the requested priority
  • ApplicationData - Arguments to the application.
  • Replace - If set to 'yes', '1', 'true' or any of the other values we evaluate as true, then if an extension already exists at the requested context, extension, and priority it will be overwritten. Otherwise, the existing extension will remain and the action will fail.

Example

Action: DialplanExtensionAdd
ActionID: 123456
Context: test_dialplan
Extension: test_exten
Priority: 1
Application: echo

Response: Success
ActionID: 123456
Message: Added requested extension

DialplanExtensionRemove

Enable since Asterisk-13

Dialplan 에서 Extension 을 삭제한다.

Action: DialplanExtensionRemove
ActionID: <value>
Context: <value>
Extension: <value>
[Priority:] <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Context - Context of the extension being removed
  • Extension - Name of the extension being removed (may include callerid match by separating with '/')
  • Priority - If provided, only remove this priority from the extension instead of all priorities in the extension.

Example

Action: DialplanExtensionRemove
ActionID: 999
Context: test_dialplan
Extension: test_exten

Response: Success
ActionID: 999
Message: Removed the requested extension

Login

AMI login 을 한다.

Action: Login
ActionID: <value>
Username: <value>
Secret: <value>
  • Username : Access Username. manager.conf 에 설정되어 있다.
  • Secret : Password. manager.conf 에 설정되어 있다.

Example

$ telnet localhost 5038
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Asterisk Call Manager/2.8.0

Action: login
username: test
secret: test

Response: Success
Message: Authentication accepted

Logoff

AMI logoff 를 한다.

Action: Logoff
ActionID: <value>

Example

Action: Logoff
ActionID: logofftest

Response: Goodbye
ActionID: logofftest
Message: Thanks for all the fish.

Hangup

채널을 종료한다.

Action: Hangup
ActionID: <value>
Channel: <value>
Cause: <value>
  • channel : 종료하고자하는 채널의 정확한 이름. 혹은 정규표현식도 가능하다.
Example exact channel: SIP/provider-0000012a
Example regular expression: /^SIP/provider-.*$/
  • Cause : 채널 종료 사유(숫자)

Hangup causes

#define AST_CAUSE_UNALLOCATED                    1
#define AST_CAUSE_NO_ROUTE_TRANSIT_NET           2
#define AST_CAUSE_NO_ROUTE_DESTINATION           3
#define AST_CAUSE_MISDIALLED_TRUNK_PREFIX        5
#define AST_CAUSE_CHANNEL_UNACCEPTABLE           6
#define AST_CAUSE_CALL_AWARDED_DELIVERED         7
#define AST_CAUSE_PRE_EMPTED                     8
#define AST_CAUSE_NUMBER_PORTED_NOT_HERE        14
#define AST_CAUSE_NORMAL_CLEARING               16
#define AST_CAUSE_USER_BUSY                     17
#define AST_CAUSE_NO_USER_RESPONSE              18
#define AST_CAUSE_NO_ANSWER                     19
#define AST_CAUSE_SUBSCRIBER_ABSENT             20
#define AST_CAUSE_CALL_REJECTED                 21
#define AST_CAUSE_NUMBER_CHANGED                22
#define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION 23
#define AST_CAUSE_ANSWERED_ELSEWHERE            26
#define AST_CAUSE_DESTINATION_OUT_OF_ORDER      27
#define AST_CAUSE_INVALID_NUMBER_FORMAT         28
#define AST_CAUSE_FACILITY_REJECTED             29
#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY    30
#define AST_CAUSE_NORMAL_UNSPECIFIED            31
#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION     34
#define AST_CAUSE_NETWORK_OUT_OF_ORDER          38
#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE      41
#define AST_CAUSE_SWITCH_CONGESTION             42
#define AST_CAUSE_ACCESS_INFO_DISCARDED         43
#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL        44
#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED       50
#define AST_CAUSE_OUTGOING_CALL_BARRED          52
#define AST_CAUSE_INCOMING_CALL_BARRED          54
#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH      57
#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL     58
#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL      65
#define AST_CAUSE_CHAN_NOT_IMPLEMENTED          66
#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED      69
#define AST_CAUSE_INVALID_CALL_REFERENCE        81
#define AST_CAUSE_INCOMPATIBLE_DESTINATION      88
#define AST_CAUSE_INVALID_MSG_UNSPECIFIED       95
#define AST_CAUSE_MANDATORY_IE_MISSING          96
#define AST_CAUSE_MESSAGE_TYPE_NONEXIST         97
#define AST_CAUSE_WRONG_MESSAGE                 98
#define AST_CAUSE_IE_NONEXIST                   99
#define AST_CAUSE_INVALID_IE_CONTENTS          100
#define AST_CAUSE_WRONG_CALL_STATE             101
#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE     102
#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR    103
#define AST_CAUSE_PROTOCOL_ERROR               111
#define AST_CAUSE_INTERWORKING                 127

/* Special Asterisk aliases */
#define AST_CAUSE_BUSY          AST_CAUSE_USER_BUSY
#define AST_CAUSE_FAILURE       AST_CAUSE_NETWORK_OUT_OF_ORDER
#define AST_CAUSE_NORMAL        AST_CAUSE_NORMAL_CLEARING
#define AST_CAUSE_NOANSWER      AST_CAUSE_NO_ANSWER
#define AST_CAUSE_CONGESTION    AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
#define AST_CAUSE_UNREGISTERED  AST_CAUSE_SUBSCRIBER_ABSENT
#define AST_CAUSE_NOTDEFINED    0
#define AST_CAUSE_NOSUCHDRIVER  AST_CAUSE_CHAN_NOT_IMPLEMENTED

Monitor

채널을 모니터링 한다. 모니터링되는 채널은 in/out 오디로가 녹음되며, 녹음된 파일의 Default 디렉토리는 (/var/spool/asterisk/monitor) 이다.

pchero@pluto:/var/spool/asterisk/monitor $ ls -tlr
total 408
-rw-r--r-- 1 root root 206764 Dec 16 09:26 SIP-300-00000000-out.wav
-rw-r--r-- 1 root root 206444 Dec 16 09:26 SIP-300-00000000-in.wav

This action may be used to record the audio on a specified channel.

Action: Monitor
ActionID: <value>
Channel: <value>
File: <value>
Format: <value>
Mix: <value>
  • ActionID
  • Channel : Used to specify the channel to record.
  • File : Is the name of the file created in the monitor spool directory. Defaults to the same name as the channel(with slashed replaced with dashes).
  • Format : Is the audio recording format. Defaults to wav.
  • Mix : 하나의 파일에 input/output 데이터를 모두 write 할 지를 설정한다(Default : false). Boolean parameter as to whether to mix the input and output channels together after the recording is finished.

Example

Action: Monitor
Channel: SIP/300-00000000

Response: Success
Message: Started monitoring channel

See also

Originate

발신을 한다.

Action: Originate
ActionID: <value>
Channel: <value>
Exten: <value>
Context: <value>
Priority: <value>
Application: <value>
Data: <value>
Timeout: <value>
CallerID: <value>
Variable: <value>
Account: <value>
EarlyMedia: <value>
Async: <value>
Codecs: <value>
ChannelId: <value>
OtherChannelId: <value>
  • Channel : 발신 목적지 채널
  • Exten : 발신 성공 후 연결될 Extension(Context, Priority 항목 설정 필요)
  • Context : 발신 성공 후 연결될 Context(Exten, Priority 항목 설정 필요)
  • Priority : 발신 성공 후 사용될 Priority(Exten, Context 항목 설정 필요)
  • Application : 발신 성공 후 실행될 Application
  • Data : Application 에 사용될 Data(Application 항목 설정 필요)
  • Timeout : 발신 후, 응답시까지의 timeout
  • CallerID : 발신 채널에 설정될 Caller ID. "CallerIDName"<CallerIdNum> 의 형식으로 name 과 number 의 설정이 가능하다<ref>http://www.voip-info.org/wiki/view/Setting+Callerid</ref>
  • Variable : 채널 헤더에 설정될 임의 변수 값. 다중의 채널 헤더 변수 값 설정 가능.
  • Account  : Account code
  • EalryMedia : true 설정시, 강제로 early media 로 연결되게 된다.
  • Async : true 설정시, 곧바로 발신 성공값을 리턴한다.
  • Codecs : 발신에 사용될 코덱 지정. 콤마로 구분자로 여러개의 값을 지정할 수 있다.
  • ChannelId : 채널에 설정될 유니크 아이디 값.
  • OtherChannelId : 다른쪽 로컬 채널에 설정될 유니크 아이디 값.

Example

Action: Originate
ActionId: 1112
Channel: sip/300
Application: park
Async: 1

Response: Success
ActionID: 1112
Message: Originate successfully queued

Park

Action: Park
ActionID: <value>
Channel: <value>
[TimeoutChannel:] <value>
[AnnounceChannel:] <value>
[Timeout:] <value>
[Parkinglot:] <value>
  • ActionID - Action ID for this transaction. Will be returned.
  • Channel - Channel name to park.
  • TimeoutChannel - Channel name to use when constructing the dial string that will be dialed if the parked channel times out. If TimeoutChannel is in a two party bridge with channel, then TimeoutChannel will receive an announcement and be treated as having parked Channel in the same manner as the Park Call DTMF feature.
  • AnnounceChannel - If specified, then this channel will receive an announcement when Channel is parked if AnnounceChannel is in a state where it can receive announcements(AnnounceChannel must be bridged). AnnounceChannel has no bearing on the actual state of the parked call.
  • Timeout - Overrides the timeout of the parking lot for this park action. Specified in milliseconds, but will be converted to seconds. Use a value of 0 to disable the timeout.
  • Parkinglot - The parking lot to use when parking the channel.

Example

Action: park
Channel: SIP/300-00000013

Response: Success
Message: Park successful

ParkedCalls

해당 parking lot 에 대기중인 콜들의 정보를 요청한다.

Action: ParkedCalls
ActionID: <value>
ParkingLot: <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • ParkingLot - If specified, only show parked calls from the parking lot with this name.

Parkinglots

현재 등록되어 있는 모든 parking lot 정보를 요청한다.

Action: Parkinglots
ActionID: <value>
  • ActionID - ActionID for this transaction. Will be returned.

QueueStatus

Queue/Member(Channel) 의 현재 상태 정보를 확인한다. 입력된 Queue/Member(Channel) 항목이 없다면 현재 활성화된 전체 Queue/Member(Channel) 의 상태 정보를 리턴한다.

Action: QueueStatus
ActionID: <value>
Queue: <value>
Member: <value>
  • Queue - 확인하고자 하는 Queue name.
  • Member - 확인하고자 하는 멤버(Channel) 이름

Example

Action: QueueStatus
Queue: Camp200
ActionID: 001

Response: Success
ActionID: 001
Message: Queue status will follow

Event: QueueParams
Queue: Camp200
Max: 0
Strategy: ringall
Calls: 0
Holdtime: 0
TalkTime: 0
Completed: 0
Abandoned: 0
ServiceLevel: 0
ServicelevelPerf: 0.0
Weight: 100
ActionID: 001

Event: QueueMember
Queue: Camp200
Name: user1
Location: Local/200@DialCamp
Membership: static
Penalty: 0
CallsTaken: 0
LastCall: 0
Status: 5
Paused: 0
ActionID: 001

Event: QueueEntry
Queue: Camp200
Position: 1
Channel: SIP/test-201-00000001
Uniqueid: 1447837150.7
CallerIDNum: 201
CallerIDName: user 2
ConnectedLineNum: unknown
ConnectedLineName: unknown
Wait: 16

Event: QueueStatusComplete
ActionID: 001

- QueueParam 정보

  • Event - 메시지 타입. QueueParam:Queue 정보, QueueMember:Queue에 속해있는 member 정보, QueueEntry:Queue에서 대기중인 콜 정보.
  • Queue - Queue name
  • Max - Queue에서 허용 가능한 최대 콜 수.
  • Strategy - 콜 분배 방식.(rignall|roundrobin|leastrecent|fewestcalls|random|rrmemory|linear|wrandom)
  • HoldTime - 현재 평균 큐 대기 시간.
  • Weight - 큐의 우선 순위. 높은(많은) 우선순위를 가진 큐의 콜이 낮은(적은) 우선순위를 가진 큐보다 먼저 분배될 확률이 높아진다.
  • ServiceLevel - ServiceLevelPerf 를 확인하는 Interval time(sec)
  • ServicelevelPerf - SerivceLevel 시간동안의 콜 응답률(%). 응답 콜 /전체 인입 콜 * 100
  • Calls - 현재 큐에서 대기중인 콜의 갯수.
  • Abandoned - 큐에서 대기중에 분배되지 못하고 끊어진 콜.
  • TalkTikme - 분배 후 평균 통화시간.
  • Completed - 정상적으로 분배 완료된 콜 갯수

- QueueMember 정보

  • Event - 메시지 타입. QueueParam:Queue 정보, QueueMember:Queue에 속해있는 member 정보, QueueEntry:Queue에서 대기중인 콜 정보.
  • Queue - Queue name
  • Name - Member name
  • Status - 멤버의 상태 번호
    • 0:AST_DEVICE_UNKNOWN
    • 1:AST_DEVICE_NOT_INUSE
    • 2:AST_DEVICE_INUSE
    • 3:AST_DEVICE_BUSY
    • 4:AST_DEVICE_INVALID
    • 5:AST_DEVICE_UNAVAILABLE
    • 6:AST_DEVICE_RINGING
    • 7:AST_DEVICE_RINGINUSE
    • 8:AST_DEVICE_ONHOLD
  • Location - 멤버의 Channel 정보 혹은 위치 정보
  • StateInterface - 멤버의 상태 정보를 확인하는 장치 정보.
  • Membership - 멤버의 등록 방법(dynamic|realtime|static).
    • dynamic - 동적 등록. AMI, Dialplan 등으로 등록된 방식.
    • static - 정적 등록. queues.conf 에 명시적으로 등록하여 등록된 방식.
    • static -
  • Penalty - 패널티 정보(높은 패널티를 가지게 되면 상대적으로 콜을 분배받기 어려워진다.)
  • CallsTaken - 분배받은 콜의 숫자
  • LastCall - 마지막으로 받은 콜의 시간. Unix 타임을 사용한다.
  • Paused - Paused 여부. (1:Paused 상태, 0:Normal 상태)

- QueueEntry 정보

  • Event - 메시지 타입. QueueParam:Queue 정보, QueueMember:Queue에 속해있는 member 정보, QueueEntry:Queue에서 대기중인 콜 정보.
  • Queue - Queue name
  • Position - Priority number of entry from the queue.
  • Channel - Channel name
  • Uniqueid - Unique id of Asterisk
  • CallerIDNum - Caller's number
  • CallerIDName - Caller's name
  • ConnectedLineNum - 현재 이 콜과 연결된(통화중인) number
  • ConnectedLineName - 현재 이 콜과 연결된(통화중인) name
  • Wait - 이 큐에서 대기한 시간(초)

QueueSummary

Queue의 간략 상태를 표시한다.

Action: QueueSummary
ActionID: <value>
Queue: <value>
  • Queue : Queue name

Example

Action: QueueSummary
Queue: Camp200

Response: Success
Message: Queue summary will follow

Event: QueueSummary
Queue: Camp200
LoggedIn: 1
Available: 1
Callers: 0
HoldTime: 0
TalkTime: 3
LongestHoldTime: 0

Event: QueueSummaryComplete
  • LoggedIn : 현재 로그인(활성화)되어 있는 멤버(Channel) 갯수
  • Available : 현재 대기중인 멤버(Channel) 갯수
  • Callers : 현재 큐에 인입되어 대기중인 콜 갯수
  • HoldTime : 콜이 큐에 인입되어 분배되기 까지의 평균 대기 시간
  • TalkTime : 콜이 큐에 인입되어 분배되고 난 후의 평균 통화 시간
  • LongestHoldTime : 큐에서 가장 오래 대기한 콜의 대기시간.

QueuePenalty

큐 멤버의 패널티를 설정한다.

Action: QueuePenalty
ActionID: <value>
Interface: <value>
Penalty: <value>
Queue: <value>
  • Interface : 패널티를 수정하고자 하는 멤버(Channel) 이름(tech/name).
  • Penalty : 설정하고자 하는 패널티 값. 단, 음수를 설정할수는 없다.
  • Queue : 패널티를 설정하고자하는 큐 이름. 만약 지정하지 않으면, 해당 멤버(Channel)이 속한 모든 큐에서 패널티 값을 수정하게 된다.

QueuePause

큐에 설정된 멤버(Channel)을 일시적 사용불가/사용가능 상태로 변경한다.

Action: QueuePause
ActionID: <value>
Interface: <value>
Paused: <value>
Queue: <value>
Reason: <value>
  • Interface : 사용가능/불가 상태로 지정하고자 하는 채널 혹은 인터페이스(tech/name)
  • Paused : "true": 사용불가, "false" : 사용가능
  • Queue : paused/unpaused 하고자 하는 큐 이름. 만약 지정하지 않으면, 해당 멤버(Channel)이 속한 모든 큐에서 paused/unpaused 를 하게 된다.
  • Reason : Description. QueueMemberPaused 이벤트에 설정되게 된다.

QueueReload

Queue를 reload한다. 하나 혹은 다수 Queue 또는 큐의 하위 섹션들을 reload 한다.

Action: QueueReload
ActionID: <value>
Queue: <value>
Members: <value>
Rules: <value>
Parameters: <value>
  • Queue : reload 하고자 하는 큐 이름. 만약 지정하지 않으면, 모든 큐에 대해 reload가 수행된다.
  • Members : Queue 의 멤버들의 reload 여부. (yes|no)
  • Rules : queuerules.conf 파일의 reload 여부. (yes|no)
  • Parameters : 다른 Queue 옵션들의 reload 여부. (yes|no)

QueueAdd

Action: QueueAdd
ActionID: <value>
Queue: <value>
Interface: <value>
Penalty: <value>
Paused: <value>
MemberName: <value>
StateInterface: <value>
  • Queue : Queue name
  • Interface : Queue에 추가하고자 하는 멤버(Channel) 이름(tech/name).
  • Penalty : 초기 설정 Penalty 값
  • Paused : Paused 설정(true/false 혹은 1/0)
  • MemberName : Interface 별명.
  • StateInterface : 멤버 State 를 받아오는 device 혹은 Channel 정보.

QueueRemove

Queue 에서 해당 멤버(Channel)를 삭제한다.

Action: QueueRemove
ActionID: <value>
Queue: <value>
Interface: <value>
  • Queue : Queue name
  • Interface : 삭제하고자 하는 멤버(Channel) 이름(tech/name)

QueueReset

Queue 관련 통계를 초기화한다.

Action: QueueReset
ActionID: <value>
Queue: <value>
  • Queue : Queue name

QueueRule

queuerules.conf 에 설정된 Queue Rule 을 보여준다.

Action: QueueRule
ActionID: <value>
Rule: <value>
  • Rule : queuerules.conf 파일에 설정되어 있는 Rule 이름.

Redirect

채널을 다른곳으로 redirect(transfer)한다. 즉, 채널 넘겨주기.

Action: Redirect
ActionID: <value>
Channel: <value>
Exten: <value>
Context: <value>
Priority: <value>
ExtraChannel: <value>
ExtraExten: <value>
ExtraContext: <value>
ExtraPriority: <value>
  • Channel - 넘겨주고자 하는 채널.
  • Exten - 채널을 넘겨받게 되는 Extension.
  • Context - 넘겨받게 되는 Context.
  • Priority - 념겨받게 되는 채널의 Priority.
  • ExtraChannel -추가로 같이 넘겨주고자 하는 채널(optional).
  • ExtraExten - ExtraChannel 을 넘겨받게 되는 Extension(optional).
  • ExtraContext - ExtraChannel 을 넘겨받게 되는 Context(optional).
  • ExtraPriority - 넘겨받게 되는 ExtraChannel 의 Priority(optional).

SIPnotify

Action: SIPnotify
ActionID: <value>
Channel: <value>
Variable: <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Channel - Peer to receive the notify.
  • Variable - At least one variable pair must be specified. name=value

SIPpeers

현재 등록되어 있는 모든 SIP peer 를 보여준다.

Action: SIPpeers
ActionID: <value>
  • ActionID - ActionID for this transaction. Will be returned.

SIPpeerstatus

지정된 SIP peer 의 status 를 확인한다.

만약 SIP peer 를 지정하지 않을 경우, 모든 SIP peer 의 status 를 돌려준다.

정상적인 sip peer status 를 확인하기 위해서는 sip.conf 에서 해당 peer 의 설정에 qualify=yes 옵션을 설정해주어야 한다. 만약 qualify=yes 옵션을 설정하지 않을 경우, status 는 "Unmonitored" 라고 표시된다.

Action: SIPpeerstatus
ActionID: <value>
[Peer:] <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Peer - The peer name you want to check.

Example

  • qualify 설정 전.
Action: SIPpeerstatus
Peer: SIP/300

Response: Success
EventList: start
Message: Peer status will follow

Event: PeerStatus
Privilege: System
ChannelType: SIP
Peer: SIP/300
PeerStatus: Unmonitored

Event: SIPpeerstatusComplete
EventList: Complete
ListItems: 1
  • qualify 설정 후.
Action: SIPpeerstatus
Peer: SIP/300

Response: Success
EventList: start
Message: Peer status will follow

Event: PeerStatus
Privilege: System
ChannelType: SIP
Peer: SIP/300
PeerStatus: Unknown

Event: SIPpeerstatusComplete
EventList: Complete
ListItems: 1

SIPqualifypeer

Qualify SIP peers.

Action: SIPqualifypeer
ActionID: <value>
Peer: <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Peer - The peer name you want to qualify.

Example

Action: SIPqualifypeer
Peer: 300

Response: Success
Message: SIP peer found - will qualify

Event: SIPQualifyPeerDone
Privilege: call,all
Peer: 300

SIPshowpeer

Show one SIP peer with details on current status.

Action: SIPshowpeer
ActionID: <value>
Peer: <value>
  • ActionID - ActionID for this transaction. Will be returned.
  • Peer - The peer name you want to check.

Sipshowregistry

현재 등록된 SIP registry 목록을 보여준다.

Action: SIPshowregistry
ActionID: <value>

Example

Action: SIPshowregistry

Response: Success
EventList: start
Message: Registrations will follow

Event: RegistryEntry
Host: 192.168.100.10
Port: 5060
Username: test_register
Domain: 192.168.100.10
DomainPort: 5060
Refresh: 105
State: Request Sent
RegistrationTime: 1447519599

Event: RegistrationsComplete
EventList: Complete
ListItems: 1

Status

List channel status.

Will return the status information of each channel along with the value for the specified channel variables.

Action: Status
ActionID: <value>
[Channel:] <value>
Variables: <value>
AllVariables: <value>
  • ActionID
  • Channel : The name of the channel to query for status.
  • Variables : Comma(,) separated list of variable to include.
  • AllVariables : If set to "true", the Status event will include all channel variables for the requested channel(s).
true
false

Example

Action: Status
AllVariables: true
ActionID: a6519095-0c70-42ec-a013-ead0cae59401

Response: Success
ActionID: a6519095-0c70-42ec-a013-ead0cae59401
EventList: start
Message: Channel status will follow

Event: Status
Privilege: Call
Channel: SIP/300-0000000c
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 300
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode: 
Context: sample_park
Exten: s
Priority: 2
Uniqueid: 1481806671.27
Linkedid: 1481806671.27
Type: SIP
DNID: 4001
EffectiveConnectedLineNum: <unknown>
EffectiveConnectedLineName: <unknown>
TimeToHangup: 0
BridgeID: 299de6ea-1dc7-4144-9e46-d6513723333e
Linkedid: 1481806671.27
Application: Park
Data: 
Nativeformats: (ulaw)
Readformat: ulaw
Readtrans: 
Writeformat: gsm
Writetrans: (gsm@8000)->(slin@8000)->(ulaw@8000)
Callgroup: 0
Pickupgroup: 0
Seconds: 2
Variable: SIPCALLID=1945371327@pluto.pchero21.com
Variable: SIPDOMAIN=pluto.pchero21.com
Variable: SIPURI=sip:300@10.1.27.60:5060
ActionID: a6519095-0c70-42ec-a013-ead0cae59401

Event: StatusComplete
ActionID: a6519095-0c70-42ec-a013-ead0cae59401
EventList: Complete
ListItems: 1
Items: 1

See also

See also

References

<references />