| 963 | }; |
| 964 | |
| 965 | static int fixup_init_flags(void** param) |
| 966 | { |
| 967 | str *s = (str*)*param; |
| 968 | struct b2b_params *init_params; |
| 969 | str flag_vals[1]; |
| 970 | |
| 971 | init_params = pkg_malloc(sizeof *init_params); |
| 972 | if (!init_params) { |
| 973 | LM_ERR("out of pkg memory\n"); |
| 974 | return -1; |
| 975 | } |
| 976 | memset(init_params, 0, sizeof *init_params); |
| 977 | |
| 978 | init_params->init_timeout = b2bl_th_init_timeout; |
| 979 | |
| 980 | if (!s) { |
| 981 | *param = (void*)init_params; |
| 982 | return 0; |
| 983 | } |
| 984 | |
| 985 | if (fixup_named_flags(param, init_request_flags, init_request_kv_flags, |
| 986 | flag_vals) < 0) { |
| 987 | LM_ERR("Failed to parse flags\n"); |
| 988 | return -1; |
| 989 | } |
| 990 | |
| 991 | init_params->flags = (unsigned int)(unsigned long)(void*)*param; |
| 992 | *param = (void*)init_params; |
| 993 | |
| 994 | if (flag_vals[0].s) { |
| 995 | if (str2int(&flag_vals[0], &init_params->init_timeout) < 0) { |
| 996 | LM_ERR("timeout is not an integer\n"); |
| 997 | return -1; |
| 998 | } |
| 999 | } |
| 1000 | |
| 1001 | return 0; |
| 1002 | } |
| 1003 | |
| 1004 | static str reply_flags[] = |
| 1005 | { |
nothing calls this directly
no test coverage detected