Module: kamailio
Branch: master
Commit: a28bc7c4c2dc02d7cf1d267ffa53f4d7f983fb5f
URL:
https://github.com/kamailio/kamailio/commit/a28bc7c4c2dc02d7cf1d267ffa53f4d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-02-01T18:53:34+01:00
tm: use core sip routing api callid generator if available
- if no component set a custom callid id generator, then the internal
one is used, like so far
---
Modified: modules/tm/callid.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a28bc7c4c2dc02d7cf1d267ffa53f4d…
Patch:
https://github.com/kamailio/kamailio/commit/a28bc7c4c2dc02d7cf1d267ffa53f4d…
---
diff --git a/modules/tm/callid.c b/modules/tm/callid.c
index 560af33..e5a5064 100644
--- a/modules/tm/callid.c
+++ b/modules/tm/callid.c
@@ -35,6 +35,7 @@
#include "../../dprint.h"
#include "../../pt.h"
#include "../../socket_info.h"
+#include "../../srapi.h"
#include "callid.h"
/**
@@ -161,7 +162,7 @@ static inline int inc_hexchar(char* _c)
* \brief Get a unique Call-ID
* \param callid returned Call-ID
*/
-void generate_callid(str* callid)
+void tm_generate_callid(str* callid)
{
int i;
@@ -171,3 +172,17 @@ void generate_callid(str* callid)
callid->s = callid_prefix.s;
callid->len = callid_prefix.len + callid_suffix.len;
}
+
+/**
+ * \brief Wrapper to get a unique Call-ID based on tm or core callback
+ * \param callid returned Call-ID
+ */
+void generate_callid(str* callid)
+{
+ sr_generate_callid_f cf;
+ if((cf=sr_get_callid_func())!=NULL) {
+ cf(callid);
+ } else {
+ tm_generate_callid(callid);
+ }
+}