{"id":16389369,"url":"https://github.com/marcelog/erlami","last_synced_at":"2025-10-26T13:30:42.977Z","repository":{"id":3287287,"uuid":"4328022","full_name":"marcelog/erlami","owner":"marcelog","description":"An Asterisk Manager Interface written in Erlang","archived":false,"fork":false,"pushed_at":"2015-07-02T21:09:23.000Z","size":435,"stargazers_count":12,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-11T13:53:21.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcelog.png","metadata":{"files":{"readme":"README","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}},"created_at":"2012-05-14T19:32:41.000Z","updated_at":"2020-09-11T19:11:36.000Z","dependencies_parsed_at":"2022-09-04T01:10:18.888Z","dependency_job_id":null,"html_url":"https://github.com/marcelog/erlami","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Ferlami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Ferlami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Ferlami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelog%2Ferlami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelog","download_url":"https://codeload.github.com/marcelog/erlami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219862888,"owners_count":16555951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-11T04:32:40.134Z","updated_at":"2025-10-26T13:30:37.708Z","avatar_url":"https://github.com/marcelog.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n------------\nThis is an application for erlang/otp suited to monitor asterisk installations.\n\nA PHP version is available at http://marcelog.github.com/PAMI\nA NodeJs version is available at http://marcelog.github.com/Nami\n\nIt has 1 top-level supervisor that spawns a worker for each one of the asterisk\nboxes you configure.\n\nLicense\n-------\nerlami is under the Apache License 2.0. See the LICENSE file\nfor more details.\n\nConfiguring\n-----------\nSee rel/files/sys.config for an example configuration. Here's a snippet:\n{erlami, [\n    {servers, [\n        {asterisk1, [                 % The server name is an atom\n            {connection, {erlami_tcp_connection, [\n                {host, \"1.1.1.1\"}, {port, 5038}\n            ]}},\n            {username, \"username\"},\n            {secret, \"secret\"}\n        ]},\n        {asterisk2, [\n            {connection, {erlami_tcp_connection, [\n                {host, \"2.2.2.2\"}, {port, 5039}\n            ]}},\n            {username, \"username\"},\n            {secret, \"secret\"}\n        ]}\n    ]}\n]}.\n\nListening for events\n--------------------\nerlami_client:register_listener(\n    ServerName, {fun event_callback/2, fun(_) -\u003e true end}\n).\n\nThe 1st argument is the server name configured in the application, meaning\nyou are interested in listening for events coming in from that specific server.\n\nThe 2nd argument is a fun, which is called for every event received. This\nfun should accept 2 arguments, a servername (atom) and the event. You can\nmanipulate the event with the functions in the erlami_message module.\n\nThe 3rd argument is the predicate, which will receive the event so it can\nprocess it, returning true or false. The event_callback is called only if the\npredicate returns true.\n\nSee src/erlami_example.erl for a detailed example.\n\nFiltering Events\n----------------\nYou can use the predicate to filter which events you want to listen for. For\nexample, this will only listen for events that *are not* DTMF:\n\nerlami_client:register_listener(\n    ServerName, {\n        fun event_callback/2,\n        fun(Event) -\u003e\n            {ok, Value} = erlami_message:get(Event, \"event\"),\n            Value =/= \"DTMF\" end\n        end\n    }).\n\n\nSending actions\n---------------\nAction = erlami_message:new_action(\"CoreShowChannels\"),\nerlami_client:send_action(ServerName, Action, fun response_callback/2).\n\nThe response_callback is invoked when the response for the action is received.\nThe 1st argument passed to it is the response itself, and the 2nd argument is\nthe list of associated events for that response.\n\nSee src/erlami_example.erl for a detailed example.\n\nOTP\n---\nerlami is the name of the included OTP application. Just start is as\nany other application, like:\n\n1\u003e application:start(erlami).\n\nThe application will start a supervisor, that has 1 supervisor per configured\nasterisk server.\n\nCompiling\n---------\nJust type make in the top level directory. The .beam files will\nbe generated in the ebin/ directory. The Makefile contains the correct\nrebar commands to run.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Ferlami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelog%2Ferlami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelog%2Ferlami/lists"}