Take care of the statistics associated with numerical codes and replies */
| 108 | |
| 109 | /* Take care of the statistics associated with numerical codes and replies */ |
| 110 | static inline void update_sl_reply_stat(int code) |
| 111 | { |
| 112 | stat_var *numerical_stat; |
| 113 | |
| 114 | /* If stats aren't enabled, just skip over this. */ |
| 115 | if (!sl_enable_stats) |
| 116 | return; |
| 117 | |
| 118 | /* OpenSIPS already kept track of the total number of 1xx, 2xx, replies. |
| 119 | * There may be setups that still expect these variables to exist, so we |
| 120 | * don't touch them */ |
| 121 | if (code < 200 ) { |
| 122 | update_stat( tx_1xx_rpls , 1); |
| 123 | } else if (code<300) { |
| 124 | update_stat( tx_2xx_rpls , 1); |
| 125 | } else if (code<400) { |
| 126 | update_stat( tx_3xx_rpls , 1); |
| 127 | } else if (code<500) { |
| 128 | update_stat( tx_4xx_rpls , 1); |
| 129 | } else if (code<600) { |
| 130 | update_stat( tx_5xx_rpls , 1); |
| 131 | } else { |
| 132 | update_stat( tx_6xx_rpls , 1); |
| 133 | } |
| 134 | |
| 135 | update_stat( sent_rpls , 1); |
| 136 | |
| 137 | numerical_stat = get_stat_var_from_num_code(code, 1); |
| 138 | |
| 139 | if (numerical_stat != NULL) |
| 140 | update_stat(numerical_stat, 1); |
| 141 | } |
| 142 | |
| 143 | |
| 144 | int sl_send_reply_helper(struct sip_msg *msg ,int code, const str *text) |
no test coverage detected