0

I'm trying find a way to start a single process of Kamailio or OpenSIP server in debugging mode but I unable to do so.

I'm starting the Kamailio with foreground with following command

./kamailio -l 192.168.1.117:5060 -eD

Upon the executing the command I see 4 kamailio process getting started

ps aux | grep kamailio
meetme2meat     27433   0.0  0.0  2461016    464 s004  U+    6:18PM   0:00.00 grep kamailio
meetme2meat     27370   0.0  0.0  2558672   1828 s005  S+    6:16PM   0:00.01 ./kamailio -l 192.168.1.117:5060 -eD
meetme2meat     27369   0.0  0.0  2558672   1836 s005  S+    6:16PM   0:00.01 ./kamailio -l 192.168.1.117:5060 -eD
meetme2meat     27368   0.0  0.0  2558672   1800 s005  S+    6:16PM   0:00.01 ./kamailio -l 192.168.1.117:5060 -eD
meetme2meat     27367   0.0  0.2  2549432   6864 s005  S+    6:16PM   0:00.04 ./kamailio -l 192.168.1.117:5060 -eD

Any clue ??

Viren
  • 5,812
  • 6
  • 45
  • 98

2 Answers2

2

Even in no-fork mode, Kamailio creates some extra processes, because they are needed during runtime, for example the timer process to do retransmissions over UDP. In other words, you can't get a single process.

You can run next commands to see details about the type of processes created:

kamctl ps
miconda
  • 1,754
  • 11
  • 14
0

Here is a very useful guide to debug Kamailio: https://topic.alibabacloud.com/a/opensipskamailio-gdb-code-debugging-method-detailed_8_8_30118342.html

In order to attach to Kamailio's tcp receiver process with debugger use following command:

gdb attach $(/usr/local/sbin/kamcmd -s unix:/var/run/kamailio/kam_ctl ps | grep 'tcp receiver'| awk '{print $1}')

PS: Change unix domain socket of your kamailio "/var/run/kamailio/kam_ctl" with yours.

Erhan
  • 55
  • 5