{"id":26129057,"url":"https://github.com/sgofferj/ami2mqtt","last_synced_at":"2026-04-18T18:34:49.748Z","repository":{"id":151398368,"uuid":"615424989","full_name":"sgofferj/ami2mqtt","owner":"sgofferj","description":"An Asterisk Manager event to MQTT bridge","archived":false,"fork":false,"pushed_at":"2023-05-05T11:45:18.000Z","size":61,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-10T19:45:02.966Z","etag":null,"topics":["ami","asterisk","bridge","mqtt"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/sgofferj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-17T16:59:55.000Z","updated_at":"2025-01-21T18:19:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa67a993-2765-4d9f-8008-132271caed42","html_url":"https://github.com/sgofferj/ami2mqtt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sgofferj/ami2mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgofferj%2Fami2mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgofferj%2Fami2mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgofferj%2Fami2mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgofferj%2Fami2mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgofferj","download_url":"https://codeload.github.com/sgofferj/ami2mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgofferj%2Fami2mqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31980209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: 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","bridge","mqtt"],"created_at":"2025-03-10T19:37:16.477Z","updated_at":"2026-04-18T18:34:49.741Z","avatar_url":"https://github.com/sgofferj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build and publish the container image](https://github.com/sgofferj/ami2mqtt/actions/workflows/actions.yml/badge.svg?branch=master)](https://github.com/sgofferj/ami2mqtt/actions/workflows/actions.yml)\n\n# ami2mqtt\nAn Asterisk Manager event to MQTT bridge\n\n(C) 2023 Stefan Gofferje\n\nLicensed under the GNU General Public License V3 or later.\n\n## Description\nami2mqtt is designed to run in the background, ideally as a container. It connects to an Asterisk PBX server's manager interface, subscribes to certain events and publishes them under corresponding topics on an MQTT server.\n\n## Purpose\nI wrote this for integrating my home Asterisk deeper into my home automation system, namely Home Assistant and a bunch of IoT devices. Among other things, I have an solar-powered ESP8266-based Wifi-buzzer in the garden, which buzzes whenever a call comes in on my Asterisk. I also have a nice busy lamp field now in Home Assistant.\n\n## Configuration\nThe following values are supported and can be provided either as environment variables or through an .env-file.\n\n| Variable | Default | Purpose |\n|----------|---------|---------|\n| AMI_HOST | asterisk | Asterisk server IP or hostname |\n| AMI_PORT | 5038 | Asterisk Manager Interface port |\n| AMI_USERNAME | asterisk | User name for Asterisk Manager Interface |\n| AMI_PASSWORD | manager | Password for Asterisk Manager Interface |\n| MQTT_URL | mqtt | MQTT server URL (can be one the following protocols: 'mqtt', 'mqtts', 'tcp', 'tls', 'ws', 'wss', 'wxs', 'alis') e.g. 'mqtt://server.domain.tld' |\n| MQTT_USERNAME | null | MQTT user name\n| MQTT_PASSWORD | null | MQTT password |\n\n## MQTT topics\nCurrently, everything is published under the topic `pbx/#`. I might make this configurable later.\n### DeviceStateChange\nDeviceStateChange events are published as `pbx/devstate/\u003cdevice\u003e`. Colons are replaced with slashes.\nExamples:\n* SIP/1234 -\u003e `pbx/devstate/SIP/1234`\n* Custom:Night -\u003e `pbx/devstate/Custom/Night`\n* MWI:1000@default -\u003e `pbx/devstate/MWI/1000@default`\n### ExtensionStatus\nExtensionStatus events are published as `pbx/exten/\u003ccontext\u003e/\u003cextension\u003e`.\n* 1234 in context internal -\u003e `pbx/exten/internal/1234`\n### Set DeviceState\nThe state of Custom devstates can be set with `pbx/devstate/Custom/\u003cdevice\u003e/set`\n* Custom:Night -\u003e `pbx/devstate/Custom/Night/set`\n\n## Home Assistant autodiscovery\nFor devstate objects [Home Assistant MQTT autodiscovery topics](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery) are created. Custom devstates are registered as switches and can be switched from Home Assistant between INUSE and NOT_INUSE. All others are registered as sensors.\n\n## Container use\n### Image\nThe image is built for AMD64 and ARM64 and pushed to ghcr.io: *ghcr.io/sgofferj/ami2mqtt:latest*\n### Docker\nFirst, rename .env.example to .env and edit according to your needs \\\nCreate and start the container:\n```\ndocker run -d --env-file .env --name ami2mqtt --restart always ghcr.io/sgofferj/ami2mqtt:latest\n```\n\n### Docker compose\nHere is an example for a docker-compose.yml file:\n```\nversion: '2.0'\n\nservices:\n  ami2mqtt:\n    image: ghcr.io/sgofferj/ami2mqtt:latest\n    restart: always\n    networks:\n      - default\n    environment:\n      - AMI_HOST=asterisk\n      - AMI_PORT=5038\n      - AMI_USERNAME=asterisk\n      - AMI_PASSWORD=manager\n      - MQTT_URL=mqtt://mqtt-server.local\n      - MQTT_USERNAME=mqtt\n      - MQTT_PASSWORD=mqtt\n\nnetworks:\n  default:\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgofferj%2Fami2mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgofferj%2Fami2mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgofferj%2Fami2mqtt/lists"}