diff --git a/src/modules/acc/README b/src/modules/acc/README index 77bb6cbc91a..c8dd133d593 100644 --- a/src/modules/acc/README +++ b/src/modules/acc/README @@ -105,28 +105,23 @@ Sven Knoblich 6.26. acc_time_column (string) 6.27. db_extra (string) 6.28. db_insert_mode (integer) - 6.29. diameter_flag (integer) - 6.30. diameter_missed_flag (integer) - 6.31. diameter_client_host (string) - 6.32. diameter_client_port (int) - 6.33. diameter_extra (string) - 6.34. cdr_enable (integer) - 6.35. cdr_expired_dlg_enable (integer) - 6.36. cdr_start_on_confirmed (integer) - 6.37. cdr_facility (integer) - 6.38. cdr_extra (string) - 6.39. cdr_start_id (string) - 6.40. cdr_end_id (string) - 6.41. cdr_duration_id (string) - 6.42. cdr_log_enable (int) - 6.43. cdrs_table (str) - 6.44. time_mode (int) - 6.45. time_attr (str) - 6.46. time_exten (str) - 6.47. time_format (str) - 6.48. reason_from_hf (int) - 6.49. clone_msg (int) - 6.50. cdr_on_failed (int) + 6.29. cdr_enable (integer) + 6.30. cdr_expired_dlg_enable (integer) + 6.31. cdr_start_on_confirmed (integer) + 6.32. cdr_facility (integer) + 6.33. cdr_extra (string) + 6.34. cdr_start_id (string) + 6.35. cdr_end_id (string) + 6.36. cdr_duration_id (string) + 6.37. cdr_log_enable (int) + 6.38. cdrs_table (str) + 6.39. time_mode (int) + 6.40. time_attr (str) + 6.41. time_exten (str) + 6.42. time_format (str) + 6.43. reason_from_hf (int) + 6.44. clone_msg (int) + 6.45. cdr_on_failed (int) 7. Functions @@ -167,32 +162,27 @@ Sven Knoblich 1.26. acc_time_column example 1.27. db_extra example 1.28. db_insert_mode example - 1.29. diameter_flag example - 1.30. diameter_missed_flag example - 1.31. diameter_client_host example - 1.32. diameter_client_host example - 1.33. diameter_extra example - 1.34. cdr_enable example - 1.35. cdr_expired_dlg_enable example - 1.36. cdr_start_on_confirmed example - 1.37. cdr_facility example - 1.38. cdr_extra example - 1.39. cdr_start_id example - 1.40. cdr_end_id example - 1.41. cdr_duration_id example - 1.42. cdr_log_enable example - 1.43. cdrs_table example - 1.44. time_mode example - 1.45. time_attr example - 1.46. time_exten example - 1.47. time_format example - 1.48. reason_from_hf - 1.49. clone_msg - 1.50. cdr_on_failed - 1.51. acc_log_request usage - 1.52. acc_db_request usage - 1.53. acc_db_request usage - 1.54. acc_diam_request usage + 1.29. cdr_enable example + 1.30. cdr_expired_dlg_enable example + 1.31. cdr_start_on_confirmed example + 1.32. cdr_facility example + 1.33. cdr_extra example + 1.34. cdr_start_id example + 1.35. cdr_end_id example + 1.36. cdr_duration_id example + 1.37. cdr_log_enable example + 1.38. cdrs_table example + 1.39. time_mode example + 1.40. time_attr example + 1.41. time_exten example + 1.42. time_format example + 1.43. reason_from_hf + 1.44. clone_msg + 1.45. cdr_on_failed + 1.46. acc_log_request usage + 1.47. acc_db_request usage + 1.48. acc_db_request usage + 1.49. acc_diam_request usage Chapter 1. Admin Guide @@ -265,28 +255,23 @@ Chapter 1. Admin Guide 6.26. acc_time_column (string) 6.27. db_extra (string) 6.28. db_insert_mode (integer) - 6.29. diameter_flag (integer) - 6.30. diameter_missed_flag (integer) - 6.31. diameter_client_host (string) - 6.32. diameter_client_port (int) - 6.33. diameter_extra (string) - 6.34. cdr_enable (integer) - 6.35. cdr_expired_dlg_enable (integer) - 6.36. cdr_start_on_confirmed (integer) - 6.37. cdr_facility (integer) - 6.38. cdr_extra (string) - 6.39. cdr_start_id (string) - 6.40. cdr_end_id (string) - 6.41. cdr_duration_id (string) - 6.42. cdr_log_enable (int) - 6.43. cdrs_table (str) - 6.44. time_mode (int) - 6.45. time_attr (str) - 6.46. time_exten (str) - 6.47. time_format (str) - 6.48. reason_from_hf (int) - 6.49. clone_msg (int) - 6.50. cdr_on_failed (int) + 6.29. cdr_enable (integer) + 6.30. cdr_expired_dlg_enable (integer) + 6.31. cdr_start_on_confirmed (integer) + 6.32. cdr_facility (integer) + 6.33. cdr_extra (string) + 6.34. cdr_start_id (string) + 6.35. cdr_end_id (string) + 6.36. cdr_duration_id (string) + 6.37. cdr_log_enable (int) + 6.38. cdrs_table (str) + 6.39. time_mode (int) + 6.40. time_attr (str) + 6.41. time_exten (str) + 6.42. time_format (str) + 6.43. reason_from_hf (int) + 6.44. clone_msg (int) + 6.45. cdr_on_failed (int) 7. Functions @@ -300,14 +285,13 @@ Chapter 1. Admin Guide 1.1. General Example ACC module is used to account transactions information to different - backends like syslog and SQL. With the separate module, radius support - is enabled. + backends like syslog and SQL. With the separate module “acc_radius” + support for radius is enabled. - There is some very early support of the Diameter protocol in the code - which is no longer included by default and will be deleted in coming - releases. This support is not up to date with the current Diameter - protocols and is disabled. If you need Diameter support, please use the - ims_charging module. + There is some very early support of the Diameter protocol in the + “acc_diameter” module which will be deleted in coming releases. This + support is not up to date with the current Diameter protocols. If you + need Diameter support, please use the ims_charging module. To account a transaction and to choose which set of backends to be used, the script writer just has to set some flags (see the module @@ -349,19 +333,10 @@ Chapter 1. Admin Guide status (including media status and PSTN status in case of the gateway). However, CDR-base logging has the option to log existing information from expired dialogs (the dlg_vars in cdr_extra) Please - see cdr_expired_dlg_enable parameter - Section 6.35, + see cdr_expired_dlg_enable parameter - Section 6.30, “cdr_expired_dlg_enable (integer)”. - The SQL backend support is compiled in the module. For DIAMETER you - need to enable it by recompiling the module with properly set defines: - uncomment the DDIAM_ACC lines in modules/acc/Makefile. - - NOTE: diameter support was developed for DISC (DIameter Server Client - project at http://developer.berlios.de/projects/disc/). This project - seems to be no longer maintained and DIAMETER specifications were - updated in the meantime. Thus, the DIAMETER part in the module is - obsolete and needs rework to be usable with opendiameter or other - DIAMETER servers. + The SQL backend support is compiled in the module. 1.1. General Example @@ -545,7 +520,7 @@ Note Sometimes, dialogs expire because the UA has a problem and a final message is never transmitted. You can toggle on/off the generation of CDR-based logging in such cases with only the dlg_vars showing by using - the cdr_expired_dlg_enable parameter - Section 6.35, + the cdr_expired_dlg_enable parameter - Section 6.30, “cdr_expired_dlg_enable (integer)”. Default behavior is not logging. 4.2. CDR Extra @@ -560,7 +535,7 @@ Note * cdr_extra = cdr_extra_definition (';'cdr_extra_definition)* * cdr_extra_definition = cdr_log_name '=' pseudo_variable - See also Section 6.38, “cdr_extra (string)”. + See also Section 6.33, “cdr_extra (string)”. The full list of supported pseudo-variables in Sip-Router is available at: http://sip-router.org/wiki/cookbooks/pseudo-variables/devel @@ -673,28 +648,23 @@ $dlg_var(callee) = $avp(callee); #callee='C' 6.26. acc_time_column (string) 6.27. db_extra (string) 6.28. db_insert_mode (integer) - 6.29. diameter_flag (integer) - 6.30. diameter_missed_flag (integer) - 6.31. diameter_client_host (string) - 6.32. diameter_client_port (int) - 6.33. diameter_extra (string) - 6.34. cdr_enable (integer) - 6.35. cdr_expired_dlg_enable (integer) - 6.36. cdr_start_on_confirmed (integer) - 6.37. cdr_facility (integer) - 6.38. cdr_extra (string) - 6.39. cdr_start_id (string) - 6.40. cdr_end_id (string) - 6.41. cdr_duration_id (string) - 6.42. cdr_log_enable (int) - 6.43. cdrs_table (str) - 6.44. time_mode (int) - 6.45. time_attr (str) - 6.46. time_exten (str) - 6.47. time_format (str) - 6.48. reason_from_hf (int) - 6.49. clone_msg (int) - 6.50. cdr_on_failed (int) + 6.29. cdr_enable (integer) + 6.30. cdr_expired_dlg_enable (integer) + 6.31. cdr_start_on_confirmed (integer) + 6.32. cdr_facility (integer) + 6.33. cdr_extra (string) + 6.34. cdr_start_id (string) + 6.35. cdr_end_id (string) + 6.36. cdr_duration_id (string) + 6.37. cdr_log_enable (int) + 6.38. cdrs_table (str) + 6.39. time_mode (int) + 6.40. time_attr (str) + 6.41. time_exten (str) + 6.42. time_format (str) + 6.43. reason_from_hf (int) + 6.44. clone_msg (int) + 6.45. cdr_on_failed (int) 6.1. early_media (integer) @@ -1067,89 +1037,29 @@ modparam("acc", "db_extra", "ct=$hdr(Content-type); email=$avp(s:email)") modparam("acc", "db_insert_mode", 1) ... -6.29. diameter_flag (integer) - - Request flag which needs to be set to account a transaction -- DIAMETER - specific. - - Default value is not-set (no flag). - - Example 1.29. diameter_flag example -... -modparam("acc", "diameter_flag", 2) -... - -6.30. diameter_missed_flag (integer) - - Request flag which needs to be set to account missed calls -- DIAMETER - specific. - - Default value is not-set (no flag). - - Example 1.30. diameter_missed_flag example -... -modparam("acc", "diameter_missed_flag", 3) -... - -6.31. diameter_client_host (string) - - Hostname of the machine where the DIAMETER Client is running -- - DIAMETER specific. - - Default value is “localhost”. - - Example 1.31. diameter_client_host example -... -modparam("acc", "diameter_client_host", "3a_server.net") -... - -6.32. diameter_client_port (int) - - Port number where the Diameter Client is listening -- DIAMETER - specific. - - Default value is 3000. - - Example 1.32. diameter_client_host example -... -modparam("acc", "diameter_client_port", 3000) -... - -6.33. diameter_extra (string) - - Extra values to be logged via DIAMETER - DIAMETER specific. See section - Section 2, “Extra accounting” for more details. - - Default value is NULL. - - Example 1.33. diameter_extra example -... -modparam("acc", "diameter_extra", "7846=$hdr(Content-type);7847=$avp(s:email)") -... - -6.34. cdr_enable (integer) +6.29. cdr_enable (integer) Should CDR-based logging be enabled? 0 - off (default). 1 - on. - Example 1.34. cdr_enable example + Example 1.29. cdr_enable example ... modparam("acc", "cdr_enable", 1) ... -6.35. cdr_expired_dlg_enable (integer) +6.30. cdr_expired_dlg_enable (integer) Should CDR-based logging be enabled in case of expired dialogs? 0 - off (default). 1 - on. - Example 1.35. cdr_expired_dlg_enable example + Example 1.30. cdr_expired_dlg_enable example ... modparam("acc", "cdr_expired_dlg_enable", 1) ... -6.36. cdr_start_on_confirmed (integer) +6.31. cdr_start_on_confirmed (integer) Should the start time be taken from the time when the dialog is created, or when the dialog is confirmed? @@ -1157,91 +1067,91 @@ modparam("acc", "cdr_expired_dlg_enable", 1) 0 - use time of dialog creation (default). 1 - use time of dialog confirmation. - Example 1.36. cdr_start_on_confirmed example + Example 1.31. cdr_start_on_confirmed example ... modparam("acc", "cdr_start_on_confirmed", 1) ... -6.37. cdr_facility (integer) +6.32. cdr_facility (integer) Log facility to which CDR messages are issued to syslog. This allows to easily seperate CDR-specific logging from the other log messages. Default value is LOG_DAEMON. - Example 1.37. cdr_facility example + Example 1.32. cdr_facility example ... modparam("acc", "cdr_facility", "LOG_DAEMON") ... -6.38. cdr_extra (string) +6.33. cdr_extra (string) Set of pseudo-variables defining custom CDR fields. See Section 4.2, “CDR Extra” for more details. Default value is NULL. - Example 1.38. cdr_extra example + Example 1.33. cdr_extra example ... modparam("acc", "cdr_extra", "c1=$dlg_var(caller);c2=$dlg_var(callee)" ... -6.39. cdr_start_id (string) +6.34. cdr_start_id (string) Modifying the id which is used to store the start time. Default value is 'start_time' - Example 1.39. cdr_start_id example + Example 1.34. cdr_start_id example ... modparam("acc", "cdr_start_id", "start") ... -6.40. cdr_end_id (string) +6.35. cdr_end_id (string) Modifying the id which is used to store the end time. Default value is 'end_time' - Example 1.40. cdr_end_id example + Example 1.35. cdr_end_id example ... modparam("acc", "cdr_end_id", "end") ... -6.41. cdr_duration_id (string) +6.36. cdr_duration_id (string) Modify the id which is used to store the duration. Default value is 'duration' - Example 1.41. cdr_duration_id example + Example 1.36. cdr_duration_id example ... modparam("acc", "cdr_duration_id", "d") ... -6.42. cdr_log_enable (int) +6.37. cdr_log_enable (int) Control if CDR-based accounting should be written to syslog. 0 - off. 1 - on (default). - Example 1.42. cdr_log_enable example + Example 1.37. cdr_log_enable example ... modparam("acc", "cdr_log_enable", 0) ... -6.43. cdrs_table (str) +6.38. cdrs_table (str) Name of db table to store dialog-based CDRs. Default value is "" (no db storage for dialog-based CDRs). - Example 1.43. cdrs_table example + Example 1.38. cdrs_table example ... modparam("acc", "cdrs_table", "acc_cdrs") ... -6.44. time_mode (int) +6.39. time_mode (int) Store additional value related to the time of event. @@ -1255,12 +1165,12 @@ modparam("acc", "cdrs_table", "acc_cdrs") * 4 - save formatted time according to time_format parameter, using the output of gmtime(). Used for cdr entries too. - Example 1.44. time_mode example + Example 1.39. time_mode example ... modparam("acc", "time_mode", 1) ... -6.45. time_attr (str) +6.40. time_attr (str) Name of the syslog attribute or database column where to store additional value related to the time of event. @@ -1276,35 +1186,35 @@ modparam("acc", "time_mode", 1) value is already unix timestamp, but in db accounting time value is datetime and requires a function to get the timestamp. - Example 1.45. time_attr example + Example 1.40. time_attr example ... modparam("acc", "time_attr", "seconds") ... -6.46. time_exten (str) +6.41. time_exten (str) Name of the syslog attribute or database column where to store extended value related to the time of event. It is used now only for time_mode=1 and database column has to be int: - Example 1.46. time_exten example + Example 1.41. time_exten example ... modparam("acc", "time_exten", "microsecs") ... -6.47. time_format (str) +6.42. time_format (str) Specify the format to print the time for time_mode 3 or 4. Default value is %Y-%m-%d %H:%M:%S". - Example 1.47. time_format example + Example 1.42. time_format example ... modparam("acc", "time_format", "%Y/%m/%d %H:%M:%S") ... -6.48. reason_from_hf (int) +6.43. reason_from_hf (int) Tells where to take sip_reason from. If value is 0, sip_reason is taken from status line. Otherwise, sip_reason is taken from Reason header @@ -1312,12 +1222,12 @@ modparam("acc", "time_format", "%Y/%m/%d %H:%M:%S") Default value is 0. - Example 1.48. reason_from_hf + Example 1.43. reason_from_hf ... modparam("acc", "reason_from_hf", 1) ... -6.49. clone_msg (int) +6.44. clone_msg (int) If set to 1, request structure from transaction is cloned temporarily in the callback to get acc attributes. It is required if you account @@ -1328,12 +1238,12 @@ modparam("acc", "reason_from_hf", 1) Default value is 1. - Example 1.49. clone_msg + Example 1.44. clone_msg ... modparam("acc", "clone_msg", 0) ... -6.50. cdr_on_failed (int) +6.45. cdr_on_failed (int) If set to 1, the module stores the CDR for a failed dialog (calls not answered). If set to 0, those records are not stored, only those for @@ -1341,7 +1251,7 @@ modparam("acc", "clone_msg", 0) Default value is 1. - Example 1.50. cdr_on_failed + Example 1.45. cdr_on_failed ... modparam("acc", "cdr_on_failed", 0) ... @@ -1366,7 +1276,7 @@ modparam("acc", "cdr_on_failed", 0) This function can be used from ANY_ROUTE. - Example 1.51. acc_log_request usage + Example 1.46. acc_log_request usage ... acc_log_request("Some comment"); $var(code) = 404; @@ -1388,7 +1298,7 @@ acc_log_request("$var(code) Error: $avp(reason)"); This function can be used from ANY_ROUTE. - Example 1.52. acc_db_request usage + Example 1.47. acc_db_request usage ... acc_db_request("Some comment", "SomeTable"); acc_db_request("Some comment", "acc_$time(year)_$time(mon)"); @@ -1412,7 +1322,7 @@ acc_db_request("$var(code) Error: $avp(reason)", "SomeTable"); This function can be used from ANY_ROUTE. - Example 1.53. acc_db_request usage + Example 1.48. acc_db_request usage ... acc_request("100 Received", "acc"); acc_request("100 Received", "acc_$time(year)_$time(mon)"); @@ -1430,7 +1340,7 @@ acc_db_request("$var(code) $avp(reason)", "acc"); This function can be used from ANY_ROUTE. - Example 1.54. acc_diam_request usage + Example 1.49. acc_diam_request usage ... acc_diam_request("Some comment"); acc_diam_request("$var(code) Error: $avp(reason)");