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

Function get_stat_var_from_num_code

statistics.c:111–130  ·  view source on GitHub ↗

! \brief * Returns the statistic associated with 'numerical_code' and 'out_codes'. * Specifically: * * - if out_codes is nonzero, then the stat_var for the number of messages * _sent out_ with the 'numerical_code' will be returned if it exists. * - otherwise, the stat_var for the number of messages _received_ with the * 'numerical_code' will be returned, if the stat exists. */

Source from the content-addressed store, hash-verified

109 * 'numerical_code' will be returned, if the stat exists.
110 */
111stat_var *get_stat_var_from_num_code(unsigned int numerical_code, int out_codes)
112{
113 static char msg_code[INT2STR_MAX_LEN+4];
114 str stat_name;
115
116 stat_name.s = int2bstr( (unsigned long)numerical_code, msg_code,
117 &stat_name.len);
118 stat_name.s[stat_name.len++] = '_';
119
120 if (out_codes) {
121 stat_name.s[stat_name.len++] = 'o';
122 stat_name.s[stat_name.len++] = 'u';
123 stat_name.s[stat_name.len++] = 't';
124 } else {
125 stat_name.s[stat_name.len++] = 'i';
126 stat_name.s[stat_name.len++] = 'n';
127 }
128
129 return get_stat(&stat_name);
130}
131
132
133char *build_stat_name( str* prefix, char *var_name)

Callers 4

update_sl_reply_statFunction · 0.85
stats_trans_rplFunction · 0.85

Calls 2

int2bstrFunction · 0.85
get_statFunction · 0.85

Tested by

no test coverage detected