{"id":15063653,"url":"https://github.com/staskobzar/amiex","last_synced_at":"2026-02-19T13:03:08.336Z","repository":{"id":62430833,"uuid":"499167093","full_name":"staskobzar/amiex","owner":"staskobzar","description":"Elixir Asterisk Manager Interface library for AMI ver2","archived":false,"fork":false,"pushed_at":"2022-06-03T15:31:27.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T21:40:41.457Z","etag":null,"topics":["ami","asterisk","asterisk-ami","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staskobzar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-02T14:24:44.000Z","updated_at":"2022-06-03T00:24:14.000Z","dependencies_parsed_at":"2022-11-01T20:30:51.001Z","dependency_job_id":null,"html_url":"https://github.com/staskobzar/amiex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/staskobzar/amiex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Famiex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Famiex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Famiex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Famiex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staskobzar","download_url":"https://codeload.github.com/staskobzar/amiex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Famiex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29614592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ami","asterisk","asterisk-ami","elixir"],"created_at":"2024-09-25T00:05:24.946Z","updated_at":"2026-02-19T13:03:08.318Z","avatar_url":"https://github.com/staskobzar.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMI\n[![Elixir CI](https://github.com/staskobzar/amiex/actions/workflows/elixir.yml/badge.svg)](https://github.com/staskobzar/amiex/actions/workflows/elixir.yml)\n[![Coverage Status](https://coveralls.io/repos/github/staskobzar/amiex/badge.svg?branch=master)](https://coveralls.io/github/staskobzar/amiex?branch=master)\n[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/staskobzar/exfastagi/blob/master/LICENSE)\n\nElixir AMI (Asterisk Manager Interface) library to help build Asterisk application.\nCan be used to read Asterisk events and to send Actions and commands.\nCan connect to one or many Asterisks and proxy all events to single handler.\nCan send an action to a single Asterisk or broadcast to all established connections.\n\n## Installation\n\nThe package can be installed by adding `amiex` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:amiex, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nThe docs can be found at [https://hexdocs.pm/amiex](https://hexdocs.pm/amiex/AMI.html).\n\n## Usage\n\nCreate module that will use AMI:\n```elixir\ndefmodule MyAMI do\n  use AMI\n\n  def handle_message(msg, addr) do\n    IO.inspect(msg, label: \"handle_message from #{addr}\")\n    # process incoming events\n    :ok\n  end\nend\n```\n\nAMI client can connect to Asterisk using ```start_link/1``` function using module above:\n\n```elixir\nAMI.Client.start_link({'localhost', 5447, \"admin\",  \"5ecR37\", MyAMI})\n```\n\nIt is better to use AMI as supervised process and it is possible to connect\nmultiple Asterisk servers. For example:\n\n```elixir\n    children = [\n      %{\n        id: :pbx01,\n        start: {\n          AMI.Client,\n          :start_link,\n          [{'pbx01.myphones.com', 5038, \"admin\", \"secret4\", MyAMI}]\n        }\n      },\n      %{\n        id: :pbx02,\n        start: {\n          AMI.Client,\n          :start_link,\n          [{'127.0.0.1', 5038, \"admin\", \"secret9\", MyAMI}]\n        }\n      },\n    ]\n\n    Supervisor.start_link(children, strategy: :one_for_one)\n```\n\nEvents also can be filtered via ```handle_message/2``` function:\n\n```elixir\n  # handle FullyBooted event which is sent after successful login\n  # and send QueueSummary to all Asterisks via broadcast function\n  def handle_message(%{\"Event\" =\u003e [\"FullyBooted\"]} = msg, _addr) do\n    {:ok, qsum} = AMI.Action.new(\"QueueSummary\")\n    AMI.Action.broadcast(qsum) # request queues summary to all Asterisks\n    :ok\n  end\n\n  # handle queues summary response events\n  def handle_message(%{\"Event\" =\u003e [\"QueueSummary\"]} = msg, addr) do\n    # process event here\n    :ok\n  end\n\n  # handle all other events\n  def handle_message(msg, addr) do\n    # process event here\n    AMI.Client.send(addr, AMI.Action.new(\"Hello\"))\n    :ok\n  end\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaskobzar%2Famiex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaskobzar%2Famiex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaskobzar%2Famiex/lists"}