Browse code

kex: new module - kamailio extensions

- the module collects kamailio core extensions
- K core mi commands included in the module

Daniel-Constantin Mierla authored on 16/04/2009 18:56:13
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+# $Id$
2
+#
3
+# example module makefile
4
+#
5
+# 
6
+# WARNING: do not run this directly, it should be run by the master Makefile
7
+
8
+include ../../Makefile.defs
9
+auto_gen=
10
+NAME=kex.so
11
+LIBS=
12
+
13
+DEFS+=-DOPENSER_MOD_INTERFACE
14
+
15
+include ../../Makefile.modules
0 16
new file mode 100644
... ...
@@ -0,0 +1,85 @@
1
+/**
2
+ * $Id$
3
+ *
4
+ * Copyright (C) 2009
5
+ *
6
+ * This file is part of Kamailio, a free SIP server.
7
+ *
8
+ * Kamailio is free software; you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation; either version 2 of the License, or
11
+ * (at your option) any later version
12
+ *
13
+ * Kamailio is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License 
19
+ * along with this program; if not, write to the Free Software 
20
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
+ */
22
+
23
+#include <stdio.h>
24
+#include <string.h>
25
+#include <stdlib.h>
26
+
27
+#include "../../sr_module.h"
28
+#include "../../dprint.h"
29
+
30
+#include "mi_core.h"
31
+
32
+
33
+MODULE_VERSION
34
+
35
+
36
+/** parameters */
37
+
38
+/** module functions */
39
+static int mod_init(void);
40
+
41
+void destroy(void);
42
+
43
+static cmd_export_t cmds[]={
44
+	{0,0,0,0,0,0}
45
+};
46
+
47
+static param_export_t params[]={
48
+	{0,0,0}
49
+};
50
+
51
+
52
+/** module exports */
53
+struct module_exports exports= {
54
+	"kex",
55
+	DEFAULT_DLFLAGS, /* dlopen flags */
56
+	cmds,
57
+	params,
58
+	0,          /* exported statistics */
59
+	0,          /* exported MI functions */
60
+	0,          /* exported pseudo-variables */
61
+	0,          /* extra processes */
62
+	mod_init,   /* module initialization function */
63
+	0,
64
+	(destroy_function) destroy,
65
+	0           /* per-child init function */
66
+};
67
+
68
+/**
69
+ * init module function
70
+ */
71
+static int mod_init(void)
72
+{
73
+	if(init_mi_core()<0)
74
+		return -1;
75
+	return 0;
76
+}
77
+
78
+/**
79
+ * destroy function
80
+ */
81
+void destroy(void)
82
+{
83
+	return;
84
+}
85
+