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 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036
|
Acc Module
Jiri Kuthan
iptel.org
Ramona-Elena Modroiu
voice-system.ro
Edited by
Bogdan-Andrei Iancu
Copyright 2002, 2003 FhG FOKUS
Copyright 2004, 2005 voice-system.ro
_________________________________________________________
Table of Contents
1. User's Guide
1.1. Overview
1.1.1. General Example
1.2. Extra accounting
1.2.1. Overview
1.2.2. Definitions and syntax
1.2.3. How it works
1.3. Multi Call-Legs accounting
1.3.1. Overview
1.3.2. Configuration
1.3.3. Logged data
1.4. Dependencies
1.4.1. OpenSER Modules
1.4.2. External Libraries or Applications
1.5. Exported Parameters
1.5.1. early_media (integer)
1.5.2. failed_transaction_flag (integer)
1.5.3. report_ack (integer)
1.5.4. report_cancels (integer)
1.5.5. multi_leg_enabled (integer)
1.5.6. src_leg_avp_id (integer)
1.5.7. dst_leg_avp_id (integer)
1.5.8. log_flag (integer)
1.5.9. log_missed_flag (integer)
1.5.10. log_level (integer)
1.5.11. log_fmt (string)
1.5.12. log_extra (string)
1.5.13. radius_config (string)
1.5.14. radius_flag (integer)
1.5.15. radius_missed_flag (integer)
1.5.16. service_type (integer)
1.5.17. radius_extra (string)
1.5.18. diameter_flag (integer)
1.5.19. diameter_missed_flag (integer)
1.5.20. diameter_client_host (string)
1.5.21. diameter_client_port (int)
1.5.22. diamter_extra (string)
1.5.23. db_flag (integer)
1.5.24. db_missed_flag (integer)
1.5.25. db_table_acc (string)
1.5.26. db_table_missed_calls (string)
1.5.27. db_url (string)
1.5.28. db_localtime (int)
1.5.29. acc_sip_from_column (string)
1.5.30. acc_sip_to_column (string)
1.5.31. acc_sip_status_column (string)
1.5.32. acc_sip_method_column (string)
1.5.33. acc_i_uri_column (string)
1.5.34. acc_o_uri_column (string)
1.5.35. acc_sip_callid_column (string)
1.5.36. acc_user_column (string)
1.5.37. acc_time_column (string)
1.5.38. acc_from_uri_column (string)
1.5.39. acc_to_uri_column (string)
1.5.40. acc_totag_column (string)
1.5.41. acc_fromtag_column (string)
1.5.42. acc_domain_column (string)
1.5.43. acc_src_leg_column (string)
1.5.44. acc_dst_leg_column (string)
1.5.45. db_extra (string)
1.5.46. detect_direction (integer)
1.6. Exported Functions
1.6.1. acc_log_request(comment)
1.6.2. acc_db_request(comment, table)
1.6.3. acc_rad_request(comment)
1.6.4. acc_diam_request(comment)
2. Developer's Guide
3. Frequently Asked Questions
List of Examples
1-1. early_media example
1-2. failed_transaction_flag example
1-3. report_ack example
1-4. report_cancels example
1-5. multi_leg_enabled example
1-6. src_leg_avp_id example
1-7. dst_leg_avp_id example
1-8. log_flag example
1-9. log_missed_flag example
1-10. log_level example
1-11. log_fmt example
1-12. log_extra example
1-13. radius_config example
1-14. radius_flag example
1-15. radius_missed_flag example
1-16. service_type example
1-17. radius_extra example
1-18. diameter_flag example
1-19. diameter_missed_flag example
1-20. diameter_client_host example
1-21. diameter_client_host example
1-22. diameter_extra example
1-23. db_flag example
1-24. db_missed_flag example
1-25. db_table_acc example
1-26. db_table_missed_calls example
1-27. db_url example
1-28. db_localtime example
1-29. acc_sip_from_column example
1-30. acc_sip_to_column example
1-31. acc_sip_status_column example
1-32. acc_sip_method_column example
1-33. acc_i_uri_column example
1-34. acc_o_uri_column example
1-35. acc_sip_callid_column example
1-36. acc_user_column example
1-37. acc_time_column example
1-38. acc_from_uri_column example
1-39. acc_to_uri_column example
1-40. acc_totag_column example
1-41. acc_fromtag_column example
1-42. acc_domain_column example
1-43. acc_src_leg_column example
1-44. acc_dst_leg_column example
1-45. db_extra example
1-46. detect_direction example
1-47. acc_log_request usage
1-48. acc_db_request usage
1-49. acc_rad_request usage
1-50. acc_diam_request usage
_________________________________________________________
Chapter 1. User's Guide
1.1. Overview
acc module is used to report on transactions to syslog, SQL,
RADIUS and DIAMETER (beta version).
To report on a transaction using syslog, use "setflag" to mark
a transaction you are interested in with a flag, load
accounting module and set its "log_flag" to the same flag
number. The acc module will then report on completed
transaction to syslog. A typical usage of the module takes no
acc-specific script command -- the functionality binds
invisibly through transaction processing. Script writers just
need to mark the transaction for accounting with proper
setflag.
What is printed depends on module's "log_fmt" parameter. It's
a string with characters specifying which parts of request
should be printed:
* n = Cseq number
* c = Call-Id
* m = Method
* i = Inbound Request-URI
* o = Outbound Request-URI
* p = Username part of inbound Request-URI
* D = Domain part of inbound Request-URI
* f = From header
* r = From TAG
* F = From URI
* 0 = From URI user part
* X = From URI domain part
* t = To header
* d = To TAG
* T = To URI
* 1 = To URI user part
* S = 3-digit Status code from reply
* s = Status
* U = User name (digest, From URI otherwise)
* u = digest Username
If a value is not present in request, "n/a" is accounted
instead.
Note that:
* A single INVITE may produce multiple accounting reports --
that's due to SIP forking feature
* Subsequent ACKs and other requests do not hit the server
and can't be accounted unless record-routing is enforced.
The ACKs assert very little useful information anyway and
reporting on INVITE's 200 makes most accounting scenarios
happy.
* There is no session accounting -- OpenSER maintains no
sessions. If one needs to correlate INVITEs with BYEs for
example for purpose of billing, then it is better done in
the entity which collects accounting information.
Otherwise, SIP server would have to become
sessions-stateful, which would very badly impact its
scalability.
* If a UA fails in middle of conversation, a proxy will
never learn it. In general, a better practice is to
account from an end-device (such as PSTN gateway), which
best knows about call status (including media status and
PSTN status in case of the gateway).
Support for SQL, RADIUS and DIAMETER works analogously. The
SQL support is compiled in the moduls. For RADIUS and DIAMETER
you need to enable it by recompiling the module with properly
set defines: uncomment the RAD_ACC or DDIAM_ACC lines in
modules/acc/Makefile. To compile RADIUS support, you need to
have radiusclient-ng (only versions higher or equal to 0.5.0)
installed on your system which is available from
http://developer.berlios.de/projects/radiusclient-ng/. The
radius client needs to be configured properly. To do so, use
the template at etc/radiusclient.conf and make sure that
module's radius_config parameter points to its location. In
particular, accounting secret must match that one configured
in server and proper dictionary is used (one is available at
etc/sip_dictionary). Uses along with FreeRadius (
http://www.freeradius.org/) and Radiator (
http://www.open.com.au/radiator/) servers have been reported
to us.
For Radius support, the radius libraries must be dynamically
linkable. You need to configure your OS so that OpenSER, when
started, will find it. Typically, you do so by manipulating
LD_LIBRARY_PATH environment variable or configuring ld.so.
_________________________________________________________
1.1.1. General Example
loadmodule "modules/acc/acc.so"
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1)
if (uri=~"sip:+40") /* calls to Romania */ {
if (!proxy_authorize("sip_domain.net" /* realm */,
"subscriber" /* table name */)) {
proxy_challenge("sip_domain.net" /* realm */, "0" /* no qop */
);
break;
}
if (method=="INVITE" & !check_from()) {
log("from!=digest\n");
sl_send_reply("403","Forbidden");
break;
}
setflag(1); /* set for accounting (the same value as in log_flag!)
t_relay(); /* enter stateful mode now */
};
_________________________________________________________
1.2. Extra accounting
1.2.1. Overview
Along the static information defined via FMT-s, ACC modules
allows dynamical selection of extra information to be logged.
There are two classes of information that are accessible by
extra accounting: data from SIP messages (as headers) and
internal OpenSER data (as AVPs).
_________________________________________________________
1.2.2. Definitions and syntax
Selection of extra information is done via xxx_extra
parameters by specifying the names of additional information
you want to log. This information is defined via
pseudo-variables and may include headers or AVPs values or
other message or system values. The syntax of the parameter
is:
* xxx_extra = extra_definition (';'extra_definition)*
* extra_definition = log_name '=' pseudo_variable
The full list of supported pseudo-variables in OpenSER is
availabe at:
http://openser.org/docs/pseudo-variables-1.1.x.html
Via log_name you define how/where the data will be logged. Its
meaning depends of the accounting support which is used:
* LOG accounting - log_name will be just printed along with
the data in log_name=data format;
* DB accounting - log_name will be the name of the DB column
where the data will be stored.IMPORTANT: add in db acc
table the columns corresponding to each extra data;
* RADIUS accounting - log_name will be the AVP name used for
packing the data into RADIUS message. The log_name will be
translated to AVP number via the dictionary. IMPORTANT:
add in RADIUS dictionary the log_name attribute.
* DIAMETER accounting - log_name will be the AVP code used
for packing the data into DIAMETER message. The AVP code
is given directly as integer, since DIAMETER has no
dictionary support yet. IMPORTANT: log_name must be a
number.
_________________________________________________________
1.2.3. How it works
Some pseudo variables may return more than one value (like
headers or AVPs). In this case, the returned values are
embedded in a single string in a comma-separated format.
_________________________________________________________
1.3. Multi Call-Legs accounting
1.3.1. Overview
A SIP call can have multiple legs due forwarding actions. For
example user A calls user B which forwards the call to user C.
There is only one SIP call but with 2 legs ( A to B and B to
C). Accounting the legs of a call is required for proper
billing of the calls (if C is a PSTN number and the call is
billed, user B must pay for the call -as last party modifing
the call destination-, and not A -as initiator of the call.
Call forwarding on server is only one example which shows the
necessity of the having an accounting engine with multiple
legs support.
_________________________________________________________
1.3.2. Configuration
First how it works? The idea is to store in several OpenSER
AVP pairs the originator and destination for each call-leg.
For the A call B and B forwards to C example, the AVP pairs
are (A,B) and (B,C). There are two type of AVPs -source and
destination- which refined a call-leg. The administator must
take care and to properly insert these AVP from the script (in
proper order and with correct type).
When the accouning infomation for the call will be
written/sent, all the call-leg pairs will be added (based on
found AVP pairs).
By default, the multiple call-legs support is disable - it can
be enabled via the multi_leg_enabled module parameter. By
enabling it, you will have also to define the AVPs to be used
for source and destination (which define one call-leg). From
performance reasons, the AVPs may be specified only via IDs.
_________________________________________________________
1.3.3. Logged data
For each call, all the source-destination pairs (which defined
a call-leg) will be looged. How the information will be
actually logged, depends of the data backend:
* syslog -- all pairs will be added to one record string as
src_leg=xxx, dst_leg=xxxx pairs.
* database -- each pair will be separatly logged (due DB
data structure constraints); several records will be
written, the difference between them being only the source
& destination of the corresponding call-leg. with database
support.
Note
You will need to add in your DB (all acc related tables) the
two colums for call-leg definition (source and destination).
* Radius -- all pairs will be added to same Radius
accounting message as RADIUS AVPs - for each call-leg two
RADIUS AVPs will be added: source and destination
Note
You will need to add in your dictionaty the two RADIUS AVPs
used for call-leg definition (source and destination):
Sip-Leg-Source and Sip-Leg-Destination
* Diameter -- not supported. with database support.
_________________________________________________________
1.4. Dependencies
1.4.1. OpenSER Modules
The module depends on the following modules (in the other
words the listed modules must be loaded before this module):
* tm -- Transaction Manager
* a database module -- If database support is used.
* rr -- Record Route, if "detect_direction" module parameter
is enabled.
_________________________________________________________
1.4.2. External Libraries or Applications
The following libraries or applications must be installed
before running OpenSER with this module loaded:
* radiusclient-ng 0.5.0 or higher -- if compiled with RADIUS
support. See
http://developer.berlios.de/projects/radiusclient-ng/.
_________________________________________________________
1.5. Exported Parameters
1.5.1. early_media (integer)
Should be early media (183) accounted too ?
Default value is 0 (no).
Example 1-1. early_media example
modparam("acc", "early_media", 1)
_________________________________________________________
1.5.2. failed_transaction_flag (integer)
Per transaction flag which says if the transaction should be
accounted also in case of failure (status>=300).
Default value is 0 (no flag).
Example 1-2. failed_transaction_flag example
modparam("acc", "failed_transaction_flag", 4)
_________________________________________________________
1.5.3. report_ack (integer)
Shall acc attempt to account e2e ACKs too ? Note that this is
really only an attempt, as e2e ACKs may take a different path
(unless RR enabled) and mismatch original INVITE (e2e ACKs are
a separate transaction).
Default value is 1 (yes).
Example 1-3. report_ack example
modparam("acc", "report_ack", 0)
_________________________________________________________
1.5.4. report_cancels (integer)
By default, CANCEL reporting is disabled -- most accounting
applications are happy to see INVITE's cancellation status.
Turn on if you explicitly want to account CANCEL transactions.
Default value is 0 (no).
Example 1-4. report_cancels example
modparam("acc", "report_cancels", 1)
_________________________________________________________
1.5.5. multi_leg_enabled (integer)
If set to a non 0 value, it will enables the logging of the
call-legs. See Section 1.3 for a detailed description of the
Multi Call-Legs accounting.
Default value is 0 (disabled).
Example 1-5. multi_leg_enabled example
modparam("acc", "multi_leg_enabled", 1)
_________________________________________________________
1.5.6. src_leg_avp_id (integer)
Defines the AVP (ID AVP) which contains the source URI part of
a call-leg. See Section 1.3 for a detailed description of the
Multi Call-Legs accounting.
Default value is 0 (undefined).
Example 1-6. src_leg_avp_id example
modparam("acc", "src_leg_avp_id", 110)
_________________________________________________________
1.5.7. dst_leg_avp_id (integer)
Defines the AVP (ID AVP) which contains the destination URI
part of a call-leg. See Section 1.3 for a detailed description
of the Multi Call-Legs accounting.
Default value is 0 (undefined).
Example 1-7. dst_leg_avp_id example
modparam("acc", "dst_leg_avp_id", 110)
_________________________________________________________
1.5.8. log_flag (integer)
Request flag which needs to be set to account a transaction.
Default value is 1.
Example 1-8. log_flag example
modparam("acc", "log_flag", 2)
_________________________________________________________
1.5.9. log_missed_flag (integer)
Request flag which needs to be set to account missed calls.
Default value is 2.
Example 1-9. log_missed_flag example
modparam("acc", "log_missed_flag", 3)
_________________________________________________________
1.5.10. log_level (integer)
Log level at which accounting messages are issued to syslog.
Default value is L_NOTICE.
Example 1-10. log_level example
modparam("acc", "log_level", 2) # Set log_level to 2
_________________________________________________________
1.5.11. log_fmt (string)
Defines what parts of header fields will be printed to syslog,
see "overview" for list of accepted values.
Default value is "miocfs".
Example 1-11. log_fmt example
modparam("acc", "log_fmt", "mfs")
_________________________________________________________
1.5.12. log_extra (string)
Extra values to be logged.
Default value is NULL.
Example 1-12. log_extra example
modparam("acc", "log_extra", "ua=$hdr(User-Agent);uuid=$avp(i:123)")
_________________________________________________________
1.5.13. radius_config (string)
This parameter is radius specific. Path to radius client
configuration file, set the referred config file correctly and
specify there address of server, shared secret (should equal
that in /usr/local/etc/raddb/clients for freeRadius servers)
and dictionary, see etc for an example of config file and
dictionary.
Default value is
"/usr/local/etc/radiusclient/radiusclient.conf ".
Example 1-13. radius_config example
modparam("acc", "radius_config", "/etc/radiusclient/radiusclient.conf")
_________________________________________________________
1.5.14. radius_flag (integer)
Request flag which needs to be set to account a transaction --
RADIUS specific.
Default value is 1.
Example 1-14. radius_flag example
modparam("acc", "radius_flag", 2)
_________________________________________________________
1.5.15. radius_missed_flag (integer)
Request flag which needs to be set to account missed calls --
RADIUS specific.
Default value is 2.
Example 1-15. radius_missed_flag example
modparam("acc", "radius_missed_flag", 3)
_________________________________________________________
1.5.16. service_type (integer)
Radius service type used for accounting.
Default value is 15 (SIP).
Example 1-16. service_type example
modparam("acc", "service_type", 16)
_________________________________________________________
1.5.17. radius_extra (string)
Extra values to be logged via RADIUS - RADIUS specific.
Default value is NULL.
Example 1-17. radius_extra example
modparam("acc", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)"
)
_________________________________________________________
1.5.18. diameter_flag (integer)
Request flag which needs to be set to account a transaction --
DIAMETER specific.
Default value is 1.
Example 1-18. diameter_flag example
modparam("acc", "diameter_flag", 2)
_________________________________________________________
1.5.19. diameter_missed_flag (integer)
Request flag which needs to be set to account missed calls --
DIAMETER specific.
Default value is 2.
Example 1-19. diameter_missed_flag example
modparam("acc", "diameter_missed_flag", 3)
_________________________________________________________
1.5.20. diameter_client_host (string)
Hostname of the machine where the DIAMETER Client is running
-- DIAMETER specific.
Default value is "localhost".
Example 1-20. diameter_client_host example
modparam("acc", "diameter_client_host", "3a_server.net")
_________________________________________________________
1.5.21. diameter_client_port (int)
Port number where the Diameter Client is listening -- DIAMETER
specific.
Default value is 3000.
Example 1-21. diameter_client_host example
modparam("acc", "diameter_client_port", 3000)
_________________________________________________________
1.5.22. diamter_extra (string)
Extra values to be logged via DIAMETER - DIAMETER specific.
Default value is NULL.
Example 1-22. diameter_extra example
modparam("acc", "diameter_extra", "7846=$hdr(Content-type);7847=$avp(s:
email)")
_________________________________________________________
1.5.23. db_flag (integer)
Request flag which needs to be set to account a transaction --
database specific.
Default value is 1.
Example 1-23. db_flag example
modparam("acc", "db_flag", 2)
_________________________________________________________
1.5.24. db_missed_flag (integer)
Request flag which needs to be set to account missed calls --
database specific.
Default value is 2.
Example 1-24. db_missed_flag example
modparam("acc", "db_missed_flag", 3)
_________________________________________________________
1.5.25. db_table_acc (string)
Table name of accounting successfull calls -- database
specific.
Default value is "acc"
Example 1-25. db_table_acc example
modparam("acc", "db_table_acc", "myacc_table")
_________________________________________________________
1.5.26. db_table_missed_calls (string)
Table name for accounting missed calls -- database specific.
Default value is "missed_calls"
Example 1-26. db_table_missed_calls example
modparam("acc", "db_table_missed_calls", "myMC_table")
_________________________________________________________
1.5.27. db_url (string)
SQL address -- database specific. If is set to NULL or emty
string, the SQL support is disabled.
Default value is "NULL" (SQL disabled).
Example 1-27. db_url example
modparam("acc", "db_url", "mysql://user:password@localhost/openser")
_________________________________________________________
1.5.28. db_localtime (int)
If DB timestamps should follow localtime or GMT time. Any
non-zero value enables this option.
Default value is "0".
Example 1-28. db_localtime example
modparam("acc", "db_localtime", 1) # use GMT time
_________________________________________________________
1.5.29. acc_sip_from_column (string)
Column name in accouting table to store the "sip_from" value.
Default value is "sip_from".
Example 1-29. acc_sip_from_column example
modparam("acc", "acc_sip_from_column", "sip_from")
_________________________________________________________
1.5.30. acc_sip_to_column (string)
Column name in accouting table to store the "sip_to" value.
Default value is "sip_to".
Example 1-30. acc_sip_to_column example
modparam("acc", "acc_sip_to_column", "sip_to")
_________________________________________________________
1.5.31. acc_sip_status_column (string)
Column name in accouting table to store the "sip_status"
value.
Default value is "sip_status".
Example 1-31. acc_sip_status_column example
modparam("acc", "acc_sip_status_column", "sip_status")
_________________________________________________________
1.5.32. acc_sip_method_column (string)
Column name in accouting table to store the "sip_method"
value.
Default value is "sip_method".
Example 1-32. acc_sip_method_column example
modparam("acc", "acc_sip_method_column", "sip_method")
_________________________________________________________
1.5.33. acc_i_uri_column (string)
Column name in accouting table to store the "incoming_URI"
value.
Default value is "i_uri".
Example 1-33. acc_i_uri_column example
modparam("acc", "acc_i_uri_column", "in_uri")
_________________________________________________________
1.5.34. acc_o_uri_column (string)
Column name in accouting table to store the "outgoing_uri"
value.
Default value is "o_uri".
Example 1-34. acc_o_uri_column example
modparam("acc", "acc_o_uri_column", "out_uri")
_________________________________________________________
1.5.35. acc_sip_callid_column (string)
Column name in accouting table to store the "sip_callid"
value.
Default value is "sip_callid".
Example 1-35. acc_sip_callid_column example
modparam("acc", "acc_sip_callid_column", "sip_callid")
_________________________________________________________
1.5.36. acc_user_column (string)
Column name in accouting table to store the "username" value.
Default value is "username".
Example 1-36. acc_user_column example
modparam("acc", "acc_user_column", "username")
_________________________________________________________
1.5.37. acc_time_column (string)
Column name in accouting table to store the "time" value.
Default value is "time".
Example 1-37. acc_time_column example
modparam("acc", "acc_time_column", "time")
_________________________________________________________
1.5.38. acc_from_uri_column (string)
Column name in accouting table to store the "from_uri" value.
Default value is "from_uri".
Example 1-38. acc_from_uri_column example
modparam("acc", "acc_from_uri_column", "from_uri")
_________________________________________________________
1.5.39. acc_to_uri_column (string)
Column name in accouting table to store the "to_uri" value.
Default value is "to_uri".
Example 1-39. acc_to_uri_column example
modparam("acc", "acc_to_uri_column", "to_uri")
_________________________________________________________
1.5.40. acc_totag_column (string)
Column name in accouting table to store the "to_tag" value.
Default value is "totag".
Example 1-40. acc_totag_column example
modparam("acc", "acc_totag_column", "totag")
_________________________________________________________
1.5.41. acc_fromtag_column (string)
Column name in accouting table to store the "from_tag" value.
Default value is "fromtag".
Example 1-41. acc_fromtag_column example
modparam("acc", "acc_fromtag_column", "fromtag")
_________________________________________________________
1.5.42. acc_domain_column (string)
Column name in accouting table to store the "domain" value.
Default value is "domain".
Example 1-42. acc_domain_column example
modparam("acc", "acc_domain_column", "domain")
_________________________________________________________
1.5.43. acc_src_leg_column (string)
Column name in accouting table to store the "source_leg" value
in case of multi-leg accouting.
Default value is "src_leg".
Example 1-43. acc_src_leg_column example
modparam("acc", "acc_src_leg_column", "src_leg")
_________________________________________________________
1.5.44. acc_dst_leg_column (string)
Column name in accouting table to store the "destination_leg"
value in case of multi-leg accouting.
Default value is "dst_leg".
Example 1-44. acc_dst_leg_column example
modparam("acc", "acc_dst_leg_column", "dst_leg")
_________________________________________________________
1.5.45. db_extra (string)
Extra values to be logged into database - DB specific.
Default value is NULL.
Example 1-45. db_extra example
modparam("acc", "db_extra", "ct=$hdr(Content-type); email=$avp(s:email)
")
_________________________________________________________
1.5.46. detect_direction (integer)
Controlles the direction detection for sequential requests. If
enabled (non zero value), for sequential requests with
upstream direction (from callee to caller), the FROM and TO
will be swapped (the direction will be preserved as in the
original request).
It affects all values related to TO and FROM headers (body,
URI, username, domain, TAG).
Default value is 0 (disabled).
Example 1-46. detect_direction example
modparam("acc", "detect_direction", 1)
_________________________________________________________
1.6. Exported Functions
1.6.1. acc_log_request(comment)
acc_request reports on a request, for example, it can be used
to report on missed calls to off-line users who are replied
404 - Not Found. To avoid multiple reports on UDP request
retransmission, you would need to embed the action in stateful
processing.
Meaning of the parameters is as follows:
* comment - Comment to be appended.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1-47. acc_log_request usage
...
acc_log_request("Some comment");
...
_________________________________________________________
1.6.2. acc_db_request(comment, table)
Like acc_log_request, acc_db_request reports on a request. The
report is sent to database at "db_url", in the table referred
to in the second action parameter.
Meaning of the parameters is as follows:
* comment - Comment to be appended.
* table - Database table to be used.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1-48. acc_db_request usage
...
acc_log_request("Some comment", "Some table");
...
_________________________________________________________
1.6.3. acc_rad_request(comment)
Like acc_log_request, acc_rad_request reports on a request. It
reports to radius server as configured in "radius_config".
Meaning of the parameters is as follows:
* comment - Comment to be appended.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1-49. acc_rad_request usage
...
acc_rad_request("Some comment");
...
_________________________________________________________
1.6.4. acc_diam_request(comment)
Like acc_log_request, acc_diam_request reports on a request.
It reports to the configured Diameter server.
Meaning of the parameters is as follows:
* comment - Comment to be appended.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
Example 1-50. acc_diam_request usage
...
acc_diam_request("Some comment");
...
_________________________________________________________
Chapter 2. Developer's Guide
The module does not provide any API to use in other OpenSER
modules.
_________________________________________________________
Chapter 3. Frequently Asked Questions
3.1. Where can I find more about OpenSER?
3.2. Where can I post a question about this module?
3.3. How can I report a bug?
3.1. Where can I find more about OpenSER?
Take a look at http://openser.org/.
3.2. Where can I post a question about this module?
First at all check if your question was already answered on
one of our mailing lists:
* User Mailing List -
http://openser.org/cgi-bin/mailman/listinfo/users
* Developer Mailing List -
http://openser.org/cgi-bin/mailman/listinfo/devel
E-mails regarding any stable OpenSER release should be sent to
<users@openser.org> and e-mails regarding development versions
should be sent to <devel@openser.org>.
If you want to keep the mail private, send it to
<team@openser.org>.
3.3. How can I report a bug?
Please follow the guidelines provided at:
http://sourceforge.net/tracker/?group_id=139143.
|