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

Function fixup_stat

modules/statistics/statistics.c:509–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509static int fixup_stat(void** param)
510{
511 struct stat_param *sp;
512 str sname, group;
513 int grp_idx __attribute__((unused));
514
515 sp = (struct stat_param *)pkg_malloc(sizeof(struct stat_param));
516 if (sp==NULL) {
517 LM_ERR("no more pkg mem (%d)\n", (int)sizeof(struct stat_param));
518 return E_OUT_OF_MEM;
519 }
520 memset( sp, 0 , sizeof(struct stat_param) );
521
522 if (resolve_stat((str*)*param, &group, &sname, &grp_idx) != 0) {
523 return E_CFG;
524 }
525 /* text token */
526 sp->u.stat = __get_stat(&sname, grp_idx);
527 if (sp->u.stat) {
528 /* statistic found */
529 sp->type = STAT_PARAM_TYPE_STAT;
530 } else {
531 /* stat not found, keep the name for later */
532 sp->type = STAT_PARAM_TYPE_NAME;
533 sp->u.name = *param;
534 }
535
536 *param = sp;
537
538 return 0;
539}
540
541static int fixup_free_stat(void** param)
542{

Callers

nothing calls this directly

Calls 2

resolve_statFunction · 0.85
__get_statFunction · 0.85

Tested by

no test coverage detected