-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This guide assumes no prior experience — just VS Code installed and
a kamailio.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 kamailio, click Install on "Kamailio 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/kamailio-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/kamailio-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/kamailio-lsp/releases/latest in a browser.
-
Download two files from the Assets list:
-
kamailio-lsp-…-x86_64-linux-gnu.tar.gz(oraarch64on ARM) kamailio-lsp-ext-….vsix
-
-
Install the server — Linux/macOS in a terminal (Windows: just unzip
kamailio-lsp-…-windows.zipanywhere, e.g.%LOCALAPPDATA%\kamailio-lsp):tar xzf kamailio-lsp-*-linux-gnu.tar.gz # or *-darwin.tar.gz mkdir -p ~/.local/bin install -m755 kamailio-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
kamailio-lsp-ext-….vsixfile you downloaded.
Open a folder containing a kamailio.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
Kamailio checker on the file (that is a safety feature, because
checking a config executes parts of it).
This needs Kamailio itself installed on the same machine.
- Press Ctrl+, (Settings), type
kamailioin the search box. - In Kamailio Lsp: Kamailio Path enter the full path of your
kamailiobinary, e.g./usr/sbin/kamailio. - Open your
kamailio.cfgand save it (Ctrl+S).
Mistakes now get red squiggles at the exact spot — hover one to
read the message. Misspell a parameter (say fr_tmer instead of tm's
fr_timer) and the squiggle lands on that modparam line saying
Can't set module parameter — the real Kamailio parser talking (its
log names the offender: parameter <fr_tmer> of type <2:int> not found in module <tm>). 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 Kamailio Lsp: Kamailio Src (in the same Settings page) to a folder containing the Kamailio source code matching your version, and Kamailio Lsp: Kamailio Wiki to a clone of the kamailio-wiki repository (core parameters, functions, and pseudo-variables).
-
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 kamailio.cfg (or start with a #!KAMAILIO first line). |
| No red squiggles | Set Kamailio Path (step above), save the file, and make sure you trusted the folder. |
| Squiggles on a correct file | The checker uses your Kamailio version — a config written for another version can legitimately fail. |
| Completion has no documentation | Set Kamailio Src to a Kamailio source folder. |
| Still stuck | View → Output, pick Kamailio LSP in the dropdown — the server explains what it is doing (e.g. "ready (254 documented modules)"). |
Generated from the repository docs — edit docs/ in the repo, not the wiki.