Revision: 5910
http://openser.svn.sourceforge.net/openser/?rev=5910&view=rev
Author: henningw
Date: 2009-08-06 17:08:30 +0000 (Thu, 06 Aug 2009)
Log Message:
-----------
- fix error in auth_db documentation for calc_ha1 parameter
Modified Paths:
--------------
branches/1.3/modules/auth_db/README
branches/1.3/modules/auth_db/doc/auth_db_user.sgml
branches/1.4/modules/auth_db/README
branches/1.4/modules/auth_db/doc/auth_db_admin.xml
branches/1.5/modules/auth_db/README
branches/1.5/modules/auth_db/doc/auth_db_admin.xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5909
http://openser.svn.sourceforge.net/openser/?rev=5909&view=rev
Author: anomarme
Date: 2009-08-05 11:34:36 +0000 (Wed, 05 Aug 2009)
Log Message:
-----------
- fix memory leak
Modified Paths:
--------------
branches/1.5/modules/rls/notify.c
branches/1.5/modules/rls/resource_notify.c
branches/1.5/modules/rls/subscribe.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5908
http://openser.svn.sourceforge.net/openser/?rev=5908&view=rev
Author: anomarme
Date: 2009-08-04 15:47:21 +0000 (Tue, 04 Aug 2009)
Log Message:
-----------
- fixed supported header name
Modified Paths:
--------------
branches/1.5/modules/rls/subscribe.c
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Hello,
I committed in branch tmp/core_events a simple framework to execute
callbacks by core in various cases. So far there are two defined events:
for network data in and data out.
I used it for implementing a topo-hiding module that is transparent for
script writer and cope with stateless/stateful module in the same way.
Now, about the new event framework.
The core stores a structure with pointers to event manager callbacks.
typedef int (*sr_event_cb_f)(void *data);
typedef struct sr_event_cb {
sr_event_cb_f net_data_in;
sr_event_cb_f net_data_out;
} sr_event_cb_t;
The event manager can be implemented elsewhere, but the execution of
call manager and implementation must be very tied. The event manager
callback gets only one parameter, which is a void* and is specific per
event, thus the implementation must know what is the content.
So far, only one listener is needed for network data in/out events, thus
the event manager does the processing, but if the event should trigger
more functions from different parts of code, then the manager must take
of handling them (registration, execution, etc...).
You can download the branch and test the topoh module. It will be merged
once we discuss and decide whether the new core events framework is the
best for now, if something is missing, a.s.o.
Feedback is very much appreciated.
Cheers,
Daniel
--
Daniel-Constantin Mierla
* SIP Router Bootcamp
* Kamailio (OpenSER) and Asterisk Training
* Berlin, Germany, Sep 1-4, 2009
* http://www.asipto.com/index.php/sip-router-bootcamp/
Module: sip-router
Branch: tmp/core_events
Commit: 85acffe10f182c5d0cfb382f33ff5a2d1203524a
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=85acffe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Tue Aug 4 16:47:10 2009 +0200
core: new sr events system
- designed to have small footprint in core
- the goal is to execute a event manager function during core processing
- event managers can be implemented in modules or elsewhere
- two event types added: SREV_NET_DATA_IN and SREV_NET_DATA_OUT (see the
other commit)
---
events.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
events.h | 40 +++++++++++++++++++++++++++
2 files changed, 130 insertions(+), 0 deletions(-)
diff --git a/events.c b/events.c
new file mode 100644
index 0000000..7ba5e34
--- /dev/null
+++ b/events.c
@@ -0,0 +1,90 @@
+/**
+ * $Id$
+ *
+ * Copyright (C) 2009 SIP-Router.org
+ *
+ * This file is part of Extensible SIP Router, a free SIP server.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "dprint.h"
+#include "mem/mem.h"
+#include "events.h"
+
+static sr_event_cb_t _sr_events_list;
+static int _sr_events_inited = 0;
+
+void sr_event_cb_init(void)
+{
+ if(_sr_events_inited == 0)
+ {
+ memset(&_sr_events_list, 0, sizeof(sr_event_cb_t));
+ _sr_events_inited = 1;
+ }
+}
+
+int sr_event_register_cb(int type, sr_event_cb_f f)
+{
+ sr_event_cb_init();
+ switch(type) {
+ case SREV_NET_DATA_IN:
+ if(_sr_events_list.net_data_in==0)
+ _sr_events_list.net_data_in = f;
+ else return -1;
+ break;
+ case SREV_NET_DATA_OUT:
+ if(_sr_events_list.net_data_out==0)
+ _sr_events_list.net_data_out = f;
+ else return -1;
+ break;
+ default:
+ return -1;
+ }
+ return 0;
+}
+
+int sr_event_exec(int type, void *data)
+{
+ int ret;
+ str *p;
+ switch(type) {
+ case SREV_NET_DATA_IN:
+ if(_sr_events_list.net_data_in!=0)
+ {
+ p = (str*)data;
+ LM_DBG("PRE-IN ++++++++++++++++++++++++++++++++\n"
+ "%.*s\n+++++\n", p->len, p->s);
+ ret = _sr_events_list.net_data_in(data);
+ LM_DBG("POST-IN ++++++++++++++++++++++++++++++++\n"
+ "%.*s\n+++++\n", p->len, p->s);
+ return ret;
+ } else return 1;
+ break;
+ case SREV_NET_DATA_OUT:
+ if(_sr_events_list.net_data_out!=0)
+ {
+ p = (str*)data;
+ LM_DBG("PRE-OUT ++++++++++++++++++++\n"
+ "%.*s\n+++++++++++++++++++\n", p->len, p->s);
+ ret = _sr_events_list.net_data_out(data);
+ LM_DBG("POST-OUT ++++++++++++++++++++\n"
+ "%.*s\n+++++++++++++++++++\n", p->len, p->s);
+ return ret;
+ } else return 1;
+ break;
+ default:
+ return -1;
+ }
+}
+
diff --git a/events.h b/events.h
new file mode 100644
index 0000000..9fda619
--- /dev/null
+++ b/events.h
@@ -0,0 +1,40 @@
+/**
+ * $Id$
+ *
+ * Copyright (C) 2009 SIP-Router.org
+ *
+ * This file is part of Extensible SIP Router, a free SIP server.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _SR_EVENTS_H_
+#define _SR_EVENTS_H_
+
+#include "parser/msg_parser.h"
+
+#define SREV_NET_DATA_IN 1
+#define SREV_NET_DATA_OUT 2
+
+typedef int (*sr_event_cb_f)(void *data);
+
+typedef struct sr_event_cb {
+ sr_event_cb_f net_data_in;
+ sr_event_cb_f net_data_out;
+} sr_event_cb_t;
+
+void sr_event_cb_init(void);
+int sr_event_register_cb(int type, sr_event_cb_f f);
+int sr_event_exec(int type, void *data);
+
+#endif
Thanks to Klaus Darilion, QjSimple 0.6.3 works on most of desktop OS:
Linux(es), Windows and Mac OS X.
It is a very handy application, especially for developers, but not olny,
with simple UI and debugger window. A perfect replacement (for my very
old good Linux testing tool) KPhone since QjSimple has SIMPLE presence
support, tls ... more at:
http://www.ipcom.at/index.php?id=560/
Cheers,
Daniel
--
Daniel-Constantin Mierla
* SIP Router Bootcamp
* Kamailio (OpenSER) and Asterisk Training
* Berlin, Germany, Sep 1-4, 2009
* http://www.asipto.com/index.php/sip-router-bootcamp/