| 1051 | |
| 1052 | |
| 1053 | static int cfg_validate(void) |
| 1054 | { |
| 1055 | if (hep_capture_on) { |
| 1056 | /* db_url is mandatory if sip_capture is used */ |
| 1057 | if (((is_script_func_used("sip_capture", -1) || |
| 1058 | is_script_async_func_used("sip_capture", -1)) || |
| 1059 | hep_route_ref == NULL) || |
| 1060 | (is_script_func_used("report_capture", -1) || |
| 1061 | is_script_async_func_used("report_capture", -1))) |
| 1062 | { |
| 1063 | if (db_funcs.insert==NULL) { |
| 1064 | LM_ERR("sip_capture() found in new script, but the module " |
| 1065 | "did not initalized the DB conn, better restart\n"); |
| 1066 | return 0; |
| 1067 | } |
| 1068 | } |
| 1069 | } else { |
| 1070 | if ((is_script_func_used("sip_capture", -1) || |
| 1071 | is_script_async_func_used("sip_capture", -1))) |
| 1072 | { |
| 1073 | if (db_funcs.insert==NULL) { |
| 1074 | LM_ERR("sip_capture() found in new script, but the module " |
| 1075 | "did not initalized the DB conn, better restart\n"); |
| 1076 | return 0; |
| 1077 | } |
| 1078 | } |
| 1079 | } |
| 1080 | |
| 1081 | return 1; |
| 1082 | } |
| 1083 | |
| 1084 | |
| 1085 | /* |
nothing calls this directly
no test coverage detected