Отладка исходного кода Asterisk
,
Asterisk
.
ף
VirtualBox
, GDB Visual
Studio Code ,
.
, Linux
, .
ߣ .
:
VirtualBox >7.0
Linux ( ,
Ubuntu Server 24.04)
Visual Studio Code : Remote Explorer
:
- . , :
- 1 - Nat
- 1 - - -
: TCP - : 2022 - : 22
SSH. Linux .
.
SSH:
ssh user@localhost -p 2022
Remote Explorer.
SSH (c. ):
Host localhost
HostName 127.0.0.1
User username
Port 2022
Remote Explorer Connect
in current Window. , .
VS Code
(>{SSH: localhost).
Ctrl+J .
Asterisk .
, :
ping 1.1.1.1
Asterisk .
wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22-current.tar.gz
tar -x -zf asterisk-22-current.tar.gz
cd asterisk-22
:
sudo ./contrib/scripts/install_prereq install
sudo apt install gdb
. .
./configure --enable-dev-mode
make menuselect.makeopts
menuselect/menuselect --disable-all --enable pbx_config menuselect.makedeps
.
make
sudo make install
Asterisk
echo -e "[modules]\\nautoload = yes" | sudo tee -a /etc/asterisk/modules.conf
sudo cp configs/basic-pbx/extensions.conf /etc/asterisk/
asterisk -f
,
Asterisk Ready. .
Asterisk:
VS Code, ޣ , C/C++ C/C++ Extension Pack.
VS Code Explorer (Ctrl+Shift+E) Open Folder.
Asterisk Ok.
Asterisk.
VS Code Run - Add Configuration - CMake Debug
.vscode/launch.json 2 :
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Asterisk (Local Launch)",
"type": "cppdbg",
"request": "launch",
"program": "/usr/sbin/asterisk",
"args": ["-f", "-vvvgc"], //
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Debug Asterisk (Local Attach)",
"type": "cppdbg",
"request": "attach",
"program": "/usr/sbin/asterisk",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"miDebuggerArgs": "--interpreter=mi",
"setupCommands": [
{
"description": "Enable pretty-printing",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set debug mode",
"text": "handle SIG33 pass nostop noprint"
}
],
}
]
}
.
.vscode/launch.json (Ctrl+s).
Asterisk VS Code Explorer (Ctrl+Shift+E)
main/asterisk.c
3613 int main(int argc, char *argv[]).
,
( ).
F5 Run - Debug.
F10
F11
Run and Debug (Ctrl+Shift+D),
, .
PBX extensions.conf:
pbx_config.so /usr/lib/asterisk/modules/
ls /usr/lib/asterisk/modules/
/etc/asterisk/modules.conf :
[modules]
autoload = yes
pbx/pbx_config.c 2151 breakpoint
static int load_module(void)
. main()
F5 ģ pbx/pbx_config.c:2151
, F10 - F11 ,
.
.
, :
make menuselect
make
sudo make install
asterisk/testsuite
Asterisk
root
launch.json
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Атомарные обновления в OSTree | 0 | 2.5 | 25-12-2025 |
| 2 | Ускорение пересборки llama.cpp | 0 | 2.5 | 27-01-2026 |
| 3 | BTC — | 0 | 0 | 12-02-2026 |
| 4 | Создание загрузочного атомарно обновляемого образа Oracle Linux при помощи OSTree | 0 | 2.5 | 26-10-2025 |
| 5 | Пользователи Telegram жалуются на сбой в работе мессенджера | 0 | 0 | 30-06-2025 |
| 6 | editors/vim-classic - 8.3.0 | 0 | 36.92 | 15-08-2026 |
| 7 | adafruit-circuitpython-nau88l21 1.0.1 | 0 | 40 | 14-08-2026 |
| 8 | Rebuilding the CircleCI CLI from scratch | 0 | 5 | 07-07-2026 |
| 9 | LÄSARTEXT: Konfirmandjubileum Ovikens gamla kyrka | 0 | 10 | 20-07-2026 |
| 10 | Test URL et redirection Modif | 0 | 10 | 11-06-2026 |