{"id":29835213,"url":"https://github.com/livekit/sip","last_synced_at":"2025-07-29T12:17:32.009Z","repository":{"id":209492489,"uuid":"706451996","full_name":"livekit/sip","owner":"livekit","description":"SIP to WebRTC bridge for LiveKit","archived":false,"fork":false,"pushed_at":"2025-07-24T05:28:58.000Z","size":1904,"stargazers_count":242,"open_issues_count":50,"forks_count":85,"subscribers_count":25,"default_branch":"main","last_synced_at":"2025-07-24T06:52:46.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livekit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-18T01:33:30.000Z","updated_at":"2025-07-23T12:15:52.000Z","dependencies_parsed_at":"2024-12-05T02:28:20.026Z","dependency_job_id":"48df9643-50d7-4a63-8e72-bb289eef65d5","html_url":"https://github.com/livekit/sip","commit_stats":null,"previous_names":["livekit/sip"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/livekit/sip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fsip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fsip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fsip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fsip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livekit","download_url":"https://codeload.github.com/livekit/sip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fsip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267685547,"owners_count":24127706,"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-07-29T02:00:12.549Z","response_time":2574,"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":[],"created_at":"2025-07-29T12:17:31.357Z","updated_at":"2025-07-29T12:17:31.999Z","avatar_url":"https://github.com/livekit.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!--BEGIN_BANNER_IMAGE--\u003e\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"/.github/banner_dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"/.github/banner_light.png\"\u003e\n  \u003cimg style=\"width:100%;\" alt=\"The LiveKit icon, the name of the repository and some sample code in the background.\" src=\"https://raw.githubusercontent.com/livekit/sip/main/.github/banner_light.png\"\u003e\n\u003c/picture\u003e\n\n\u003c!--END_BANNER_IMAGE--\u003e\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/livekit/sip)\n\n# LiveKit SIP Service\n\n\u003c!--BEGIN_DESCRIPTION--\u003e\nWebRTC is proving to be a versatile and scalable transport protocol both for media ingestion and delivery. However, not all devices support WebRTC. SIP provides a way to bring SIP traffic into a LiveKit room.\n\u003c!--END_DESCRIPTION--\u003e\n\n## Capabilities\n\nSIP is designed to be a full-featured SIP bridge, connecting LiveKit sessions with Telephony networks with SIP Trunking.\nCurrently, the following features are supported:\n- Dialing Out (Sending INVITEs)\n- Dialing In (Accepting INVITEs)\n- Digest Authentication\n- Touch Tone (Sending and Reading DTMF)\n\n## Documentation\n\n### Workflow\n\nTo accept inbound calls, the workflow goes like this:\n\n* create an SIP Trunk with `CreateSIPTrunk` API (to livekit-server)\n* create an SIP Dispatch Rule with `CreateSIPDispatchRule` API (to livekit-server)\n* SIP service receives a call\n* SIP service connects to the LiveKit room and SIP caller is a participant\n\nSee [SIP Quickstart](https://docs.livekit.io/sip/quickstarts/configuring-sip-trunk/) for a full guide.\n\n### Service Architecture\n\nThe SIP service and the LiveKit server communicate over Redis. Redis is also used as storage for the SIP session state. The SIP service must also expose a public IP address for remote SIP peers to connect to.\n\n### Config\n\nThe SIP service takes a YAML config file:\n\n```yaml\n# required fields\napi_key: livekit server api key. LIVEKIT_API_KEY env can be used instead\napi_secret: livekit server api secret. LIVEKIT_API_SECRET env can be used instead\nws_url: livekit server websocket url. LIVEKIT_WS_URL env can be used instead\nredis:\n  address: must be the same redis address used by your livekit server\n  username: redis username\n  password: redis password\n  db: redis db\n\n# optional fields\nhealth_port: if used, will open an http port for health checks\nprometheus_port: port used to collect prometheus metrics. Used for autoscaling\nlog_level: debug, info, warn, or error (default info)\nsip_port: port to listen and send SIP traffic (default 5060)\nrtp_port: port to listen and send RTP traffic (default 10000-20000)\n```\n\nThe config file can be added to a mounted volume with its location passed in the SIP_CONFIG_FILE env var, or its body can be passed in the SIP_CONFIG_BODY env var.\n\n### Using the SIP service\n\n#### Creating Bridge and Dispatch Rule\n\nAccepting SIP traffic requires two resources be created. First a `SIP Bridge`, then a `SIP Dispatch Rule`.\n\nThese resources can be created with any of the server SDKs or with the [livekit-cli](https://github.com/livekit/livekit-cli). The syntax with the livekit-cli is as follow:\n\nThe `SIP Bridge` is used to authenticate incoming traffic. Typically you will create a `SIP Bridge` to map to your different\nSIP providers and their IP Ranges/Authentication details.\n\n```shell\nlivekit-cli create-sip-trunk \\\n  --request \u003cpath to SIP Trunk creation request JSON file\u003e\n```\n\nThe SIP Bridge request creation JSON file uses the following syntax:\n\n```json\n{\n    \"inbound_addresses\": Array of IP Address or CIDRs where SIP INVITEs will be accepted from\n    \"outbound_address\": IP Address that SIP INVITEs will be sent too\n    \"outbound_number\": When making an outbound call on this SIP Trunk what Phone Number should be used\n    \"inbound_numbers_regex\": Phone numbers this SIP Trunk will serve. If Empty it will serve all incoming calls,\n    \"inbound_username\": Username for Authentication of inbound calls, no Authentication if empty,\n    \"inbound_password\": Password for Authentication of inbound calls, no Authentication if empty,\n    \"outbound_username\": Username for Authentication of outbound calls, no Authentication if empty,\n    \"outbound_password\": Password for Authentication of outbound calls, no Authentication if empty\n}\n```\n\nOn success, `livekit-cli` will return the unique id for the SIP Trunk.\n\nNext a `SIP Dispatch Rule` needs to be created. A `SIP Dispatch Rule` determines what LiveKit room an incoming call should be directed into. You can direct calls into\ndifferent rooms depending on the metadata of the call. Things like who is calling, who they called and what pin did they enter.\n\n```shell\nlivekit-cli create-sip-dispatch-rule \\\n  --request \u003cpath to SIP Distpach Rule creation request JSON file\u003e\n```\n\nThe SIP Bridge request creation JSON file uses the following syntax:\n\n```json\n{\n    \"rule\": // What rule to use to dispatch this call, see the next section for rules\n    \"trunk_ids\": // Array of SIP Trunk IDs that are accepted for this rule. If empty all Trunks are accepted\n    \"hide_phone_number\": // If true hide the phone number when joining the LiveKit room\n}\n```\n\nAt this time we support one rule `dispatchRuleDirect`. This can be set like so\n\n```\n\t\"rule\": {\n\t\t\"dispatchRuleDirect\": {\n\t\t\t\"roomName\":\"my-new-room\"\n\t\t}\n\t}\n```\n\n\nOn success, `livekit-cli` will return the unique id for the SIP Dispatch Rule.\n\n### Running locally\n\n#### Running natively\n\nThe SIP service can be run natively on any platform supported by libpous.\n\n##### Prerequisites\n\nThe SIP service is built in Go. Go \u003e= 1.18 is needed. The SIP services uses [libopus](https://opus-codec.org/) and must be installed externally:\n\nFor Debian\n\n```\nsudo apt-get install pkg-config libopus-dev libopusfile-dev libsoxr-dev\n```\n\nFor Mac\n\n```\nbrew install pkg-config opus opusfile libsoxr\n```\n\nFor more instructions see [hraban/opus' README](https://github.com/hraban/opus#build--installation)\n\n##### Building\n\nBuild the SIP service by running:\n\n```shell\nmage build\n````\n\n##### Running the service\n\nTo run against a local LiveKit server, a redis server must be running locally. All servers must be configured to communicate over localhost. Create a file named `config.yaml` with the following content:\n\n```yaml\nlog_level: debug\napi_key: \u003cyour-api-key\u003e\napi_secret: \u003cyour-api-secret\u003e\nws_url: ws://localhost:7880\nredis:\n  address: localhost:6379\n```\n\n```shell\nsip --config=config.yaml\n```\n\n#### Running with Docker\n\nTo run against a local LiveKit server, a Redis server must be running locally. The SIP service must be instructed to connect to LiveKit server and Redis on the host. The host network is accessible from within the container on IP:\n- host.docker.internal on MacOS and Windows\n- 172.17.0.1 on linux\n\nCreate a file named `config.yaml` with the following content:\n\n```yaml\nlog_level: debug\napi_key: \u003cyour-api-key\u003e\napi_secret: \u003cyour-api-secret\u003e\nws_url: ws://host.docker.internal:7880 (or ws://172.17.0.1:7880 on linux)\nredis:\n  address: host.docker.internal:6379 (or 172.17.0.1:6379 on linux)\n```\n\nThe container must be run with host networking enabled. SIP by default uses UDP port 10000 -\u003e 20000 and 5060, this large range of ports is hard for docker to handle at this time.\n\nThen to run the service:\n\n```shell\ndocker run --rm \\\n    -e SIP_CONFIG_BODY=\"`cat config.yaml`\" \\\n    --network host \\\n    livekit/sip\n```\n\n\n\n\u003c!--BEGIN_REPO_NAV--\u003e\n\u003cbr/\u003e\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth colspan=\"2\"\u003eLiveKit Ecosystem\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eLiveKit SDKs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/client-sdk-js\"\u003eBrowser\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-swift\"\u003eiOS/macOS/visionOS\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-android\"\u003eAndroid\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-flutter\"\u003eFlutter\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-react-native\"\u003eReact Native\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/rust-sdks\"\u003eRust\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity\"\u003eUnity\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity-web\"\u003eUnity (WebGL)\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eServer APIs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-go\"\u003eGolang\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-ruby\"\u003eRuby\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-kotlin\"\u003eJava/Kotlin\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/rust-sdks\"\u003eRust\u003c/a\u003e · \u003ca href=\"https://github.com/agence104/livekit-server-sdk-php\"\u003ePHP (community)\u003c/a\u003e · \u003ca href=\"https://github.com/pabloFuente/livekit-server-sdk-dotnet\"\u003e.NET (community)\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eUI Components\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/components-js\"\u003eReact\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-android\"\u003eAndroid Compose\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-swift\"\u003eSwiftUI\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eAgents Frameworks\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/agents\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/agents-js\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/agent-playground\"\u003ePlayground\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eServices\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/livekit\"\u003eLiveKit server\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/egress\"\u003eEgress\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/ingress\"\u003eIngress\u003c/a\u003e · \u003cb\u003eSIP\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eResources\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://docs.livekit.io\"\u003eDocs\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples\"\u003eExample apps\u003c/a\u003e · \u003ca href=\"https://livekit.io/cloud\"\u003eCloud\u003c/a\u003e · \u003ca href=\"https://docs.livekit.io/home/self-hosting/deployment\"\u003eSelf-hosting\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/livekit-cli\"\u003eCLI\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c!--END_REPO_NAV--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fsip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivekit%2Fsip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fsip/lists"}