Skip to content

Example: Asterisk AMI

Lorenzo Mangani edited this page Sep 17, 2017 · 6 revisions

Asterisk AMI

The ami plugin is used to get events from Asterisk AMI.

Asterisk Config

;
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
webenabled = no

; Each user has a section labeled with the username
; so this is the section for the user named "mark"
[admin]
secret = admin;
read = call;

Recipe

input {
  ami {
    host => "127.0.0.1"
    port => 5038
    user => "admin"
    pass => "admin"
  }
}

output {
  stdout {}
}

Output

[STDOUT] {
  "Event": "HangupRequest",
  "Privilege": "call,all",
  "Channel": "PJSIP/asterisk1-00000000",
  "ChannelState": "6",
  "ChannelStateDesc": "Up",
  "CallerIDNum": "asterisk1",
  "CallerIDName": "<unknown>",
  "ConnectedLineNum": "<unknown>",
  "ConnectedLineName": "<unknown>",
  "Language": "en",
  "AccountCode": "",
  "Context": "inbound",
  "Exten": "3333",
  "Priority": "4",
  "Uniqueid": "1505675286.0",
  "Linkedid": "1505675286.0",
  "Cause": "16",
  "host": "localhost.localdomain",
  "@timestamp": "2017-09-17T19:08:13.646Z",
  "@version": "1"
}

Clone this wiki locally