debugger_admin.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. <?xml version="1.0" encoding='ISO-8859-1'?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!-- Include general documentation entities -->
  5. <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
  6. %docentities;
  7. ]>
  8. <!-- Module User's Guide -->
  9. <chapter>
  10. <title>&adminguide;</title>
  11. <section>
  12. <title>Overview</title>
  13. <para>
  14. This module provides an interactive config file debugger. It can print
  15. a trace of config script execution for a SIP message to log and set
  16. breakpoints on every script action, allowing step-by-step execution of
  17. the routing and response scripts.
  18. </para>
  19. <para>
  20. Debugging can be done from local or remote host via RPC interface (e.g.,
  21. XMLRPC, &sercmd;, siremis).
  22. </para>
  23. <para>
  24. The framework to set breakpoints on specific actions and config lines
  25. is not exported to RPC. Each action can be accompanied by an
  26. breakpoint or you can use dbg_breakpoint() function to set a breakpoint
  27. at certain line. Global breakpoints can be enabled/disabled at runtime.
  28. The script running trace can also be enabled/disabled at runtime.
  29. </para>
  30. <para>
  31. When the SIP router process is stopped at a breakpoint, you can
  32. investigate the values of any pseudo-variables. Note that some of
  33. pseudo-variables may produce memory leaks; a fix is planned in the
  34. future (here fall pseudo-variables with dynamic name such as htable,
  35. sqlops). References to SIP message, avps, headers, script and shared
  36. variables are safe.
  37. </para>
  38. </section>
  39. <section>
  40. <title>Dependencies</title>
  41. <section>
  42. <title>&kamailio; Modules</title>
  43. <para>
  44. The following modules must be loaded before this module:
  45. <itemizedlist>
  46. <listitem>
  47. <para>
  48. <emphasis>none</emphasis>.
  49. </para>
  50. </listitem>
  51. </itemizedlist>
  52. </para>
  53. </section>
  54. <section>
  55. <title>External Libraries or Applications</title>
  56. <para>
  57. The following libraries or applications must be installed before running
  58. &kamailio; with this module loaded:
  59. <itemizedlist>
  60. <listitem>
  61. <para>
  62. <emphasis>None</emphasis>.
  63. </para>
  64. </listitem>
  65. </itemizedlist>
  66. </para>
  67. </section>
  68. </section>
  69. <section>
  70. <title>Parameters</title>
  71. <section id="dbg.p.cfgtrace">
  72. <title><varname>cfgtrace</varname> (int)</title>
  73. <para>
  74. Control whether the config script trace is enabled or disabled
  75. at startup. You can change the value at runtime without
  76. restart, globally or per process.
  77. </para>
  78. <para>
  79. <emphasis>
  80. Default value is <quote>0</quote> (disabled).
  81. </emphasis>
  82. </para>
  83. <example>
  84. <title>Set <varname>cfgtrace</varname> parameter</title>
  85. <programlisting format="linespecific">
  86. ...
  87. modparam("debugger", "cfgtrace", 1)
  88. ...
  89. </programlisting>
  90. </example>
  91. </section>
  92. <section id="dbg.p.breakpoint">
  93. <title><varname>breakpoint</varname> (int)</title>
  94. <para>
  95. Control whether every line (global) breakpoint is enabled
  96. or disabled at startup.
  97. </para>
  98. <para>
  99. <emphasis>
  100. Default value is <quote>0</quote> (disabled).
  101. </emphasis>
  102. </para>
  103. <example>
  104. <title>Set <varname>breakpoint</varname> parameter</title>
  105. <programlisting format="linespecific">
  106. ...
  107. modparam("debugger", "breakpoint", 1)
  108. ...
  109. </programlisting>
  110. </example>
  111. </section>
  112. <section id="dbg.p.log_level">
  113. <title><varname>log_level</varname> (int)</title>
  114. <para>
  115. What log level is to be used to print module-specific messages.
  116. </para>
  117. <para>
  118. <emphasis>
  119. Default value is <quote>-1</quote> (L_ERR).
  120. </emphasis>
  121. </para>
  122. <example>
  123. <title>Set <varname>log_level</varname> parameter</title>
  124. <programlisting format="linespecific">
  125. ...
  126. modparam("debugger", "log_level", 1)
  127. ...
  128. </programlisting>
  129. </example>
  130. </section>
  131. <section id="dbg.p.log_level_name">
  132. <title><varname>log_level_name</varname> (str)</title>
  133. <para>
  134. What log level name is to be used to print cfg trace messages.
  135. </para>
  136. <para>
  137. <emphasis>
  138. Default value is <quote>NULL</quote> (use default log names).
  139. </emphasis>
  140. </para>
  141. <example>
  142. <title>Set <varname>log_level_name</varname> parameter</title>
  143. <programlisting format="linespecific">
  144. ...
  145. modparam("debugger", "log_level_name", "exec")
  146. ...
  147. </programlisting>
  148. </example>
  149. </section>
  150. <section id="dbg.p.log_facility">
  151. <title><varname>log_facility</varname> (str)</title>
  152. <para>
  153. Which log facility is to be used to print module-specific messages.
  154. By using this setting, you can configure syslog to send debug
  155. messages to a separate log channel, like a specific kamailio-debug log file.
  156. </para>
  157. <para>
  158. <emphasis>
  159. Default value is <quote>NULL</quote> (default from core).
  160. </emphasis>
  161. </para>
  162. <example>
  163. <title>Set <varname>log_facility</varname> parameter</title>
  164. <programlisting format="linespecific">
  165. ...
  166. modparam("debugger", "log_facility", "LOG_DAEMON")
  167. ...
  168. </programlisting>
  169. </example>
  170. </section>
  171. <section id="dbg.p.log_prefix">
  172. <title><varname>log_prefix</varname> (str)</title>
  173. <para>
  174. String to print before any module-specific messages.
  175. </para>
  176. <para>
  177. <emphasis>
  178. Default value is <quote>*** cfgtrace:</quote>.
  179. </emphasis>
  180. </para>
  181. <example>
  182. <title>Set <varname>log_prefix</varname> parameter</title>
  183. <programlisting format="linespecific">
  184. ...
  185. modparam("debugger", "log_prefix", "from-debugger-with-love:")
  186. ...
  187. </programlisting>
  188. </example>
  189. </section>
  190. <section id="dbg.p.step_usleep">
  191. <title><varname>step_usleep</varname> (int)</title>
  192. <para>
  193. Microseconds to sleep before checking for new commands when
  194. waiting at a breakpoint.
  195. </para>
  196. <para>
  197. <emphasis>
  198. Default value is <quote>100000</quote> (that is 0.1 sec).
  199. </emphasis>
  200. </para>
  201. <example>
  202. <title>Set <varname>step_usleep</varname> parameter</title>
  203. <programlisting format="linespecific">
  204. ...
  205. modparam("debugger", "step_usleep", 500000)
  206. ...
  207. </programlisting>
  208. </example>
  209. </section>
  210. <section id="dbg.p.step_loops">
  211. <title><varname>step_loops</varname> (int)</title>
  212. <para>
  213. How many sleeps of 'step_usleep' the RPC process performs when
  214. waiting for a reply from a worker process before responding to RPC.
  215. This avoids blocking RPC process forever in case the worker
  216. process 'forgets' to write back a reply.
  217. </para>
  218. <para>
  219. <emphasis>
  220. Default value is <quote>200</quote>.
  221. </emphasis>
  222. </para>
  223. <example>
  224. <title>Set <varname>step_loops</varname> parameter</title>
  225. <programlisting format="linespecific">
  226. ...
  227. modparam("debugger", "step_loops", 100)
  228. ...
  229. </programlisting>
  230. </example>
  231. </section>
  232. <section id="dbg.p.mod_hash_size">
  233. <title><varname>mod_hash_size</varname> (int)</title>
  234. <para>
  235. Used to compute power of two as size of internal hash table to store levels
  236. per module (e.g., if its set to 4, internal hash table has 16 slots). This
  237. parameter is accesible readonly via the Kamailio config framework.
  238. </para>
  239. <para>
  240. <emphasis>
  241. Default value is <quote>0</quote> - feature disabled.
  242. </emphasis>
  243. </para>
  244. <example>
  245. <title>Set <varname>mod_hash_size</varname> parameter</title>
  246. <programlisting format="linespecific">
  247. ...
  248. modparam("debugger", "mod_hash_size", 5)
  249. ...
  250. </programlisting>
  251. </example>
  252. </section>
  253. <section id="dbg.p.mod_level_mode">
  254. <title><varname>mod_level_mode</varname> (int)</title>
  255. <para>
  256. Enable or disable per module log level (0 - disabled, 1 - enabled).
  257. This parameter is tunable via the Kamailio config framework.
  258. </para>
  259. <para>
  260. <emphasis>
  261. Default value is <quote>0</quote>.
  262. </emphasis>
  263. </para>
  264. <example>
  265. <title>Set <varname>mod_level_mode</varname> parameter</title>
  266. <programlisting format="linespecific">
  267. ...
  268. modparam("debugger", "mod_level_mode", 1)
  269. ...
  270. </programlisting>
  271. </example>
  272. </section>
  273. <section id="dbg.p.mod_level">
  274. <title><varname>mod_level</varname> (str)</title>
  275. <para>
  276. Specify module log level - the value must be in the format:
  277. modulename=level. The parameter can be set many times. For core
  278. log level, use module name 'core'.
  279. </para>
  280. <example>
  281. <title>Set <varname>mod_level</varname> parameter</title>
  282. <programlisting format="linespecific">
  283. ...
  284. modparam("debugger", "mod_level", "core=3")
  285. modparam("debugger", "mod_level", "tm=3")
  286. ...
  287. </programlisting>
  288. </example>
  289. </section>
  290. <section id="dbg.p.log_assign">
  291. <title><varname>log_assign</varname> (int)</title>
  292. <para>
  293. Enable or disable log assign actions on config (0 - disabled, 1 - enabled).
  294. </para>
  295. <para>
  296. <emphasis>
  297. Default value is <quote>0</quote>.
  298. </emphasis>
  299. </para>
  300. <example>
  301. <title>Set <varname>log_assign</varname> parameter</title>
  302. <programlisting format="linespecific">
  303. ...
  304. modparam("debugger", "log_assign", 1)
  305. ...
  306. </programlisting>
  307. </example>
  308. </section>
  309. <section id="dbg.p.cfgpkgcheck">
  310. <title><varname>cfgpkgcheck</varname> (int)</title>
  311. <para>
  312. If set, before each config action is done pkg memory check,
  313. useful to detect buffer overflows.
  314. </para>
  315. <para>
  316. <emphasis>
  317. Default value is <quote>0</quote> (disabled).
  318. </emphasis>
  319. </para>
  320. <example>
  321. <title>Set <varname>cfgpkgcheck</varname> parameter</title>
  322. <programlisting format="linespecific">
  323. ...
  324. modparam("debugger", "cfgpkgcheck", 1)
  325. ...
  326. </programlisting>
  327. </example>
  328. </section>
  329. <section id="dbg.p.reset_msgid">
  330. <title><varname>reset_msgid</varname> (int)</title>
  331. <para>
  332. Used to enable or disable the ability to reset the msgid ($mi)
  333. through the dbg.reset_msgid RPC command. (0 - disabled, 1 - enabled).
  334. </para>
  335. <para>
  336. <emphasis>
  337. Default value is <quote>0</quote> - feature disabled.
  338. </emphasis>
  339. </para>
  340. <example>
  341. <title>Set <varname>reset_msgid</varname> parameter</title>
  342. <programlisting format="linespecific">
  343. ...
  344. modparam("debugger", "reset_msgid", 1)
  345. ...
  346. </programlisting>
  347. </example>
  348. </section>
  349. </section>
  350. <section>
  351. <title>Functions</title>
  352. <section id="dbg.f.db_breakpoint">
  353. <title>
  354. <function moreinfo="none">dbg_breakpoint(mode)</function>
  355. </title>
  356. <para>
  357. Anchor a breakpoint at the current line of the config (the one
  358. on which this function is called). The 'mode' specifies whether
  359. the breakpoint is enabled (1) or disabled (0) at startup.
  360. </para>
  361. <para>
  362. Note that this version of the module does not export this anchors to RPC for
  363. interactive debugging (temporarily disabled).
  364. </para>
  365. <example>
  366. <title><function>dbg_breakpoint</function> usage</title>
  367. <programlisting format="linespecific">
  368. ...
  369. if($si=="10.0.0.10")
  370. dbg_breakpoint("1");
  371. ...
  372. </programlisting>
  373. </example>
  374. </section>
  375. <section id="dbg.f.dbg_pv_dump">
  376. <title>
  377. <function moreinfo="none">dbg_pv_dump([mask] [, level])</function>
  378. </title>
  379. <para>
  380. Prints the content of pv_cache on json format.
  381. Defaults are mask=31 and level = "L_DBG"
  382. </para>
  383. <para>
  384. </para>
  385. <itemizedlist>
  386. <para><emphasis>mask</emphasis> - Controls the content to dump:
  387. </para>
  388. <itemizedlist>
  389. <listitem><para>
  390. 1 - dump null values
  391. </para></listitem>
  392. <listitem><para>
  393. 2 - dump avp vars
  394. </para></listitem>
  395. <listitem><para>
  396. 4 - dump script vars
  397. </para></listitem>
  398. <listitem><para>
  399. 8 - dump xavp vars
  400. </para></listitem>
  401. <listitem><para>
  402. 16 - dump DP_OTHER vars
  403. </para></listitem>
  404. </itemizedlist>
  405. <para><emphasis>level</emphasis> - The level that will be used in LOG function. It can be:
  406. </para>
  407. <itemizedlist>
  408. <listitem><para>
  409. L_ALERT - log level -5
  410. </para></listitem>
  411. <listitem><para>
  412. L_BUG - log level -4
  413. </para></listitem>
  414. <listitem><para>
  415. L_CRIT - log level -3
  416. </para></listitem>
  417. <listitem><para>
  418. L_ERR - log level -1
  419. </para></listitem>
  420. <listitem><para>
  421. L_WARN - log level 0
  422. </para></listitem>
  423. <listitem><para>
  424. L_NOTICE - log level 1
  425. </para></listitem>
  426. <listitem><para>
  427. L_INFO - log level 2
  428. </para></listitem>
  429. <listitem><para>
  430. L_DBG - log level 3
  431. </para></listitem>
  432. </itemizedlist>
  433. </itemizedlist>
  434. <example>
  435. <title><function>dbg_pv_dump</function> usage</title>
  436. <programlisting format="linespecific">
  437. ...
  438. $var(temp) = 1;
  439. $avp(s:more_avp) = 2;
  440. $avp(s:more_avp) = 3;
  441. $xavp(x=>more) = "bye";
  442. $xavp(x[0]=>more) = "hi";
  443. $xavp(x[0]=>other) = 1;
  444. $xavp(x[0]=>other) = 2;
  445. $xavp(x=>different) = "foo";
  446. $var(empty) = $null;
  447. dbg_pv_dump(30, "L_DBG");
  448. ...
  449. </programlisting>
  450. <para>Output</para>
  451. <programlisting format="linespecific">
  452. ...
  453. 4(30943) DEBUG: debugger [debugger_api.c:1613]: dbg_dump_json(): {"$sp":37597,"$var(rc)":0,"$var(temp)":1,"$avp(more_avp)":[3,2],"$si":"127.0.0.1","$rc":0,"$xavp(x)":[{"different":["foo"]},{"other":[2,1],"more":["hi","bye"]}],"$T_branch_idx":0,"$var(empty)":0}
  454. ...
  455. </programlisting>
  456. </example>
  457. </section>
  458. </section>
  459. <section>
  460. <title>Exported RPC Functions</title>
  461. <section id="dbg.r.ls">
  462. <title>
  463. <function moreinfo="none">dbg.ls</function>
  464. </title>
  465. <para>
  466. List &kamailio; processes with info related to interactive
  467. debugging.
  468. </para>
  469. <para>
  470. Name: <emphasis>dbg.list</emphasis>
  471. </para>
  472. <para>Parameters:</para>
  473. <itemizedlist>
  474. <listitem><para>_pid_ : pid for which to list the details. If 'pid' is
  475. omitted then will print for all processes.</para></listitem>
  476. </itemizedlist>
  477. <para>
  478. Examples of use with &sercmd;:
  479. </para>
  480. <programlisting format="linespecific">
  481. dbg.ls
  482. dbg.ls 1234
  483. </programlisting>
  484. </section>
  485. <section id="dbg.r.trace">
  486. <title>
  487. <function moreinfo="none">dbg.trace</function>
  488. </title>
  489. <para>
  490. Control config script running trace.
  491. </para>
  492. <para>
  493. Name: <emphasis>dbg.trace</emphasis>
  494. </para>
  495. <para>Parameters:</para>
  496. <itemizedlist>
  497. <listitem><para>_cmd_ : command can be 'on' or 'off' to
  498. enable or disable tracing for one or all processes.</para>
  499. </listitem>
  500. <listitem><para>_pid_ : pid for which to list the details. If 'pid' is
  501. omitted, then details for all processes will be printed.</para>
  502. </listitem>
  503. </itemizedlist>
  504. <para>
  505. Examples for using with &sercmd;:
  506. </para>
  507. <programlisting format="linespecific">
  508. dbg.trace on
  509. dbg.trace off
  510. dbg.trace on 1234
  511. </programlisting>
  512. </section>
  513. <section id="dbg.r.bp">
  514. <title>
  515. <function moreinfo="none">dbg.bp</function>
  516. </title>
  517. <para>
  518. Control breakpoints and config execution.
  519. </para>
  520. <para>
  521. Name: <emphasis>dbg.bp</emphasis>
  522. </para>
  523. <para>Parameters:</para>
  524. <itemizedlist>
  525. <listitem><para>_cmd_ : command, see next section for
  526. the list of available values.</para>
  527. </listitem>
  528. <listitem><para>_pid_ : process id for which to apply the command.
  529. If 'pid' is omitted, then the inner command will be applied
  530. to all processes.</para>
  531. </listitem>
  532. <listitem><para>_params_ : extra params specific for each command.</para>
  533. </listitem>
  534. </itemizedlist>
  535. <para>Commands:</para>
  536. <itemizedlist>
  537. <listitem>
  538. <para>on - turn on breakpoints. Pid parameter is optional.
  539. </para>
  540. </listitem>
  541. <listitem>
  542. <para>off - turn off breakpoints. Pid parameter is optional.
  543. </para>
  544. </listitem>
  545. <listitem>
  546. <para>keep - keep breakpoints only for pid given as parameter
  547. </para>
  548. </listitem>
  549. <listitem>
  550. <para>release - disable breakpoints for processes that are
  551. not waiting at a breakpoint. Pid parameter is optional.</para>
  552. </listitem>
  553. <listitem>
  554. <para>next - run the action under breakpoint and stop at next one
  555. (step by step execution). Pid parameter is mandatory.
  556. </para>
  557. </listitem>
  558. <listitem>
  559. <para>move - run the action under breakpoint and remove the rest
  560. of breakpoints (continue execution without stopping again at next
  561. actions). Pid parameter is mandatory.</para>
  562. </listitem>
  563. <listitem>
  564. <para>show - print details about the current breakpoint for pid.
  565. Pid parameter is mandatory.</para>
  566. </listitem>
  567. <listitem>
  568. <para>eval - evaluate a pseudo-variable and print the result in RPC
  569. Pid parameter is mandatory.</para>
  570. </listitem>
  571. <listitem>
  572. <para>log - evaluate a pseudo-variable and print the result in SIP
  573. router logs. Pid parameter is mandatory.</para>
  574. </listitem>
  575. </itemizedlist>
  576. <para>
  577. Examples for using with &sercmd;:
  578. </para>
  579. <programlisting format="linespecific">
  580. dbg.bp off
  581. dbg.bp on
  582. dbg.bp release
  583. dbg.bp on 1234
  584. dbg.bp eval 1234 $fu
  585. dbg.bp move 1234
  586. </programlisting>
  587. </section>
  588. <section id="dbg.r.mod_level">
  589. <title>
  590. <function moreinfo="none">dbg.mod_level</function>
  591. </title>
  592. <para>
  593. Specify module log level.
  594. </para>
  595. <para>
  596. Name: <emphasis>dbg.mod_level</emphasis>
  597. </para>
  598. <para>Parameters:</para>
  599. <itemizedlist>
  600. <listitem><para>_module_ : For core log
  601. level, use module name 'core'</para></listitem>
  602. <listitem><para>_level_ : integer</para></listitem>
  603. </itemizedlist>
  604. <para>
  605. Examples of use with &sercmd;:
  606. </para>
  607. <programlisting format="linespecific">
  608. dbg.mod_level core 3
  609. dbg.mod_level tm 3
  610. </programlisting>
  611. </section>
  612. <section id="dbg.r.reset_msgid">
  613. <title>
  614. <function moreinfo="none">dbg.reset_msgid</function>
  615. </title>
  616. <para>
  617. Resets the message sequence ($mi). Internally there is no real change.
  618. This can be useful for unit test cases in order to be able to replicate
  619. exactly the same kamailio output.
  620. You need to set the debugger parameter reset_msgid to 1 to activate this
  621. functionallity.
  622. </para>
  623. <para>
  624. Name: <emphasis>dbg.reset_msgid</emphasis>
  625. </para>
  626. <para>
  627. Examples of use with &sercmd;:
  628. </para>
  629. <programlisting format="linespecific">
  630. dbg.reset_msgid
  631. </programlisting>
  632. </section>
  633. </section>
  634. <section>
  635. <title>Usage</title>
  636. <para>
  637. A common usage is to investigate the execution path for a specific
  638. SIP message. Just enable cfg running trace, send the message and
  639. watch the logs.
  640. </para>
  641. <para>
  642. Another typical usage is to do interactive debugging and run
  643. each line of the route blocks of the configuration file step-by-step for a
  644. particular SIP message.
  645. </para>
  646. <para>
  647. You need to connect using &sercmd; (or other RPC client) to &kamailio;.
  648. Then you can enable cfg breakpoints and send the SIP message. One
  649. process will be in waiting state ('state' field different than 0 when
  650. you do dbg.ls). Calling dbg.release will set the other &kamailio;
  651. processes in no-breakpoint mode so they can process other SIP messages
  652. without need to interact with them.
  653. </para>
  654. <para>
  655. A process blocked at a breakpoint is waiting for a command. Use
  656. 'dbg.bp next pid' to execute the current action and stop at the next
  657. one. 'dbg.bp eval pid PV' can be used to retrieve the value of PV. Once
  658. you are done and want to continue the execution of the config wihtout
  659. interaction use 'dbg.bp move pid'.
  660. </para>
  661. <para>
  662. Example of a session:
  663. </para>
  664. <programlisting format="linespecific">
  665. ...
  666. &sercmd;> dbg.ls
  667. {
  668. entry: 0
  669. pid: 6393
  670. set: 3
  671. state: 0
  672. in.pid: 0
  673. in.cmd: 0
  674. }
  675. {
  676. entry: 1
  677. pid: 6394
  678. set: 3
  679. state: 0
  680. in.pid: 0
  681. in.cmd: 0
  682. }
  683. ...
  684. {
  685. entry: 9
  686. pid: 6402
  687. set: 3
  688. state: 1
  689. in.pid: 0
  690. in.cmd: 0
  691. }
  692. &sercmd;> dbg.bp show 6402
  693. at bkp [/etc/kamailio/debugger.cfg:369] a=6 n=route
  694. &sercmd;> dbg.bp next 6402
  695. exec [/etc/kamailio/debugger.cfg:369] a=6 n=route
  696. &sercmd;> dbg.bp next 6402
  697. exec [/etc/kamailio/debugger.cfg:462] a=17 n=if
  698. &sercmd;> dbg.bp eval 6402 $fu
  699. $fu : t=str v=sip:[email protected]
  700. &sercmd;> dbg.bp move 6402
  701. 200 ok
  702. ...
  703. </programlisting>
  704. <para>
  705. Running the config trace looks like:
  706. </para>
  707. <programlisting format="linespecific">
  708. ...
  709. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=368 a=6 n=route
  710. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=461 a=17 n=if
  711. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=456 a=26 n=mf_process_maxfwd_header
  712. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=466 a=17 n=if
  713. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=461 a=27 n=sanity_check
  714. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=371 a=6 n=route
  715. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=659 a=3 n=return
  716. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=374 a=6 n=route
  717. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=501 a=17 n=if
  718. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=470 a=25 n=has_totag
  719. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=386 a=17 n=if
  720. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=379 a=26 n=is_method
  721. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=386 a=25 n=t_check_trans
  722. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=389 a=6 n=route
  723. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=643 a=3 n=return
  724. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=393 a=26 n=remove_hf
  725. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=398 a=17 n=if
  726. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=394 a=26 n=is_method
  727. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=404 a=17 n=if
  728. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=398 a=26 n=is_method
  729. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=404 a=6 n=route
  730. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=682 a=17 n=if
  731. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=409 a=6 n=route
  732. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=575 a=17 n=if
  733. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=550 a=26 n=is_method
  734. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=551 a=3 n=return
  735. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=412 a=6 n=route
  736. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=518 a=17 n=if
  737. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=505 a=26 n=is_method
  738. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=513 a=17 n=if
  739. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=507 a=42 n=isflagset
  740. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=516 a=17 n=if
  741. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=513 a=26 n=save
  742. 9(6285) ERROR: *** cfgtrace: c=[/etc/kamailio/debugger.cfg] l=516 a=3 n=exit
  743. ...
  744. </programlisting>
  745. <para>
  746. The above example is for a registration with default config for
  747. version 3.1.0, without authentication. Listed fields are:
  748. 'c' - config file; 'l' - line; 'a' - internal action id;
  749. 'n' - name of executed action. 'ERROR' prefix is printed
  750. because these messages were sent to the L_ERR log level.
  751. </para>
  752. </section>
  753. </chapter>