MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / w_log_level

Function w_log_level

mi/mi_core.c:402–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402static mi_response_t *w_log_level(const mi_params_t *params,
403 struct mi_handler *async_hdl)
404{
405 mi_response_t *resp;
406 mi_item_t *resp_obj;
407 mi_item_t *procs_arr, *proc_item;
408 int i;
409
410 resp = init_mi_result_object(&resp_obj);
411 if (!resp)
412 return 0;
413
414 procs_arr = add_mi_array(resp_obj, MI_SSTR("Processes"));
415 if (!procs_arr) {
416 free_mi_response(resp);
417 return 0;
418 }
419
420 for (i = 0; i < counted_max_processes; i++) {
421 if (!is_process_running(i))
422 continue;
423 proc_item = add_mi_object(procs_arr, NULL, 0);
424 if (!proc_item)
425 goto error;
426
427 if (add_mi_number(proc_item, MI_SSTR("PID"), pt[i].pid) < 0)
428 goto error;
429
430 if (add_mi_number(proc_item, MI_SSTR("Log level"), pt[i].log_level) < 0)
431 goto error;
432
433 if (add_mi_string(proc_item, MI_SSTR("Type"),
434 pt[i].desc, strlen(pt[i].desc)) < 0)
435 goto error;
436 }
437
438 return resp;
439
440error:
441 free_mi_response(resp);
442 return 0;
443}
444
445static mi_response_t *w_log_level_1(const mi_params_t *params,
446 struct mi_handler *async_hdl)

Callers

nothing calls this directly

Calls 6

init_mi_result_objectFunction · 0.85
add_mi_arrayFunction · 0.85
free_mi_responseFunction · 0.85
add_mi_objectFunction · 0.85
add_mi_numberFunction · 0.85
add_mi_stringFunction · 0.85

Tested by

no test coverage detected