Module: sip-router
Branch: master
Commit: de1509aa7f2ade90074c2fe3b9b13e65224c4b43
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=de1509a…
Author: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Committer: Alexandr Dubovikov <alexandr.dubovikov(a)gmail.com>
Date: Fri Sep 30 11:37:35 2011 +0200
modules:sipcapture: ETHHDR moved from .h to .c, changed method check in kamailio.cfg
---
modules/sipcapture/examples/kamailio.cfg | 7 ++++---
modules/sipcapture/sipcapture.c | 3 +++
modules/sipcapture/sipcapture.h | 2 --
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/modules/sipcapture/examples/kamailio.cfg
b/modules/sipcapture/examples/kamailio.cfg
index a4e7a07..eaf57fa 100644
--- a/modules/sipcapture/examples/kamailio.cfg
+++ b/modules/sipcapture/examples/kamailio.cfg
@@ -25,6 +25,7 @@
mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
loadmodule "pv.so"
loadmodule "db_mysql.so"
loadmodule "sipcapture.so"
+loadmodule "textops.so"
# ----- mi_fifo params -----
@@ -58,7 +59,7 @@ modparam("sipcapture", "raw_sock_children", 4)
route {
#For example, you can capture only needed methods...
- #if (method =~ "^(INVITE|UPDATE|NOTIFY|SUBSCRIBE|OPTIONS|REGISTER|BYE)") {
+ #if (is_method("INVITE|UPDATE|NOTIFY|SUBSCRIBE|OPTIONS|REGISTER|BYE")) {
sip_capture();
#}
exit;
@@ -67,8 +68,8 @@ route {
onreply_route {
#And replies of request methods
- #if(status =~ "^(1[0-9][0-9]|[3[0-9][0-9]|4[0-9]|[56][0-9][0-9])") {
- #if($rm =~ "^(INVITE|UPDATE|NOTIFY|SUBSCRIBE|OPTIONS|REGISTER|BYE)") {
+ #if(status =~ "^(1[0-9][0-9]|[3[0-9][0-9]|4[0-9]|[56][0-9][0-9])$") {
+ #if($rm =~ "^(INVITE|UPDATE|NOTIFY|SUBSCRIBE|OPTIONS|REGISTER|BYE)$") {
sip_capture();
#}
exit;
diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c
index 9dd357e..2d4d459 100644
--- a/modules/sipcapture/sipcapture.c
+++ b/modules/sipcapture/sipcapture.c
@@ -76,6 +76,7 @@
#include "../../lib/kcore/statistics.h"
#endif
+
MODULE_VERSION
struct _sipcapture_object {
@@ -119,6 +120,8 @@ struct _sipcapture_object {
#endif
};
+#define ETHHDR 14 /* sizeof of ethhdr structure */
+
#define EMPTY_STR(val) val.s=""; val.len=0;
#define TABLE_LEN 256
diff --git a/modules/sipcapture/sipcapture.h b/modules/sipcapture/sipcapture.h
index 1e670c4..0ee665c 100644
--- a/modules/sipcapture/sipcapture.h
+++ b/modules/sipcapture/sipcapture.h
@@ -45,8 +45,6 @@ struct hep_ip6hdr {
};
#endif
-#define ETHHDR 14 /* sizeof of ethhdr structure */
-
/* Make it independed */
/* Copied from linux/filter.h */
struct my_sock_filter /* Filter block */