Internal support hints: Difference between revisions
(Add workaround for disabling sensor logs popup) |
(Rewrite: consolidate structure, use tables, remove obsolete content (macOS VirtualBox setup), improve organization) |
||
| Line 2: | Line 2: | ||
{{DISPLAYTITLE:Internal Support Hints}} | {{DISPLAYTITLE:Internal Support Hints}} | ||
{{Warning|1= | {{Warning|1=This documentation is for the internal support team. Use at your own risk and test on non-production servers first.}} | ||
= Quick Reference = | |||
<kroki lang="mermaid"> | <kroki lang="mermaid"> | ||
| Line 10: | Line 10: | ||
flowchart LR | flowchart LR | ||
subgraph Test["Testing"] | subgraph Test["Testing"] | ||
A[json_config] --> B[Regexp] | A[json_config] --> B[Regexp/Country] | ||
B --> C | B --> C[Billing] | ||
end | end | ||
subgraph Debug["Debugging"] | subgraph Debug["Debugging"] | ||
D[Jemalloc] --> E[Threads] | |||
E --> F[Charts crash] | |||
end | end | ||
subgraph Tools["Tools"] | subgraph Tools["Tools"] | ||
G[PCAP replay] --> H[Manager API] | |||
H --> I[Scripts] | |||
end | end | ||
</kroki> | </kroki> | ||
= Testing Configuration = | |||
== Override Settings with json_config == | |||
Override config file and database settings without editing files: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 \ | |||
--json_config='[{"id_sensor":"11"},{"interface":"lo"},{"natalias":"8.8.8.8 10.10.100.50"}]' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Tip|Useful for quick testing of specific parameters. Options in json_config take precedence over config file and DB settings.}} | |||
== Regexp / Country / Billing Tests == | |||
= | {| class="wikitable" | ||
! Test Type !! Command | |||
|- | |||
| Regexp pattern || <code>voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --test-regexp '^800...[1-9][0-9]'</code> | |||
|- | |||
| Country by IP || <code>voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --find-country-for-ip=102.140.68.113</code> | |||
|- | |||
* | | Country by number || <code>voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --find-country-for-number 0034*12345</code> | ||
|- | |||
| Billing test || <code>voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --test-billing test_data/billing</code> | |||
|} | |||
'''Billing test file format''' (CSV): | |||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
# calldate,connect_duration,caller,called,sipcallerip,sipcalledip,[exp_price_op],[exp_price_cust] | |||
2018-05-09 12:00,120,+4121353333,+41792826527,192.168.101.10,192.168.101.151,800,8 | 2018-05-09 12:00,120,+4121353333,+41792826527,192.168.101.10,192.168.101.151,800,8 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
= | = License Management = | ||
{| class="wikitable" | |||
! Task !! Command | |||
|- | |||
| Write channel stats to DB || <code>php /var/www/html/php/run.php saveCallStatistics</code> | |||
</ | |- | ||
| Check license details || <code>php /var/www/html/php/run.php checkLicense -v</code> | |||
|- | |||
| Check max peak only || <code>php /var/www/html/php/run.php checkLicense -v <nowiki>|</nowiki> grep max_peak -A3 -B1</code> | |||
|- | |||
| Get token from DB || <code>SELECT content FROM voipmonitor.system WHERE type='license token';</code> | |||
< | |- | ||
php /var/www/html/php/run.php checkLicense -v | | View license file || <code>cat /var/www/html/key.php</code> | ||
</ | |} | ||
< | |||
php /var/www/html/php/run.php checkLicense -v | grep max_peak -A3 -B1 | |||
</ | |||
'''Auto-update license via cron''' (without processing alerts/reports): | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
04 04 * * * root php /var/www/html/php/run.php runUpdateLicenseKey | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= Utility Scripts = | |||
= | {| class="wikitable" | ||
! Script !! Purpose !! Details | |||
|- | |||
| Parallel alerts || Process alerts faster || Enable in '''Settings → System Configuration → Advanced → Number of parallel tasks''' | |||
|- | |||
| [[script-for-big-batchdownloads|Batch download]] || Download >1000 audio files || Bypasses GUI limit of 1000 CDRs | |||
|- | |||
| [[script-for-GUI-cron-control-oom|RAM control]] || Prevent OOM killer || Sets <code>oom_adj_score</code> for PHP threads | |||
|- | |||
| [[script-for-probes-backup|Probe backup]] || Backup all probe configs || Requires SSH access without password | |||
|} | |||
= Debugging = | |||
== Charts Binary Crash == | |||
== Charts Binary Crash | |||
When dmesg or Apache log shows charts crash: | |||
<syntaxhighlight lang="text"> | <syntaxhighlight lang="text"> | ||
charts-x86_64[7321]: segfault at 10 ip 0000000000412553... | |||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Debug procedure:''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Create debug folder | |||
mkdir /tmp/vm_charts_parameters | mkdir /tmp/vm_charts_parameters | ||
After GUI creates | # After GUI creates charts, test with saved arguments | ||
/var/www/html/bin/charts-x86_64 -i /tmp/vm_charts_parameters/files | /var/www/html/bin/charts-x86_64 -i /tmp/vm_charts_parameters/files | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == Memory Leak Detection (Jemalloc) == | ||
=== Compile Jemalloc === | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Download from https://github.com/jemalloc/jemalloc | |||
./autogen.sh | ./autogen.sh | ||
./configure --enable-prof | ./configure --enable-prof | ||
make | make && make install | ||
make install | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === Compile VoIPmonitor with Jemalloc === | ||
Edit <code>config.h</code>: | |||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
#define HAVE_LIBTCMALLOC 0 | #define HAVE_LIBTCMALLOC 0 | ||
| Line 221: | Line 129: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Edit <code>Makefile</code> | Edit <code>Makefile</code>: | ||
<syntaxhighlight lang="makefile"> | <syntaxhighlight lang="makefile"> | ||
# | # Change -O2 to -O0 (disable optimization) | ||
LIBS = ${SHARED_LIBS} -ljemalloc | LIBS = ${SHARED_LIBS} -ljemalloc | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
make clean && make -j8 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Run with Jemalloc === | |||
Modify <code>/etc/init.d/voipmonitor</code> start section: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' /usr/local/src/voipmonitor --config-file $CONFIGFILE --pid-file $PIDFILE $ARGS | LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' /usr/local/src/voipmonitor --config-file $CONFIGFILE --pid-file $PIDFILE $ARGS | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== | === Generate Memory Report === | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Install dependencies | |||
# or: | apt install graphviz ghostscript # or: yum install graphviz ghostscript | ||
# Generate PDF report | |||
echo 'jemalloc_stat_full' | nc 127.0.0.1 5029 > /tmp/je_prof | echo 'jemalloc_stat_full' | nc 127.0.0.1 5029 > /tmp/je_prof | ||
jeprof --show_bytes --pdf /usr/local/src/sniffer/voipmonitor /tmp/je_prof > je_prof.pdf | jeprof --show_bytes --pdf /usr/local/src/sniffer/voipmonitor /tmp/je_prof > je_prof.pdf | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === X88 Mode (Detailed Memory Debug) === | ||
For more detailed memory allocation info: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
cp -a /usr/src/voipmonitor-git /usr/src/sniffer-git-jemalloc-X88 | cp -a /usr/src/voipmonitor-git /usr/src/sniffer-git-jemalloc-X88 | ||
LD_PRELOAD=/usr/local/lib/libjemalloc.so ./voipmonitor -k -v1 -c -X88 | LD_PRELOAD=/usr/local/lib/libjemalloc.so ./voipmonitor -k -v1 -c -X88 | ||
make clean && make | |||
make clean | |||
make | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Run with extra verbose options: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' ./voipmonitor \ | |||
LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' | |||
--config-file=/etc/voipmonitor.conf \ | --config-file=/etc/voipmonitor.conf \ | ||
-v 1,force_log_sqlq,memory_stat_ex,memory_stat_ignore_limit=100000,heapsafe | -v 1,force_log_sqlq,memory_stat_ex,memory_stat_ignore_limit=100000,heapsafe | ||
</syntaxhighlight> | </syntaxhighlight> | ||
See: [[X88-memoryConsumptionDebug]] | |||
== Thread Debugging == | |||
{| class="wikitable" | |||
! Method !! Usage | |||
|- | |||
| Log thread CPU || Add <code>-v1,threads_cpu_log</code> to command line | |||
|- | |||
| List threads || <code>echo 'sniffer_threads' | nc 127.0.0.1 5029</code> | |||
|- | |||
| Extended info || Set <code>sniffer_threads_ext=yes</code> in config (requires compile with <code>SNIFFER_THREADS_EXT true</code>) | |||
|} | |||
</ | |||
'''sniffer_threads options:''' | |||
* <code>no_sort</code> - don't sort by load | |||
* <code>only_traffic</code> - only threads with traffic | |||
* <code>all</code> - include unloaded threads | |||
* <code>line</code> - simple line output | |||
== SS7 Module Compilation == | |||
Requires Wireshark 3.2. | |||
Edit <code>config.h</code>: | |||
<syntaxhighlight lang="c"> | <syntaxhighlight lang="c"> | ||
#define HAVE_LIBWIRESHARK 1 | #define HAVE_LIBWIRESHARK 1 | ||
| Line 395: | Line 203: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Edit <code>Makefile</code>: | |||
<syntaxhighlight lang="makefile"> | <syntaxhighlight lang="makefile"> | ||
-I/usr/include/wireshark | INCLUDE += -I/usr/include/wireshark | ||
SHARED_LIBS += -lwiretap -lwireshark -lwsutil | |||
# Change -O2 to -O0 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| Line 421: | Line 214: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
= | = PCAP Testing = | ||
== | == Basic Methods == | ||
==== | {| class="wikitable" | ||
! Method !! Command | |||
|- | |||
| Basic upload || <code>voipmonitor --config-file=/etc/voipmonitor.conf -r /tmp/file.pcap</code> | |||
|- | |||
| Via packetbuffer (fast) || <code>voipmonitor --config-file=/etc/voipmonitor.conf -rpbsa9: /tmp/file.pcap</code> | |||
|- | |||
| Via packetbuffer (original time) || <code>voipmonitor --config-file=/etc/voipmonitor.conf -rpb: /tmp/file.pcap</code> | |||
|} | |||
== IPFIX Testing == | |||
'''Receiver instance:''' | |||
<syntaxhighlight lang="ini"> | <syntaxhighlight lang="ini"> | ||
ipfix = yes | ipfix = yes | ||
| Line 435: | Line 237: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Sender instance:''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
voipmonitor --config-file=/etc/voipmonitor | voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 \ | ||
--ipfix-client-emulation='/tmp/ipfix.pcap;1.2.3.4;8.8.8.8;127.0.0.1;12345' | |||
# Parameters: pcap_file;client_ip;server_ip;dest_ip;dest_port | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== Tcpreplay == | |||
Enable in <code>/etc/init.d/voipmonitor</code>: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
ARGS="-v 1,dump_call_flags,tcpreplay" | ARGS="-v 1,dump_call_flags,tcpreplay" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Add Layer 2 if missing''' (for captures done on "any" interface): | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
tcprewrite --dlt=enet -i /tmp/x.pcap -o /tmp/x_enet.pcap | |||
tcprewrite --dlt=enet -i /tmp | |||
tcprewrite --enet-dmac=00:55:22:AF:C6:37 --enet-smac=00:44:66:FC:29:AF \ | tcprewrite --enet-dmac=00:55:22:AF:C6:37 --enet-smac=00:44:66:FC:29:AF \ | ||
--infile=/tmp | --infile=/tmp/x_enet.pcap --outfile=/tmp/x_l2.pcap | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Rewrite IP addresses:''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
tcprewrite --pnat=8.7.6.5/32:1.2.3.4/32 -i ./original.pcap -o ./rewritten.pcap | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== SSL/TLS Testing == | |||
== SSL | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
voipmonitor --config-file /etc/test.conf -k -v1,pcap_stat_period=1,_ssl,_tls,_ssldecode \ | |||
-rpba:/tmp/keys.pcap@@/tmp/call.pcap \ | -rpba:/tmp/keys.pcap@@/tmp/call.pcap \ | ||
--json_config='[{"sipport":"8089"},{"ssl":"yes"},{"ssl_ipport":"192.168.0.1:8089"},{"ssl_sessionkey_udp":"yes"},{"ssl_sessionkey_udp_port":"1234 | --json_config='[{"sipport":"8089"},{"ssl":"yes"},{"ssl_ipport":"192.168.0.1:8089"},{"ssl_sessionkey_udp":"yes"},{"ssl_sessionkey_udp_port":"1234"}]' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
For TLS details, see [[Tls]]. | |||
= | = Manager API = | ||
== Via Manager Port (5029) == | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
echo 'listcalls' | nc 127.0.0.1 5029 | |||
echo 'sniffer_stats' | nc 127.0.0.1 5029 | |||
echo 'jemalloc_stat_full' | nc 127.0.0.1 5029 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == Via Server Port (60024) == | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# List connected clients | |||
echo '{"type_connection":"manager_command","command":"active"}' | nc 127.0.0.1 60024 | echo '{"type_connection":"manager_command","command":"active"}' | nc 127.0.0.1 60024 | ||
# Send command to specific probe | |||
echo '{"type_connection":"gui_command","sensor_id":1011,"command":"terminating"}' | nc 127.0.0.1 60024 | echo '{"type_connection":"gui_command","sensor_id":1011,"command":"terminating"}' | nc 127.0.0.1 60024 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | = GUI Workarounds = | ||
=== | == Disable Sensor Logs Popup == | ||
{{Note|There is no built-in GUI option to disable the sensor logs popup shown at admin login.}} | |||
There is no built-in | |||
'''Option 1: Periodic SQL update''' | |||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
UPDATE voipmonitor.log_sensor SET confirmed = 1; | UPDATE voipmonitor.log_sensor SET confirmed = 1; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
'''Option 2: Database trigger (permanent)''' | |||
<syntaxhighlight lang="sql"> | <syntaxhighlight lang="sql"> | ||
DELIMITER $$ | DELIMITER $$ | ||
| Line 764: | Line 316: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== IonCube Crash Fix (Ubuntu 22.04 + PHP 7.4) == | |||
'''Symptom:''' ldap.so crash at login page (CVE-2024-8932). | |||
'''Fix:''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# Backup | |||
cd /usr/lib/php/20190902 && mkdir BKUP && cp -pv ldap.so* BKUP | |||
# Download and extract fixed package | |||
wget https://pl.archive.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb | |||
ar x php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb | |||
# Install and restart | |||
cp -v ./usr/lib/php/20190902/ldap.so /usr/lib/php/20190902/ldap.so | |||
systemctl restart apache2 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= | = Database Operations = | ||
== Rename MySQL Database == | |||
<syntaxhighlight lang=" | Generate RENAME TABLE commands: | ||
<syntaxhighlight lang="sql"> | |||
SELECT CONCAT('RENAME TABLE ',table_schema,'.',table_name,' TO NEW_DB.',table_name,';') | |||
FROM information_schema.TABLES | |||
WHERE table_schema LIKE 'OLD_DB'; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Warning|1=Foreign keys may cause issues during rename.}} | |||
==== | == Spooldir Testing == | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
voipmonitor --config-file /etc/voipmonitor.conf -k -v1 --test-cleanspool-load all | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= Remote Support Access = | |||
== VPN Connection Issues == | |||
When support staff cannot connect to client VPN (Fortinet, etc.): | |||
# '''Cause:''' Support IP not whitelisted on client firewall | |||
# '''Solution:''' Client must add support staff's public IP to their VPN/firewall whitelist | |||
# '''Note:''' This is client-side network administration, not a VoIPmonitor issue | |||
{{Note|1=Don't confuse VPN network access with FortiToken 2FA (GUI authentication).}} | |||
= Additional Resources = | |||
{| class="wikitable" | |||
! Topic !! Link | |||
|- | |||
| HAProxy config || [[sample HAproxy configuration]] | |||
|- | |||
| Hugepages for high CPS || [[voipmonitor and hugepages]] | |||
|- | |||
| Manager API encryption || [[encryption_in_manager_api]] | |||
|- | |||
| Ribbon SBC 7k TLS || [[Ribbon7k monitoring profiles]] | |||
|- | |||
| Support email templates || [[common body of support emails]] | |||
|- | |||
| IPACCOUNT feature || [[ipaccount]] | |||
|- | |||
| DTLS decryption || [[DTLS]] | |||
|- | |||
| Rocky 9 installation || [[Rocky 9]] | |||
|} | |||
'''IOPS testing:''' | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
fio --name=rootTest --ioengine=libaio --rw=randwrite --bs=8k --numjobs=16 \ | |||
--size=1G --runtime=600s --time_based --filename=/root/testW.dat | |||
</syntaxhighlight> | </syntaxhighlight> | ||
= AI Summary for RAG = | |||
'''Summary:''' Internal support documentation for VoIPmonitor team. | '''Summary:''' Internal support documentation for VoIPmonitor team covering testing, debugging, and troubleshooting procedures. Key topics: (1) Testing configuration with <code>--json_config</code> to override settings without editing files; (2) Testing regexp, country assignment, and billing; (3) License management commands (<code>checkLicense</code>, cron updates); (4) Debugging tools including jemalloc for memory leaks, X88 mode for detailed allocation, thread monitoring via <code>sniffer_threads</code> command; (5) PCAP testing methods (basic upload, packetbuffer, IPFIX emulation, tcpreplay with L2 addition and IP rewriting); (6) SS7/Wireshark module compilation; (7) Manager API commands on ports 5029 and 60024; (8) GUI workarounds including sensor logs popup disable (database trigger solution); (9) IonCube ldap.so crash fix for Ubuntu 22.04 + PHP 7.4; (10) VPN access troubleshooting (IP whitelisting on client firewall). | ||
'''Keywords:''' internal support, json_config, testing, regexp, country assignment, billing test, license, checkLicense, jemalloc, memory leak, X88, sniffer_threads, SS7, wireshark, IPFIX, tcpreplay, pcap testing | '''Keywords:''' internal support, json_config, testing, regexp, country assignment, billing test, license, checkLicense, jemalloc, memory leak, X88, sniffer_threads, SS7, wireshark, IPFIX, tcpreplay, pcap testing, Manager API, IonCube, ldap.so, Ubuntu 22.04, VPN access, IP whitelisting, sensor logs popup, log_sensor, database trigger | ||
'''Key Questions:''' | '''Key Questions:''' | ||
* How to test configuration | * How to test configuration without modifying voipmonitor.conf? | ||
* How to test regexp patterns or country assignment? | |||
* How to test regexp patterns | * How to check license channel usage? | ||
* How to debug memory leaks using jemalloc? | |||
* How to compile voipmonitor with jemalloc or SS7 support? | |||
* How to check license channel usage | * How to generate jeprof PDF memory report? | ||
* How to monitor thread load with sniffer_threads? | |||
* How to test IPFIX or replay PCAPs? | |||
* How to debug memory leaks | |||
* How to compile voipmonitor with jemalloc support? | |||
* How to generate jeprof PDF memory | |||
* How to monitor | |||
* How to test IPFIX | |||
* How to add layer 2 to PCAP for tcpreplay? | * How to add layer 2 to PCAP for tcpreplay? | ||
* How to disable sensor logs popup in GUI? | |||
* How to disable | |||
* How to fix IonCube ldap.so crash in Ubuntu 22.04? | * How to fix IonCube ldap.so crash in Ubuntu 22.04? | ||
* How to resolve VPN connection issues for remote support? | |||
Revision as of 16:49, 8 January 2026
⚠️ Warning: This documentation is for the internal support team. Use at your own risk and test on non-production servers first.
Quick Reference
Testing Configuration
Override Settings with json_config
Override config file and database settings without editing files:
voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 \
--json_config='[{"id_sensor":"11"},{"interface":"lo"},{"natalias":"8.8.8.8 10.10.100.50"}]'
💡 Tip: Useful for quick testing of specific parameters. Options in json_config take precedence over config file and DB settings.
Regexp / Country / Billing Tests
| Test Type | Command |
|---|---|
| Regexp pattern | voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --test-regexp '^800...[1-9][0-9]'
|
| Country by IP | voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --find-country-for-ip=102.140.68.113
|
| Country by number | voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --find-country-for-number 0034*12345
|
| Billing test | voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 --test-billing test_data/billing
|
Billing test file format (CSV):
# calldate,connect_duration,caller,called,sipcallerip,sipcalledip,[exp_price_op],[exp_price_cust]
2018-05-09 12:00,120,+4121353333,+41792826527,192.168.101.10,192.168.101.151,800,8
License Management
| Task | Command |
|---|---|
| Write channel stats to DB | php /var/www/html/php/run.php saveCallStatistics
|
| Check license details | php /var/www/html/php/run.php checkLicense -v
|
| Check max peak only | php /var/www/html/php/run.php checkLicense -v | grep max_peak -A3 -B1
|
| Get token from DB | SELECT content FROM voipmonitor.system WHERE type='license token';
|
| View license file | cat /var/www/html/key.php
|
Auto-update license via cron (without processing alerts/reports):
04 04 * * * root php /var/www/html/php/run.php runUpdateLicenseKey
Utility Scripts
| Script | Purpose | Details |
|---|---|---|
| Parallel alerts | Process alerts faster | Enable in Settings → System Configuration → Advanced → Number of parallel tasks |
| Batch download | Download >1000 audio files | Bypasses GUI limit of 1000 CDRs |
| RAM control | Prevent OOM killer | Sets oom_adj_score for PHP threads
|
| Probe backup | Backup all probe configs | Requires SSH access without password |
Debugging
Charts Binary Crash
When dmesg or Apache log shows charts crash:
charts-x86_64[7321]: segfault at 10 ip 0000000000412553...
Debug procedure:
# Create debug folder
mkdir /tmp/vm_charts_parameters
# After GUI creates charts, test with saved arguments
/var/www/html/bin/charts-x86_64 -i /tmp/vm_charts_parameters/files
Memory Leak Detection (Jemalloc)
Compile Jemalloc
# Download from https://github.com/jemalloc/jemalloc
./autogen.sh
./configure --enable-prof
make && make install
Compile VoIPmonitor with Jemalloc
Edit config.h:
#define HAVE_LIBTCMALLOC 0
#define HAVE_LIBJEMALLOC 1
Edit Makefile:
# Change -O2 to -O0 (disable optimization)
LIBS = ${SHARED_LIBS} -ljemalloc
make clean && make -j8
Run with Jemalloc
Modify /etc/init.d/voipmonitor start section:
LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' /usr/local/src/voipmonitor --config-file $CONFIGFILE --pid-file $PIDFILE $ARGS
Generate Memory Report
# Install dependencies
apt install graphviz ghostscript # or: yum install graphviz ghostscript
# Generate PDF report
echo 'jemalloc_stat_full' | nc 127.0.0.1 5029 > /tmp/je_prof
jeprof --show_bytes --pdf /usr/local/src/sniffer/voipmonitor /tmp/je_prof > je_prof.pdf
X88 Mode (Detailed Memory Debug)
For more detailed memory allocation info:
cp -a /usr/src/voipmonitor-git /usr/src/sniffer-git-jemalloc-X88
LD_PRELOAD=/usr/local/lib/libjemalloc.so ./voipmonitor -k -v1 -c -X88
make clean && make
Run with extra verbose options:
LD_PRELOAD=/usr/local/lib/libjemalloc.so MALLOC_CONF='prof:true' ./voipmonitor \
--config-file=/etc/voipmonitor.conf \
-v 1,force_log_sqlq,memory_stat_ex,memory_stat_ignore_limit=100000,heapsafe
See: X88-memoryConsumptionDebug
Thread Debugging
| Method | Usage |
|---|---|
| Log thread CPU | Add -v1,threads_cpu_log to command line
|
| List threads | nc 127.0.0.1 5029 |
| Extended info | Set sniffer_threads_ext=yes in config (requires compile with SNIFFER_THREADS_EXT true)
|
sniffer_threads options:
no_sort- don't sort by loadonly_traffic- only threads with trafficall- include unloaded threadsline- simple line output
SS7 Module Compilation
Requires Wireshark 3.2.
Edit config.h:
#define HAVE_LIBWIRESHARK 1
#define LIBWIRESHARK_VERSION 30200
Edit Makefile:
INCLUDE += -I/usr/include/wireshark
SHARED_LIBS += -lwiretap -lwireshark -lwsutil
# Change -O2 to -O0
./configure && make clean && make ss7
PCAP Testing
Basic Methods
| Method | Command |
|---|---|
| Basic upload | voipmonitor --config-file=/etc/voipmonitor.conf -r /tmp/file.pcap
|
| Via packetbuffer (fast) | voipmonitor --config-file=/etc/voipmonitor.conf -rpbsa9: /tmp/file.pcap
|
| Via packetbuffer (original time) | voipmonitor --config-file=/etc/voipmonitor.conf -rpb: /tmp/file.pcap
|
IPFIX Testing
Receiver instance:
ipfix = yes
ipfix_bind_ip = 0.0.0.0
ipfix_bind_port = 12345
Sender instance:
voipmonitor --config-file=/etc/voipmonitor.conf -k -v1 \
--ipfix-client-emulation='/tmp/ipfix.pcap;1.2.3.4;8.8.8.8;127.0.0.1;12345'
# Parameters: pcap_file;client_ip;server_ip;dest_ip;dest_port
Tcpreplay
Enable in /etc/init.d/voipmonitor:
ARGS="-v 1,dump_call_flags,tcpreplay"
Add Layer 2 if missing (for captures done on "any" interface):
tcprewrite --dlt=enet -i /tmp/x.pcap -o /tmp/x_enet.pcap
tcprewrite --enet-dmac=00:55:22:AF:C6:37 --enet-smac=00:44:66:FC:29:AF \
--infile=/tmp/x_enet.pcap --outfile=/tmp/x_l2.pcap
Rewrite IP addresses:
tcprewrite --pnat=8.7.6.5/32:1.2.3.4/32 -i ./original.pcap -o ./rewritten.pcap
SSL/TLS Testing
voipmonitor --config-file /etc/test.conf -k -v1,pcap_stat_period=1,_ssl,_tls,_ssldecode \
-rpba:/tmp/keys.pcap@@/tmp/call.pcap \
--json_config='[{"sipport":"8089"},{"ssl":"yes"},{"ssl_ipport":"192.168.0.1:8089"},{"ssl_sessionkey_udp":"yes"},{"ssl_sessionkey_udp_port":"1234"}]'
For TLS details, see Tls.
Manager API
Via Manager Port (5029)
echo 'listcalls' | nc 127.0.0.1 5029
echo 'sniffer_stats' | nc 127.0.0.1 5029
echo 'jemalloc_stat_full' | nc 127.0.0.1 5029
Via Server Port (60024)
# List connected clients
echo '{"type_connection":"manager_command","command":"active"}' | nc 127.0.0.1 60024
# Send command to specific probe
echo '{"type_connection":"gui_command","sensor_id":1011,"command":"terminating"}' | nc 127.0.0.1 60024
GUI Workarounds
Disable Sensor Logs Popup
ℹ️ Note: There is no built-in GUI option to disable the sensor logs popup shown at admin login.
Option 1: Periodic SQL update
UPDATE voipmonitor.log_sensor SET confirmed = 1;
Option 2: Database trigger (permanent)
DELIMITER $$
CREATE TRIGGER before_insert_log_sensor
BEFORE INSERT ON log_sensor
FOR EACH ROW
BEGIN
SET NEW.confirmed = 1;
END$$
DELIMITER ;
IonCube Crash Fix (Ubuntu 22.04 + PHP 7.4)
Symptom: ldap.so crash at login page (CVE-2024-8932).
Fix:
# Backup
cd /usr/lib/php/20190902 && mkdir BKUP && cp -pv ldap.so* BKUP
# Download and extract fixed package
wget https://pl.archive.ubuntu.com/ubuntu/pool/main/p/php7.4/php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb
ar x php7.4-ldap_7.4.3-4ubuntu2.24_amd64.deb
# Install and restart
cp -v ./usr/lib/php/20190902/ldap.so /usr/lib/php/20190902/ldap.so
systemctl restart apache2
Database Operations
Rename MySQL Database
Generate RENAME TABLE commands:
SELECT CONCAT('RENAME TABLE ',table_schema,'.',table_name,' TO NEW_DB.',table_name,';')
FROM information_schema.TABLES
WHERE table_schema LIKE 'OLD_DB';
⚠️ Warning: Foreign keys may cause issues during rename.
Spooldir Testing
voipmonitor --config-file /etc/voipmonitor.conf -k -v1 --test-cleanspool-load all
Remote Support Access
VPN Connection Issues
When support staff cannot connect to client VPN (Fortinet, etc.):
- Cause: Support IP not whitelisted on client firewall
- Solution: Client must add support staff's public IP to their VPN/firewall whitelist
- Note: This is client-side network administration, not a VoIPmonitor issue
ℹ️ Note: Don't confuse VPN network access with FortiToken 2FA (GUI authentication).
Additional Resources
| Topic | Link |
|---|---|
| HAProxy config | sample HAproxy configuration |
| Hugepages for high CPS | voipmonitor and hugepages |
| Manager API encryption | encryption_in_manager_api |
| Ribbon SBC 7k TLS | Ribbon7k monitoring profiles |
| Support email templates | common body of support emails |
| IPACCOUNT feature | ipaccount |
| DTLS decryption | DTLS |
| Rocky 9 installation | Rocky 9 |
IOPS testing:
fio --name=rootTest --ioengine=libaio --rw=randwrite --bs=8k --numjobs=16 \
--size=1G --runtime=600s --time_based --filename=/root/testW.dat
AI Summary for RAG
Summary: Internal support documentation for VoIPmonitor team covering testing, debugging, and troubleshooting procedures. Key topics: (1) Testing configuration with --json_config to override settings without editing files; (2) Testing regexp, country assignment, and billing; (3) License management commands (checkLicense, cron updates); (4) Debugging tools including jemalloc for memory leaks, X88 mode for detailed allocation, thread monitoring via sniffer_threads command; (5) PCAP testing methods (basic upload, packetbuffer, IPFIX emulation, tcpreplay with L2 addition and IP rewriting); (6) SS7/Wireshark module compilation; (7) Manager API commands on ports 5029 and 60024; (8) GUI workarounds including sensor logs popup disable (database trigger solution); (9) IonCube ldap.so crash fix for Ubuntu 22.04 + PHP 7.4; (10) VPN access troubleshooting (IP whitelisting on client firewall).
Keywords: internal support, json_config, testing, regexp, country assignment, billing test, license, checkLicense, jemalloc, memory leak, X88, sniffer_threads, SS7, wireshark, IPFIX, tcpreplay, pcap testing, Manager API, IonCube, ldap.so, Ubuntu 22.04, VPN access, IP whitelisting, sensor logs popup, log_sensor, database trigger
Key Questions:
- How to test configuration without modifying voipmonitor.conf?
- How to test regexp patterns or country assignment?
- How to check license channel usage?
- How to debug memory leaks using jemalloc?
- How to compile voipmonitor with jemalloc or SS7 support?
- How to generate jeprof PDF memory report?
- How to monitor thread load with sniffer_threads?
- How to test IPFIX or replay PCAPs?
- How to add layer 2 to PCAP for tcpreplay?
- How to disable sensor logs popup in GUI?
- How to fix IonCube ldap.so crash in Ubuntu 22.04?
- How to resolve VPN connection issues for remote support?