diff --git a/debian/patches/sipwise/extend_stats.patch b/debian/patches/sipwise/extend_stats.patch index c66facdde..bd317c074 100644 --- a/debian/patches/sipwise/extend_stats.patch +++ b/debian/patches/sipwise/extend_stats.patch @@ -57,17 +57,26 @@ Subject: [PATCH] kex: Extend kamailio rcv_replies statistics {0,0,0} }; -@@ -200,6 +231,28 @@ static int km_cb_req_stats(struct sip_ms +@@ -200,6 +231,37 @@ static int km_cb_req_stats(struct sip_ms return 1; } +static int km_cb_rpl_stats_by_method(struct sip_msg *msg, + unsigned int flags, void *param) +{ -+ int method = get_cseq(msg)->method_id; -+ int group = msg->first_line.u.reply.statuscode / 100 - 1; ++ int method = 0; ++ int group = 0; + -+ if (group >= 1 && group <= 6) { ++ if(msg==NULL) { ++ return -1; ++ } ++ if (!msg->cseq && (parse_headers(msg, HDR_CSEQ_F, 0) < 0 || !msg->cseq)) { ++ return -1; ++ } ++ method = get_cseq(msg)->method_id; ++ group = msg->first_line.u.reply.statuscode / 100 - 1; ++ ++ if (group >= 0 && group <= 5) { + switch(method) { + case METHOD_INVITE: update_stat( VAR_NAME(invite)[group], 1); break; + case METHOD_CANCEL: update_stat( VAR_NAME(cancel)[group], 1); break;