-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
This guide assumes no prior experience — just VS Code installed and
an opensips.cfg file you want to edit.
Works the same on Linux, macOS, and Windows — every release ships native builds for all three (x86_64 and arm64), and the platform extension packages bundle the server, so your editor picks the right one automatically.
VSCodium / Cursor / Gitpod (and other Open VSX editors): press Ctrl+Shift+X, search for opensips, click Install on "OpenSIPS Routing Script" — done; the platform builds bundle everything.
Standard VS Code ships with Microsoft's marketplace, where this extension is not distributed — use Option B (one command, installs the extension for you) or Option C.
Windows (PowerShell):
irm https://raw.githubusercontent.com/NormB/opensips-lsp/main/install.ps1 | iexLinux / macOS:
Open a terminal (in VS Code: Terminal → New Terminal), paste this line, and press Enter:
curl -fsSL https://raw.githubusercontent.com/NormB/opensips-lsp/main/install.sh | shThat's it. The script downloads the right build for your machine,
installs the server to ~/.local/bin, and adds the extension to VS
Code. It prints what it did; if something is missing (for example the
code command), it prints exactly what to do instead.
-
Open https://github.com/NormB/opensips-lsp/releases/latest in a browser.
-
Download two files from the Assets list:
-
opensips-lsp-…-x86_64-linux-gnu.tar.gz(oraarch64on ARM) opensips-lsp-ext-….vsix
-
-
Install the server — Linux/macOS in a terminal (Windows: just unzip
opensips-lsp-…-windows.zipanywhere, e.g.%LOCALAPPDATA%\opensips-lsp):tar xzf opensips-lsp-*-linux-gnu.tar.gz # or *-darwin.tar.gz mkdir -p ~/.local/bin install -m755 opensips-lsp ~/.local/bin/
-
Install the extension — in VS Code:
- Press Ctrl+Shift+X (the Extensions panel opens).
- Click the ⋯ button in the panel's top-right corner.
- Choose Install from VSIX…
- Pick the
opensips-lsp-ext-….vsixfile you downloaded.
Open a folder containing an opensips.cfg (File → Open Folder…)
and click the file. You should immediately see syntax colors.
If VS Code asks "Do you trust the authors of the files in this
folder?" — answer honestly: in an untrusted folder the extension
still colors, completes, and navigates, but it will not run the
OpenSIPS checker on the file (that is a safety feature, because
checking a config executes parts of it).
This needs OpenSIPS itself installed on the same machine.
- Press Ctrl+, (Settings), type
opensipsin the search box. - In Opensips Lsp: Opensips Path enter the full path of your
opensipsbinary, e.g./usr/local/sbin/opensips. - Open your
opensips.cfgand save it (Ctrl+S).
Mistakes now get red squiggles at the exact spot — hover one to
read the message (it is the real OpenSIPS parser talking, e.g.
Parameter <fr_timeot> not found in module <tm> - can't set). Squiggles refresh
every time you save.
- Type
loadmodule "— a list of every module appears. Keep typing to filter, press Enter to accept. - Type
modparam("tm", "— the list shows only tm's parameters, each with its documentation. - Inside a route, type the first letters of a function
(
t_re…→t_relay) — functions of the modules you loaded, plus core functions, appear with their signatures. - Type
$— pseudo-variables ($ru,$si, …) with descriptions. - If a list ever disappears, press Ctrl+Space to bring it back.
For the richest documentation in these popups, also set Opensips Lsp: Opensips Src (in the same Settings page) to a folder containing the OpenSIPS source code matching your version.
-
Hover the mouse over any function, parameter, or
$variableto read what it does. -
Ctrl+Click on a route name inside
route(name)to jump to where that route is defined. - Press Ctrl+Shift+O to see every route in the file and jump between them.
| Symptom | Fix |
|---|---|
| No colors | The file must be named opensips.cfg or end in .cfg. |
| No red squiggles | Set Opensips Path (step above), save the file, and make sure you trusted the folder. |
| Squiggles on a correct file | The checker uses your OpenSIPS version — a config written for another version can legitimately fail. |
| Completion has no documentation | Set Opensips Src to an OpenSIPS source folder. |
| Still stuck | View → Output, pick OpenSIPS LSP in the dropdown — the server explains what it is doing (e.g. "ready (193 documented modules)"). |
Generated from the repository docs — edit docs/ in the repo, not the wiki.