1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
|
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
%docentities;
]>
<!-- Module User's Guide -->
<chapter>
<title>&adminguide;</title>
<section>
<title>Overview</title>
<para>
This module collects extensions from &kamailio; core.
</para>
<para>
&kamailio; Core CookBook is available at:
<ulink url="http://kamailio.org/dokuwiki/">
http://kamailio.org/dokuwiki/</ulink>
</para>
</section>
<section>
<title>Dependencies</title>
<section>
<title>&kamailio; Modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
<emphasis>No dependencies on other &kamailio; modules</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before running
&kamailio; with this module loaded:
<itemizedlist>
<listitem>
<para>
<emphasis>None</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section>
<title>Functions</title>
<section id="kex.f.setsflag">
<title><function moreinfo="none">setsflag(flag)</function></title>
<para>
Set the script flag.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the script flag to
be set. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>setsflag</function> usage</title>
<programlisting format="linespecific">
...
setsflag("1");
...
$var(flag) = 11;
setsflag("$var(flag)");
...
</programlisting>
</example>
</section>
<section id="kex.f.issflagset">
<title><function moreinfo="none">issflagset(flag)</function></title>
<para>
Return true of the script flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the script flag to
be tested. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>issflagset</function> usage</title>
<programlisting format="linespecific">
...
if(issflagset("1"))
{
...
}
...
</programlisting>
</example>
</section>
<section id="kex.f.resetsflag">
<title><function moreinfo="none">resetsflag(flag)</function></title>
<para>
Reset the script flag.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the script flag to
be reset. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>resetsflag</function> usage</title>
<programlisting format="linespecific">
...
resetsflag("1");
...
</programlisting>
</example>
</section>
<section id="kex.f.setbflag">
<title><function moreinfo="none">setbflag(flag [, branch])</function></title>
<para>
Set the branch flag.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the branch flag to
be set. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
<listitem>
<para>
<emphasis>branch</emphasis> - the index of the branch whose
flag to be set. Can be integer or pseudo-variable with integer
value. If omitted, then branch 0 is used (R-URI).
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>setbflag</function> usage</title>
<programlisting format="linespecific">
...
setbflag("1");
...
$var(flag) = 11;
setbflag("$var(flag)", "1");
...
</programlisting>
</example>
</section>
<section id="kex.f.isbflagset">
<title><function moreinfo="none">isbflagset(flag [, branch])</function></title>
<para>
Return true of the branch flag is set.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the branch flag to
be tested. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
<listitem>
<para>
<emphasis>branch</emphasis> - the index of the branch whose
flag to be set. Can be integer or pseudo-variable with integer
value. If omitted, then branch 0 is used (R-URI).
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>isbflagset</function> usage</title>
<programlisting format="linespecific">
...
if(isbflagset("1"))
{
...
}
...
</programlisting>
</example>
</section>
<section id="kex.f.resetbflag">
<title><function moreinfo="none">resetbflag(flag [, branch])</function></title>
<para>
Reset the branch flag.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>flag</emphasis> - the index of the branch flag to
be reset. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
<listitem>
<para>
<emphasis>branch</emphasis> - the index of the branch whose
flag to be set. Can be integer or pseudo-variable with integer
value. If omitted, then branch 0 is used (R-URI).
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>resetbflag</function> usage</title>
<programlisting format="linespecific">
...
resetbflag("1");
...
</programlisting>
</example>
</section>
<section id="kex.f.setdsturi">
<title><function moreinfo="none">setdsturi(uri)</function></title>
<para>
Set the destination address URI (outbound proxy address).
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>uri</emphasis> - Valid SIP URI representing the
address where to send the request. It must be a static string,
no variables are evaluated at runtime. If you need to set
outbound proxy address via a variable, use assginment to
<emphasis>$du</emphasis>.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>setdsturi</function> usage</title>
<programlisting format="linespecific">
...
setdsturi("sip:10.0.0.10");
...
</programlisting>
</example>
</section>
<section id="kex.f.resetdsturi">
<title><function moreinfo="none">resetdsturi()</function></title>
<para>
Reset the destination address URI (outbound proxy address).
</para>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>resetdsturi</function> usage</title>
<programlisting format="linespecific">
...
resetdsturi();
...
</programlisting>
</example>
</section>
<section id="kex.f.isdsturiset">
<title><function moreinfo="none">isdsturiset()</function></title>
<para>
Check if the destination address URI (outbound proxy address)
is set.
</para>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>isdsturiset</function> usage</title>
<programlisting format="linespecific">
...
if(isdsturiset())
{
...
}
...
</programlisting>
</example>
</section>
<section id="kex.f.pv_printf">
<title><function moreinfo="none">pv_printf(var, str)</function></title>
<para>
Evalues the str and sets the resulting value to variable var. For
backward compatibility reasons, the same function can be executed via
'avp_printf(var, str)'.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>var</emphasis> - name of a writable variable
</para>
</listitem>
<listitem>
<para>
<emphasis>str</emphasis> - string that may contain variables
which will be evaluated at runtime.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_printf</function> usage</title>
<programlisting format="linespecific">
...
pv_printf("$ru", "sip:$rU@$fd");
pv_printf("$avp(x)", "From: $fU - To: $tU");
...
</programlisting>
</example>
</section>
<section id="kex.f.is_myself">
<title><function moreinfo="none">is_myself(uri)</function></title>
<para>
Check if the parameter matches the 'myself' condition (i.e., is
a local IP or domain).
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>uri</emphasis> - Valid SIP URI or IP address to
check against the list of local IP addresses or domains.
The parameter value can contain pseudo-variables.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>is_myself</function> usage</title>
<programlisting format="linespecific">
...
if(is_myself("$fu")) {
...
}
...
</programlisting>
</example>
</section>
<section id="kex.f.setdebug">
<title><function moreinfo="none">setdebug(level)</function></title>
<para>
Set the debug log level per process.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>level</emphasis> - the debug log level to
be set. Can be integer or pseudo-variable with integer value.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>setdebug</function> usage</title>
<programlisting format="linespecific">
...
setdebug("1");
...
$var(level) = 2;
setdebug("$var(level)");
...
</programlisting>
</example>
</section>
<section id="kex.f.resetdebug">
<title><function moreinfo="none">resetdebug()</function></title>
<para>
Reset the local debug log level back to the value of core parameter
'debug'.
</para>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>resetdebug</function> usage</title>
<programlisting format="linespecific">
...
resetdebug();
...
</programlisting>
</example>
</section>
<section id="kex.f.km_append_branch">
<title><function moreinfo="none">km_append_branch([uri])</function></title>
<para>
This function was replaced by append_branch() from corex module, starting with
version 4.0.0.
</para>
</section>
</section>
<section>
<title>MI Commands</title>
<section id="kex.m.arg">
<title>
<function moreinfo="none">arg</function>
</title>
<para>
Print command line arguments.
</para>
<para>
Name: <emphasis>arg</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:arg:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.kill">
<title>
<function moreinfo="none">kill</function>
</title>
<para>
Kill the application.
</para>
<para>
Name: <emphasis>kill</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:kill:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.pwd">
<title>
<function moreinfo="none">pwd</function>
</title>
<para>
Print working directory.
</para>
<para>
Name: <emphasis>pwd</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:pwd:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.uptime">
<title>
<function moreinfo="none">uptime</function>
</title>
<para>
Print uptime.
</para>
<para>
Name: <emphasis>uptime</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:uptime:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.version">
<title>
<function moreinfo="none">version</function>
</title>
<para>
Print version information.
</para>
<para>
Name: <emphasis>version</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:version:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.which">
<title>
<function moreinfo="none">which</function>
</title>
<para>
Print list of available MI commands.
</para>
<para>
Name: <emphasis>which</emphasis>
</para>
<para>Parameters: <emphasis>none</emphasis>.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:which:_reply_fifo_file_
_empty_line_
</programlisting>
</section>
<section id="kex.m.get_statistics">
<title>
<function moreinfo="none">get_statistics</function>
</title>
<para>
Print the list of available internal statistics.
</para>
<para>
Name: <emphasis>get_statistics</emphasis>
</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be printed. If set to 'all' then all statistics are printed; if
set to 'statsgroup:' then all statistics in the group are printed;
if set to 'statsname' then the statistics identified by the name
is printed.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:get_statistics:_reply_fifo_file_
_statsid_
_empty_line_
</programlisting>
</section>
<section id="kex.m.reset_statistics">
<title>
<function moreinfo="none">reset_statistics</function>
</title>
<para>
Reset internal statistics.
</para>
<para>
Name: <emphasis>reset_statistics</emphasis>
</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be reset, give as name.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:reset_statistics:_reply_fifo_file_
_statsid_
_empty_line_
</programlisting>
</section>
<section id="kex.m.clear_statistics">
<title>
<function moreinfo="none">clear_statistics</function>
</title>
<para>
Return statistics and reset their value in one command.
</para>
<para>
Name: <emphasis>get_statistics</emphasis>
</para>
<para>Parameters: <emphasis>statsid</emphasis> - same as for
get_statistics.</para>
<para>
MI FIFO Command Format:
</para>
<programlisting format="linespecific">
:clear_statistics:_reply_fifo_file_
_statsid_
_empty_line_
</programlisting>
</section>
</section>
<section>
<title>RPC Commands</title>
<section id="kex.r.pkg.stats">
<title>
<function moreinfo="none">pkg.stats</function>
</title>
<para>
Print private memory (pkg) usage statistics per process. It
can take optinally a filter to print statistics only for a
specific process or set of processes. If no filter is given,
it prints statistics for all processes.
</para>
<para>The filter can be:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>pid value</emphasis> - print statistics for
specific process pid.
</para>
</listitem>
<listitem>
<para>
<emphasis>rank value</emphasis> - print statistics for
specific process rank.
</para>
</listitem>
<listitem>
<para>
<emphasis>index value</emphasis> - print statistics for
specific index in process table.
</para>
</listitem>
</itemizedlist>
<para>
Examples:
</para>
<programlisting format="linespecific">
&sercmd; pkg.stats
&sercmd; pkg.stats pid 1234
&sercmd; pkg.stats rank 1
&sercmd; pkg.stats index 10
</programlisting>
</section>
<section id="kex.r.stats.get_statistics">
<title>
<function moreinfo="none">stats.get_statistics</function>
</title>
<para>Print the list of available internal statistics.</para>
<para>Parameters: <emphasis>statsid</emphasis> - which statistics to
be printed. If set to 'all' then all statistics are printed; if
set to 'statsgroup:' then all statistics in the group are printed;
if set to 'statsname' then the statistics identified by the name
is printed.</para>
<para>Examples:</para>
<programlisting format="linespecific">
&sercmd; stats.get_statistics all
&sercmd; stats.get_statistics core:
&sercmd; stats.get_statistics unsupported_methods
&sercmd; stats.get_statistics shmem: fwd_requests fwd_replies
</programlisting>
</section>
<section id="kex.r.stats.reset_statistics">
<title>
<function moreinfo="none">stats.reset_statistics</function>
</title>
<para>Reset internal statistics.</para>
<para>
Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
</para>
<para>Examples:</para>
<programlisting format="linespecific">
&sercmd; stats.reset_statistics all
&sercmd; stats.reset_statistics core:
&sercmd; stats.reset_statistics unsupported_methods
&sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies
</programlisting>
</section>
<section id="kex.r.stats.clear_statistics">
<title>
<function moreinfo="none">stats.clear_statistics</function>
</title>
<para>Return statistics and reset their value in one command.</para>
<para>
Parameters: <emphasis>statsid</emphasis> - same as for get_statistics.
</para>
<para>Examples:</para>
<programlisting format="linespecific">
&sercmd; stats.reset_statistics all
&sercmd; stats.reset_statistics core:
&sercmd; stats.reset_statistics unsupported_methods
&sercmd; stats.reset_statistics shmem: fwd_requests fwd_replies
</programlisting>
</section>
</section>
</chapter>
|