{"id":19185658,"url":"https://github.com/staskobzar/exfastagi","last_synced_at":"2025-10-25T02:05:41.295Z","repository":{"id":40493401,"uuid":"488605992","full_name":"staskobzar/exfastagi","owner":"staskobzar","description":"Elixir FastAGI library","archived":false,"fork":false,"pushed_at":"2022-05-05T01:07:34.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T02:43:24.737Z","etag":null,"topics":["asterisk","asterisk-agi","asterisk-pbx","elixir","fastagi"],"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":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-04T13:46:39.000Z","updated_at":"2023-06-26T22:51:24.000Z","dependencies_parsed_at":"2022-08-09T22:01:14.059Z","dependency_job_id":null,"html_url":"https://github.com/staskobzar/exfastagi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/staskobzar/exfastagi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Fexfastagi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Fexfastagi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Fexfastagi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Fexfastagi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staskobzar","download_url":"https://codeload.github.com/staskobzar/exfastagi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staskobzar%2Fexfastagi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280893614,"owners_count":26409280,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["asterisk","asterisk-agi","asterisk-pbx","elixir","fastagi"],"created_at":"2024-11-09T11:11:22.829Z","updated_at":"2025-10-25T02:05:41.269Z","avatar_url":"https://github.com/staskobzar.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastagi\n[![Elixir CI](https://github.com/staskobzar/exfastagi/actions/workflows/elixir.yml/badge.svg)](https://github.com/staskobzar/exfastagi/actions/workflows/elixir.yml)\n[![Coverage Status](https://coveralls.io/repos/github/staskobzar/exfastagi/badge.svg?branch=master)](https://coveralls.io/github/staskobzar/exfastagi?branch=master)\n[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/staskobzar/exfastagi/blob/master/LICENSE)\n\n\nElixir FastAGI library to build FastAGI servers and process Asterisk calls.\n\n## Installation\n\nThe package can be installed by adding `fastagi` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:fastagi, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n[Fastagi.Session commands](https://hexdocs.pm/fastagi/Fastagi.Session.html) documentation.\n\n## Usage\nModule to Fasagi processes each AGI connection with \"handle_connection\" callback withing a module that uses Fastagi. Module example:\n\n```elixir\ndefmodule MyAGI do\n  require Logger\n  use Fastagi\n\n  def handle_connection(sess) do\n    IO.puts(\"========================================\")\n    IO.inspect(sess)\n\n    with {:ok, _} \u003c- Fastagi.Session.answer(sess),\n         {:ok, _} \u003c- Fastagi.Session.verbose(sess, \"Hello there from exFastagi\"),\n         {:ok, resp} \u003c- Fastagi.Session.get_variable(sess, \"VARFOO\"),\n         :ok \u003c- Logger.info(\"VARFOO = #{resp.value}\"),\n         {:ok, _} = Fastagi.Session.hangup(sess) do\n      IO.puts(\"=================================================\")\n      IO.puts(\"| session is done\")\n      IO.puts(\"=================================================\")\n    else\n      :hangup -\u003e Logger.warn(\"Session channel was hangup by Asterisk\")\n      {:error, err} -\u003e Logger.error(\"Session error: #{err}\")\n    end\n\n    Fastagi.Session.close(sess)\n  end\nend\n```\n\nStarting ```Fastagi.Server``` can be done directly via \"start_link\" function that receives port and module name as arguments. Can also be used in application. For example:\n```elixir\ndefmodule MyMAGI.App do\n  use Application\n\n  @impl true\n  def start(_type, _args) do\n    children = [\n      Supervisor.child_spec({Task, fn -\u003e Fastagi.Server.start_link(4575, MyAGI) end},\n        restart: :permanent\n      )\n    ]\n\n    Supervisor.start_link(children, strategy: :one_for_one)\n  end\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaskobzar%2Fexfastagi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaskobzar%2Fexfastagi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaskobzar%2Fexfastagi/lists"}