Module: kamailio
Branch: master
Commit: 10129d056e3660a33b6ebc7b487b1de0f616dcc9
URL:
https://github.com/kamailio/kamailio/commit/10129d056e3660a33b6ebc7b487b1de…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-06-20T16:00:00+02:00
core: faked msg - functions to get next fmsg with clear branches
---
Modified: src/core/fmsg.c
Modified: src/core/fmsg.h
---
Diff:
https://github.com/kamailio/kamailio/commit/10129d056e3660a33b6ebc7b487b1de…
Patch:
https://github.com/kamailio/kamailio/commit/10129d056e3660a33b6ebc7b487b1de…
---
diff --git a/src/core/fmsg.c b/src/core/fmsg.c
index ba83a5b876..888032517a 100644
--- a/src/core/fmsg.c
+++ b/src/core/fmsg.c
@@ -69,16 +69,33 @@ int faked_msg_init(void)
return 0;
}
-sip_msg_t* faked_msg_next(void)
+static inline sip_msg_t* faked_msg_next_id(int mode)
{
_faked_msg.id = 1 + _faked_msg_no++;
_faked_msg.pid = my_pid();
memset(&_faked_msg.tval, 0, sizeof(struct timeval));
+ if(mode) clear_branches();
return &_faked_msg;
}
+sip_msg_t* faked_msg_next(void)
+{
+ return faked_msg_next_id(0);
+}
+
+sip_msg_t* faked_msg_next_clear(void)
+{
+ return faked_msg_next_id(1);
+}
+
sip_msg_t* faked_msg_get_next(void)
{
faked_msg_init();
return faked_msg_next();
}
+
+sip_msg_t* faked_msg_get_next_clear(void)
+{
+ faked_msg_init();
+ return faked_msg_next_clear();
+}
diff --git a/src/core/fmsg.h b/src/core/fmsg.h
index ada40c15a0..b279100269 100644
--- a/src/core/fmsg.h
+++ b/src/core/fmsg.h
@@ -27,5 +27,7 @@
int faked_msg_init(void);
sip_msg_t* faked_msg_next(void);
sip_msg_t* faked_msg_get_next(void);
+sip_msg_t* faked_msg_next_clear(void);
+sip_msg_t* faked_msg_get_next_clear(void);
#endif