Browse code

modules_k/*: moved k modules in directory modules/

Daniel-Constantin Mierla authored on 20/01/2013 11:57:52
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,118 +0,0 @@
1
-/*
2
- * Copyright (C) 2007 Juha Heinanen
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
- *
20
- * History:
21
- * --------
22
- *  2007-05-1  initial version (jih)
23
- */
24
-
25
-
26
-/*!
27
- * \defgroup presence_mwi Presence_mwi :: Presence Handling of message-summary events
28
- */
29
-
30
-/*!
31
- * \file
32
- * \brief SIP-router Presence :: Message waiting indication
33
- * \ingroup presence
34
- * Module: \ref presence
35
- */
36
-
37
-
38
-#include <stdio.h>
39
-#include <stdlib.h>
40
-#include <string.h>
41
-#include <time.h>
42
-#include <sys/types.h>
43
-#include <unistd.h>
44
-
45
-#include "../../sr_module.h"
46
-#include "../../dprint.h"
47
-#include "../../str.h"
48
-#include "../../parser/msg_parser.h"
49
-#include "../../mem/mem.h"
50
-#include "../presence/bind_presence.h"
51
-#include "add_events.h"
52
-#include "presence_mwi.h"
53
-
54
-MODULE_VERSION
55
-
56
-/* module functions */
57
-static int mod_init(void);
58
-
59
-/* module variables */
60
-add_event_t pres_add_event;
61
-
62
-/* module exported commands */
63
-static cmd_export_t cmds[] =
64
-{
65
-    {0,	0, 0, 0, 0, 0}
66
-};
67
-
68
-/* module exported paramaters */
69
-static param_export_t params[] = {
70
-    {0, 0, 0}
71
-};
72
-
73
-/* module exports */
74
-struct module_exports exports= {
75
-    "presence_mwi",				/* module name */
76
-    DEFAULT_DLFLAGS,            /* dlopen flags */
77
-    cmds,						/* exported functions */
78
-    params,						/* exported parameters */
79
-    0,							/* exported statistics */
80
-    0,							/* exported MI functions */
81
-    0,							/* exported pseudo-variables */
82
-	0,							/* extra processes */
83
-    mod_init,					/* module initialization function */
84
-    0,							/* response handling function */
85
-    0,							/* destroy function */
86
-    0							/* per-child init function */
87
-};
88
-	
89
-/*
90
- * init module function
91
- */
92
-static int mod_init(void)
93
-{
94
-	presence_api_t pres;
95
-    bind_presence_t bind_presence;
96
-
97
-    bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
98
-    if (!bind_presence) {
99
-	LM_ERR("can't bind presence\n");
100
-	return -1;
101
-    }
102
-    if (bind_presence(&pres) < 0) {
103
-	LM_ERR("can't bind pua\n");
104
-	return -1;
105
-    }
106
-
107
-    pres_add_event = pres.add_event;
108
-    if (pres_add_event == NULL) {
109
-	LM_ERR("could not import add_event\n");
110
-	return -1;
111
-    }
112
-    if(mwi_add_events() < 0) {
113
-	LM_ERR("failed to add mwi events\n");
114
-	return -1;		
115
-    }	
116
-    
117
-    return 0;
118
-}
Browse code

modules_k/presence_[dialoginfo|mwi|reginfo]: fixed test of wrong variable

Juha Heinanen authored on 13/06/2012 13:25:12
Showing 1 changed files
... ...
@@ -105,7 +105,7 @@ static int mod_init(void)
105 105
     }
106 106
 
107 107
     pres_add_event = pres.add_event;
