Module: kamailio
Branch: 5.0
Commit: 5add6c44cc8d268748488b8f2683c88bbfd4572e
URL:
https://github.com/kamailio/kamailio/commit/5add6c44cc8d268748488b8f2683c88…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2017-06-02T14:28:09+01:00
core: wrapper function to reset avps/xavps from msg environment
- use it to clean after processing received msg
(cherry picked from commit 46ea6b0a6bcf55243a0d11be41f60a2678dbbcfb)
---
Modified: src/core/receive.c
Modified: src/core/receive.h
---
Diff:
https://github.com/kamailio/kamailio/commit/5add6c44cc8d268748488b8f2683c88…
Patch:
https://github.com/kamailio/kamailio/commit/5add6c44cc8d268748488b8f2683c88…
---
diff --git a/src/core/receive.c b/src/core/receive.c
index 0e622274f9..7f2599af69 100644
--- a/src/core/receive.c
+++ b/src/core/receive.c
@@ -360,11 +360,7 @@ int receive_msg(char* buf, unsigned int len, struct receive_info*
rcv_info)
#ifdef STATS
skipped = 0;
#endif
- /* free possible loaded avps -bogdan */
- reset_avps();
-#ifdef WITH_XAVP
- xavp_reset_list();
-#endif
+ ksr_msg_env_reset();
LM_DBG("cleaning up\n");
free_sip_msg(msg);
pkg_free(msg);
@@ -390,13 +386,21 @@ int receive_msg(char* buf, unsigned int len, struct receive_info*
rcv_info)
free_sip_msg(msg);
pkg_free(msg);
error00:
- reset_avps();
-#ifdef WITH_XAVP
- xavp_reset_list();
-#endif
+ ksr_msg_env_reset();
STATS_RX_DROPS;
/* reset log prefix */
log_prefix_set(NULL);
return -1;
}
+/**
+ * clean up msg environment, such as avp and xavp lists
+ */
+void ksr_msg_env_reset(void)
+{
+ reset_avps();
+#ifdef WITH_XAVP
+ xavp_reset_list();
+#endif
+
+}
diff --git a/src/core/receive.h b/src/core/receive.h
index 4e6a13d3fd..0a928c5d42 100644
--- a/src/core/receive.h
+++ b/src/core/receive.h
@@ -33,5 +33,6 @@
int receive_msg(char* buf, unsigned int len, struct receive_info *ri);
unsigned int inc_msg_no(void);
+void ksr_msg_env_reset(void);
#endif