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

Function try_get_mi_array_param

mi/item.c:494–520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494int try_get_mi_array_param(const mi_params_t *params, char *name,
495 mi_item_t **value, int *no_items)
496{
497 mi_item_t *p;
498
499 param_err_pname = name;
500
501 p = _get_mi_param(params, name);;
502 if (!p) {
503 param_err_type = MI_PARAM_ERR_MISSING;
504 return MI_PARAM_ERR_MISSING;
505 }
506
507 if (!(p->type & cJSON_Array)) {
508 param_err_type = MI_PARAM_ERR_BAD_TYPE;
509 return MI_PARAM_ERR_BAD_TYPE;
510 }
511
512 *value = p;
513 *no_items = cJSON_GetArraySize(p);
514 if (*no_items == 0) {
515 param_err_type = MI_PARAM_ERR_EMPTY_ARR;
516 return MI_PARAM_ERR_EMPTY_ARR;
517 }
518
519 return 0;
520}
521
522int get_mi_array_param(const mi_params_t *params, char *name,
523 mi_item_t **value, int *no_items)

Callers 8

get_mi_array_paramFunction · 0.85
mi_dfks_setFunction · 0.85
parse_trace_filtersFunction · 0.85
cluster_send_miFunction · 0.85
cluster_bcast_miFunction · 0.85
mi_trigger_scenarioFunction · 0.85
mi_parse_call_holdFunction · 0.85
w_mi_raise_eventFunction · 0.85

Calls 2

_get_mi_paramFunction · 0.85
cJSON_GetArraySizeFunction · 0.50

Tested by

no test coverage detected