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

Function try_get_mi_string_param

mi/item.c:428–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426}
427
428int try_get_mi_string_param(const mi_params_t *params, char *name,
429 char **value, int *value_len)
430{
431 mi_item_t *p;
432
433 param_err_pname = name;
434
435 p = _get_mi_param(params, name);
436 if (!p) {
437 param_err_type = MI_PARAM_ERR_MISSING;
438 return MI_PARAM_ERR_MISSING;
439 }
440
441 if (!(p->type & (cJSON_Number|cJSON_String))) {
442 param_err_type = MI_PARAM_ERR_BAD_TYPE;
443 return MI_PARAM_ERR_BAD_TYPE;
444 }
445
446 if (p->type & cJSON_String) {
447 *value = p->valuestring;
448 *value_len = strlen(p->valuestring);
449 } else {
450 *value = sint2str(p->valueint, value_len);
451 }
452
453 return 0;
454}
455
456int get_mi_string_param(const mi_params_t *params, char *name,
457 char **value, int *value_len)

Callers 15

mi_sr_get_statusFunction · 0.85
mi_sr_list_statusFunction · 0.85
mi_sr_list_reportsFunction · 0.85
mi_sr_list_identifiersFunction · 0.85
mi_print_blacklistsFunction · 0.85
mi_bl_get_extraFunction · 0.85
get_mi_string_paramFunction · 0.85
get_mi_bool_like_paramFunction · 0.85
sca_mi_list_linesFunction · 0.85
mi_dfks_setFunction · 0.85
ds_mi_listFunction · 0.85
mi_aka_av_addFunction · 0.85

Calls 2

_get_mi_paramFunction · 0.85
sint2strFunction · 0.85

Tested by

no test coverage detected