108
-    if (add_event == NULL) {
108
+    if (pres_add_event == NULL) {
109 109
 	LM_ERR("could not import add_event\n");
110 110
 	return -1;
111 111
     }
Browse code

presence(k): fix doxygen errors, small extensions and cleanups in comments

Henning Westerholt authored on 08/08/2011 20:18:28
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /*
2
- * presence_mwi module - Presence Handling of message-summary events
3
- *
4 2
  * Copyright (C) 2007 Juha Heinanen
5 3
  *
6 4
  * This file is part of Kamailio, a free SIP server.
... ...
@@ -24,6 +22,11 @@
24 22
  *  2007-05-1  initial version (jih)
25 23
  */
26 24
 
25
+
26
+/*!
27
+ * \defgroup presence_mwi Presence_mwi :: Presence Handling of message-summary events
28
+ */
29
+
27 30
 /*!
28 31
  * \file
29 32
  * \brief SIP-router Presence :: Message waiting indication
Browse code

Updates (doxygen documentation) to message waiting indication module

oej authored on 25/10/2009 20:03:57
Showing 1 changed files
... ...
@@ -24,6 +24,14 @@
24 24
  *  2007-05-1  initial version (jih)
25 25
  */
26 26
 
27
+/*!
28
+ * \file
29
+ * \brief SIP-router Presence :: Message waiting indication
30
+ * \ingroup presence
31
+ * Module: \ref presence
32
+ */
33
+
34
+
27 35
 #include <stdio.h>
28 36
 #include <stdlib.h>
29 37
 #include <string.h>
Browse code

* modules: presence_mwi, presence_xml, pua, pua_mi

Moved back to modules_k presence related modules, because they include
stuff from sl module that does not exist in modules yet.

Juha Heinanen authored on 18/04/2009 12:53:54
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,107 @@
1
+/*
2
+ * presence_mwi module - Presence Handling of message-summary events
3
+ *
4
+ * Copyright (C) 2007 Juha Heinanen
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
+ * History:
23
+ * --------
24
+ *  2007-05-1  initial version (jih)
25
+ */
26
+
27
+#include <stdio.h>
28
+#include <stdlib.h>
29
+#include <string.h>
30
+#include <time.h>
31
+#include <sys/types.h>
32
+#include <unistd.h>
33
+
34
+#include "../../sr_module.h"
35
+#include "../../dprint.h"
36
+#include "../../str.h"
37
+#include "../../parser/msg_parser.h"
38
+#include "../../mem/mem.h"
39
+#include "../presence/bind_presence.h"
40
+#include "add_events.h"
41
+#include "presence_mwi.h"
42
+
43
+MODULE_VERSION
44
+
45
+/* module functions */
46
+static int mod_init(void);
47
+
48
+/* module variables */
49
+add_event_t pres_add_event;
50
+
51
+/* module exported commands */
52
+static cmd_export_t cmds[] =
53
+{
54
+    {0,	0, 0, 0, 0, 0}
55
+};
56
+
57
+/* module exported paramaters */
58
+static param_export_t params[] = {
59
+    {0, 0, 0}
60
+};
61
+
62
+/* module exports */
63
+struct module_exports exports= {
64
+    "presence_mwi",				/* module name */
65
+    DEFAULT_DLFLAGS,            /* dlopen flags */
66
+    cmds,						/* exported functions */
67
+    params,						/* exported parameters */
68
+    0,							/* exported statistics */
69
+    0,							/* exported MI functions */
70
+    0,							/* exported pseudo-variables */
71
+	0,							/* extra processes */
72
+    mod_init,					/* module initialization function */
73
+    0,							/* response handling function */
74
+    0,							/* destroy function */
75
+    0							/* per-child init function */
76
+};
77
+	
78
+/*
79
+ * init module function
80
+ */
81
+static int mod_init(void)
82
+{
83
+	presence_api_t pres;
84
+    bind_presence_t bind_presence;
85
+
86
+    bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
87
+    if (!bind_presence) {
88
+	LM_ERR("can't bind presence\n");
89
+	return -1;
90
+    }
91
+    if (bind_presence(&pres) < 0) {
92
+	LM_ERR("can't bind pua\n");
93
+	return -1;
94
+    }
95
+
96
+    pres_add_event = pres.add_event;
97
+    if (add_event == NULL) {
98
+	LM_ERR("could not import add_event\n");
99
+	return -1;
100
+    }
101
+    if(mwi_add_events() < 0) {
102
+	LM_ERR("failed to add mwi events\n");
103
+	return -1;		
104
+    }	
105
+    
106
+    return 0;
107
+}
Browse code

* modules: peering, pua, pua_mi, presence, presence_xml, presence_mwi

Moved some k modules that don't exist in s from modules_k to modules.

Juha Heinanen authored on 18/04/2009 12:29:07
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,107 +0,0 @@
1
-/*
2
- * presence_mwi module - Presence Handling of message-summary events
3
- *
4
- * Copyright (C) 2007 Juha Heinanen
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
- * History:
23
- * --------
24
- *  2007-05-1  initial version (jih)
25
- */
26
-
27
-#include <stdio.h>
28
-#include <stdlib.h>
29
-#include <string.h>
30
-#include <time.h>
31
-#include <sys/types.h>
32
-#include <unistd.h>
33
-
34
-#include "../../sr_module.h"
35
-#include "../../dprint.h"
36
-#include "../../str.h"
37
-#include "../../parser/msg_parser.h"
38
-#include "../../mem/mem.h"
39
-#include "../presence/bind_presence.h"
40
-#include "add_events.h"
41
-#include "presence_mwi.h"
42
-
43
-MODULE_VERSION
44
-
45
-/* module functions */
46
-static int mod_init(void);
47
-
48
-/* module variables */
49
-add_event_t pres_add_event;
50
-
51
-/* module exported commands */
52
-static cmd_export_t cmds[] =
53
-{
54
-    {0,	0, 0, 0, 0, 0}
55
-};
56
-
57
-/* module exported paramaters */
58
-static param_export_t params[] = {
59
-    {0, 0, 0}
60
-};
61
-
62
-/* module exports */
63
-struct module_exports exports= {
64
-    "presence_mwi",				/* module name */
65
-    DEFAULT_DLFLAGS,            /* dlopen flags */
66
-    cmds,						/* exported functions */
67
-    params,						/* exported parameters */
68
-    0,							/* exported statistics */
69
-    0,							/* exported MI functions */
70
-    0,							/* exported pseudo-variables */
71
-	0,							/* extra processes */
72
-    mod_init,					/* module initialization function */
73
-    0,							/* response handling function */
74
-    0,							/* destroy function */
75
-    0							/* per-child init function */
76
-};
77
-	
78
-/*
79
- * init module function
80
- */
81
-static int mod_init(void)
82
-{
83
-	presence_api_t pres;
84
-    bind_presence_t bind_presence;
85
-
86
-    bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
87
-    if (!bind_presence) {
88
-	LM_ERR("can't bind presence\n");
89
-	return -1;
90
-    }
91
-    if (bind_presence(&pres) < 0) {
92
-	LM_ERR("can't bind pua\n");
93
-	return -1;
94
-    }
95
-
96
-    pres_add_event = pres.add_event;
97
-    if (add_event == NULL) {
98
-	LM_ERR("could not import add_event\n");
99
-	return -1;
100
-    }
101
-    if(mwi_add_events() < 0) {
102
-	LM_ERR("failed to add mwi events\n");
103
-	return -1;		
104
-    }	
105
-    
106
-    return 0;
107
-}
Browse code

- further logging output cleanup in mod_init, mod_destroy: dispatcher, mi_xmlrpc, presence_dialoginfo, presence_mwi, pua, pua_bla, pua_dialoginfo, pua_mi, pua_usrloc - remove now empty mod_init, mod_destroy functions in: presence_dialoginfo, presence_mwi, pua_bla, pua_dialoginfo, pua_mi, pua_usrloc - smaller whitespace and alignment changes in module exports, remove response_function cast from NULL pointer, we don't do this for all other function exports, so it make no sense to handle this one special

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4949 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 18/09/2008 12:02:39
Showing 1 changed files
... ...
@@ -44,8 +44,6 @@ MODULE_VERSION
44 44
 
45 45
 /* module functions */
46 46
 static int mod_init(void);
47
-static int child_init(int);
48
-static void destroy(void);
49 47
 
50 48
 /* module variables */
51 49
 add_event_t pres_add_event;
... ...
@@ -63,18 +61,18 @@ static param_export_t params[] = {
63 61
 
64 62
 /* module exports */
65 63
 struct module_exports exports= {
66
-    "presence_mwi",		/* module name */
64
+    "presence_mwi",				/* module name */
67 65
     DEFAULT_DLFLAGS,            /* dlopen flags */
68
-    cmds,			/* exported functions */
69
-    params,			/* exported parameters */
70
-    0,			        /* exported statistics */
71
-    0,				/* exported MI functions */
72
-    0,				/* exported pseudo-variables */
73
-	0,				/* extra processes */
74
-    mod_init,			/* module initialization function */
75
-    (response_function) 0,	/* response handling function */
76
-    destroy,			/* destroy function */
77
-    child_init                  /* per-child init function */
66
+    cmds,						/* exported functions */
67
+    params,						/* exported parameters */
68
+    0,							/* exported statistics */
69
+    0,							/* exported MI functions */
70
+    0,							/* exported pseudo-variables */
71
+	0,							/* extra processes */
72
+    mod_init,					/* module initialization function */
73
+    0,							/* response handling function */
74
+    0,							/* destroy function */
75
+    0							/* per-child init function */
78 76
 };
79 77
 	
80 78
 /*
... ...
@@ -107,17 +105,3 @@ static int mod_init(void)
107 105
     
108 106
     return 0;
109 107
 }
110
-
111
-static int child_init(int rank)
112
-{
113
-    LM_DBG("[%d] pid [%d]\n", rank, getpid());
114
-	
115
-    return 0;
116
-}	
117
-
118
-static void destroy(void)
119
-{	
120
-    LM_DBG("destroying module ...\n");
121
-
122
-    return;
123
-}
Browse code

- cleanup in modules, instead of logging module initialization in each mod_init (with different messages, levels..) do this in the core

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4657 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 10/08/2008 22:51:44
Showing 1 changed files
... ...
@@ -83,8 +83,6 @@ struct module_exports exports= {
83 83
 static int mod_init(void)
84 84
 {
85 85
 	presence_api_t pres;
86
-    LM_INFO("initializing...\n");
87
-
88 86
     bind_presence_t bind_presence;
89 87
 
90 88
     bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
Browse code

- change name in copyright headers

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@4518 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt authored on 28/07/2008 15:39:28
Showing 1 changed files
... ...
@@ -3,14 +3,14 @@
3 3
  *
4 4
  * Copyright (C) 2007 Juha Heinanen
5 5
  *
6
- * This file is part of openser, a free SIP server.
6
+ * This file is part of Kamailio, a free SIP server.
7 7
  *
8
- * openser is free software; you can redistribute it and/or modify
8
+ * Kamailio is free software; you can redistribute it and/or modify
9 9
  * it under the terms of the GNU General Public License as published by
10 10
  * the Free Software Foundation; either version 2 of the License, or
11 11
  * (at your option) any later version
12 12
  *
13
- * openser is distributed in the hope that it will be useful,
13
+ * Kamailio is distributed in the hope that it will be useful,
14 14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
Browse code

- cmd_export_t has a new field: free_fixup - it is the function to be called if you want to free the structure resulted after calling the fixup function - to be used in dynamic environments, like perl scripts, where you have to call fixup function every time you call a function exported by modules - for future, a better cleanup of used memory can be achived by freeing fixed strucutred in config file - fixup functions in core got the free_fixup pair if is the case - textops has some free_fixup functions set - dev version increased

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2845 689a6050-402a-0410-94f2-e92a70836424

Daniel-Constantin Mierla authored on 04/10/2007 11:21:22
Showing 1 changed files
... ...
@@ -53,7 +53,7 @@ add_event_t pres_add_event;
53 53
 /* module exported commands */
54 54
 static cmd_export_t cmds[] =
55 55
 {
56
-    {0,	0, 0, 0, 0}
56
+    {0,	0, 0, 0, 0, 0}
57 57
 };
58 58
 
59 59
 /* module exported paramaters */
Browse code

- more log messages migrated to LM_* format credits go to Ancuta Onofrei <ancuta@voice-system.ro>

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2802 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 21/09/2007 14:11:40
Showing 1 changed files
... ...
@@ -83,27 +83,27 @@ struct module_exports exports= {
83 83
 static int mod_init(void)
84 84
 {
85 85
 	presence_api_t pres;
86
-    DBG("presence_mwi: mod_init...\n");
86
+    LM_INFO("initializing...\n");
87 87
 
88 88
     bind_presence_t bind_presence;
89 89
 
90 90
     bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
91 91
     if (!bind_presence) {
92
-	LOG(L_ERR, "presence_mwi:mod_init: Can't bind presence\n");
92
+	LM_ERR("can't bind presence\n");
93 93
 	return -1;
94 94
     }
95 95
     if (bind_presence(&pres) < 0) {
96
-	LOG(L_ERR, "presence_mwi:mod_init Can't bind pua\n");
96
+	LM_ERR("can't bind pua\n");
97 97
 	return -1;
98 98
     }
99 99
 
100 100
     pres_add_event = pres.add_event;
101 101
     if (add_event == NULL) {
102
-	LOG(L_ERR, "presence_mwi:mod_init Could not import add_event\n");
102
+	LM_ERR("could not import add_event\n");
103 103
 	return -1;
104 104
     }
105 105
     if(mwi_add_events() < 0) {
106
-	LOG(L_ERR, "presence_mwi:mod_init: ERROR while adding mwi events\n");
106
+	LM_ERR("failed to add mwi events\n");
107 107
 	return -1;		
108 108
     }	
109 109
     
... ...
@@ -112,14 +112,14 @@ static int mod_init(void)
112 112
 
113 113
 static int child_init(int rank)
114 114
 {
115
-    DBG("presence_mwi: init_child [%d] pid [%d]\n", rank, getpid());
115
+    LM_DBG("[%d] pid [%d]\n", rank, getpid());
116 116
 	
117 117
     return 0;
118 118
 }	
119 119
 
120 120
 static void destroy(void)
121 121
 {	
122
-    DBG("presence_mwi: destroying module ...\n");
122
+    LM_DBG("destroying module ...\n");
123 123
 
124 124
     return;
125 125
 }
Browse code

- modified presence and presence_xml to allow using external XCAP servers with the possibility to configure the mode of operation through presence_xml module parameter 'integrated_xcap_server'

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2628 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu authored on 22/08/2007 13:32:55
Showing 1 changed files
... ...
@@ -48,7 +48,6 @@ static int child_init(int);
48 48
 static void destroy(void);
49 49
 
50 50
 /* module variables */
51
-event_api_t pres;
52 51
 add_event_t pres_add_event;
53 52
 
54 53
 /* module exported commands */
... ...
@@ -83,6 +82,7 @@ struct module_exports exports= {
83 82
  */
84 83
 static int mod_init(void)
85 84
 {
85
+	presence_api_t pres;
86 86
     DBG("presence_mwi: mod_init...\n");
87 87
 
88 88
     bind_presence_t bind_presence;
Browse code

- included memory caching storage with the possibility to configure a fallback to database mode

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2604 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu authored on 16/08/2007 07:35:58
Showing 1 changed files
... ...
@@ -28,6 +28,8 @@
28 28
 #include <stdlib.h>
29 29
 #include <string.h>
30 30
 #include <time.h>
31
+#include <sys/types.h>
32
+#include <unistd.h>
31 33
 
32 34
 #include "../../sr_module.h"
33 35
 #include "../../dprint.h"
Browse code

- added new field in the module interface - list of the additional processes to be created (work on progress)

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2554 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 31/07/2007 13:01:04
Showing 1 changed files
... ...
@@ -69,6 +69,7 @@ struct module_exports exports= {
69 69
     0,			        /* exported statistics */
70 70
     0,				/* exported MI functions */
71 71
     0,				/* exported pseudo-variables */
72
+	0,				/* extra processes */
72 73
     mod_init,			/* module initialization function */
73 74
     (response_function) 0,	/* response handling function */
74 75
     destroy,			/* destroy function */
Browse code

* Introduced presence_mwi module (see presence_mwi/README).

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2102 689a6050-402a-0410-94f2-e92a70836424

Juha Heinanen authored on 30/04/2007 13:43:26
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,122 @@
1
+/*
2
+ * presence_mwi module - Presence Handling of message-summary events
3
+ *
4
+ * Copyright (C) 2007 Juha Heinanen
5
+ *
6
+ * This file is part of openser, a free SIP server.
7
+ *
8
+ * openser 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
+ * openser 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
+ * History:
23
+ * --------
24
+ *  2007-05-1  initial version (jih)
25
+ */
26
+
27
+#include <stdio.h>
28
+#include <stdlib.h>
29
+#include <string.h>
30
+#include <time.h>
31
+
32
+#include "../../sr_module.h"
33
+#include "../../dprint.h"
34
+#include "../../str.h"
35
+#include "../../parser/msg_parser.h"
36
+#include "../../mem/mem.h"
37
+#include "../presence/bind_presence.h"
38
+#include "add_events.h"
39
+#include "presence_mwi.h"
40
+
41
+MODULE_VERSION
42
+
43
+/* module functions */
44
+static int mod_init(void);
45
+static int child_init(int);
46
+static void destroy(void);
47
+
48
+/* module variables */
49
+event_api_t pres;
50
+add_event_t pres_add_event;
51
+
52
+/* module exported commands */
53
+static cmd_export_t cmds[] =
54
+{
55
+    {0,	0, 0, 0, 0}
56
+};
57
+
58
+/* module exported paramaters */
59
+static param_export_t params[] = {
60
+    {0, 0, 0}
61
+};
62
+
63
+/* module exports */
64
+struct module_exports exports= {
65
+    "presence_mwi",		/* module name */
66
+    DEFAULT_DLFLAGS,            /* dlopen flags */
67
+    cmds,			/* exported functions */
68
+    params,			/* exported parameters */
69
+    0,			        /* exported statistics */
70
+    0,				/* exported MI functions */
71
+    0,				/* exported pseudo-variables */
72
+    mod_init,			/* module initialization function */
73
+    (response_function) 0,	/* response handling function */
74
+    destroy,			/* destroy function */
75
+    child_init                  /* per-child init function */
76
+};
77
+	
78
+/*
79
+ * init module function
80
+ */
81
+static int mod_init(void)
82
+{
83
+    DBG("presence_mwi: mod_init...\n");
84
+
85
+    bind_presence_t bind_presence;
86
+
87
+    bind_presence= (bind_presence_t)find_export("bind_presence", 1,0);
88
+    if (!bind_presence) {
89
+	LOG(L_ERR, "presence_mwi:mod_init: Can't bind presence\n");
90
+	return -1;
91
+    }
92
+    if (bind_presence(&pres) < 0) {
93
+	LOG(L_ERR, "presence_mwi:mod_init Can't bind pua\n");
94
+	return -1;
95
+    }
96
+
97
+    pres_add_event = pres.add_event;
98
+    if (add_event == NULL) {
99
+	LOG(L_ERR, "presence_mwi:mod_init Could not import add_event\n");
100
+	return -1;
101
+    }
102
+    if(mwi_add_events() < 0) {
103
+	LOG(L_ERR, "presence_mwi:mod_init: ERROR while adding mwi events\n");
104
+	return -1;		
105
+    }	
106
+    
107
+    return 0;
108
+}
109
+
110
+static int child_init(int rank)
111
+{
112
+    DBG("presence_mwi: init_child [%d] pid [%d]\n", rank, getpid());
113
+	
114
+    return 0;
115
+}	
116
+
117
+static void destroy(void)
118
+{	
119
+    DBG("presence_mwi: destroying module ...\n");
120
+
121
+    return;
122
+}