[sr-dev] git:master: core: remove sctp options init from core

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: e9f7980602cadcc179425cad57a4d0f89c63fb55
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e9f7980602cadcc179425cad57a4d0f89c63fb55

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 15:39:13 2013 +0200

core: remove sctp options init from core

- will be done in mod_register() from sctp module
- don't print anymore info about sctp unsupported socket options in
  output of -v, they are known now only in sctp module which is not
  loaded at that time
- sctp will print a warn message in mod init about unsupported socket
  options

---

 main.c |9 -
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/main.c b/main.c
index e489daf..05f45b5 100644
--- a/main.c
+++ b/main.c
@@ -1901,9 +1901,6 @@ int main(int argc, char** argv)
 #ifdef USE_TCP
init_tcp_options(); /* set the defaults before the config */
 #endif
-#ifdef USE_SCTP
-   sctp_core_init_options(); /* set defaults before the config */
-#endif
/* process command line (cfg. file path etc) */
optind = 1;  /* reset getopt */
/* switches required before script processing */
@@ -1941,12 +1938,6 @@ int main(int argc, char** argv)
printf(version: %s\n, full_version);
printf(flags: %s\n, ver_flags );
print_ct_constants();
-#ifdef USE_SCTP
-   tmp=malloc(256);
-   if (tmp  
(sctp_core_check_compiled_sockopts(tmp, 256)!=0))
-   printf(sctp unsupported socket 
options: %s\n, tmp);
-   if (tmp) free(tmp);
-#endif
printf(id: %s\n, ver_id);
printf(compiled on %s with %s\n,
ver_compiled_time, 
ver_compiler );


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: filled sctp core api

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: a2afc3d42224d0c35e4867ad50251e7aa6231879
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a2afc3d42224d0c35e4867ad50251e7aa6231879

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 15:42:14 2013 +0200

core: filled sctp core api

- cleanup of not needed members

---

 sctp_core.c |   29 ++---
 sctp_core.h |2 --
 2 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/sctp_core.c b/sctp_core.c
index 19ffda6..49b1da6 100644
--- a/sctp_core.c
+++ b/sctp_core.c
@@ -44,29 +44,20 @@ int sctp_core_init(void)
  */
 void sctp_core_destroy(void)
 {
-}
-
-/**
- *
- */
-int sctp_core_init_sock(struct socket_info* sock_info)
-{
-   return 0;
-}
+   if(_sctp_srapi_set==0) {
+   LM_INFO(SCTP API not initialized\n);
+   return;
+   }
 
-/**
- *
- */
-void sctp_core_init_options(void)
-{
+   _sctp_srapi.destroy();
 }
 
 /**
  *
  */
-int sctp_core_check_compiled_sockopts(char* buf, int size)
+int sctp_core_init_sock(struct socket_info* sock_info)
 {
-   return 0;
+   return _sctp_srapi.init_sock(sock_info);
 }
 
 /**
@@ -74,7 +65,7 @@ int sctp_core_check_compiled_sockopts(char* buf, int size)
  */
 int sctp_core_check_support(void)
 {
-   return 0;
+   return _sctp_srapi.check_support();
 }
 
 /**
@@ -82,7 +73,7 @@ int sctp_core_check_support(void)
  */
 int sctp_core_rcv_loop(void)
 {
-   return 0;
+   return _sctp_srapi.rcv_loop();
 }
 
 /**
@@ -90,7 +81,7 @@ int sctp_core_rcv_loop(void)
  */
 int sctp_core_msg_send(struct dest_info* dst, char* buf, unsigned len)
 {
-   return 0;
+   return _sctp_srapi.msg_send(dst, buf, len);
 }
 
 /**
diff --git a/sctp_core.h b/sctp_core.h
index 362dd38..88e0470 100644
--- a/sctp_core.h
+++ b/sctp_core.h
@@ -52,8 +52,6 @@ typedef struct sctp_srapi {
sctp_srapi_init_f init;
sctp_srapi_destroy_f destroy;
sctp_srapi_init_sock_f init_sock;
-   sctp_srapi_init_options_f init_options;
-   sctp_srapi_check_compiled_sockopts_f check_compiled_sockopts;
sctp_srapi_check_support_f check_support;
sctp_srapi_rcv_loop_f rcv_loop;
sctp_srapi_msg_send_f msg_send;


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: protoshoot: use Makefile pattern for utils

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 1bdbdb64e4862ddb69c2bf13be0f9be93968bb1e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1bdbdb64e4862ddb69c2bf13be0f9be93968bb1e

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 16:30:33 2013 +0200

protoshoot: use Makefile pattern for utils

- link to libsctp if SCTP support is enabled

---

 utils/protoshoot/Makefile |   19 ---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/utils/protoshoot/Makefile b/utils/protoshoot/Makefile
index 1adba1f..9f6efd4 100644
--- a/utils/protoshoot/Makefile
+++ b/utils/protoshoot/Makefile
@@ -1,13 +1,26 @@
 #
 
-include ../../Makefile.defs
+COREPATH=../..
+include $(COREPATH)/Makefile.defs
+include $(COREPATH)/Makefile.targets
 
 auto_gen=
 NAME=protoshoot
+RELEASE=0.2
 
-include ../../Makefile.sources
+ifneq (,$(findstring -DUSE_SCTP,$(C_DEFS)))
+SCTP=1
+endif
 
-include ../../Makefile.rules
+ifeq ($(SCTP),1)
+ifeq ($(OS), linux)
+   LIBS+= -lsctp
+endif
+endif
+
+include $(COREPATH)/Makefile.utils
+
+$(NAME).o:
 
 modules:
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: Makefile.groups: added compile group for sctp module

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 25c3df171d219eb71c63f4832b69f33b470c9c96
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=25c3df171d219eb71c63f4832b69f33b470c9c96

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 16:42:21 2013 +0200

Makefile.groups: added compile group for sctp module

- depends on libsctp-dev

---

 Makefile.groups |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.groups b/Makefile.groups
index ff2aa57..f27cdcb 100644
--- a/Makefile.groups
+++ b/Makefile.groups
@@ -101,6 +101,9 @@ mod_list_stun=stun
 # - modules depending on libval-threads libcrypto libsres libpthread
 mod_list_dnssec=dnssec
 
+# - modules depending on libsctp
+mod_list_sctp=sctp
+
 # - modules related to SIMPLE presence extensions
 mod_list_presence=presence presence_conference presence_dialoginfo \
   presence_mwi presence_profile 
presence_reginfo \
@@ -172,7 +175,7 @@ mod_list_all=$(sort $(mod_list_basic) $(mod_list_extra) \
   $(mod_list_iptrtpproxy) $(mod_list_mi_xmlrpc) \
   $(mod_list_outbound) $(mod_list_osp) \
   $(mod_list_java) $(mod_list_stun) \
-  $(mod_list_dnssec))
+  $(mod_list_dnssec) $(mod_list_sctp))
 
 
 
@@ -327,6 +330,9 @@ module_group_kstun=$(mod_list_stun)
 # pkg dnssec module
 module_group_kdnssec=$(mod_list_dnssec)
 
+# pkg sctp module
+module_group_ksctp=$(mod_list_sctp)
+
 # list of static modules
 #
 static_modules:=


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: sctp: added skeleton files for docbook module documentation

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c4cf64ea992e0f0f46f1c6fc23c6f38c05a80b0f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c4cf64ea992e0f0f46f1c6fc23c6f38c05a80b0f

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 17:05:58 2013 +0200

sctp: added skeleton files for docbook module documentation

---

 modules/sctp/README |   98 ++
 modules/sctp/doc/Makefile   |4 ++
 modules/sctp/doc/sctp.xml   |   34 
 modules/sctp/doc/sctp_admin.xml |  110 +++
 4 files changed, 246 insertions(+), 0 deletions(-)

diff --git a/modules/sctp/README b/modules/sctp/README
new file mode 100644
index 000..c6d1e02
--- /dev/null
+++ b/modules/sctp/README
@@ -0,0 +1,98 @@
+SCTP Module
+
+Daniel-Constantin Mierla
+
+   mico...@gmail.com
+
+Andrei Pelinescu-Onciul
+ __
+
+   Table of Contents
+
+   1. Admin Guide
+
+1. Overview
+2. Dependencies
+
+  2.1. Kamailio Modules
+  2.2. External Libraries or Applications
+
+3. Parameters
+
+  3.1. sctp_socket_rcvbuf (int)
+  3.2. sctp_ (int)
+
+   List of Examples
+
+   1.1. Set sctp_socket_rcvbuf parameter
+   1.2. Set sctp_ parameter
+
+Chapter 1. Admin Guide
+
+   Table of Contents
+
+   1. Overview
+   2. Dependencies
+
+2.1. Kamailio Modules
+2.2. External Libraries or Applications
+
+   3. Parameters
+
+3.1. sctp_socket_rcvbuf (int)
+3.2. sctp_ (int)
+
+1. Overview
+
+   This module provides SCTP transport layer for Kamailio. SCTP is an
+   acronym for Stream Control Transmission Protocol, read more about it
+   at: http://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol
+
+   The module itself implements the callbacks required by the core to
+   receive and send SIP messages over SCTP sockets.
+
+   The core Makefile variable SCTP must be set to 1 (which is by default
+   set to 1 in Makefile.defs) and sources compiled with -DUSE_SCTP
+   (automatically set when SCTP=1). In other words, if core Makefiles are
+   not changed and SCTP variable is not overwritten from command line,
+   then the SCTP support in core is enabled.
+
+2. Dependencies
+
+   2.1. Kamailio Modules
+   2.2. External Libraries or Applications
+
+2.1. Kamailio Modules
+
+   The following modules must be loaded before this module:
+ * none.
+
+2.2. External Libraries or Applications
+
+   The following libraries or applications must be installed before
+   running Kamailio with this module loaded:
+ * libsctp - SCTP user space library available on Linux. To compile
+   the module, libsctp-dev is required as well.
+
+3. Parameters
+
+   3.1. sctp_socket_rcvbuf (int)
+   3.2. sctp_ (int)
+
+3.1. sctp_socket_rcvbuf (int)
+
+   Default value is automatically set based on OS limits.
+
+   Example 1.1. Set sctp_socket_rcvbuf parameter
+...
+modparam(sctp, sctp_socket_rcvbuf, )
+...
+
+3.2. sctp_ (int)
+
+   Default value is 1.
+
+   Example 1.2. Set sctp_ parameter
+...
+modparam(sctp, sctp, )
+...
diff --git a/modules/sctp/doc/Makefile b/modules/sctp/doc/Makefile
new file mode 100644
index 000..953e62d
--- /dev/null
+++ b/modules/sctp/doc/Makefile
@@ -0,0 +1,4 @@
+docs = sctp.xml
+
+docbook_dir = ../../../docbook
+include $(docbook_dir)/Makefile.module
diff --git a/modules/sctp/doc/sctp.xml b/modules/sctp/doc/sctp.xml
new file mode 100644
index 000..4f03c2f
--- /dev/null
+++ b/modules/sctp/doc/sctp.xml
@@ -0,0 +1,34 @@
+?xml version=1.0 encoding='ISO-8859-1'?
+!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.4//EN
+http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd; [
+
+!-- Include general documentation entities --
+!ENTITY % docentities SYSTEM ../../../docbook/entities.xml
+%docentities;
+
+]
+
+book xmlns:xi=http://www.w3.org/2001/XInclude;
+bookinfo
+   titleSCTP Module/title
+   productname class=tradekamailio.org/productname
+   authorgroup
+   author
+   firstnameDaniel-Constantin/firstname
+   surnameMierla/surname
+   emailmico...@gmail.com/email
+   /author
+author
+firstnameAndrei/firstname
+surnamePelinescu-Onciul/surname
+address
+emailand...@iptel.org/email
+/address
+/author
+   /authorgroup
+/bookinfo
+toc/toc
+
+xi:include href=sctp_admin.xml/
+
+/book
diff --git a/modules/sctp/doc/sctp_admin.xml b/modules/sctp/doc/sctp_admin.xml
new file mode 100644
index 000..f95bc9e
--- /dev/null
+++ b/modules/sctp/doc/sctp_admin.xml
@@ -0,0 +1,110 @@
+?xml version=1.0 encoding='ISO-8859-1'?
+!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.4//EN
+http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd; [
+
+!-- Include general documentation entities

[sr-dev] git:master: Makefile.defs: version set to 4.1.0-dev6

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 2e6675bd92968fd96865ee266ca4ba10c7cc1cdc
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2e6675bd92968fd96865ee266ca4ba10c7cc1cdc

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 17:14:23 2013 +0200

Makefile.defs: version set to 4.1.0-dev6

---

 Makefile.defs |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.defs b/Makefile.defs
index b5fe3bb..7026f5d 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -161,11 +161,11 @@ SCTP ?= 1
 # what to install
 INSTALL_FLAVOUR=$(FLAVOUR)
 
-#version number
+# version number
 VERSION = 4
 PATCHLEVEL = 1
 SUBLEVEL =  0
-EXTRAVERSION = -dev5
+EXTRAVERSION = -dev6
 
 # memory manager switcher
 # 0 - f_malloc (fast malloc)


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: sctp: documented module parameters

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 93d97e53741d786692903bd9df9622cd55e4cfea
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=93d97e53741d786692903bd9df9622cd55e4cfea

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 21:04:43 2013 +0200

sctp: documented module parameters

---

 modules/sctp/README |  386 ++-
 modules/sctp/doc/sctp_admin.xml |  491 ++-
 2 files changed, 862 insertions(+), 15 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=93d97e53741d786692903bd9df9622cd55e4cfea

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: tm: return current branch id if sending fails and tm_failure_exec_mode=1

2013-05-25 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 59c4a6550862ed7c3e8c63a3a5d5c1dcd404bd6d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=59c4a6550862ed7c3e8c63a3a5d5c1dcd404bd6d

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 21:28:33 2013 +0200

tm: return current branch id if sending fails and tm_failure_exec_mode=1

- reported by Juha Heinanen

---

 modules/tm/t_fwd.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index 6ac7bd8..86c5daa 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -1592,7 +1592,7 @@ int t_send_branch( struct cell *t, int branch, struct 
sip_msg* p_msg ,
failed\n, branch);
if (proxy) { proxy-errors++; proxy-ok=0; }
if(tm_failure_exec_mode==1) {
-   LOG(L_ERR, putting branch %d on hold \n, branch);
+   LM_DBG(putting branch %d on hold \n, branch);
/* put on retransmission timer,
 * but set proto to NONE, so actually it is not trying 
to resend */
uac-request.dst.proto = PROTO_NONE;
@@ -1604,7 +1604,7 @@ int t_send_branch( struct cell *t, int branch, struct 
sip_msg* p_msg ,
uac-request);
return -2;
}
-   return ret;
+   return branch;
}
return -2;
} else {


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dmq: many safety checks for mem mallocs and function return codes

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 1977645ceb12ca2d0f2f767046606f6c5ae2c3bb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1977645ceb12ca2d0f2f767046606f6c5ae2c3bb

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 10:43:24 2013 +0200

dmq: many safety checks for mem mallocs and function return codes

- added license header in the files

---

 modules/dmq/bind_dmq.c  |   27 ++
 modules/dmq/bind_dmq.h  |   35 +++-
 modules/dmq/dmq.c   |   46 +++---
 modules/dmq/dmq.h   |   29 ++-
 modules/dmq/dmq_funcs.c |  128 ++-
 modules/dmq/dmq_funcs.h |   38 +++-
 modules/dmq/dmqnode.c   |  185 +--
 modules/dmq/dmqnode.h   |   29 ++-
 modules/dmq/message.c   |   37 -
 modules/dmq/message.h   |   28 ++
 modules/dmq/notification_peer.c |   93 +---
 modules/dmq/notification_peer.h |   31 ++-
 modules/dmq/peer.c  |   98 ++---
 modules/dmq/peer.h  |   29 ++-
 modules/dmq/worker.c|  133 +++-
 modules/dmq/worker.h|   30 ++-
 16 files changed, 861 insertions(+), 135 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=1977645ceb12ca2d0f2f767046606f6c5ae2c3bb

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: topoh: safety check for SIP messages

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 352a7dccf2570af857d7e2e50fed600c4762278d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=352a7dccf2570af857d7e2e50fed600c4762278d

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 16:14:51 2013 +0200

topoh: safety check for SIP messages

- received callback can be executed for non-sip messages
- reported by Julia

---

 modules/topoh/topoh_mod.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index f42b928..73ebf21 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -204,6 +204,18 @@ int th_prepare_msg(sip_msg_t *msg)
return 1;
}
 
+   if(msg-first_line.type==SIP_REQUEST)
+   {
+   if(!IS_SIP(msg))
+   {
+   LM_DBG(non sip request message\n);
+   return 1;
+   }
+   } else if(msg-first_line.type!=SIP_REPLY) {
+   LM_DBG(non sip message\n);
+   return 1;
+   }
+
if (parse_headers(msg, HDR_EOH_F, 0)==-1)
{
LM_DBG(parsing headers failed);


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: topoh: safety check for SIP messages

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 533f2238d9d14ed8ef0a367ce574aef8052c0452
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=533f2238d9d14ed8ef0a367ce574aef8052c0452

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 16:14:51 2013 +0200

topoh: safety check for SIP messages

- received callback can be executed for non-sip messages
- reported by Julia
(cherry picked from commit 352a7dccf2570af857d7e2e50fed600c4762278d)

---

 modules/topoh/topoh_mod.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index f42b928..73ebf21 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -204,6 +204,18 @@ int th_prepare_msg(sip_msg_t *msg)
return 1;
}
 
+   if(msg-first_line.type==SIP_REQUEST)
+   {
+   if(!IS_SIP(msg))
+   {
+   LM_DBG(non sip request message\n);
+   return 1;
+   }
+   } else if(msg-first_line.type!=SIP_REPLY) {
+   LM_DBG(non sip message\n);
+   return 1;
+   }
+
if (parse_headers(msg, HDR_EOH_F, 0)==-1)
{
LM_DBG(parsing headers failed);


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:3.3: topoh: safety check for SIP messages

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 3.3
Commit: cd97c66880bc1597d64dd7e075428fcc25a537ee
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cd97c66880bc1597d64dd7e075428fcc25a537ee

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 16:14:51 2013 +0200

topoh: safety check for SIP messages

- received callback can be executed for non-sip messages
- reported by Julia
(cherry picked from commit 352a7dccf2570af857d7e2e50fed600c4762278d)
(cherry picked from commit 533f2238d9d14ed8ef0a367ce574aef8052c0452)

---

 modules/topoh/topoh_mod.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index f42b928..73ebf21 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -204,6 +204,18 @@ int th_prepare_msg(sip_msg_t *msg)
return 1;
}
 
+   if(msg-first_line.type==SIP_REQUEST)
+   {
+   if(!IS_SIP(msg))
+   {
+   LM_DBG(non sip request message\n);
+   return 1;
+   }
+   } else if(msg-first_line.type!=SIP_REPLY) {
+   LM_DBG(non sip message\n);
+   return 1;
+   }
+
if (parse_headers(msg, HDR_EOH_F, 0)==-1)
{
LM_DBG(parsing headers failed);


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: sctp: rpc commands are prefixed with sctp

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: ca923db8727333ad7df14126bb377418a829cce3
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ca923db8727333ad7df14126bb377418a829cce3

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 17:04:23 2013 +0200

sctp: rpc commands are prefixed with sctp

- no longer part of core and proper matching of the module

---

 modules/sctp/sctp_rpc.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/sctp/sctp_rpc.c b/modules/sctp/sctp_rpc.c
index cbed0d6..15dbd07 100644
--- a/modules/sctp/sctp_rpc.c
+++ b/modules/sctp/sctp_rpc.c
@@ -155,9 +155,9 @@ static void core_sctpinfo(rpc_t* rpc, void* c)
  * RPC Methods exported by this module
  */
 static rpc_export_t scp_rpc_methods[] = {
-   {core.sctp_options,  core_sctp_options,  
core_sctp_options_doc,
+   {sctp.options,  core_sctp_options,  core_sctp_options_doc,
0},
-   {core.sctp_info, core_sctpinfo,  core_sctpinfo_doc,   
0},
+   {sctp.info, core_sctpinfo,  core_sctpinfo_doc,   0},
 
{0, 0, 0, 0}
 };


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: sctp: added rpc commands to module documentation

2013-05-26 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 375d878b5f318acc08b155c29398e4abb74edbd5
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=375d878b5f318acc08b155c29398e4abb74edbd5

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 17:11:25 2013 +0200

sctp: added rpc commands to module documentation

---

 modules/sctp/README |   36 
 modules/sctp/doc/sctp_admin.xml |   33 +
 2 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/modules/sctp/README b/modules/sctp/README
index e05854e..1fb71dc 100644
--- a/modules/sctp/README
+++ b/modules/sctp/README
@@ -39,6 +39,11 @@ Andrei Pelinescu-Onciul
   3.18. sctp_sack_freq (int)
   3.19. sctp_max_burst (int)
 
+4. RPC Commands
+
+  4.1. sctp.info
+  4.2. sctp.options
+
List of Examples
 
1.1. Set sctp_socket_rcvbuf parameter
@@ -60,6 +65,8 @@ Andrei Pelinescu-Onciul
1.17. Set sctp_sack_delay parameter
1.18. Set sctp_sack_freq parameter
1.19. Set sctp_max_burst parameter
+   1.20. Use sctp.info with kamcmd
+   1.21. Use sctp.options with kamcmd
 
 Chapter 1. Admin Guide
 
@@ -93,6 +100,11 @@ Chapter 1. Admin Guide
 3.18. sctp_sack_freq (int)
 3.19. sctp_max_burst (int)
 
+   4. RPC Commands
+
+4.1. sctp.info
+4.2. sctp.options
+
 1. Overview
 
This module provides SCTP transport layer for Kamailio. SCTP is an
@@ -464,3 +476,27 @@ modparam(sctp, sctp_sack_freq, 3)
 ...
 modparam(sctp, sctp_max_burst, 3)
 ...
+
+4. RPC Commands
+
+   4.1. sctp.info
+   4.2. sctp.options
+
+4.1. sctp.info
+
+   Print information about SCTP transport.
+
+   Example 1.20. Use sctp.info with kamcmd
+...
+kamcmd sctp.info
+...
+
+4.2. sctp.options
+
+   Print the options of SCTP sockets. It can take an optional parameter
+   that specifies the listen address of SCTP socket.
+
+   Example 1.21. Use sctp.options with kamcmd
+...
+kamcmd sctp.options
+...
diff --git a/modules/sctp/doc/sctp_admin.xml b/modules/sctp/doc/sctp_admin.xml
index 2009fcb..3ede4ca 100644
--- a/modules/sctp/doc/sctp_admin.xml
+++ b/modules/sctp/doc/sctp_admin.xml
@@ -585,5 +585,38 @@ modparam(sctp, sctp_max_burst, 3)
/section
/section
 
+   section
+   titleRPC Commands/title
+   section id=sctp.r.sctp.info
+   titlevarnamesctp.info/varname/title
+   para
+   Print information about SCTP transport.
+   /para
+   example
+   titleUse varnamesctp.info/varname with kamcmd/title
+   programlisting format=linespecific
+...
+kamcmd sctp.info
+...
+/programlisting
+   /example
+   /section
+   section id=sctp.r.sctp.
+   titlevarnamesctp.options/varname/title
+   para
+   Print the options of SCTP sockets. It can take an 
optional
+   parameter that specifies the listen address of SCTP 
socket.
+   /para
+   example
+   titleUse varnamesctp.options/varname with kamcmd/title
+   programlisting format=linespecific
+...
+kamcmd sctp.options
+...
+/programlisting
+   /example
+   /section
+   /section
+
 /chapter
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master: modules/usrloc: added two new rpc commands ul.users and ul. contacts

2013-05-27 Thread Daniel-Constantin Mierla

Hello,

the commands are querying the database and the results can be 
inaccurate, or at least not something I would expect.


In db_mode=DB_WRITEBACK, there can be expired records that are not yet 
deleted, they will be at the next timer trigger. Also, DB_READONLY might 
not reflect properly the correct situation.


Also, cache-only mode is not covered, so it is strictly related to 
database records. I would suggest the names of the commands should 
reflect somehow that, to be something like 'dbusers' and 'dbcontacts' or 
similar.


FYI, there are counters (statistics) for the two values you were looking 
for, but working only for one location table (or all together):

- http://kamailio.org/docs/modules/devel/modules/usrloc.html#idp1873288

Cheers,
Daniel

On 5/27/13 12:55 PM, Juha Heinanen wrote:

Module: sip-router
Branch: master
Commit: d0d298070fdbb015a96f209fa3c925ba71e3a37b
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d0d298070fdbb015a96f209fa3c925ba71e3a37b

Author: Juha Heinanen j...@tutpro.com
Committer: Juha Heinanen j...@tutpro.com
Date:   Mon May 27 13:54:23 2013 +0300

modules/usrloc: added two new rpc commands ul.users and ul.contacts

- for accessing number of different AoRs and contacts in a location table



--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: enclose uri in angle brakets for redirect contact header

2013-05-27 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 74bf08ef30cf18fb609c2c067584f1515ede23da
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=74bf08ef30cf18fb609c2c067584f1515ede23da

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon May 27 16:54:02 2013 +0200

core: enclose uri in angle brakets for redirect contact header

- safer for uri with parameters and no q
- reported by Dan Bogos

---

 dset.c |   24 ++--
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/dset.c b/dset.c
index 98be023..52521ce 100644
--- a/dset.c
+++ b/dset.c
@@ -461,9 +461,11 @@ char* print_dset(struct sip_msg* msg, int* len)
 
if (msg-new_uri.s) {
cnt = 1;
-   *len = msg-new_uri.len;
+   *len = msg-new_uri.len + 1 /*''*/;
if (ruri_q != Q_UNSPECIFIED) {
-   *len += 1 + Q_PARAM_LEN + len_q(ruri_q);
+   *len += Q_PARAM_LEN + len_q(ruri_q);
+   } else {
+   *len += 1 /*''*/;
}
} else {
cnt = 0;
@@ -476,9 +478,11 @@ char* print_dset(struct sip_msg* msg, int* len)
init_branch_iterator();
while ((uri.s = next_branch(uri.len, q, 0, 0, 0, 0, 0, 0, 0))) {
cnt++;
-   *len += uri.len;
+   *len += uri.len + 1 /*''*/;
if (q != Q_UNSPECIFIED) {
-   *len += 1 + Q_PARAM_LEN + len_q(q);
+   *len += Q_PARAM_LEN + len_q(q);
+   } else {
+   *len += 1 /*''*/;
}
}
 
@@ -494,9 +498,7 @@ char* print_dset(struct sip_msg* msg, int* len)
memcpy(dset, CONTACT, CONTACT_LEN);
p = dset + CONTACT_LEN;
if (msg-new_uri.s) {
-   if (ruri_q != Q_UNSPECIFIED) {
-   *p++ = '';
-   }
+   *p++ = '';
 
memcpy(p, msg-new_uri.s, msg-new_uri.len);
p += msg-new_uri.len;
@@ -508,6 +510,8 @@ char* print_dset(struct sip_msg* msg, int* len)
qbuf = q2str(ruri_q, qlen);
memcpy(p, qbuf, qlen);
p += qlen;
+   } else {
+   *p++ = '';
}
i = 1;
} else {
@@ -521,9 +525,7 @@ char* print_dset(struct sip_msg* msg, int* len)
p += CONTACT_DELIM_LEN;
}
 
-   if (q != Q_UNSPECIFIED) {
-   *p++ = '';
-   }
+   *p++ = '';
 
memcpy(p, uri.s, uri.len);
p += uri.len;
@@ -534,6 +536,8 @@ char* print_dset(struct sip_msg* msg, int* len)
qbuf = q2str(q, qlen);
memcpy(p, qbuf, qlen);
p += qlen;
+   } else {
+   *p++ = '';
}
i++;
}


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master: modules/usrloc: added two new rpc commands ul.users and ul. contacts

2013-05-27 Thread Daniel-Constantin Mierla


On 5/27/13 4:52 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


the commands are querying the database and the results can be
inaccurate, or at least not something I would expect.

they just return the described values from database table, nothing more
or less is claimed.


I was referring that one may expect to return the number of valid 
contacts (not including the expired ones).





In db_mode=DB_WRITEBACK, there can be expired records that are not yet
deleted, they will be at the next timer trigger. Also, DB_READONLY might
not reflect properly the correct situation.
Also, cache-only mode is not covered, so it is strictly related to
database records. I would suggest the names of the commands should
reflect somehow that, to be something like 'dbusers' and 'dbcontacts' or
similar.

FYI, there are counters (statistics) for the two values you were looking
for, but working only for one location table (or all together):
-
http://kamailio.org/docs/modules/devel/modules/usrloc.html#idp1873288

which ones?  i checked the above page and didn't find them.


I guess the html readme was regenerated, the id in the page different, 
the link being now:


http://kamailio.org/docs/modules/devel/modules/usrloc.html#idp1909616

(another good reason to introduce section id in docbook files).

The usrloc statistics for users and contacts return number of distinct 
aors and contacts managed by the module. You can see them in the output 
of 'kamctl stats'.


Cheers,
Daniel



sure, i can change the names.

-- juha


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Modules linking with OpenSSL

2013-05-28 Thread Daniel-Constantin Mierla


On 5/28/13 11:06 AM, Klaus Darilion wrote:



On 28.05.2013 10:20, Olle E. Johansson wrote:
28 maj 2013 kl. 10:15 skrev Peter 
Dunkleypeter.dunk...@crocodile-rcs.com:


No. This information is incomplete and I have only provided this 
information as there was a discussion about OpenSSL during the 
recent developer meeting - this mailing list is the correct place to 
continue and conclude this discussion.
I was worried about the initialization of OpenSSL libraries. The 
problem we had in Asterisk was that Asterisk initialized
several times and external libraries could do that as well - like 
jabber and database libraries. I think Kevin solved that
by creating a small shim that made sure that only one call could be 
made. I can see that it can happen here as

well with postgresql client libraries initializing OpenSSL by itself.



I remember that we had the postgresql openssl initialization problem 
already in Kamailio (or was it ser?) and it was solved by having the 
other module linking to openssl statically.
This is not an issue anymore, now tls module is the one initializing 
first. Everything works fine for the latest several stable releases.


Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: misc_radius: handle IPv4 returned attributes

2013-05-28 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 355490abd8c6e82a45cb96338ceca938c99ed744
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=355490abd8c6e82a45cb96338ceca938c99ed744

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue May 28 15:43:27 2013 +0200

misc_radius: handle IPv4 returned attributes

- populate attributes for negative replies when common_response is set
- patch by Victor V. Kustov

---

 modules/misc_radius/functions.c |   30 +-
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/modules/misc_radius/functions.c b/modules/misc_radius/functions.c
index 7a2468b..4292999 100644
--- a/modules/misc_radius/functions.c
+++ b/modules/misc_radius/functions.c
@@ -192,21 +192,23 @@ static void generate_avps(struct attr *attrs, VALUE_PAIR* 
received)
 }
 
 /* Macro to add extra attribute */
-#define ADD_EXTRA_AVPAIR(_attrs, _attr, _val, _len)\
-   do {\
-   if ((_len) != 0) {  
\
-   if ((_len) == -1) { 
\
-   if (_attrs[_attr].t != PW_TYPE_INTEGER) {   
\
-   LM_ERR(attribute %d is not of type 
integer\n, \
-   _attrs[_attr].v);   
\
-   goto error; 
\
-   }   
\
-   }   
\
+#define ADD_EXTRA_AVPAIR(_attrs, _attr, _val, _len)\
+   do { \
+   if ((_len) != 0) { \
+   if ((_len) == -1) { \
+   if (_attrs[_attr].t != PW_TYPE_INTEGER) { \
+   if (_attrs[_attr].t != PW_TYPE_IPADDR) 
{ \
+   LM_ERR(attribute %d is not of 
type integer or ipaddr\n, \
+   _attrs[_attr].v); \
+   goto error; \
+   } \
+   } \
+   } \
if (!rc_avpair_add( rh, send, _attrs[_attr].v, _val, 
_len, 0)) { \
LM_ERR(failed to add %s, %d\n, 
_attrs[_attr].n, _attr); \
-   goto error; 
\
-   }   
\
-   }   
\
+   goto error; \
+   } \
+   } \
}while(0)
 
 
@@ -274,6 +276,7 @@ int radius_load_caller_avps(struct sip_msg* _m, char* 
_caller, char* _s2)
return 1;
} else {
rc_avpair_free(send);
+   if (common_response) generate_avps_rad(received);
rc_avpair_free(received);
 #ifdef REJECT_RC
if (res == REJECT_RC) {
@@ -359,6 +362,7 @@ int radius_load_callee_avps(struct sip_msg* _m, char* 
_callee, char* _s2)
return 1;
} else {
rc_avpair_free(send);
+   if (common_response) generate_avps_rad(received);
rc_avpair_free(received);
 #ifdef REJECT_RC
if (res == REJECT_RC) {


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: misc_radius: updated readme

2013-05-28 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 8cba441b17c75cd078a499c24268c8a60c6b1771
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8cba441b17c75cd078a499c24268c8a60c6b1771

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue May 28 15:48:22 2013 +0200

misc_radius: updated readme

- from a patch by Victor V. Kustov

---

 modules/misc_radius/README|   51 +++--
 modules/misc_radius/doc/misc_radius_admin.xml |   34 +++-
 2 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/modules/misc_radius/README b/modules/misc_radius/README
index 50d6008..ed2a47c 100644
--- a/modules/misc_radius/README
+++ b/modules/misc_radius/README
@@ -59,11 +59,12 @@ Daniel-Constantin Mierla
1.10. uri_extra parameter usage
1.11. use_sip_uri_host parameter usage
1.12. common_response parameter usage
-   1.13. radius_load_caller_avps() usage
-   1.14. radius_load_callee_avps() usage
-   1.15. radius_is_user_in() usage
-   1.16. radius_does_uri_exist() usage
-   1.17. radius_does_uri_user_exist() usage
+   1.13. radius response with common_response value 1
+   1.14. radius_load_caller_avps() usage
+   1.15. radius_load_callee_avps() usage
+   1.16. radius_is_user_in() usage
+   1.17. radius_does_uri_exist() usage
+   1.18. radius_does_uri_user_exist() usage
 
 Chapter 1. Admin Guide
 
@@ -293,13 +294,39 @@ modparam(misc_radius, use_sip_uri_host, 1)
 3.11. common_response (integer)
 
Set it to 1 if you need common radius response attributes to be added
-   as AVPs.
+   as AVPs in radius_load_caller_avps and radius_load_callee_avps with
+   name as radius attribute name and value as radius attribute value.
 
Default value is 0.
 
Example 1.12. common_response parameter usage
 ...
-modparam(misc_radius, common_response, 21)
+modparam(misc_radius, common_response, 1)
+...
+radius_load_caller_avps($fU);
+...
+
+   Example 1.13. radius response with common_response value 1
+...
+Sending Access-Accept of id 60 to 192.168.25.32 port 59736
+Session-Timeout = 4261674
+next-hop-ip = SIP/00111222333444@cisco-out
+SIP-AVP = email:sr-us...@lists.sip-router.org session-timeout#161 
next-hop-
+ip:h323/0001...@myvoip-gate.kamailio.org
+session-protocol = SIP
+...
+
+$avp(Session-Timeout) has integer value 4261674
+$avp(next-hop-ip) has string value SIP/00777888@cisco-out
+$avp(session-protocol) has string value SIP
+$avp(SIP-AVP) has string value  email:sr-us...@lists.sip-router.org 
session-tim
+eout#161 next-hop-ip:h323/0001...@myvoip-gate.kamailio.org
+
+...
+When recieving negative response, check appropriate avp's:
+$avp(Reply-Message) = Not enough money on deposit '-89.83'. Rejected
+$avp(Filter-Id) = neg_deposit
+...
 
 4. Functions
 
@@ -317,7 +344,7 @@ modparam(misc_radius, common_response, 21)
 
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
-   Example 1.13. radius_load_caller_avps() usage
+   Example 1.14. radius_load_caller_avps() usage
 ...
 radius_load_caller_avps($fU@$fd); # take caller from From URI
 ...
@@ -332,7 +359,7 @@ radius_load_caller_avps($au@$ar); # take caller from 
Authorization
 
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
-   Example 1.14. radius_load_callee_avps() usage
+   Example 1.15. radius_load_callee_avps() usage
 ...
 radius_load_callee_avps($rU@$rd); # take callee from Request-URI
 ...
@@ -347,7 +374,7 @@ radius_load_callee_avps($rU@$rd); # take callee from 
Request-URI
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, and LOCAL_ROUTE.
 
-   Example 1.15. radius_is_user_in() usage
+   Example 1.16. radius_is_user_in() usage
 ...
 radius_is_user_in($rU@$rd, 1);  # take user from Request-URI
 ...
@@ -362,7 +389,7 @@ radius_is_user_in($au@$ar, group_x);# take user from 
credentials
 
This function can be used from REQUEST_ROUTE and LOCAL_ROUTE.
 
-   Example 1.16. radius_does_uri_exist() usage
+   Example 1.17. radius_does_uri_exist() usage
 ...
 if (radius_does_uri_exist()) ...# check Request-URI
 ...
@@ -379,7 +406,7 @@ if (radius_does_uri_exist($avp(i:99))) ...# check URI 
in $avp(i:99)
 
This function can be used from REQUEST_ROUTE and LOCAL_ROUTE.
 
-   Example 1.17. radius_does_uri_user_exist() usage
+   Example 1.18. radius_does_uri_user_exist() usage
 ...
 if (radius_does_uri_user_exist()) ...   # check Request-URI userpart
 ...
diff --git a/modules/misc_radius/doc/misc_radius_admin.xml 
b/modules/misc_radius/doc/misc_radius_admin.xml
index aff0973..950d8d4 100644
--- a/modules/misc_radius/doc/misc_radius_admin.xml
+++ b/modules/misc_radius/doc/misc_radius_admin.xml
@@ -307,7 +307,9 @@ modparam(misc_radius, use_sip_uri_host, 1)
titlevarnamecommon_response/varname (integer)/title
para
Set it to 1 if you need common radius response

Re: [sr-dev] git:master: Merge branch 'master' of ssh://git.sip-router.org/sip-router

2013-05-28 Thread Daniel-Constantin Mierla


On 5/27/13 4:59 PM, Juha Heinanen wrote:

Module: sip-router
Branch: master
Commit: a435f770e7162f73aea560a77851f8fb639a495a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a435f770e7162f73aea560a77851f8fb639a495a

Author: Juha Heinanen j...@tutpro.com
Committer: Juha Heinanen j...@tutpro.com
Date:   Mon May 27 17:58:33 2013 +0300

Merge branch 'master' of ssh://git.sip-router.org/sip-router

- i did pull , but there was race conditions with somebody else's push
Have you done simple 'git pull ...' or also rebase and fast forward 'git 
--ff --rebase pull ...'?


Cheers,
Daniel


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: topoh: safety check for Via header when removed from script

2013-05-29 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: b480ac55508e5d9b92cc9560e0b1d338d04f3b11
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b480ac55508e5d9b92cc9560e0b1d338d04f3b11

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed May 29 10:49:40 2013 +0200

topoh: safety check for Via header when removed from script

- reported by Guillaume Bour, FS#300

---

 modules/topoh/th_msg.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/topoh/th_msg.c b/modules/topoh/th_msg.c
index df29ea1..4d25750 100644
--- a/modules/topoh/th_msg.c
+++ b/modules/topoh/th_msg.c
@@ -967,6 +967,11 @@ int th_del_via_cookie(sip_msg_t *msg, struct via_body *via)
 {
struct via_param *p;
struct lump* l;
+
+   if(via==NULL) {
+   LM_DBG(no via header\n);
+   return 0;
+   }
for(p=via-param_lst; p; p=p-next)
{
if(p-name.len==th_cookie_name.len


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: topoh: safety check for Via header when removed from script

2013-05-29 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 817d5dfdd8fbae905c64c41672f197143b6f563c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=817d5dfdd8fbae905c64c41672f197143b6f563c

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed May 29 10:49:40 2013 +0200

topoh: safety check for Via header when removed from script

- reported by Guillaume Bour, FS#300
(cherry picked from commit b480ac55508e5d9b92cc9560e0b1d338d04f3b11)

---

 modules/topoh/th_msg.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/topoh/th_msg.c b/modules/topoh/th_msg.c
index df29ea1..4d25750 100644
--- a/modules/topoh/th_msg.c
+++ b/modules/topoh/th_msg.c
@@ -967,6 +967,11 @@ int th_del_via_cookie(sip_msg_t *msg, struct via_body *via)
 {
struct via_param *p;
struct lump* l;
+
+   if(via==NULL) {
+   LM_DBG(no via header\n);
+   return 0;
+   }
for(p=via-param_lst; p; p=p-next)
{
if(p-name.len==th_cookie_name.len


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master: DB scheme: as discussed on sr-users list, change default mysql engine to InnoDB

2013-05-29 Thread Daniel-Constantin Mierla

Hello,

I thought of not setting the engine at all and let the mysql server 
configuration deal with that (or maybe kamdbctl can specify for the 
entire kamailio database somehow). If we change to another one we get to 
same issues, I bet some users want myisam.


Cheers,
Daniel

On 5/29/13 11:51 AM, Henning Westerholt wrote:

Module: sip-router
Branch: master
Commit: fa49fe070adadfff893b338f2a2d69776c043653
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa49fe070adadfff893b338f2a2d69776c043653

Author: Henning Westerholt h...@kamailio.org
Committer: Henning Westerholt h...@kamailio.org
Date:   Wed May 29 11:49:59 2013 +0200

DB scheme: as discussed on sr-users list, change default mysql engine to InnoDB




--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: don't free pvar spec - is reference to cache

2013-05-30 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: d5c4dda7932e8efe018beb77f8ca2e29a44aa185
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d5c4dda7932e8efe018beb77f8ca2e29a44aa185

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu May 30 17:59:01 2013 +0200

core: don't free pvar spec - is reference to cache

- reported by Peter Dunkley

---

 cfg.y |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cfg.y b/cfg.y
index 0e5f8b1..5f88d13 100644
--- a/cfg.y
+++ b/cfg.y
@@ -2696,7 +2696,7 @@ rval: intno   {$$=mk_rve_rval(RV_INT, 
(void*)$1); }
| STRING{   s_tmp.s=$1; 
s_tmp.len=strlen($1);
$$=mk_rve_rval(RV_STR, 
s_tmp); }
| attr_id_any   {$$=mk_rve_rval(RV_AVP, $1); pkg_free($1); }
-   | pvar  {$$=mk_rve_rval(RV_PVAR, $1); 
pkg_free($1); }
+   | pvar  {$$=mk_rve_rval(RV_PVAR, $1); }
| avp_pvar  {
switch($1-type){
case LV_AVP:


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Kamailio segfaulting early in start-up with Kamailio git master

2013-05-30 Thread Daniel-Constantin Mierla
It was a free of pv specs that was forgotten when usage of core pv cache 
was introduced for config interpreter.


I pushed a commit that should fix it.

Thanks,
Daniel

On 5/30/13 5:37 PM, Peter Dunkley wrote:
Please disregard the bit about the listen directives - I got my test 
configuration files mixed up.


The line that causes the segmentation fault appears to be:

mem_join=1

When the line is there crash, when the line is commented out Kamailio 
runs.


Regards,

Peter


On 30/05/13 16:20, Peter Dunkley wrote:
When I have explicit listen directives like this (PRIV_IP_ADDR is a 
substdef included from another file):


listen=tcp:PRIV_IP_ADDR:80
listen=tls:PRIV_IP_ADDR:443
listen=tls:PRIV_IP_ADDR:2855

Kamailio seg-faults very early in start-up.

The output from GDB is:

(gdb) run
Starting program: /usr/sbin/kamailio
loading modules under /usr/lib64/kamailio/modules
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
qm_detach_free (qm=0x7722b010, p=value optimized out)
at mem/q_malloc.c:269
269FRAG_END(next)-prev_free=prev;
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.107.el6.x86_64 keyutils-libs-1.4-4.el6.x86_64
krb5-libs-1.10.3-10.el6_4.2.x86_64
libcom_err-1.41.12-14.el6.x86_64
libselinux-2.0.94-5.3.el6_4.1.x86_64
libunistring-0.9.3-5.el6.x86_64 mysql-libs-5.1.69-1.el6_4.x86_64
nss-softokn-freebl-3.12.9-11.el6.x86_64
openssl-1.0.0-27.el6_4.2.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt
#0  qm_detach_free (qm=0x7722b010, p=value optimized out)
at mem/q_malloc.c:269
#1  qm_free (qm=0x7722b010, p=value optimized out) at
mem/q_malloc.c:511
#2  0x005b7927 in yyparse () at cfg.y:2699
#3  0x0046b8e3 in main (argc=1, argv=0x7fffe548) at
main.c:2083


This happens with Kamailio git master built about 20 minutes ago.

Regards,

Peter


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] WebSockets broken?

2013-05-30 Thread Daniel-Constantin Mierla


On 5/30/13 6:17 PM, Peter Dunkley wrote:
When latest Kamailio git master sends a message over WebSocket 
(specifically an MSRP reply on my test system) I get the error,


One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

in Google Chrome.  This happens for WebSockets over TCP and WebSockets 
over TLS.  It doesn't happen with a build of Kamailio git master from 
around two weeks ago.


Have there been any changes in the network code over the last couple 
of weeks that might have had an effect on what Kamailio puts out on 
the wire for TCP and TLS?
I don't recall any, but if you give the commit id of the version you are 
running and it is ok, we can check the rest of the commits till today.


Cheers,
Daniel


The code to send an MSRP reply over WebSocket is in 
modules/msrp/msrp_netio.c:msrp_reply()

 if (unlikely((env-srcinfo.proto == PROTO_WS
 || env-srcinfo.proto == PROTO_WSS)
  sr_event_enabled(SREV_TCP_WS_FRAME_OUT))) {
 struct tcp_connection *con = tcpconn_get(env-srcinfo.id, 0, 0,
 0, 0);
 ws_event_info_t wsev;

 if (con == NULL)
 {
 LM_WARN(TCP/TLS connection for WebSocket could not be
 found\n);
 return -1;
 }

 memset(wsev, 0, sizeof(ws_event_info_t));
 wsev.type = SREV_TCP_WS_FRAME_OUT;
 wsev.buf = rplbuf;
 wsev.len = p - rplbuf;
 wsev.id = con-id;
 return sr_event_exec(SREV_TCP_WS_FRAME_OUT, (void *) wsev);
 }

The code that handles the SREV_TCP_WS_FRAME_OUT event is in 
modules/websocket/ws_frame.c and basically involves:


  * filling in the WebSocket message header
  * identifying the correct TCP/TLS connection
  * setting some flags (for example, SND_F_FORCE_CON_REUSE)
  * calling tcp_send()

These areas of the code haven't been changed for months.

Regards,

Peter




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] WebSockets broken?

2013-05-30 Thread Daniel-Constantin Mierla


On 5/30/13 6:44 PM, Peter Dunkley wrote:
I don't have a commit ID for it working as the system that is working 
was installed from RPMs.  However, It was compiled at 18:39:25 (BST) 
on May 20 2013.


It will have been a clean pull from Git at the time it was built.
After that date, from core perspective, sctp was moved as a module, 
syn_branch parameter removed and pv cache used for confg vars, but it 
doesn't look like should be a direct effect on msrp. A bit before was 
removal of IPv6 define.


Maybe is a side effect with some memory overflow. Can you compile with 
MEMDBG=1 and see if you get some errors from memory manager?


Cheers,
Daniel



Peter

On 30/05/13 17:36, Daniel-Constantin Mierla wrote:


On 5/30/13 6:17 PM, Peter Dunkley wrote:
When latest Kamailio git master sends a message over WebSocket 
(specifically an MSRP reply on my test system) I get the error,


One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

in Google Chrome.  This happens for WebSockets over TCP and 
WebSockets over TLS.  It doesn't happen with a build of Kamailio git 
master from around two weeks ago.


Have there been any changes in the network code over the last couple 
of weeks that might have had an effect on what Kamailio puts out on 
the wire for TCP and TLS?
I don't recall any, but if you give the commit id of the version you 
are running and it is ok, we can check the rest of the commits till 
today.


Cheers,
Daniel


The code to send an MSRP reply over WebSocket is in 
modules/msrp/msrp_netio.c:msrp_reply()

 if (unlikely((env-srcinfo.proto == PROTO_WS
 || env-srcinfo.proto == PROTO_WSS)
  sr_event_enabled(SREV_TCP_WS_FRAME_OUT))) {
 struct tcp_connection *con = tcpconn_get(env-srcinfo.id, 0, 0,
 0, 0);
 ws_event_info_t wsev;

 if (con == NULL)
 {
 LM_WARN(TCP/TLS connection for WebSocket could not be
 found\n);
 return -1;
 }

 memset(wsev, 0, sizeof(ws_event_info_t));
 wsev.type = SREV_TCP_WS_FRAME_OUT;
 wsev.buf = rplbuf;
 wsev.len = p - rplbuf;
 wsev.id = con-id;
 return sr_event_exec(SREV_TCP_WS_FRAME_OUT, (void *) wsev);
 }

The code that handles the SREV_TCP_WS_FRAME_OUT event is in 
modules/websocket/ws_frame.c and basically involves:


  * filling in the WebSocket message header
  * identifying the correct TCP/TLS connection
  * setting some flags (for example, SND_F_FORCE_CON_REUSE)
  * calling tcp_send()

These areas of the code haven't been changed for months.

Regards,

Peter




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
   *http://asipto.com/u/katu  *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] WebSockets broken?

2013-05-30 Thread Daniel-Constantin Mierla

Hello,

you can have some fun and then revert :-)

Are the reserved bits before or after the websocket payload?

Cheers,
Daniel

On 5/30/13 6:58 PM, Peter Dunkley wrote:

Hi Daniel,

I don't think it is an MSRP issue.  It's just I have first spotted it 
with MSRP and now can't risk touching my SIP WebSocket server.


My suspicion is that (if it is related to the changes made in the last 
10 days) it is something that happens during or after a call to 
tcp_send().


Regards,

Peter


On 30/05/13 17:56, Daniel-Constantin Mierla wrote:


On 5/30/13 6:44 PM, Peter Dunkley wrote:
I don't have a commit ID for it working as the system that is 
working was installed from RPMs.  However, It was compiled at 
18:39:25 (BST) on May 20 2013.


It will have been a clean pull from Git at the time it was built.
After that date, from core perspective, sctp was moved as a module, 
syn_branch parameter removed and pv cache used for confg vars, but it 
doesn't look like should be a direct effect on msrp. A bit before was 
removal of IPv6 define.


Maybe is a side effect with some memory overflow. Can you compile 
with MEMDBG=1 and see if you get some errors from memory manager?


Cheers,
Daniel



Peter

On 30/05/13 17:36, Daniel-Constantin Mierla wrote:


On 5/30/13 6:17 PM, Peter Dunkley wrote:
When latest Kamailio git master sends a message over WebSocket 
(specifically an MSRP reply on my test system) I get the error,


One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

in Google Chrome.  This happens for WebSockets over TCP and 
WebSockets over TLS.  It doesn't happen with a build of Kamailio 
git master from around two weeks ago.


Have there been any changes in the network code over the last 
couple of weeks that might have had an effect on what Kamailio 
puts out on the wire for TCP and TLS?
I don't recall any, but if you give the commit id of the version 
you are running and it is ok, we can check the rest of the commits 
till today.


Cheers,
Daniel


The code to send an MSRP reply over WebSocket is in 
modules/msrp/msrp_netio.c:msrp_reply()

 if (unlikely((env-srcinfo.proto == PROTO_WS
 || env-srcinfo.proto == PROTO_WSS)
  sr_event_enabled(SREV_TCP_WS_FRAME_OUT))) {
 struct tcp_connection *con = tcpconn_get(env-srcinfo.id, 0, 0,
 0, 0);
 ws_event_info_t wsev;

 if (con == NULL)
 {
 LM_WARN(TCP/TLS connection for WebSocket could not be
 found\n);
 return -1;
 }

 memset(wsev, 0, sizeof(ws_event_info_t));
 wsev.type = SREV_TCP_WS_FRAME_OUT;
 wsev.buf = rplbuf;
 wsev.len = p - rplbuf;
 wsev.id = con-id;
 return sr_event_exec(SREV_TCP_WS_FRAME_OUT, (void *) wsev);
 }

The code that handles the SREV_TCP_WS_FRAME_OUT event is in 
modules/websocket/ws_frame.c and basically involves:


  * filling in the WebSocket message header
  * identifying the correct TCP/TLS connection
  * setting some flags (for example, SND_F_FORCE_CON_REUSE)
  * calling tcp_send()

These areas of the code haven't been changed for months.

Regards,

Peter




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
   *http://asipto.com/u/katu  *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda  -http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
   *http://asipto.com/u/katu  *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev




___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: pua: release lock on not finding temp dialog

2013-05-31 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 09cc2207b265d51dcbc28279623bf9c597fa3b46
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=09cc2207b265d51dcbc28279623bf9c597fa3b46

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri May 31 17:05:40 2013 +0200

pua: release lock on not finding temp dialog

- patch by Halina Nowak

---

 modules/pua/hash.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/pua/hash.c b/modules/pua/hash.c
index 9ad169b..e3dea99 100644
--- a/modules/pua/hash.c
+++ b/modules/pua/hash.c
@@ -334,8 +334,10 @@ int convert_temporary_dialog(ua_pres_t *dialog)
temp_dialog = get_temporary_dialog(dialog, hash_code);
if (temp_dialog)
delete_htable(temp_dialog, hash_code);
-   else
+   else {
+   lock_release(HashT-p_records[hash_code].lock);
return -1;
+   }
 
insert_htable(dialog, hash_code);
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: pua: release lock on not finding temp dialog

2013-05-31 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 3a64a12e056670766da7e49a0275c1240d6d229a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3a64a12e056670766da7e49a0275c1240d6d229a

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri May 31 17:05:40 2013 +0200

pua: release lock on not finding temp dialog

- patch by Halina Nowak
(cherry picked from commit 09cc2207b265d51dcbc28279623bf9c597fa3b46)

---

 modules/pua/hash.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/pua/hash.c b/modules/pua/hash.c
index 9ad169b..e3dea99 100644
--- a/modules/pua/hash.c
+++ b/modules/pua/hash.c
@@ -334,8 +334,10 @@ int convert_temporary_dialog(ua_pres_t *dialog)
temp_dialog = get_temporary_dialog(dialog, hash_code);
if (temp_dialog)
delete_htable(temp_dialog, hash_code);
-   else
+   else {
+   lock_release(HashT-p_records[hash_code].lock);
return -1;
+   }
 
insert_htable(dialog, hash_code);
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dialog: shift next timer run for keepalives of dialog

2013-06-03 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: a17a32e5f7a3120c200d6e48fe91d7aa1dfd28b1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a17a32e5f7a3120c200d6e48fe91d7aa1dfd28b1

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun  3 20:53:05 2013 +0200

dialog: shift next timer run for keepalives of dialog

- reported by Daniel Tryba

---

 modules/dialog/dlg_hash.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index 3aee269..c669290 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -209,6 +209,7 @@ int dlg_ka_run(ticks_t ti)
/* append to tail */
if(dka!=NULL)
{
+   dka-katime = ti + dlg_ka_interval;
lock_get(dlg_ka_list_lock);
if(*dlg_ka_list_tail!=NULL)
(*dlg_ka_list_tail)-next = dka;


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: Makefile: added install-initd-centos target

2013-06-03 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 5bed1c2f9721405d5e6e0678f583aee474d4b9b9
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5bed1c2f9721405d5e6e0678f583aee474d4b9b9

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun  3 23:23:15 2013 +0200

Makefile: added install-initd-centos target

- install centos specific init.d scripts

---

 Makefile |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 4f2de07..898f99e 100644
--- a/Makefile
+++ b/Makefile
@@ -1038,6 +1038,26 @@ install_initd_debian install-initd-debian:
 --home /var/run/$(NAME) $(NAME)
chown $(NAME):$(NAME) /var/run/$(NAME)
 
+.PHONY: install_initd_centos install-initd-centos
+install_initd_centos install-initd-centos:
+   sed -e s#KAM=/usr/sbin/kamailio#KAM=$(bin_prefix)/$(bin_dir)$(NAME)#g 
\
+   -e s#PROG=kamailio#PROG=$(NAME)#g \
+   -e 
s#DEFAULTS=/etc/default/kamailio#DEFAULTS=/etc/default/$(NAME)#g \
+   -e 
s#PID_FILE=/var/run/kamailio.pid#PID_FILE=/var/run/$(NAME).pid#g \
+   -e 
s#LOCK_FILE=/var/lock/subsys/kamailio#LOCK_FILE=/var/lock/subsys/$(NAME)#g \
+   -e 
s#KAMCFG=/etc/kamailio/kamailio.cfg#KAMCFG=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g
 \
+pkg/kamailio/rpm/kamailio.init \
+/etc/init.d/$(NAME)
+   chmod +x /etc/init.d/$(NAME)
+   sed -e s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g \
+   -e s#USER=kamailio#USER=$(NAME)#g \
+   -e s#GROUP=kamailio#GROUP=$(NAME)#g \
+pkg/kamailio/rpm/kamailio.default \
+/etc/default/$(NAME)
+   /usr/sbin/groupadd -r $(NAME)
+   /usr/sbin/useradd -r -g $(NAME) -s /bin/false -c Kamailio Daemon \
+  -d ${lib_prefix}/${lib_dir} $(NAME)
+
 .PHONY: dbschema
 dbschema:
-@echo Build database schemas


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamailio.cfg: few updates related to nat traversal

2013-06-05 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 0193489cca56f58b512f5379c078c98a366c17e2
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0193489cca56f58b512f5379c078c98a366c17e2

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun  5 22:44:13 2013 +0200

kamailio.cfg: few updates related to nat traversal

- added co flags to rtpproxy_manage() to change all IPs in sdp, many
  phone get confused if only media ip is changed
- add nat=yes parameter only for in branch route to avoid multiple
  occurences

---

 etc/kamailio.cfg |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 0645c83..c59c0f3 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -774,11 +774,13 @@ route[NATMANAGE] {
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
 
-   rtpproxy_manage();
+   rtpproxy_manage(co);
 
if (is_request()) {
if (!has_totag()) {
-   add_rr_param(;nat=yes);
+   if(t_is_branch_route()) {
+   add_rr_param(;nat=yes);
+   }
}
}
if (is_reply()) {


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: siputils: added new function is_first_hop()

2013-06-06 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c8e928a2c78ee963f807791bea5aacdd31e05936
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c8e928a2c78ee963f807791bea5aacdd31e05936

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jun  6 09:05:28 2013 +0200

siputils: added new function is_first_hop()

- detect if it is first hop after original sender
- added section ids for functions, remove a duplicate content for
  is_rpid_user_e164()

---

 modules/siputils/README |  188 +++---
 modules/siputils/doc/siputils_admin.xml |  104 +-
 modules/siputils/sipops.c   |   89 +--
 modules/siputils/sipops.h   |1 +
 modules/siputils/siputils.c |2 +
 5 files changed, 229 insertions(+), 155 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=c8e928a2c78ee963f807791bea5aacdd31e05936

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamailio.cfg: reset $du for voicemail re-routing in failure route

2013-06-06 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c4b29f6fac6155b9b087737df5956b687ff4e36a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c4b29f6fac6155b9b087737df5956b687ff4e36a

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jun  6 09:09:14 2013 +0200

kamailio.cfg: reset $du for voicemail re-routing in failure route

---

 etc/kamailio.cfg |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index c59c0f3..911b7d6 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -921,6 +921,7 @@ failure_route[MANAGE_FAILURE] {
# serial forking
# - route to voicemail on busy or no answer (timeout)
if (t_check_status(486|408)) {
+   $du = $null;
route(TOVOICEMAIL);
exit;
}


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] New developer: Torrey Searle

2013-06-06 Thread Daniel-Constantin Mierla

Hello,

I want to announce that a new person got developer GIT write access to 
repository: Camille Oudot - from Orange, France. Currently, he is 
developing mainly on Kamailio IMS modules, several patches being 
submitted lately by him.


His git commit id is: coudot

My warm welcome and looking forward to future work within the project!

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
 - http://conference.kamailio.com -

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] New developer: Torrey Searle

2013-06-06 Thread Daniel-Constantin Mierla
obviously 'Edit as new' fails to automatically update the subject line 
... this email will be sent again.



On 6/6/13 3:51 PM, Daniel-Constantin Mierla wrote:

Hello,

I want to announce that a new person got developer GIT write access to 
repository: Camille Oudot - from Orange, France. Currently, he is 
developing mainly on Kamailio IMS modules, several patches being 
submitted lately by him.


His git commit id is: coudot

My warm welcome and looking forward to future work within the project!

Cheers,
Daniel




--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: acc_radius: exit at startup if radius_config is not set

2013-06-06 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: ea6354c53c8871e4e117b7434645ab4fee811612
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ea6354c53c8871e4e117b7434645ab4fee811612

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jun  6 15:58:58 2013 +0200

acc_radius: exit at startup if radius_config is not set

---

 modules/acc_radius/acc_radius_mod.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/acc_radius/acc_radius_mod.c 
b/modules/acc_radius/acc_radius_mod.c
index 07f39ff..11f3115 100644
--- a/modules/acc_radius/acc_radius_mod.c
+++ b/modules/acc_radius/acc_radius_mod.c
@@ -125,8 +125,10 @@ struct module_exports exports= {
 
 static int mod_init( void )
 {
-   if (radius_config==NULL || radius_config[0]=='\0')
-   return 0;
+   if (radius_config==NULL || radius_config[0]=='\0') {
+   LM_ERR(radius config file not set\n);
+   return -1;
+   }

/* bind the ACC API */
if (acc_load_api(accb)0) {


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] releasing v4.0.2

2013-06-07 Thread Daniel-Constantin Mierla

Hello,

I am considering to release kamailio v4.0.2 next week on Wednesday, June 
12. Developers that committed fixes on master branch and should be 
backported, have to do it before. Overall, everyone should keep an eye 
and be sure their demanded fixes are backported.


Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: modules/rr: completely reverted after_strict() to its pre-outbound form

2013-06-07 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 6eb6d92af2fe55d14b255bb5c5c939cc2f78ba79
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6eb6d92af2fe55d14b255bb5c5c939cc2f78ba79

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri Jun  7 11:00:51 2013 +0200

modules/rr: completely reverted after_strict() to its pre-outbound form

- backported from c9448d9657f0e5792072c6803643c8d9075d711a by Peter
  Dunkley

---

 modules/rr/loose.c |   28 
 1 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/modules/rr/loose.c b/modules/rr/loose.c
index ccd08d9..8141bd0 100644
--- a/modules/rr/loose.c
+++ b/modules/rr/loose.c
@@ -568,7 +568,6 @@ static inline int after_strict(struct sip_msg* _m)
char* rem_off;
str uri;
struct socket_info *si;
-   int use_ob, next_is_strict;
 
hdr = _m-route;
rt = (rr_t*)hdr-parsed;
@@ -584,13 +583,7 @@ static inline int after_strict(struct sip_msg* _m)
return RR_ERROR;
}
 
-   next_is_strict = is_strict(puri.params);
-   if ((use_ob = process_outbound(_m, puri.user, uri))  0) {
-   LM_ERR(processing outbound flow-token\n);
-   return FLOW_TOKEN_BROKEN;
-   }
-
-   if (!use_ob  enable_double_rr  is_2rr(puri.params)  
is_myself(puri)) {
+   if ( enable_double_rr  is_2rr(puri.params)  is_myself(puri)) {
/* double route may occure due different IP and port, so force 
as
 * send interface the one advertise in second Route */
si = grep_sock_info( puri.host, puri.port_no, puri.proto);
@@ -627,7 +620,6 @@ static inline int after_strict(struct sip_msg* _m)
LM_ERR(failed to parse URI\n);
return RR_ERROR;
}
-   next_is_strict = is_strict(puri.params);
} 
 
/* set the hooks for the param
@@ -636,7 +628,7 @@ static inline int after_strict(struct sip_msg* _m)
routed_msg_id = _m-id;
routed_params = _m-parsed_uri.params;
 
-   if (next_is_strict) {
+   if (is_strict(puri.params)) {
LM_DBG(Next hop: '%.*s' is strict router\n, uri.len, 
ZSW(uri.s));
/* Previous hop was a strict router and the next hop is strict
 * router too. There is no need to save R-URI again because it
@@ -647,11 +639,9 @@ static inline int after_strict(struct sip_msg* _m)
 * always be a strict router because endpoints don't use ;lr 
parameter
 * In this case we will simply put the URI in R-URI and forward 
it, 
 * which will work perfectly */
-   if (!use_ob) {
-   if(get_maddr_uri(uri, puri)!=0) {
-   LM_ERR(failed to check maddr\n);
-   return RR_ERROR;
-   }
+   if(get_maddr_uri(uri, puri)!=0) {
+   LM_ERR(failed to check maddr\n);
+   return RR_ERROR;
}
if (rewrite_uri(_m, uri)  0) {
LM_ERR(failed to rewrite request URI\n);
@@ -673,11 +663,9 @@ static inline int after_strict(struct sip_msg* _m)
LM_DBG(Next hop: '%.*s' is loose router\n,
uri.len, ZSW(uri.s));
 
-   if (!use_ob) {
-   if(get_maddr_uri(uri, puri)!=0) {
-   LM_ERR(failed to check maddr\n);
-   return RR_ERROR;
-   }
+   if(get_maddr_uri(uri, puri)!=0) {
+   LM_ERR(failed to check maddr\n);
+   return RR_ERROR;
}
if (set_dst_uri(_m, uri)  0) {
LM_ERR(failed to set dst_uri\n);


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] New commits on branch 4.0

2013-06-07 Thread Daniel-Constantin Mierla
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=21747d786a4e0f8f606baeeb4f39166d351b824b
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jun 6 11:47:10 2013 +0200

cfgutils: updated docs to specify correct time unit for usleep

- it is microseconds, pointed by David K
(cherry picked from commit 8e937d260d0ff41f50be56e0a46ede44554f3f99)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e52f1d6e5702bce8031d224f006627ab3fc3f859
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jun 6 09:09:14 2013 +0200

kamailio.cfg: reset $du for voicemail re-routing in failure route
(cherry picked from commit c4b29f6fac6155b9b087737df5956b687ff4e36a)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3dc0b79993863f7399b1cb579d81f3637370e35a
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 5 22:44:13 2013 +0200

kamailio.cfg: few updates related to nat traversal

- added co flags to rtpproxy_manage() to change all IPs in sdp, many
  phone get confused if only media ip is changed
- add nat=yes parameter only for in branch route to avoid multiple
  occurences
(cherry picked from commit 0193489cca56f58b512f5379c078c98a366c17e2)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=72b483393b5e7c85096a79fd999caf17edde69b6
Author: Jason Penton jason.pen...@smilecoms.com
Date:   Wed Jun 5 08:58:29 2013 +0200

module/ims_auth: protection against crash if there is no auth vector 
initialised.
- patch submitted by Camille Oudot
(cherry picked from commit 4b65964dbe1f38bcf867301d43933f9bbf91ab7d)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=51fc2140e1d0708ed213d4903552c2f98a39a5da
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun 3 20:53:05 2013 +0200

dialog: shift next timer run for keepalives of dialog

- reported by Daniel Tryba
(cherry picked from commit a17a32e5f7a3120c200d6e48fe91d7aa1dfd28b1)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=de9607079be932be6effe40573b3219724f4393e
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon May 27 16:54:02 2013 +0200

core: enclose uri in angle brakets for redirect contact header

- safer for uri with parameters and no q
- reported by Dan Bogos
(cherry picked from commit 74bf08ef30cf18fb609c2c067584f1515ede23da)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f01889d6e717892d38df8c267e20c269dbc83b0e
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun May 26 10:43:24 2013 +0200

dmq: many safety checks for mem mallocs and function return codes

- added license header in the files
(cherry picked from commit 1977645ceb12ca2d0f2f767046606f6c5ae2c3bb)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2c04dd88c8911f3a67f3f94a5ad11b1ab865aca9
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat May 25 16:30:33 2013 +0200

protoshoot: use Makefile pattern for utils

- link to libsctp if SCTP support is enabled
(cherry picked from commit 1bdbdb64e4862ddb69c2bf13be0f9be93968bb1e)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cd1120c6500bb396af9b5410ecd535160c2ba9d7
Author: Konstantin Mosesov e...@voipgroup.org.ua
Date:   Sat May 18 13:56:22 2013 +0300

parser/sdp: Fixed segfault in sdp_print() when no SDP body.

- Failed scenario:
remove_body();
msg_apply_changes();
sdp_print(1);

- Result: sdp=0x0
(cherry picked from commit e81b3aac19ab567813d6cb21fcba3d9bd6e1cc90)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=edde8d20806aca248e3a1c1e439084988d62d361
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri May 17 00:46:42 2013 +0200

core: fixed printing function name in log message

- based on http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html
(cherry picked from commit e081c2880b46174ad836ab1f56e3062bb17b4332)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=959cab2009427fd850318980914dd0e91b3cbff8
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed May 15 22:45:18 2013 +0200

pv: clone result of several string transformations

- it is safer for assigning back to the same variable on which the
  transformation was applied
- reported by Martin Mikkelsen
(cherry picked from commit fe7e4a5152674aa9c81c09dd2fc9938d9e9e762e)

URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c3017b2e79e47edd88f2b4917afd4794d4e6ef11
Author: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue May 14 19:52:45 2013 +0200

utils/misc: updated vim syntax file
(cherry picked from commit 6038bae188863f541994976d299c38f50b0a699b)

URL:
http

Re: [sr-dev] Register VoIP phones with Kamailio server

2013-06-07 Thread Daniel-Constantin Mierla

Hello,

do not write to many mailing lists at once -- that should be done only 
for projects announcements or asking opinions of both communities for 
changes related to the project. Otherwise, send to sr-users if you have 
questions about how to use kamailio and to sr-dev only for questions 
related to new features development and unstable branch.


To help you, grab ngrep trace of registration and see who is sending 
401. If it is kamailio, then restart it with debug=3 in configuration 
file and look at the logs to see why is not authenticated. If you fail 
to understand the problem, send both ngrep output and syslog messages here.


Cheers,
Daniel

On 6/7/13 2:58 PM, Ravindra Gowda wrote:

Dear All,

I was successful in integrating  kamailio 4.0.1 server with Asterisk 
11.4.0 in Ubuntu 12.04 LTS version, by using  the following link :


http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb.

Both the servers are running parallely without any problems. And i 
choosen siremis-4.0.0 to get the control panel of kamailio server and 
i got its GUI (By following below link):


http://kb.asipto.com/siremis:install32x:main

But when i tried to register my VoIP phones with the Kamailio server, 
I am getting the status code reply as *'401 Unauthorized* (0 bindings)'.


What could be the wrong? How can i solve it? And how can i retrieve my 
Users (are which i had added to MySQL database) in SIP server 
(kamailio) GUI?


Any help will greatly appreciate.

*Thank you and Best regards,*
*R Ravindra **Gowda*
*Engineer - Systems and Products*.

*Thrikasa Technologies*
*| Office: +91 40 23260434
| Mob: +918885284050
*
*| Fax:+91 40 23221045*
*| email: ravin...@thrikasa.in mailto:ravin...@thrikasa.in*
*| Web: www.thrikasa.in http://www.thrikasa.in*

'If you don't give up,you cannot fail'.

The information contained in this communication is proprietary to 
Thrikasa Technologies., and/or third parties, may contain classified 
or privileged information, and is intended only for the use of the 
intended addressee thereof. If you are not the intended addressee, 
please be aware that any use, disclosure, distribution and/or copying 
of this communication is strictly prohibited.If you receive this 
communication in error, please notify the sender immediately and 
delete it from your computer.



___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] debian stable

2013-06-07 Thread Daniel-Constantin Mierla


On 6/7/13 5:31 PM, Ovidiu Sas wrote:

Should we update the deb-stable target to wheezy?

Yes.

Cheers,
Daniel


--- a/Makefile
+++ b/Makefile
@@ -681,7 +681,7 @@ deb-stable:
 dpkg-buildpackage -rfakeroot -tc; \
 rm debian; \
 else \
-   ln -s pkg/$(MAIN_NAME)/deb/squeeze debian; \
+   ln -s pkg/$(MAIN_NAME)/deb/wheezy debian; \
 dpkg-buildpackage -rfakeroot -tc; \
 rm debian; \
 fi


Regards,
Ovidiu Sas

--
VoIP Embedded, Inc.
http://www.voipembedded.com

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] releasing v4.0.2

2013-06-07 Thread Daniel-Constantin Mierla
 or â!â to â~â [-Wparentheses]
mcd_var.c:258:2: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 8 has type âsize_tâ [-Wformat]
mcd_var.c:258:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 6 has type âsize_tâ [-Wformat]
mcd_var.c:258:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 7 has type âsize_tâ [-Wformat]
mcd_var.c:258:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 5 has type âsize_tâ [-Wformat]
mcd_var.c:258:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 5 has type âsize_tâ [-Wformat]
mcd_var.c: In function âpv_set_mcd_expireâ:
mcd_var.c:311:2: warning: suggest parentheses around operand of â!â or
change ââ to ââ or â!â to â~â [-Wparentheses]
mcd_var.c:324:2: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 9 has type âsize_tâ [-Wformat]
mcd_var.c:324:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 7 has type âsize_tâ [-Wformat]
mcd_var.c:324:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 8 has type âsize_tâ [-Wformat]
mcd_var.c:324:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 6 has type âsize_tâ [-Wformat]
mcd_var.c:324:1: warning: field precision specifier â.*â expects
argument of type âintâ, but argument 6 has type âsize_tâ [-Wformat]
CC (gcc) [M memcached.so]   memcached.o
memcached.c: In function âmemcache_err_funcâ:
memcached.c:149:30: warning: variable âctxtâ set but not used
[-Wunused-but-set-variable]

CC (gcc) [M presence_conference.so] presence_conference.o
presence_conference.c: In function âmod_initâ:
presence_conference.c:112:16: warning: the comparison will always
evaluate as âfalseâ for the address of âadd_eventâ will never be NULL
[-Waddress]

CC (gcc) [M pua_reginfo.so] usrloc_cb.o
usrloc_cb.c: In function âbuild_reginfo_fullâ:
usrloc_cb.c:62:6: warning: variable âbuf_lenâ set but not used
[-Wunused-but-set-variable]

CC (gcc) [M xcap_client.so] xcap_callbacks.o
xcap_callbacks.c: In function âdestroy_xcapcb_listâ:
xcap_callbacks.c:74:25: warning: variable âprev_xcbâ set but not used
[-Wunused-but-set-variable]

CC (gcc) [M xcap_client.so] xcap_functions.o
xcap_functions.c: In function âxcapFreeNodeSelâ:
xcap_functions.c:72:17: warning: variable âmâ set but not used
[-Wunused-but-set-variable]

CC (gcc) [U kamcmd] parse_listen_id.o
parse_listen_id.c: In function âstr2sâ:
parse_listen_id.c:66:17: warning: variable âinitâ set but not used
[-Wunused-but-set-variable]



On Fri, Jun 7, 2013 at 3:29 AM, Daniel-Constantin Mierla
mico...@gmail.com wrote:

Hello,

I am considering to release kamailio v4.0.2 next week on Wednesday, June 12.
Developers that committed fixes on master branch and should be backported,
have to do it before. Overall, everyone should keep an eye and be sure their
demanded fixes are backported.

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
   * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev





--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master: siputils: added new function is_first_hop()

2013-06-08 Thread Daniel-Constantin Mierla

Hello,

On 6/8/13 8:55 AM, Juha Heinanen wrote:

daniel,

is_first_hop() readme has this on replies:

   For incoming SIP replies, it means that top Record-Route URI is
   'myself' and source address is not matching it (to avoid detecting in
   case of local loops). Note that it does not detect spirals, which can
   have the condition for replies true also in the case of additional SIP
   reply receival.

in contact alias tutorial

https://sip-router.org/wiki/tutorials/alias-example?#in-dialog_requests

i have implemented is first hop check by checking that reply does not
have any other r-r headers except the ones added by the proxy itself
when it relayed the request:

in request route i set

$avp(rr_count) = $rr_count;

and in reply route, i test

if ($rr_count == $avp(rr_count) + $rr_top_count) ...

i think that this method also works in case of spirals if i understand
correctly what spirals are.

do you have any comment about possible equivalence or non-equivalence of
the two methods?  could i safely use is_first_hop test also for replies
in contact alias tutorial?
Using your approach is safer and good for spirals as well, but requires 
tm module to keep the avp. I need it for a stateless outbound proxy. I 
considered storing the number of r-r as a parameter in the new r-r 
header, but could become too big with ftag, nat, etc...


Detecting the spiral would require to iterate through r-r headers in 
reply, see if there is another match to 'myself' and if yes, check if 
source ip/port/proto matches the previous r-r header. That should make 
it complete. Right now I know if there is a spiral inside my network, like:


UA1  K  Media Server  K  UA2

but is easy to check that source ip is media server.

Cheers,
Daniel

--
Daniel-Constantin Mierla
http://www.asipto.com


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] git:master: siputils: added new function is_first_hop()

2013-06-08 Thread Daniel-Constantin Mierla

On 6/8/13 8:59 AM, Juha Heinanen wrote:

it came to my mind that if sip ua runs on the same host as sip proxy
(which is very common in test environments at least) then it seem that
is_first_hop does not work for replies.

it may not be a good idea to introduce this function for replies if it
has such a hole.
The check is on ip, port and protocol, if ua is on same host, it will 
use a different port. It is similar situation with record-routing and UA 
on same host. Without port matching of 'myself', then contact of UA 
which appears as R-URI in subsequent requests will be detected as myself 
and eaten by loose_route() by considering a strict routing case.


For now use the test with rr count, it is good for replies.

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] is using Gerrit for Kamailio a good idea?

2013-06-10 Thread Daniel-Constantin Mierla

Hello,

I don't have any experience with it, maybe others can comment on its 
usability.


From what I could see, it is written on Java, does it have an embedded 
http server or we need to install a java application server by ourselves?


Since we are here, on admin stuff, anyone knowing an app integrating at 
least:

- git web viewer
- code review
- bug tracker

It might be easier to maintain a single system for all of them rather 
three different ones.


Cheers,
Daniel

On 6/7/13 11:48 AM, Victor Seva wrote:

Hello fellow Kamailio users and developers,

I would like to throw the idea of use Gerrit[0] for code contributions
reviews. This is not a replacement for the bugtracker, Gerrit will
help developers at the task of review and merge contributors patches.

I'm going to use mainly [1] to try to explain what Gerrit is:

Gerrit is a web-based tool that is used for code review. Its main
features are the side-by-side difference viewing and inline commenting
which makes code reviews quick and simple task. It is used together
with Git version control system. Gerrit allows authorized contributors
to submit changes to Git repository, after reviews are done.
Contributors can get their code reviewed with a little effort, and get
their changes quickly through the system.

It has a nice interface to review the different patch versions of the
change, you can comment any line of code easily and the change has to
be approved to be merged.

I would like to know your opinion on this subject and your experience
using it if you have it.

Cheers,
Victor

[0] 
http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/intro-quick.html
[1] http://qt-project.org/wiki/Gerrit-Introduction

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: registrar: more debug messages when adding ruid xavp

2013-06-11 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 9589466916305146fb4f982542c3f3a51126dcef
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9589466916305146fb4f982542c3f3a51126dcef

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:37:32 2013 +0200

registrar: more debug messages when adding ruid xavp

- free local ruid xavp if cannot be added to root list

---

 modules/registrar/reply.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c
index b692ef0..28588fa 100644
--- a/modules/registrar/reply.c
+++ b/modules/registrar/reply.c
@@ -342,7 +342,9 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host)
memset(xval, 0, sizeof(sr_xval_t));
xval.type = SR_XTYPE_STR;
xval.v.s = c-ruid;
-   xavp_add_value(xname, xval, xavp);
+   if(xavp_add_value(xname, xval, xavp)==NULL) {
+   LM_ERR(cannot add ruid value to 
xavp\n);
+   }
}
}
 
@@ -352,12 +354,15 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str 
*host)
/* add xavp with details of the record (ruid, ...) */
if(reg_xavp_rcd.s!=NULL)
{
-   if(list==NULL)
+   if(list==NULL  xavp!=NULL)
{
/* no reg_xavp_rcd xavp in root list - add it */
xval.type = SR_XTYPE_XAVP;
xval.v.xavp = xavp;
-   xavp_add_value(reg_xavp_rcd, xval, NULL);
+   if(xavp_add_value(reg_xavp_rcd, xval, NULL)==NULL) {
+   LM_ERR(cannot add ruid xavp to root list\n);
+   xavp_destroy_list(xavp);
+   }
}
}
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: registrar: readme regenerated

2013-06-11 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 407608dfef8e80ef0beaefc61df96e40060b952f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=407608dfef8e80ef0beaefc61df96e40060b952f

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:41:05 2013 +0200

registrar: readme regenerated

---

 modules/registrar/README |   80 +++---
 1 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/modules/registrar/README b/modules/registrar/README
index b4970dd..e209380 100644
--- a/modules/registrar/README
+++ b/modules/registrar/README
@@ -16,7 +16,7 @@ Edited by
 
 Bogdan-Andre Iancu
 
-   Copyright (c) 2003 FhG FOKUS
+   Copyright � 2003 FhG FOKUS
  __
 
Table of Contents
@@ -626,7 +626,7 @@ modparam(registrar, xavp_cfg, reg)
 
Example 1.21. Set xavp_rcd parameter
 ...
-modparam(registrar, xavp_cfg, ulrcd)
+modparam(registrar, xavp_rcd, ulrcd)
 ...
 
 3.23. gruu_enabled (integer)
@@ -725,7 +725,7 @@ modparam(registrar, flow_timer, 25)
4.7. reg_fetch_contacts(domain, uri, profile)
4.8. reg_free_contacts(profile)
 
-4.1.  save(domain, [, flags [, uri]])
+4.1. save(domain, [, flags [, uri]])
 
The function processes a REGISTER message. It can add, remove or modify
usrloc records depending on Contact and Expires HFs in the REGISTER
@@ -769,7 +769,7 @@ save(location, 0x01);
 save(location, 0x00, sip:t...@kamailio.org);
 ...
 
-4.2.  lookup(domain [, uri])
+4.2. lookup(domain [, uri])
 
The function extracts username from Request-URI and tries to find all
contacts for the username in usrloc. If there are no such contacts, -1
@@ -809,7 +809,7 @@ switch ($retcode) {
 };
 ...
 
-4.3.  lookup_branches(domain)
+4.3. lookup_branches(domain)
 
The function performs lookup(domain) on r-uri and additional branches
(only branches that have no other attributes set than uri).
@@ -826,7 +826,7 @@ switch ($retcode) {
 lookup_branches(location);
 ...
 
-4.4.  registered(domain [, uri])
+4.4. registered(domain [, uri])
 
The function returns true if the AOR in the Request-URI is registered,
false otherwise. The function does not modify the message being
@@ -848,7 +848,7 @@ if (registered(location)) {
 };
 ...
 
-4.5.  add_sock_hdr(hdr_name)
+4.5. add_sock_hdr(hdr_name)
 
Adds to the current REGISTER request a new header with hdr_name which
contains the description of the received socket (proto:ip:port)
@@ -865,7 +865,7 @@ if (registered(location)) {
 add_sock_hdr(Sock-Info);
 ...
 
-4.6.  unregister(domain, uri[, ruid])
+4.6. unregister(domain, uri[, ruid])
 
The function removes contacts associated with 'uri'. If 'ruid' is
provided a specific contact is removed, if 'ruid' is not provided all
@@ -891,7 +891,7 @@ unregister(location, $ru, $ulc(caller=ruid));
 unregister(location, , $ruid);
 ...
 
-4.7.  reg_fetch_contacts(domain, uri, profile)
+4.7. reg_fetch_contacts(domain, uri, profile)
 
The function fetches the contacts for 'uri' from table 'domain' to
pseudo-variable $ulc(profile).
@@ -913,7 +913,7 @@ reg_fetch_contacts(location, $ru, callee);
 reg_fetch_contacts(location, sip:u...@kamailio.org, caller);
 ...
 
-4.8.  reg_free_contacts(profile)
+4.8. reg_free_contacts(profile)
 
The function frees the contacts from pseudo-variable $ulc(profile).
Should be called to release the content of a profile. Anyhow, fetching
@@ -1056,60 +1056,60 @@ Chapter 2. Frequently Asked Questions
 
2.1.
 
-   What happend with the old nat_flag module parameter?
+   What happend with the old nat_flag module parameter?
 
-   In was removed, as the module internally loads this value from the
-   USRLOC module (see the nat_bflag USRLOC parameter).
+   In was removed, as the module internally loads this value from the
+   USRLOC module (see the nat_bflag USRLOC parameter).
 
2.2.
 
-   What happend with the old use_domain module parameter?
+   What happend with the old use_domain module parameter?
 
-   In was removed, as the module internally loads this option from the
-   USRLOC module. This was done in order to simplify the configuration.
+   In was removed, as the module internally loads this option from the
+   USRLOC module. This was done in order to simplify the configuration.
 
2.3.
 
-   What happend with the old save_noreply and save_memory functions?
+   What happend with the old save_noreply and save_memory functions?
 
-   There functions were merged into the new save(domain,flags)
-   functions. If a reply should be sent or if the DB should be updated
-   also is controlled via the flags.
+   There functions were merged into the new save(domain,flags)
+   functions. If a reply should be sent or if the DB should be updated
+   also is controlled via the flags.
 
2.4.
 
-   Where can I find more about

[sr-dev] git:master: registrar: fixed typo in example of xavp_rcd parameter

2013-06-11 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c228851e068a080050c79107c760f8ab5ffae967
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c228851e068a080050c79107c760f8ab5ffae967

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:39:31 2013 +0200

registrar: fixed typo in example of xavp_rcd parameter

---

 modules/registrar/doc/registrar_admin.xml |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/registrar/doc/registrar_admin.xml 
b/modules/registrar/doc/registrar_admin.xml
index 4cddfec..36ef882 100644
--- a/modules/registrar/doc/registrar_admin.xml
+++ b/modules/registrar/doc/registrar_admin.xml
@@ -689,7 +689,7 @@ modparam(registrar, xavp_cfg, reg)
titleSet varnamexavp_rcd/varname parameter/title
programlisting format=linespecific
 ...
-modparam(registrar, xavp_cfg, ulrcd)
+modparam(registrar, xavp_rcd, ulrcd)
 ...
/programlisting
/example


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: mtree: make log message on not maching character a debug instead of error

2013-06-11 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 862e267267ccd58e096f267ac5aab03cee042b7c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=862e267267ccd58e096f267ac5aab03cee042b7c

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:47:54 2013 +0200

mtree: make log message on not maching character a debug instead of error

---

 modules/mtree/mtree.c |  284 ++--
 modules/mtree/mtree_mod.c |  180 ++--
 2 files changed, 232 insertions(+), 232 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=862e267267ccd58e096f267ac5aab03cee042b7c

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: mtree: print more details if the record in db is broken

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: b5538401a01057318063a4e4646c9e7a2fb967c0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b5538401a01057318063a4e4646c9e7a2fb967c0

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 08:50:26 2013 +0200

mtree: print more details if the record in db is broken

---

 modules/mtree/mtree_mod.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/mtree/mtree_mod.c b/modules/mtree/mtree_mod.c
index 50e0d4f..0f4348c 100644
--- a/modules/mtree/mtree_mod.c
+++ b/modules/mtree/mtree_mod.c
@@ -566,7 +566,9 @@ static int mt_load_db(str *tname)
if(tprefix.s==NULL || tvalue.s==NULL
|| tprefix.len=0 || tvalue.len=0)
{
-   LM_ERR(Error - bad values in db (%p:%p)\n, 
tprefix.s, tvalue.s);
+   LM_ERR(Error - bad record in db
+(prefix: %p/%d - value: 
%p/%d)\n,
+   tprefix.s, tprefix.len, 
tvalue.s, tvalue.len);
continue;
}
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: registrar: fixed typo in example of xavp_rcd parameter

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 6b0d759f0dabf36c529c6c7d22c8333e7a8731e1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6b0d759f0dabf36c529c6c7d22c8333e7a8731e1

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:39:31 2013 +0200

registrar: fixed typo in example of xavp_rcd parameter
(cherry picked from commit c228851e068a080050c79107c760f8ab5ffae967)

---

 modules/registrar/doc/registrar_admin.xml |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/registrar/doc/registrar_admin.xml 
b/modules/registrar/doc/registrar_admin.xml
index cb55218..772957c 100644
--- a/modules/registrar/doc/registrar_admin.xml
+++ b/modules/registrar/doc/registrar_admin.xml
@@ -689,7 +689,7 @@ modparam(registrar, xavp_cfg, reg)
titleSet varnamexavp_rcd/varname parameter/title
programlisting format=linespecific
 ...
-modparam(registrar, xavp_cfg, ulrcd)
+modparam(registrar, xavp_rcd, ulrcd)
 ...
/programlisting
/example


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: registrar: more debug messages when adding ruid xavp

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 3f1f50068b96ea4bde1a7255842bf07683cbed8a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3f1f50068b96ea4bde1a7255842bf07683cbed8a

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jun 11 18:37:32 2013 +0200

registrar: more debug messages when adding ruid xavp

- free local ruid xavp if cannot be added to root list
(cherry picked from commit 9589466916305146fb4f982542c3f3a51126dcef)

---

 modules/registrar/reply.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c
index 7ed2a05..4b35a47 100644
--- a/modules/registrar/reply.c
+++ b/modules/registrar/reply.c
@@ -341,7 +341,9 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host)
memset(xval, 0, sizeof(sr_xval_t));
xval.type = SR_XTYPE_STR;
xval.v.s = c-ruid;
-   xavp_add_value(xname, xval, xavp);
+   if(xavp_add_value(xname, xval, xavp)==NULL) {
+   LM_ERR(cannot add ruid value to 
xavp\n);
+   }
}
}
 
@@ -351,12 +353,15 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str 
*host)
/* add xavp with details of the record (ruid, ...) */
if(reg_xavp_rcd.s!=NULL)
{
-   if(list==NULL)
+   if(list==NULL  xavp!=NULL)
{
/* no reg_xavp_rcd xavp in root list - add it */
xval.type = SR_XTYPE_XAVP;
xval.v.xavp = xavp;
-   xavp_add_value(reg_xavp_rcd, xval, NULL);
+   if(xavp_add_value(reg_xavp_rcd, xval, NULL)==NULL) {
+   LM_ERR(cannot add ruid xavp to root list\n);
+   xavp_destroy_list(xavp);
+   }
}
}
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: mtree: use debug level for log message when invalid character in value to be matched

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 81b61679cabd2470becf86700b777cc496f1d330
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=81b61679cabd2470becf86700b777cc496f1d330

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 09:11:56 2013 +0200

mtree: use debug level for log message when invalid character in value to be 
matched

- more verbose message when an invalid database record is found

---

 modules/mtree/mtree.c |  284 ++--
 modules/mtree/mtree_mod.c |  166 +-
 2 files changed, 226 insertions(+), 224 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=81b61679cabd2470becf86700b777cc496f1d330

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: registrar: regenerated the readme file

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: d54024f873c641c21da197ee7eb3a49746f58229
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d54024f873c641c21da197ee7eb3a49746f58229

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 09:14:14 2013 +0200

registrar: regenerated the readme file

---

 modules/registrar/README |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/registrar/README b/modules/registrar/README
index f5c80f3..cce005c 100644
--- a/modules/registrar/README
+++ b/modules/registrar/README
@@ -622,7 +622,7 @@ modparam(registrar, xavp_cfg, reg)
 
Example 1.21. Set xavp_rcd parameter
 ...
-modparam(registrar, xavp_cfg, ulrcd)
+modparam(registrar, xavp_rcd, ulrcd)
 ...
 
 3.23. gruu_enabled (integer)


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] releasing v4.0.2

2013-06-12 Thread Daniel-Constantin Mierla

Hello,

quick reminder about releasing v4.0.2 today. Backports to branch 4.0 
should be done before 12:00GMT, then devs have to write to sr-dev or 
wait until the release announcement is sent out.


Cheers,
Daniel

On 6/7/13 9:29 AM, Daniel-Constantin Mierla wrote:

Hello,

I am considering to release kamailio v4.0.2 next week on Wednesday, 
June 12. Developers that committed fixes on master branch and should 
be backported, have to do it before. Overall, everyone should keep an 
eye and be sure their demanded fixes are backported.


Cheers,
Daniel



--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:3.3: pv: clone result of several string transformations

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 3.3
Commit: 8e98fd0a708f96c98b942b1fcfa77a5b6e45496d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8e98fd0a708f96c98b942b1fcfa77a5b6e45496d

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed May 15 22:45:18 2013 +0200

pv: clone result of several string transformations

- it is safer for assigning back to the same variable on which the
  transformation was applied
- reported by Martin Mikkelsen
(cherry picked from commit fe7e4a5152674aa9c81c09dd2fc9938d9e9e762e)

Conflicts:
modules_k/pv/pv_trans.c

---

 modules_k/pv/pv_trans.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c
index af455eb..76efe1c 100644
--- a/modules_k/pv/pv_trans.c
+++ b/modules_k/pv/pv_trans.c
@@ -94,6 +94,15 @@ char *tr_set_crt_buffer(void)
return _tr_buffer;
 }
 
+#define tr_string_clone_result do { \
+   if(val-rs.lenTR_BUFFER_SIZE-1) { \
+   LM_ERR(result is too big\n); \
+   return -1; \
+   } \
+   strncpy(_tr_buffer, val-rs.s, val-rs.len); \
+   val-rs.s = _tr_buffer; \
+   } while(0);
+
 /*!
  * \brief Evaluate string transformations
  * \param msg SIP message
@@ -323,6 +332,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int 
subtype,
{ /* to end */
val-rs.s += i;
val-rs.len -= i;
+   tr_string_clone_result;
break;
}
val-rs.s += i;
@@ -340,10 +350,12 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, 
int subtype,
{ /* to end */
val-rs.s += val-rs.len-i;
val-rs.len = i;
+   tr_string_clone_result;
break;
}
val-rs.s += val-rs.len-i;
val-rs.len = j;
+   tr_string_clone_result;
break;
 
case TR_S_SELECT:
@@ -414,6 +426,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int 
subtype,
val-rs = _tr_empty;
}
}
+   tr_string_clone_result;
break;
 
case TR_S_TOLOWER:
@@ -489,6 +502,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int 
subtype,
if(subtype==TR_S_STRIP)
val-rs.s += i;
val-rs.len -= i;
+   tr_string_clone_result;
break;
 
case TR_S_PREFIXES:


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: pkg/deb: version set to 4.0.2 in spec files

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 963fcd0ccfac6cccdc27b3a2d7a14d207ed7c516
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=963fcd0ccfac6cccdc27b3a2d7a14d207ed7c516

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 12:29:16 2013 +0200

pkg/deb: version set to 4.0.2 in spec files

---

 pkg/kamailio/deb/debian/changelog  |6 ++
 pkg/kamailio/deb/lenny/changelog   |6 ++
 pkg/kamailio/deb/lucid/changelog   |6 ++
 pkg/kamailio/deb/precise/changelog |6 ++
 pkg/kamailio/deb/squeeze/changelog |6 ++
 pkg/kamailio/deb/wheezy/changelog  |6 ++
 6 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/pkg/kamailio/deb/debian/changelog 
b/pkg/kamailio/deb/debian/changelog
index 0dbe905..0b08063 100644
--- a/pkg/kamailio/deb/debian/changelog
+++ b/pkg/kamailio/deb/debian/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream
diff --git a/pkg/kamailio/deb/lenny/changelog b/pkg/kamailio/deb/lenny/changelog
index 0dbe905..0b08063 100644
--- a/pkg/kamailio/deb/lenny/changelog
+++ b/pkg/kamailio/deb/lenny/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream
diff --git a/pkg/kamailio/deb/lucid/changelog b/pkg/kamailio/deb/lucid/changelog
index 0dbe905..0b08063 100644
--- a/pkg/kamailio/deb/lucid/changelog
+++ b/pkg/kamailio/deb/lucid/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream
diff --git a/pkg/kamailio/deb/precise/changelog 
b/pkg/kamailio/deb/precise/changelog
index ce2f0aa..1c2ad0d 100644
--- a/pkg/kamailio/deb/precise/changelog
+++ b/pkg/kamailio/deb/precise/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream
diff --git a/pkg/kamailio/deb/squeeze/changelog 
b/pkg/kamailio/deb/squeeze/changelog
index 0dbe905..0b08063 100644
--- a/pkg/kamailio/deb/squeeze/changelog
+++ b/pkg/kamailio/deb/squeeze/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream
diff --git a/pkg/kamailio/deb/wheezy/changelog 
b/pkg/kamailio/deb/wheezy/changelog
index 0dbe905..0b08063 100644
--- a/pkg/kamailio/deb/wheezy/changelog
+++ b/pkg/kamailio/deb/wheezy/changelog
@@ -1,3 +1,9 @@
+kamailio (4.0.2) unstable; urgency=low
+
+  * update to 4.0.2 from upstream
+
+ -- Daniel-Constantin Mierla mico...@gmail.com  Wed, 12 Jun 2013 10:55:50 
+0100
+
 kamailio (4.0.1) unstable; urgency=low
 
   * update to 4.0.1 from upstream


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: pkg/rpm: version set to 4.0.2 in spec files

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: d4df824c3f16cf934d9056e94f8f44ae0bf3016f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d4df824c3f16cf934d9056e94f8f44ae0bf3016f

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 12:29:39 2013 +0200

pkg/rpm: version set to 4.0.2 in spec files

---

 pkg/kamailio/rpm/kamailio.spec-4.1   |2 +-
 pkg/kamailio/rpm/kamailio.spec.CenOS |2 +-
 pkg/kamailio/rpm/kamailio.spec.SuSE  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkg/kamailio/rpm/kamailio.spec-4.1 
b/pkg/kamailio/rpm/kamailio.spec-4.1
index 0db87b0..9ee6532 100644
--- a/pkg/kamailio/rpm/kamailio.spec-4.1
+++ b/pkg/kamailio/rpm/kamailio.spec-4.1
@@ -1,5 +1,5 @@
 %define namekamailio
-%define ver 4.0.1
+%define ver 4.0.2
 %define rel 0
 
 %define EXCLUDED_MODULES   mysql jabber cpl-c avp_radius auth_radius 
group_radius uri_radius pa postgres osp tlsops unixodbc
diff --git a/pkg/kamailio/rpm/kamailio.spec.CenOS 
b/pkg/kamailio/rpm/kamailio.spec.CenOS
index c6a9d1d..e31fd6f 100644
--- a/pkg/kamailio/rpm/kamailio.spec.CenOS
+++ b/pkg/kamailio/rpm/kamailio.spec.CenOS
@@ -1,5 +1,5 @@
 %define namekamailio
-%define ver 4.0.1
+%define ver 4.0.2
 %define rel 0
 %define _sharedir %{_prefix}/share
 
diff --git a/pkg/kamailio/rpm/kamailio.spec.SuSE 
b/pkg/kamailio/rpm/kamailio.spec.SuSE
index 58252b9..e53c288 100644
--- a/pkg/kamailio/rpm/kamailio.spec.SuSE
+++ b/pkg/kamailio/rpm/kamailio.spec.SuSE
@@ -1,5 +1,5 @@
 %define namekamailio
-%define ver 4.0.1
+%define ver 4.0.2
 %define rel 0
 
 %define EXCLUDED_MODULES   mysql jabber cpl-c auth_radius misc_radius 
peering postgress pa unixodbc osp tlsops


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: Makefile.defs: version set to 4.0.2

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: f6fc38aab505aab1301024b58581ebec9a7181c4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f6fc38aab505aab1301024b58581ebec9a7181c4

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 15:50:45 2013 +0200

Makefile.defs: version set to 4.0.2

---

 Makefile.defs |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.defs b/Makefile.defs
index cda0322..fd28c15 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -162,7 +162,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 #version number
 VERSION = 4
 PATCHLEVEL = 0
-SUBLEVEL = 1
+SUBLEVEL = 2
 EXTRAVERSION = 
 
 # memory manager switcher


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: ChangeLog: content updated for v4.0.2

2013-06-12 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: fc967b2d800d8be22bab4f12e02be549efea8403
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fc967b2d800d8be22bab4f12e02be549efea8403

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jun 12 15:53:25 2013 +0200

ChangeLog: content updated for v4.0.2

---

 ChangeLog |  712 +
 1 files changed, 712 insertions(+), 0 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=fc967b2d800d8be22bab4f12e02be549efea8403

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] Kamailio v4.0.2 Released

2013-06-12 Thread Daniel-Constantin Mierla

Hello,

Kamailio SIP Server v4.0.2 stable release is out.

This is a maintenance release of the latest stable branch, 4.0, that 
includes fixes since release of v4.0.0. There is no change to database 
schema or configuration language structure that you have to do on 
installations of v4.0.0. Deployments running previous v4.x.x versions 
are strongly recommended to be upgraded to v4.0.2.


For more details about version 4.0.2 (including links and guidelines to 
download the tarball or from GIT repository), visit:


  * http://www.kamailio.org/w/2013/06/kamailio-v4-0-2-released/

RPM, Debian/Ubuntu packages will be available soon as well.

Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] regex's as PVs in textops functions

2013-06-14 Thread Daniel-Constantin Mierla

Hello,

On 6/13/13 5:14 PM, Hugh Waite wrote:

Hello,
I need to run a text find-and-replace on the body of my requests and 
responses. The texops functions 'replace_body_all' and 'subst_body' 
work for fixed regular expressions, but mine need to be configurable 
i.e. loaded from a database.
Trying to accept PVs in the regex parameter could intefere with 
regex's that contain $ characters, so this isn't as simple as 
inserting the spve fixup into these functions.


What do you think is the best way to implement this and remain 
compatible with existing versions? New functions with different names?
I would go for using a different name. Existing ones do the fixup at 
startup, compiling the parameter to a regex structure. For the new 
function that has to be done at runtime and the structure freed as well.


Cheers,
Daniel



For example:
route(FETCH_REGEX_FROM_DB);
if ($var(regex) != $null) {
  replace_body_pv($var(regex), $var(repl));
}

Regards,
Hugh



--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013
  * http://asipto.com/u/katu *


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamctl: added show command to display user attributes in subscriber table

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: da016636be6e0ca9a65b645b6e30ec0b1dafeef4
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=da016636be6e0ca9a65b645b6e30ec0b1dafeef4

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri Jun 14 08:42:37 2013 +0200

kamctl: added show command to display user attributes in subscriber table

---

 utils/kamctl/kamctl  |   26 ++
 utils/kamctl/kamctl.base |1 +
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 01c99c9..42d031e 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -2151,6 +2151,28 @@ subscriber() {
fi
;;
 
+   show)
+   if [ $# -ne 2 ] ; then
+   usage_subscriber
+   exit 1
+   fi
+   shift
+
+   set_user $1
+
+   case $DBENGINE in
+   MYSQL|mysql|MySQL)
+   QUERY=SELECT * FROM $SUB_TABLE \
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN'\G
+   ;;
+   *)
+   QUERY=SELECT * FROM $SUB_TABLE \
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN';
+   ;;
+   esac
+   $DBROCMD $QUERY
+   ;;
+
passwd)
if [ $# -ne 3 ] ; then
usage_subscriber
@@ -2516,6 +2538,10 @@ case $1 in
subscriber $@
;;
 
+   show)
+   subscriber $@
+   ;;
+
passwd)
subscriber $@
;;
diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base
index 589e0a0..034ac51 100644
--- a/utils/kamctl/kamctl.base
+++ b/utils/kamctl/kamctl.base
@@ -422,6 +422,7 @@ usage_subscriber() {
echo
 cat EOF
  add username password .. add a new subscriber (*)
+ show username  show subscriber attributes (*)
  passwd username passwd . change user's password (*)
  rm username .. delete a user (*)
 EOF


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamailio.cfg: route subscribe for event message-summary to voicemail server

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: e7da9f72beb1c97b79a516ecdd19db8971dea508
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e7da9f72beb1c97b79a516ecdd19db8971dea508

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 18:23:48 2013 +0200

kamailio.cfg: route subscribe for event message-summary to voicemail server

---

 etc/kamailio.cfg |   30 --
 1 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 911b7d6..c8ac439 100644
--- a/etc/kamailio.cfg
+++ b/etc/kamailio.cfg
@@ -680,21 +680,25 @@ route[PRESENCE] {
if(!is_method(PUBLISH|SUBSCRIBE))
return;
 
+   if(is_method(SUBSCRIBE)  $hdr(Event)==message-summary) {
+   route(TOVOICEMAIL);
+   # returns here if no voicemail server is configured
+   sl_send_reply(404, No voicemail service);
+   exit;
+   }
+
 #!ifdef WITH_PRESENCE
if (!t_newtran())
{
sl_reply_error();
exit;
-   };
+   }
 
if(is_method(PUBLISH))
{
handle_publish();
t_release();
-   }
-   else
-   if( is_method(SUBSCRIBE))
-   {
+   } else if(is_method(SUBSCRIBE)) {
handle_subscribe();
t_release();
}
@@ -868,7 +872,7 @@ route[XMLRPC] {
 # route to voicemail server
 route[TOVOICEMAIL] {
 #!ifdef WITH_VOICEMAIL
-   if(!is_method(INVITE))
+   if(!is_method(INVITE|SUBSCRIBE))
return;
 
# check if VoiceMail server IP is defined
@@ -876,11 +880,17 @@ route[TOVOICEMAIL] {
xlog(SCRIPT: VoiceMail rotuing enabled but IP not defined\n);
return;
}
-   if($avp(oexten)==$null)
-   return;
-
-   $ru = sip: + $avp(oexten) + @ + $sel(cfg_get.voicemail.srv_ip)
+   if(is_method(INVITE)) {
+   if($avp(oexten)==$null)
+   return;
+   $ru = sip: + $avp(oexten) + @ + 
$sel(cfg_get.voicemail.srv_ip)
+ : + $sel(cfg_get.voicemail.srv_port);
+   } else {
+   if($rU==$null)
+   return;
+   $ru = sip: + $rU + @ + $sel(cfg_get.voicemail.srv_ip)
+   + : + $sel(cfg_get.voicemail.srv_port);
+   }
route(RELAY);
exit;
 #!endif


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: tm: new module parameter - dns_reuse_rcv_socket

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 30e26f22600c3f50f0ea556bf2872ef7b0807c6a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=30e26f22600c3f50f0ea556bf2872ef7b0807c6a

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 19:08:38 2013 +0200

tm: new module parameter - dns_reuse_rcv_socket

- control reuse of the receive socket for additional branches added by
  dns failover
- if 1, the rcv socket is used, if not it depends on mhomed - when that
  is 0, the first socket is used, otherwise will be selected based on
  routing table
- default is 0
- therefore beware when setting this parameter and mhomed=1
- based on discussion for FS#313

---

 modules/tm/t_fwd.c |   12 +---
 modules/tm/tm.c|3 +++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index e0b2642..55d45f4 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -127,6 +127,7 @@
 
 
 extern int tm_failure_exec_mode;
+extern int tm_dns_reuse_rcv_socket;
 
 static int goto_on_branch = 0, branch_route = 0;
 
@@ -1073,14 +1074,16 @@ int add_uac_dns_fallback(struct cell *t, struct 
sip_msg* msg,
old_uac-path,
 
(old_uac-request.dst.send_flags.f 

SND_F_FORCE_SOCKET)?
-   
old_uac-request.dst.send_sock:0,
+   
old_uac-request.dst.send_sock:
+   
((tm_dns_reuse_rcv_socket)
+   
?msg-rcv.bind_address:0),

old_uac-request.dst.send_flags,

old_uac-request.dst.proto,
old_uac-request.buffer,

old_uac-request.buffer_len,
old_uac-instance, 
old_uac-ruid,
old_uac-location_ua);
-   }else
+   } else {
/* add_uac will use dns_h = next_hop will be 
ignored.
 * Unfortunately we can't reuse the old buffer, 
the branch id
 *  must be changed and the send_socket might 
be different =
@@ -1088,11 +1091,14 @@ int add_uac_dns_fallback(struct cell *t, struct 
sip_msg* msg,
ret=add_uac(t,  msg, old_uac-uri, 0, 
old_uac-path, 0,
 
(old_uac-request.dst.send_flags.f 

SND_F_FORCE_SOCKET)?
-   
old_uac-request.dst.send_sock:0,
+   
old_uac-request.dst.send_sock:
+   
((tm_dns_reuse_rcv_socket)
+   
?msg-rcv.bind_address:0),

old_uac-request.dst.send_flags,

old_uac-request.dst.proto, UAC_DNS_FAILOVER_F,
old_uac-instance, 
old_uac-ruid,
old_uac-location_ua);
+   }
 
if (ret0){
/* failed, delete the copied dns_h */
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index f7407d6..5b410c1 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -316,6 +316,8 @@ int tm_remap_503_500 = 1;
 
 int tm_failure_exec_mode = 0;
 
+int tm_dns_reuse_rcv_socket = 0;
+
 static rpc_export_t tm_rpc[];
 
 static int fixup_t_check_status(void** param, int param_no);
@@ -540,6 +542,7 @@ static param_export_t params[]={
{faked_reply_prio,PARAM_INT, faked_reply_prio
 },
{remap_503_500,   PARAM_INT, tm_remap_503_500
 },
{failure_exec_mode,   PARAM_INT, tm_failure_exec_mode
 },
+   {dns_reuse_rcv_socket,PARAM_INT, tm_dns_reuse_rcv_socket 
 },
 #ifdef CANCEL_REASON_SUPPORT
{local_cancel_reason, PARAM_INT, default_tm_cfg.local_cancel_reason  
 },
{e2e_cancel_reason,   PARAM_INT, default_tm_cfg.e2e_cancel_reason
 },


___
sr

[sr-dev] git:master: tm: readme updated based on latest docbook

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: af6a5d7422b614e5a143bc987806181086360c34
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=af6a5d7422b614e5a143bc987806181086360c34

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 19:31:43 2013 +0200

tm: readme updated based on latest docbook

---

 modules/tm/README | 1973 +++--
 1 files changed, 994 insertions(+), 979 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=af6a5d7422b614e5a143bc987806181086360c34

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamctl: set internal version to 4.1.0

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 0b82af2019d523c680d156d9b95ae33043c79bd0
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0b82af2019d523c680d156d9b95ae33043c79bd0

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 19:33:50 2013 +0200

kamctl: set internal version to 4.1.0

---

 utils/kamctl/kamctl |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 42d031e..4583926 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -7,7 +7,7 @@
 #===
 
 ### version for this script
-VERSION='3.3.0'
+VERSION='4.1.0'
 
 PATH=$PATH:/usr/local/sbin/
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: tm: documented dn_reuse_rcv_socket parameter

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 5f1b144a7e63b464af3e5e0e7b74cf7e7e1e8668
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5f1b144a7e63b464af3e5e0e7b74cf7e7e1e8668

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 19:30:59 2013 +0200

tm: documented dn_reuse_rcv_socket parameter

---

 modules/tm/doc/params.xml |   30 ++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/modules/tm/doc/params.xml b/modules/tm/doc/params.xml
index 767a5fc..4d3bf26 100644
--- a/modules/tm/doc/params.xml
+++ b/modules/tm/doc/params.xml
@@ -1378,4 +1378,34 @@ modparam(tm, failure_exec_mode, 1)
/example
/section
 
+
+   section id=tm.p.dns_reuse_rcv_socket
+   titlevarnamedns_reuse_rcv_socket/varname (boolean)/title
+   para
+   Control reuse of the receive socket for additional 
branches added
+   by dns failover. If set to 1, the receive socket is 
used for
+   sending out the new branches, unless the socket is 
forced
+   explicitely in configuration file. If set to 0, 
selected socket
+   is done depending on value of global parameter mhomed 
(if mhomed=0,
+   then the first listen socket is used, otherwise the 
socket is
+   selected based on routing rules).
+   /para
+   para
+   Do enable it with caution, it might create troubles on 
dns results
+   with different transport layer. Better let it disabled 
and enable
+   mhomed.
+   /para
+   para
+   Default value is 0 (disabled).
+   /para
+   example
+   titleSet varnamedns_reuse_rcv_socket/varname 
parameter/title
+   programlisting
+...
+modparam(tm, dns_reuse_rcv_socket, 1)
+...
+   /programlisting
+   /example
+   /section
+
 /section


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: tm: copy tm routing blocks ids for new branches added by dns failover

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 350f4f8971a679f0d6566361b2a7bb17956a6a7e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=350f4f8971a679f0d6566361b2a7bb17956a6a7e

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 18:54:59 2013 +0200

tm: copy tm routing blocks ids for new branches added by dns failover

- patch by Jasmin Schnatterbeck, part of FS#313

---

 modules/tm/t_fwd.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c
index 86c5daa..e0b2642 100644
--- a/modules/tm/t_fwd.c
+++ b/modules/tm/t_fwd.c
@@ -1001,6 +1001,11 @@ static int add_uac_from_buf( struct cell *t, struct 
sip_msg *request,
t-uac[branch].location_ua.s[location_ua-len]=0;
memcpy( t-uac[branch].location_ua.s, location_ua-s, 
location_ua-len);
}
+
+   t-uac[branch].on_reply = t-on_reply;
+   t-uac[branch].on_failure = t-on_failure;
+   t-uac[branch].on_branch_failure = t-on_branch_failure;
+
membar_write(); /* to allow lockless ops (e.g. prepare_to_cancel()) we 
want
   to be sure everything above is fully 
written before
   updating branches no. */


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamctl: new commands can be defined in separate files

2013-06-15 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: ea772b354f84eccff0190234025f057879ff33ed
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ea772b354f84eccff0190234025f057879ff33ed

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sat Jun 15 22:03:58 2013 +0200

kamctl: new commands can be defined in separate files

- write new kamctl commands either in CFGDIR/kamctl.newcmd.ext or
  ~/.kamctl/kamctl.newcmd.ext
- 'newcmd' has to be replaced with the name of the command
- the file must include cmd_newcmd() function which is executed with the
  parameters after the command name
- example: adding new command 'sample'
- content of ~/.kamctl/kamctl.sample.ext file:

usage_sample() {
echo
mecho  -- command 'sample' - kamctl sample extension command
echo
cat EOF
 test ... print test message
 help ... help text
EOF
}

cmd_sample() {
case $1 in
test)
echo message from sample test command
;;
*)
usage_sample
;;
esac
exit 1;
}

- new command 'sample' can be executed with:

kamctl sample test

---

 utils/kamctl/kamctl |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl
index 4583926..0dee374 100755
--- a/utils/kamctl/kamctl
+++ b/utils/kamctl/kamctl
@@ -2524,6 +2524,25 @@ tls_ca() {
fi
 }
 
+extcmd() {
+   if [ -f $ETCDIR/kamctl.${1}.ext ]; then
+   . $ETCDIR/kamctl.${1}.ext
+   else
+   if [ -f ~/.kamctl/kamctl.${1}.ext ]; then
+   . ~/.kamctl/kamctl.${1}.ext
+   else
+   return
+   fi
+   fi
+
+   XCMD=cmd_${1}
+
+   shift
+   $XCMD $@
+
+   exit 1
+}
+
 #
 #  #
 ### main command switch
@@ -2705,6 +2724,8 @@ case $1 in
;;

*)
+   extcmd $@
+
usage
exit 1
;;


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: mtree: fixed typo in log function name

2013-06-16 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 330aeda83dc7ed927cf994e4b21ff44ab2d2c215
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=330aeda83dc7ed927cf994e4b21ff44ab2d2c215

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun Jun 16 16:40:59 2013 +0200

mtree: fixed typo in log function name

---

 modules/mtree/mtree.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/mtree/mtree.c b/modules/mtree/mtree.c
index 4dfada4..6587909 100644
--- a/modules/mtree/mtree.c
+++ b/modules/mtree/mtree.c
@@ -309,7 +309,7 @@ is_t* mt_get_tvalue(m_tree_t *pt, str *tomatch)
/* check validity */
if(_mt_char_table[(unsigned int)tomatch-s[l]]==255)
{
-   LM_BG(not matching char at %d in [%.*s]\n,
+   LM_DBG(not matching char at %d in [%.*s]\n,
l, tomatch-len, tomatch-s);
return NULL;
}


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: added function to get the pv cache table

2013-06-16 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 69c409e14c568fae45e449122e5b4efbf009bf41
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=69c409e14c568fae45e449122e5b4efbf009bf41

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun Jun 16 16:39:14 2013 +0200

core: added function to get the pv cache table

- pv cache struct moved to header file

---

 pvapi.c |   17 -
 pvar.h  |   16 
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/pvapi.c b/pvapi.c
index 98b3d90..7f5fcc2 100644
--- a/pvapi.c
+++ b/pvapi.c
@@ -41,7 +41,6 @@
 #include pvar.h
 
 #define PV_TABLE_SIZE  32  /*! pseudo-variables table size */
-#define PV_CACHE_SIZE  32  /*! pseudo-variables table size */
 #define TR_TABLE_SIZE  16  /*! transformations table size */
 
 
@@ -58,14 +57,6 @@ typedef struct _pv_item
 static pv_item_t* _pv_table[PV_TABLE_SIZE];
 static int _pv_table_set = 0;
 
-typedef struct _pv_cache
-{
-   str pvname;
-   unsigned int pvid;
-   pv_spec_t spec;
-   struct _pv_cache *next;
-} pv_cache_t;
-
 static pv_cache_t* _pv_cache[PV_CACHE_SIZE];
 static int _pv_cache_set = 0;
 
@@ -87,6 +78,14 @@ void pv_init_cache(void)
_pv_cache_set = 1;
 }
 
+/**
+ *
+ */
+pv_cache_t **pv_cache_get_table(void)
+{
+   if(_pv_cache_set==1) return _pv_cache;
+   return NULL;
+}
 
 /**
  * @brief Check if a char is valid according to the PV syntax
diff --git a/pvar.h b/pvar.h
index c3d7b44..75c4914 100644
--- a/pvar.h
+++ b/pvar.h
@@ -226,6 +226,22 @@ int pv_get_intstrval(struct sip_msg *msg, pv_param_t 
*param,
pv_value_t *res, int ival, str *sval);
 
 /**
+ * Core PV Cache
+ */
+typedef struct _pv_cache
+{
+   str pvname;
+   unsigned int pvid;
+   pv_spec_t spec;
+   struct _pv_cache *next;
+} pv_cache_t;
+
+#define PV_CACHE_SIZE  32  /*! pseudo-variables cache table size */
+
+pv_cache_t **pv_cache_get_table(void);
+
+
+/**
  * Transformations
  */
 #define TR_LBRACKET_STR{


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: topoh: safety check for To header

2013-06-16 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 4f3d04d547c66a1b59398cf80e93974175141514
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4f3d04d547c66a1b59398cf80e93974175141514

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun Jun 16 17:17:36 2013 +0200

topoh: safety check for To header

- protection for the case when sanity module checks are not enabled
- reported in FS#303 by Michel de Weerd

---

 modules/topoh/topoh_mod.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index 73ebf21..e5e7058 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -227,7 +227,13 @@ int th_prepare_msg(sip_msg_t *msg)
LM_ERR(cannot parse FROM header\n);
return 3;
}
-   
+
+   if(get_to(msg)==NULL)
+   {
+   LM_ERR(cannot parse TO header\n);
+   return 3;
+   }
+
return 0;
 }
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: pipelimit: fixed typo in module parameter name

2013-06-17 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c5573dddc4c11898fb68365e9a311aff0f1690c8
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c5573dddc4c11898fb68365e9a311aff0f1690c8

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun 17 11:00:29 2013 +0200

pipelimit: fixed typo in module parameter name

- patch by Krischan Udelhoven

---

 modules/pipelimit/pipelimit.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c
index b183e33..77d2796 100644
--- a/modules/pipelimit/pipelimit.c
+++ b/modules/pipelimit/pipelimit.c
@@ -133,7 +133,7 @@ static param_export_t params[]={
{reply_reason,   STR_PARAM,pl_drop_reason.s},
{db_url,STR_PARAM, pl_db_url},
{plp_table_name,STR_PARAM, rlp_table_name},
-   {plp_pipeid_colunm,STR_PARAM, rlp_pipeid_col},
+   {plp_pipeid_column,STR_PARAM, rlp_pipeid_col},
{plp_limit_column, STR_PARAM, rlp_limit_col},
{plp_algorithm_column, STR_PARAM, rlp_algorithm_col},
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: pipelimit: fixed typo in module parameter name

2013-06-17 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: c4b51e9f51b4b2c4e908b4c4dc33b824021f1ca1
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c4b51e9f51b4b2c4e908b4c4dc33b824021f1ca1

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun 17 11:00:29 2013 +0200

pipelimit: fixed typo in module parameter name

- patch by Krischan Udelhoven

(cherry picked from commit c5573dddc4c11898fb68365e9a311aff0f1690c8)

---

 modules/pipelimit/pipelimit.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/pipelimit/pipelimit.c b/modules/pipelimit/pipelimit.c
index b183e33..77d2796 100644
--- a/modules/pipelimit/pipelimit.c
+++ b/modules/pipelimit/pipelimit.c
@@ -133,7 +133,7 @@ static param_export_t params[]={
{reply_reason,   STR_PARAM,pl_drop_reason.s},
{db_url,STR_PARAM, pl_db_url},
{plp_table_name,STR_PARAM, rlp_table_name},
-   {plp_pipeid_colunm,STR_PARAM, rlp_pipeid_col},
+   {plp_pipeid_column,STR_PARAM, rlp_pipeid_col},
{plp_limit_column, STR_PARAM, rlp_limit_col},
{plp_algorithm_column, STR_PARAM, rlp_algorithm_col},
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: define PVT_XAVP as type for xavp pseudo-variables

2013-06-17 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 424691bfae61b00fa6d5f1f75e95fe60bf823526
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=424691bfae61b00fa6d5f1f75e95fe60bf823526

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun 17 14:47:56 2013 +0200

core: define PVT_XAVP as type for xavp pseudo-variables

- they may need special handling for debug purposes

---

 pvar.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pvar.h b/pvar.h
index 75c4914..c35ae94 100644
--- a/pvar.h
+++ b/pvar.h
@@ -78,7 +78,7 @@ enum _pv_type {
PVT_DSTURI,   PVT_COLOR, PVT_BRANCH,
PVT_FROM, PVT_TO,PVT_OURI,
PVT_SCRIPTVAR,PVT_MSG_BODY,  PVT_CONTEXT,
-   PVT_OTHER,PVT_EXTRA /* keep it last */
+   PVT_XAVP, PVT_OTHER, PVT_EXTRA /* keep it last 
*/
 };
 
 typedef enum _pv_type pv_type_t;


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: pv: $xavp(name) is marked as PVT_XAVP type

2013-06-17 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 1207edd603937e3e43ce20207bfeae0284f16489
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1207edd603937e3e43ce20207bfeae0284f16489

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jun 17 14:48:52 2013 +0200

pv: $xavp(name) is marked as PVT_XAVP type

---

 modules/pv/pv.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/pv/pv.c b/modules/pv/pv.c
index fcfea11..2b13ec8 100644
--- a/modules/pv/pv.c
+++ b/modules/pv/pv.c
@@ -87,7 +87,7 @@ static pv_export_t mod_pvs[] = {
pv_parse_snd_name, 0, 0, 0 },
 #ifdef WITH_XAVP
{ {xavp, sizeof(xavp)-1}, /* xavp */
-   PVT_OTHER, pv_get_xavp, pv_set_xavp,
+   PVT_XAVP, pv_get_xavp, pv_set_xavp,
pv_parse_xavp_name, 0, 0, 0 },
 #endif
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: auth: set ids for elements in the documentation

2013-06-22 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 678ab425062e6c6a30b5f1d37025c2bbdcd5425d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=678ab425062e6c6a30b5f1d37025c2bbdcd5425d

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri Jun 21 04:23:38 2013 +0200

auth: set ids for elements in the documentation

- split checks parameters in own section for easier reference

---

 modules/auth/README |  686 +--
 modules/auth/doc/auth_functions.xml |   18 +-
 modules/auth/doc/auth_params.xml|   54 ++--
 3 files changed, 383 insertions(+), 375 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=678ab425062e6c6a30b5f1d37025c2bbdcd5425d

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Segfaults in mem subsystem

2013-06-23 Thread Daniel-Constantin Mierla

Hello,

you are running a development version from the latest stable series -- 
meanwhile there were fixes and stable releases out of that code. Upgrade 
to either latest stable in branch 4.0 or master branch to be sure is not 
something that was fixed already.


Cheers,
Daniel

On 6/22/13 9:10 PM, Николай wrote:

Hi *,

we are using kamailio built from source (with minor changes not in mem
subsystem):

# /usr/local/sbin/kamailio -V
version: kamailio 3.4.0-dev6 (x86_64/linux) cd2b26-dirty
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: cd2b26 -dirty
compiled on 17:41:52 Jan  6 2013 with gcc 4.6.3


and facing segfaults in memory control subsystem in different places.
Some examples follow:

1)
(gdb) back
#0  del_nonshm_lump (lump_list=0x7f750e650600) at data_lump.c:668
#1  0x7f750e413d9c in ?? ()
#2  0x008db480 in mem_pool ()
#3  0x7f750e4137e1 in ?? ()
#4  0x0004 in ?? ()
#5  0x01f200a7 in ?? ()
#6  0x7f740b5e40f0 in ?? ()
#7  0x7f740dc6d2a0 in ?? ()
#8  0x7f740d9d0af0 in ?? ()
#9  0x7f740c605900 in ?? ()
#10 0x0001 in ?? ()
#11 0x in ?? ()
(gdb) info local
r = 0x83b7b789de298df2
crt = 0x7f740c43ba60
prev = 0x7f750e650600
prev_r = 0x7f740c43ba60

2)
(gdb) back
#0  free_to_params (tb=0x1) at parser/parse_to.c:824
#1  free_to (tb=0x1) at parser/parse_to.c:836
#2  0x7f4249ba2e92 in ?? ()
#3  0x008db480 in mem_pool ()
#4  0x7f4249ba27e1 in ?? ()
#5  0x0004 in ?? ()
#6  0x027a5a37 in ?? ()
#7  0x7f4146d831e0 in ?? ()
#8  0x7f4148b7da50 in ?? ()
#9  0x7f4147eec600 in ?? ()
#10 0x7f4147f19350 in ?? ()
#11 0x0001 in ?? ()
#12 0x in ?? ()
(gdb) info local
tp = value optimized out

3)

(gdb) back
#0  free_lump_list (lump_list=value optimized out) at data_lump.c:504
#1  del_nonshm_lump (lump_list=value optimized out) at data_lump.c:661
#2  0x7f0631a69d9c in ?? ()
#3  0x008db480 in mem_pool ()
#4  0x7f0631a697e1 in ?? ()
#5  0x0004 in ?? ()
#6  0x00f4eb77 in ?? ()
#7  0x7f052ec5a5b0 in ?? ()
#8  0x7f05303071d0 in ?? ()
#9  0x7f05309374c0 in ?? ()
#10 0x7f0530e0ccd0 in ?? ()
#11 0x0001 in ?? ()
#12 0x in ?? ()
(gdb) info local
r = 0x7fa2312af83ca962


Are the issues already known/fixed? Should I post a bugreport?
The memory subsystem looks pretty buggy... Does kamailio implement/use
its own mem allocating system?

PS I'm new to the list - sorry for possibly bad email

Thanks

Nikolay


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: allow c++ style of one line comments

2013-06-24 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 584508d5374726bf523a23693da86f0763b34767
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=584508d5374726bf523a23693da86f0763b34767

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Sun Jun 23 05:37:34 2013 +0200

core: allow c++ style of one line comments

- can make easier the read of config files with defines and comments

---

 cfg.lex |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cfg.lex b/cfg.lex
index 4b69287..053fa2e 100644
--- a/cfg.lex
+++ b/cfg.lex
@@ -540,7 +540,7 @@ CR  \n
 EVENT_RT_NAME [a-zA-Z][0-9a-zA-Z-]*(:[a-zA-Z][0-9a-zA-Z-]*)+
 
 
-COM_LINE   #
+COM_LINE   #|//
 COM_START  /\*
 COM_END\*/
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dialog: avoid realloc of memory for cseq when setting leg info

2013-07-01 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 71d7dc6bc750406d510e0571e05da3966911cfea
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71d7dc6bc750406d510e0571e05da3966911cfea

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jul  1 14:51:03 2013 +0200

dialog: avoid realloc of memory for cseq when setting leg info

- free already allocated structs when needed
- has part of a patch by Halina Nowak

---

 modules/dialog/dlg_hash.c |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index c669290..bba619a 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -485,8 +485,19 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str 
*rr, str *contact,
 {
char *p;
 
+   if(dlg-tag[leg].s)
+   shm_free(dlg-tag[leg].s);
dlg-tag[leg].s = (char*)shm_malloc( tag-len + rr-len + contact-len 
);
-   dlg-cseq[leg].s = (char*)shm_malloc( cseq-len );
+
+   if(dlg-cseq[leg].s) {
+   if (dlg-cseq[leg].len  cseq-len) {
+   shm_free(dlg-cseq[leg].s);
+   dlg-cseq[leg].s = (char*)shm_malloc(cseq-len);
+   }
+   } else {
+   dlg-cseq[leg].s = (char*)shm_malloc( cseq-len );
+   }
+
if ( dlg-tag[leg].s==NULL || dlg-cseq[leg].s==NULL) {
LM_ERR(no more shm mem\n);
if (dlg-tag[leg].s)


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dialog: fixed callee cseq reference

2013-07-01 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: ed6dbb0ca11206049bee9ab515ce071eb70e7b63
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ed6dbb0ca11206049bee9ab515ce071eb70e7b63

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jul  1 14:44:45 2013 +0200

dialog: fixed callee cseq reference

- part of patch by Halina Nowak

---

 modules/dialog/dlg_handlers.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index f98f36b..338dc44 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -220,7 +220,7 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg 
*msg,
cseq = (get_cseq(msg))-number;
} else {
/* use the same as in request */
-   cseq = dlg-cseq[DLG_CALLER_LEG];
+   cseq = dlg-cseq[DLG_CALLEE_LEG];
}
 
/* extract the contact address */


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dialog: increment cseq in early stage for PRACK and UPDATE

2013-07-01 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 6cf3ab0ca6f38d1d2e60dbc644bb4d2fb563919a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6cf3ab0ca6f38d1d2e60dbc644bb4d2fb563919a

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Mon Jul  1 15:22:33 2013 +0200

dialog: increment cseq in early stage for PRACK and UPDATE

- rework from a patch by Halina Nowak

---

 modules/dialog/dlg_handlers.c |   25 -
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index 338dc44..ec55a13 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -1249,21 +1249,28 @@ void dlg_onroute(struct sip_msg* req, str 
*route_params, void *param)
}
 
if ( (event==DLG_EVENT_REQ || event==DLG_EVENT_REQACK)
-new_state==DLG_STATE_CONFIRMED) {
+(new_state==DLG_STATE_CONFIRMED || new_state==DLG_STATE_EARLY)) {
 
timeout = get_dlg_timeout(req);
if (timeout!=default_timeout) {
dlg-lifetime = timeout;
}
-   if (update_dlg_timer( dlg-tl, dlg-lifetime )==-1) {
-   LM_ERR(failed to update dialog lifetime\n);
+   if (new_state!=DLG_STATE_EARLY) {
+   if (update_dlg_timer( dlg-tl, dlg-lifetime )==-1) {
+   LM_ERR(failed to update dialog lifetime\n);
+   } else {
+   dlg-dflags |= DLG_FLAG_CHANGED;
+   }
}
-   if (update_cseqs(dlg, req, dir)!=0) {
-   LM_ERR(cseqs update failed\n);
-   } else {
-   dlg-dflags |= DLG_FLAG_CHANGED;
-   if ( dlg_db_mode==DB_MODE_REALTIME )
-   update_dialog_dbinfo(dlg);
+   if(event != DLG_EVENT_REQACK) {
+   if(update_cseqs(dlg, req, dir)!=0) {
+   LM_ERR(cseqs update failed\n);
+   } else {
+   dlg-dflags |= DLG_FLAG_CHANGED;
+   }
+   }
+   if(dlg_db_mode==DB_MODE_REALTIME  
(dlg-dflagsDLG_FLAG_CHANGED)) {
+   update_dialog_dbinfo(dlg);
}
 
if (old_state==DLG_STATE_CONFIRMED_NA) {


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: kamailio-basic.cfg: added basic cfg config file

2013-07-02 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: b4682cac2e2f151288a411018da077b6d1526eca
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4682cac2e2f151288a411018da077b6d1526eca

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jul  2 21:40:32 2013 +0200

kamailio-basic.cfg: added basic cfg config file

- get the same set of configs as expected by former ser flavour

---

 etc/kamailio-basic.cfg |  612 
 1 files changed, 612 insertions(+), 0 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b4682cac2e2f151288a411018da077b6d1526eca

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: dialog: detect if no trasaction is created after config execution for new dialogs

2013-07-02 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: fa0339b1906690f009786fc9ed92c73a8c9e6520
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa0339b1906690f009786fc9ed92c73a8c9e6520

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Tue Jul  2 23:32:37 2013 +0200

dialog: detect if no trasaction is created after config execution for new 
dialogs

- release the dialog to avoid endless storage in state 1

---

 modules/dialog/dlg_handlers.c |   10 +-
 modules/dialog/dlg_var.c  |   14 +-
 modules/dialog/dlg_var.h  |1 +
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index ec55a13..9393d7f 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -721,11 +721,14 @@ void dlg_onreq(struct cell* t, int type, struct 
tmcb_params *param)
if (dlg==NULL) {
if((req-flagsdlg_flag)!=dlg_flag)
return;
+   LM_DBG(dialog creation on config flag\n);
dlg_new_dialog(req, t, 1);
dlg = dlg_get_ctx_dialog();
}
if (dlg!=NULL) {
+   LM_DBG(dialog added to tm callbacks\n);
dlg_set_tm_callbacks(t, req, dlg, spiral_detected);
+   _dlg_ctx.t = 1;
dlg_release(dlg);
}
 }
@@ -1515,8 +1518,13 @@ int dlg_manage(sip_msg_t *msg)
dlg = dlg_get_ctx_dialog();
if(dlg==NULL)
return -1;
-   if(t!=NULL)
+   if(t!=NULL) {
dlg_set_tm_callbacks(t, msg, dlg, spiral_detected);
+   _dlg_ctx.t = 1;
+   LM_DBG(dialog created on existing transaction\n);
+   } else {
+   LM_DBG(dialog created before transaction\n);
+   }
dlg_release(dlg);
}
return 1;
diff --git a/modules/dialog/dlg_var.c b/modules/dialog/dlg_var.c
index 108af0f..0d8a1c7 100644
--- a/modules/dialog/dlg_var.c
+++ b/modules/dialog/dlg_var.c
@@ -22,6 +22,7 @@
  */
   
 #include ../../route.h
+#include ../../script_cb.h
 #include ../../pvapi.h
 
 #include dlg_var.h
@@ -38,8 +39,19 @@ struct dlg_var * var_table = 0;
 /*! ID of the current message */
 int msg_id;
 
-int dlg_cfg_cb(struct sip_msg *foo, unsigned int flags, void *bar)
+int dlg_cfg_cb(sip_msg_t *msg, unsigned int flags, void *cbp)
 {
+   dlg_cell_t *dlg;
+   if(flagsPOST_SCRIPT_CB) {
+   dlg = dlg_get_ctx_dialog();
+   if(dlg!=NULL) {
+   if(_dlg_ctx.t==0  dlg-state==DLG_STATE_UNCONFIRMED) {
+   LM_DBG(new dialog with no trasaction after 
config execution\n);
+   dlg_release(dlg);
+   }
+   dlg_release(dlg);
+   }
+   }
memset(_dlg_ctx, 0, sizeof(dlg_ctx_t));
 
return 1;
diff --git a/modules/dialog/dlg_var.h b/modules/dialog/dlg_var.h
index 9648ab2..ec2c9c7 100644
--- a/modules/dialog/dlg_var.h
+++ b/modules/dialog/dlg_var.h
@@ -41,6 +41,7 @@ typedef struct _dlg_ctx {
dlg_iuid_t iuid;
int set;
unsigned int dir;
+   int t;
 } dlg_ctx_t;
 
 /* A dialog-variable */


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: uac_redirect: fetch all contact headers in redirect replies

2013-07-03 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: c5081ad634742d88e56e4fcc097b756098119e4e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c5081ad634742d88e56e4fcc097b756098119e4e

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jul  3 23:23:40 2013 +0200

uac_redirect: fetch all contact headers in redirect replies

- only first header was considered for redirect handling
- based on a report by Geoffrey Mina
- generate fake ruid (used as instance and user-agent) to satisfy the
  requirements of t_load_contacts()/t_next_contacts()

---

 modules/uac_redirect/Makefile   |2 +
 modules/uac_redirect/rd_funcs.c |  137 ++-
 modules/uac_redirect/redirect.c |   15 -
 3 files changed, 94 insertions(+), 60 deletions(-)

diff --git a/modules/uac_redirect/Makefile b/modules/uac_redirect/Makefile
index d8c2ae1..0b7e22d 100644
--- a/modules/uac_redirect/Makefile
+++ b/modules/uac_redirect/Makefile
@@ -10,4 +10,6 @@ LIBS=
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
+SERLIBPATH=../../lib
+SER_LIBS+=$(SERLIBPATH)/srutils/srutils
 include ../../Makefile.modules
diff --git a/modules/uac_redirect/rd_funcs.c b/modules/uac_redirect/rd_funcs.c
index 2f85ed1..89917f7 100644
--- a/modules/uac_redirect/rd_funcs.c
+++ b/modules/uac_redirect/rd_funcs.c
@@ -32,11 +32,14 @@
 #include ../../dprint.h
 #include ../../qvalue.h
 #include ../../parser/contact/parse_contact.h
+#include ../../lib/srutils/sruid.h
 #include ../../qvalue.h
 #include rd_filter.h
 #include rd_funcs.h
 
 
+extern sruid_t _redirect_sruid;
+
 #define MAX_CONTACTS_PER_REPLY   16
 #define DEFAULT_Q_VALUE  10
 
@@ -115,7 +118,7 @@ error:
 
 
 /* returns the number of contacts put in the sorted array */
-static int sort_contacts(contact_t *ct_list, contact_t **ct_array,
+static int sort_contacts(hdr_field_t *chdr, contact_t **ct_array,

qvalue_t *q_array)
 {
param_t *q_para;
@@ -123,48 +126,54 @@ static int sort_contacts(contact_t *ct_list, contact_t 
**ct_array,
int n;
int i,j;
char backup;
+   contact_t *ct_list;
+   hdr_field_t *hdr;
 
n = 0; /* number of sorted contacts */
 
-   for( ; ct_list ; ct_list = ct_list-next ) {
-   /* check the filters first */
-   backup = ct_list-uri.s[ct_list-uri.len];
-   ct_list-uri.s[ct_list-uri.len] = 0;
-   if ( run_filters( ct_list-uri.s )==-1 ){
-   ct_list-uri.s[ct_list-uri.len] = backup;
-   continue;
-   }
-   ct_list-uri.s[ct_list-uri.len] = backup;
-   /* does the contact has a q val? */
-   q_para = ct_list-q;
-   if (q_para==0 || q_para-body.len==0) {
-   q = DEFAULT_Q_VALUE;
-   } else {
-   if (str2q( q, q_para-body.s, q_para-body.len)!=0) {
-   LM_ERR(invalid q param\n);
-   /* skip this contact */
+   for(hdr=chdr; hdr; hdr=hdr-next) {
+   if(hdr-type != HDR_CONTACT_T) continue;
+   ct_list = ((contact_body_t*)hdr-parsed)-contacts;
+   for( ; ct_list ; ct_list = ct_list-next ) {
+   /* check the filters first */
+   backup = ct_list-uri.s[ct_list-uri.len];
+   ct_list-uri.s[ct_list-uri.len] = 0;
+   if ( run_filters( ct_list-uri.s )==-1 ){
+   ct_list-uri.s[ct_list-uri.len] = backup;
continue;
}
-   }
-   LM_DBG(sort_contacts: %.*s q=%d\n,
-   ct_list-uri.len,ct_list-uri.s,q);
-   /*insert the contact into the sorted array */
-   for(i=0;in;i++) {
-   /* keep in mind that the contact list is reversts */
-   if (q_array[i]=q)
-   continue;
-   break;
-   }
-   if (i!=MAX_CONTACTS_PER_REPLY) {
-   /* insert the contact at this position */
-   for( j=n-1-1*(n==MAX_CONTACTS_PER_REPLY) ; j=i ; j-- ) 
{
-   ct_array[j+1] = ct_array[j];
-   q_array[j+1] = q_array[j];
+   ct_list-uri.s[ct_list-uri.len] = backup;
+   /* does the contact has a q val? */
+   q_para = ct_list-q;
+   if (q_para==0 || q_para-body.len==0) {
+   q = DEFAULT_Q_VALUE;
+   } else {
+   if (str2q( q, q_para-body.s, 
q_para-body.len)!=0

[sr-dev] git:4.0: uac_redirect: adapted previous backport to append_branch() prototype for v4.0

2013-07-03 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: d8c3a23ad2a5c925b16d75f33fcb865f09d7f308
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d8c3a23ad2a5c925b16d75f33fcb865f09d7f308

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jul  3 23:29:29 2013 +0200

uac_redirect: adapted previous backport to append_branch() prototype for v4.0

---

 modules/uac_redirect/rd_funcs.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/modules/uac_redirect/rd_funcs.c b/modules/uac_redirect/rd_funcs.c
index 89917f7..69e6f31 100644
--- a/modules/uac_redirect/rd_funcs.c
+++ b/modules/uac_redirect/rd_funcs.c
@@ -290,8 +290,7 @@ static int shmcontact2dset(struct sip_msg *req, struct 
sip_msg *sh_rpl,
scontacts[i]-uri.s);
if(sruid_next(_redirect_sruid)==0) {
if(append_branch( 0, scontacts[i]-uri, 0, 0, 
sqvalues[i],
-   bflags, 0, 
_redirect_sruid.uid, 0,
-   _redirect_sruid.uid, 
_redirect_sruid.uid)0) {
+   bflags, 0, 
_redirect_sruid.uid, 0)0) {
LM_ERR(failed to add contact to dset\n);
} else {
added++;


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:4.0: uac_redirect: fetch all contact headers in redirect replies

2013-07-03 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: 4.0
Commit: 0227f5b61e1ea03e92a7fec9b177f602481fac84
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0227f5b61e1ea03e92a7fec9b177f602481fac84

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Wed Jul  3 23:23:40 2013 +0200

uac_redirect: fetch all contact headers in redirect replies

- only first header was considered for redirect handling
- based on a report by Geoffrey Mina
- generate fake ruid (used as instance and user-agent) to satisfy the
  requirements of t_load_contacts()/t_next_contacts()

(cherry picked from commit c5081ad634742d88e56e4fcc097b756098119e4e)

---

 modules/uac_redirect/Makefile   |2 +
 modules/uac_redirect/rd_funcs.c |  137 ++-
 modules/uac_redirect/redirect.c |   15 -
 3 files changed, 94 insertions(+), 60 deletions(-)

diff --git a/modules/uac_redirect/Makefile b/modules/uac_redirect/Makefile
index d8c2ae1..0b7e22d 100644
--- a/modules/uac_redirect/Makefile
+++ b/modules/uac_redirect/Makefile
@@ -10,4 +10,6 @@ LIBS=
 
 DEFS+=-DKAMAILIO_MOD_INTERFACE
 
+SERLIBPATH=../../lib
+SER_LIBS+=$(SERLIBPATH)/srutils/srutils
 include ../../Makefile.modules
diff --git a/modules/uac_redirect/rd_funcs.c b/modules/uac_redirect/rd_funcs.c
index 2f85ed1..89917f7 100644
--- a/modules/uac_redirect/rd_funcs.c
+++ b/modules/uac_redirect/rd_funcs.c
@@ -32,11 +32,14 @@
 #include ../../dprint.h
 #include ../../qvalue.h
 #include ../../parser/contact/parse_contact.h
+#include ../../lib/srutils/sruid.h
 #include ../../qvalue.h
 #include rd_filter.h
 #include rd_funcs.h
 
 
+extern sruid_t _redirect_sruid;
+
 #define MAX_CONTACTS_PER_REPLY   16
 #define DEFAULT_Q_VALUE  10
 
@@ -115,7 +118,7 @@ error:
 
 
 /* returns the number of contacts put in the sorted array */
-static int sort_contacts(contact_t *ct_list, contact_t **ct_array,
+static int sort_contacts(hdr_field_t *chdr, contact_t **ct_array,

qvalue_t *q_array)
 {
param_t *q_para;
@@ -123,48 +126,54 @@ static int sort_contacts(contact_t *ct_list, contact_t 
**ct_array,
int n;
int i,j;
char backup;
+   contact_t *ct_list;
+   hdr_field_t *hdr;
 
n = 0; /* number of sorted contacts */
 
-   for( ; ct_list ; ct_list = ct_list-next ) {
-   /* check the filters first */
-   backup = ct_list-uri.s[ct_list-uri.len];
-   ct_list-uri.s[ct_list-uri.len] = 0;
-   if ( run_filters( ct_list-uri.s )==-1 ){
-   ct_list-uri.s[ct_list-uri.len] = backup;
-   continue;
-   }
-   ct_list-uri.s[ct_list-uri.len] = backup;
-   /* does the contact has a q val? */
-   q_para = ct_list-q;
-   if (q_para==0 || q_para-body.len==0) {
-   q = DEFAULT_Q_VALUE;
-   } else {
-   if (str2q( q, q_para-body.s, q_para-body.len)!=0) {
-   LM_ERR(invalid q param\n);
-   /* skip this contact */
+   for(hdr=chdr; hdr; hdr=hdr-next) {
+   if(hdr-type != HDR_CONTACT_T) continue;
+   ct_list = ((contact_body_t*)hdr-parsed)-contacts;
+   for( ; ct_list ; ct_list = ct_list-next ) {
+   /* check the filters first */
+   backup = ct_list-uri.s[ct_list-uri.len];
+   ct_list-uri.s[ct_list-uri.len] = 0;
+   if ( run_filters( ct_list-uri.s )==-1 ){
+   ct_list-uri.s[ct_list-uri.len] = backup;
continue;
}
-   }
-   LM_DBG(sort_contacts: %.*s q=%d\n,
-   ct_list-uri.len,ct_list-uri.s,q);
-   /*insert the contact into the sorted array */
-   for(i=0;in;i++) {
-   /* keep in mind that the contact list is reversts */
-   if (q_array[i]=q)
-   continue;
-   break;
-   }
-   if (i!=MAX_CONTACTS_PER_REPLY) {
-   /* insert the contact at this position */
-   for( j=n-1-1*(n==MAX_CONTACTS_PER_REPLY) ; j=i ; j-- ) 
{
-   ct_array[j+1] = ct_array[j];
-   q_array[j+1] = q_array[j];
+   ct_list-uri.s[ct_list-uri.len] = backup;
+   /* does the contact has a q val? */
+   q_para = ct_list-q;
+   if (q_para==0 || q_para-body.len==0) {
+   q = DEFAULT_Q_VALUE;
+   } else {
+   if (str2q( q, q_para-body.s

[sr-dev] git:master: core: new internam sip msg flag FL_TM_RPL_MATCHED

2013-07-04 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 230a138991b25f7f9b07b4f9cbeffbdd6acef2e8
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=230a138991b25f7f9b07b4f9cbeffbdd6acef2e8

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jul  4 11:47:18 2013 +0200

core: new internam sip msg flag FL_TM_RPL_MATCHED

- mark sip reply when matched first time by tm
- used to avoid double execution of response-in callbacks

---

 parser/msg_parser.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/parser/msg_parser.h b/parser/msg_parser.h
index d58ea5e..9e97e65 100644
--- a/parser/msg_parser.h
+++ b/parser/msg_parser.h
@@ -119,6 +119,7 @@ typedef enum request_method {
 #define FL_SDP_BODY (1  12)  /*! msg has SDP in body */
 #define FL_USE_UAC_FROM  (113)  /* take FROM hdr from UAC instead of 
UAS*/
 #define FL_USE_UAC_TO(114)  /* take TO hdr from UAC instead of UAS */
+#define FL_TM_RPL_MATCHED(115)  /* tm matched reply already */
 
 /* WARNING: Value (1  28) is temporarily reserved for use in kamailio 
call_control
  * module (flag  FL_USE_CALL_CONTROL )! */


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: tm: avoid double execution of response-in callbacks

2013-07-04 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: d4cef7f5e49105c65df9651a1ad086b035f8ffdb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d4cef7f5e49105c65df9651a1ad086b035f8ffdb

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jul  4 11:48:26 2013 +0200

tm: avoid double execution of response-in callbacks

- double execution of response-in callbacks could happen when using tm
  pvs inside core reply route, being done in transaction matching
  function, which is executed again by tm reply received function

---

 modules/tm/t_lookup.c |   55 ++--
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/modules/tm/t_lookup.c b/modules/tm/t_lookup.c
index 8c34a81..fbc624b 100644
--- a/modules/tm/t_lookup.c
+++ b/modules/tm/t_lookup.c
@@ -1001,33 +1001,38 @@ int t_reply_matching( struct sip_msg *p_msg , int 
*p_branch )
REF_UNSAFE( T );
UNLOCK_HASH(hash_index);
DBG(DEBUG: t_reply_matching: reply matched (T=%p)!\n,T);
-   /* if this is a 200 for INVITE, we will wish to store to-tags 
to be
-* able to distinguish retransmissions later and not to call
-* TMCB_RESPONSE_OUT uselessly; we do it only if callbacks are
-* enabled -- except callback customers, nobody cares about 
-* retransmissions of multiple 200/INV or ACK/200s
-*/
-   if (unlikely( is_invite(p_cell)  p_msg-REPLY_STATUS=200 
-p_msg-REPLY_STATUS300 
-((!is_local(p_cell) 
-   has_tran_tmcbs(p_cell, 
-   TMCB_RESPONSE_OUT|TMCB_RESPONSE_READY
-   |TMCB_E2EACK_IN|TMCB_E2EACK_RETR_IN) )
-   || (is_local(p_cell)has_tran_tmcbs(p_cell, 
TMCB_LOCAL_COMPLETED))
-   )) ) {
-   if (parse_headers(p_msg, HDR_TO_F, 0)==-1) {
-   LOG(L_ERR, ERROR: t_reply_matching: to parsing 
failed\n);
+   if(likely(!(p_msg-msg_flagsFL_TM_RPL_MATCHED))) {
+   /* if this is a 200 for INVITE, we will wish to store 
to-tags to be
+* able to distinguish retransmissions later and not to 
call
+* TMCB_RESPONSE_OUT uselessly; we do it only if 
callbacks are
+* enabled -- except callback customers, nobody cares 
about
+* retransmissions of multiple 200/INV or ACK/200s
+*/
+   if (unlikely( is_invite(p_cell)  
p_msg-REPLY_STATUS=200
+p_msg-REPLY_STATUS300
+((!is_local(p_cell) 
+   has_tran_tmcbs(p_cell,
+   
TMCB_RESPONSE_OUT|TMCB_RESPONSE_READY
+   
|TMCB_E2EACK_IN|TMCB_E2EACK_RETR_IN) )
+   || (is_local(p_cell)has_tran_tmcbs(p_cell, 
TMCB_LOCAL_COMPLETED))
+   )) ) {
+   if (parse_headers(p_msg, HDR_TO_F, 0)==-1) {
+   LOG(L_ERR, ERROR: t_reply_matching: to 
parsing failed\n);
+   }
}
-   }
-   if (unlikely(has_tran_tmcbs(T, TMCB_RESPONSE_IN |
-   
TMCB_LOCAL_RESPONSE_IN))){
-   if (!is_local(p_cell)) {
-   run_trans_callbacks( TMCB_RESPONSE_IN, T, 
T-uas.request,
-   
p_msg, p_msg-REPLY_STATUS);
-   }else{
-   run_trans_callbacks( TMCB_LOCAL_RESPONSE_IN, T, 
T-uas.request,
-   
p_msg, p_msg-REPLY_STATUS);
+   if (unlikely(has_tran_tmcbs(T, TMCB_RESPONSE_IN |
+   
TMCB_LOCAL_RESPONSE_IN))){
+   if (!is_local(p_cell)) {
+   run_trans_callbacks( TMCB_RESPONSE_IN, 
T, T-uas.request,
+   
p_msg, p_msg-REPLY_STATUS);
+   }else{
+   run_trans_callbacks( 
TMCB_LOCAL_RESPONSE_IN, T, T-uas.request,
+   
p_msg, p_msg-REPLY_STATUS);
+   }
}
+   p_msg-msg_flags

[sr-dev] git:master: textopsx: updated docs for msg_apply_changes() and added sections ids

2013-07-04 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 647a99bd21f6059505ea1ee65ac93c6c00fc8c8d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=647a99bd21f6059505ea1ee65ac93c6c00fc8c8d

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jul  4 22:34:41 2013 +0200

textopsx: updated docs for msg_apply_changes() and added sections ids

---

 modules/textopsx/README|  240 ++--
 modules/textopsx/doc/functions.xml |   38 +++---
 2 files changed, 138 insertions(+), 140 deletions(-)

Diff:   
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=647a99bd21f6059505ea1ee65ac93c6c00fc8c8d

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: textopsx: enable usage of msg_apply_changes() for sip replies

2013-07-04 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 85f6a45e6d74044488b63a89ce8feaaf3c4b00bb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=85f6a45e6d74044488b63a89ce8feaaf3c4b00bb

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jul  4 22:29:06 2013 +0200

textopsx: enable usage of msg_apply_changes() for sip replies

---

 modules/textopsx/textopsx.c |   19 ---
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/modules/textopsx/textopsx.c b/modules/textopsx/textopsx.c
index bbe1ff1..2a7273d 100644
--- a/modules/textopsx/textopsx.c
+++ b/modules/textopsx/textopsx.c
@@ -79,7 +79,7 @@ extern select_row_t sel_declaration[];
 /* cfg functions */
 static cmd_export_t cmds[] = {
{msg_apply_changes,(cmd_function)msg_apply_changes_f, 0,
-   0, REQUEST_ROUTE },
+   0, REQUEST_ROUTE|ONREPLY_ROUTE },
{change_reply_status,  change_reply_status_f, 2,
change_reply_status_fixup, ONREPLY_ROUTE },
{remove_body,  (cmd_function)w_remove_body_f, 0,
@@ -152,7 +152,7 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, 
char *str2)
str obuf;
sip_msg_t tmp;
 
-   if(get_route_type()!=REQUEST_ROUTE)
+   if(msg-first_line.type!=SIP_REPLY  get_route_type()!=REQUEST_ROUTE)
{
LM_ERR(invalid usage - not in request route\n);
return -1;
@@ -160,9 +160,14 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, 
char *str2)
 
init_dest_info(dst);
dst.proto = PROTO_UDP;
-   obuf.s = build_req_buf_from_sip_req(msg,
-   (unsigned int*)obuf.len, dst,
-   BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE);
+   if(msg-first_line.type == SIP_REPLY) {
+   obuf.s = generate_res_buf_from_sip_res(msg,
+   (unsigned int*)obuf.len, BUILD_NO_VIA1_UPDATE);
+   } else {
+   obuf.s = build_req_buf_from_sip_req(msg,
+   (unsigned int*)obuf.len, dst,
+   BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE);
+   }
if(obuf.s == NULL)
{
LM_ERR(couldn't update msg buffer content\n);
@@ -216,9 +221,9 @@ static int msg_apply_changes_f(sip_msg_t *msg, char *str1, 
char *str2)
pkg_free(obuf.s);
 
/* reparse the message */
-   LM_DBG(SIP Request content updated - reparsing\n);
+   LM_DBG(SIP message content updated - reparsing\n);
if (parse_msg(msg-buf, msg-len, msg)!=0){
-   LM_ERR(parse_msg failed\n);
+   LM_ERR(parsing new sip message failed\n);
return -1;
}
 


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master: core: helper function to generate sip reply content without removing top via

2013-07-04 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 8248a1b2ed725933f84a343b4936ed4fdef4a869
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8248a1b2ed725933f84a343b4936ed4fdef4a869

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Thu Jul  4 22:27:32 2013 +0200

core: helper function to generate sip reply content without removing top via

---

 msg_translator.c |   45 -
 msg_translator.h |2 ++
 2 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/msg_translator.c b/msg_translator.c
index c1ae7c9..b7d4894 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -1956,8 +1956,8 @@ error00:
 
 
 
-char * build_res_buf_from_sip_res( struct sip_msg* msg,
-   unsigned int *returned_len)
+char * generate_res_buf_from_sip_res( struct sip_msg* msg,
+   unsigned int *returned_len, unsigned int mode)
 {
unsigned int new_len, via_len, body_delta;
char* new_buf;
@@ -1968,13 +1968,19 @@ char * build_res_buf_from_sip_res( struct sip_msg* msg,
buf=msg-buf;
len=msg-len;
new_buf=0;
-   /* we must remove the first via */
-   if (msg-via1-next) {
-   via_len=msg-via1-bsize;
-   via_offset=msg-h_via1-body.s-buf;
+
+   if(unlikely(modeBUILD_NO_VIA1_UPDATE)) {
+   via_len = 0;
+   via_offset = 0;
} else {
-   via_len=msg-h_via1-len;
-   via_offset=msg-h_via1-name.s-buf;
+   /* we must remove the first via */
+   if (msg-via1-next) {
+   via_len=msg-via1-bsize;
+   via_offset=msg-h_via1-body.s-buf;
+   } else {
+   via_len=msg-h_via1-len;
+   via_offset=msg-h_via1-name.s-buf;
+   }
}
 
 /* Calculate message body difference and adjust
@@ -1983,16 +1989,16 @@ char * build_res_buf_from_sip_res( struct sip_msg* msg,
body_delta = lumps_len(msg, msg-body_lumps, 0);
if (adjust_clen(msg, body_delta, (msg-via2? 
msg-via2-proto:PROTO_UDP))
 0) {
-   LOG(L_ERR, ERROR: build_req_buf_from_sip_req: Error while 
adjusting
-Content-Length\n);
+   LOG(L_ERR, error while adjusting Content-Length\n);
goto error;
}
 
-   /* remove the first via*/
-   if (del_lump( msg, via_offset, via_len, HDR_VIA_T)==0){
-   LOG(L_ERR, build_res_buf_from_sip_res: error trying to remove 
first
-   via\n);
-   goto error;
+   if(likely(!(modeBUILD_NO_VIA1_UPDATE))) {
+   /* remove the first via*/
+   if (del_lump( msg, via_offset, via_len, HDR_VIA_T)==0){
+   LOG(L_ERR, error trying to remove first via\n);
+   goto error;
+   }
}
 
new_len=len+body_delta+lumps_len(msg, msg-add_rm, 0); /*FIXME: we don't
@@ -2002,7 +2008,7 @@ char * build_res_buf_from_sip_res( struct sip_msg* msg,
new_buf=(char*)pkg_malloc(new_len+1); /* +1 is for debugging

 (\0 to print it )*/
if (new_buf==0){
-   LOG(L_ERR, ERROR: build_res_buf_from_sip_res: out of mem\n);
+   LOG(L_ERR, out of mem\n);
goto error;
}
new_buf[new_len]=0; /* debug: print the message */
@@ -2015,7 +2021,7 @@ char * build_res_buf_from_sip_res( struct sip_msg* msg,
buf+s_offset,
len-s_offset);
 /* send it! */
-   DBG(build_res_from_sip_res: copied size: orig:%d, new: %d, rest: %d
+   DBG(copied size: orig:%d, new: %d, rest: %d
 msg=\n%s\n, s_offset, offset, len-s_offset, new_buf);
 
*returned_len=new_len;
@@ -2025,6 +2031,11 @@ error:
return 0;
 }
 
+char * build_res_buf_from_sip_res( struct sip_msg* msg,
+   unsigned int *returned_len)
+{
+   return generate_res_buf_from_sip_res(msg, returned_len, 0);
+}
 
 char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag,
struct sip_msg* msg, unsigned int *returned_len, struct 
bookmark *bmark)
diff --git a/msg_translator.h b/msg_translator.h
index 33caa40..4848291 100644
--- a/msg_translator.h
+++ b/msg_translator.h
@@ -87,6 +87,8 @@ char * build_req_buf_from_sip_req(struct sip_msg* msg,
 char * build_res_buf_from_sip_res(struct sip_msg* msg,
unsigned int *returned_len);
 
+char * generate_res_buf_from_sip_res(struct sip_msg* msg,
+   unsigned int *returned_len, unsigned int mode);
 
 char * build_res_buf_from_sip_req(unsigned int code

[sr-dev] git:master: dialog: added timer process to clean unconfirmed dialogs older than 5min

2013-07-05 Thread Daniel-Constantin Mierla
Module: sip-router
Branch: master
Commit: 97781390e663116f9e5d11f5644e1145487b6cfb
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97781390e663116f9e5d11f5644e1145487b6cfb

Author: Daniel-Constantin Mierla mico...@gmail.com
Committer: Daniel-Constantin Mierla mico...@gmail.com
Date:   Fri Jul  5 09:23:32 2013 +0200

dialog: added timer process to clean unconfirmed dialogs older than 5min

- timer runs every 90sec (customization to be added in the future)
- safety procedure for cleaning dialog list

---

 modules/dialog/dialog.c   |   29 -
 modules/dialog/dlg_hash.c |   33 +
 modules/dialog/dlg_hash.h |3 +++
 3 files changed, 60 insertions(+), 5 deletions(-)

diff --git a/modules/dialog/dialog.c b/modules/dialog/dialog.c
index e560b4e..ae105d4 100644
--- a/modules/dialog/dialog.c
+++ b/modules/dialog/dialog.c
@@ -138,6 +138,7 @@ int dlg_db_mode_param = DB_MODE_NONE;
 str dlg_xavp_cfg = {0};
 int dlg_ka_timer = 0;
 int dlg_ka_interval = 0;
+int dlg_clean_timer = 90;
 
 /* db stuff */
 static str db_url = str_init(DEFAULT_DB_URL);
@@ -147,6 +148,7 @@ static int pv_get_dlg_count( struct sip_msg *msg, 
pv_param_t *param,
pv_value_t *res);
 
 void dlg_ka_timer_exec(unsigned int ticks, void* param);
+void dlg_clean_timer_exec(unsigned int ticks, void* param);
 
 /* commands wrappers and fixups */
 static int fixup_profile(void** param, int param_no);
@@ -697,9 +699,14 @@ static int mod_init(void)
}
 
destroy_dlg_callbacks( DLGCB_LOADED );
+
+   /* timer process to send keep alive requests */
if(dlg_ka_timer0  dlg_ka_interval0)
register_sync_timers(1);
 
+   /* timer process to clean old unconfirmed dialogs */
+   register_sync_timers(1);
+
return 0;
 }
 
@@ -708,11 +715,18 @@ static int child_init(int rank)
 {
dlg_db_mode = dlg_db_mode_param;
 
-   if(rank==PROC_MAIN  dlg_ka_timer0  dlg_ka_interval0)
-   {
-   if(fork_sync_timer(PROC_TIMER, Dialog KA Timer, 1 /*socks 
flag*/,
-   dlg_ka_timer_exec, NULL, dlg_ka_timer 
/*sec*/)0) {
-   LM_ERR(failed to start ka timer routine as process\n);
+   if(rank==PROC_MAIN) {
+   if(dlg_ka_timer0  dlg_ka_interval0) {
+   if(fork_sync_timer(PROC_TIMER, Dialog KA Timer, 1 
/*socks flag*/,
+   dlg_ka_timer_exec, NULL, dlg_ka_timer 
/*sec*/)0) {
+   LM_ERR(failed to start ka timer routine as 
process\n);
+   return -1; /* error */
+   }
+   }
+
+   if(fork_sync_timer(PROC_TIMER, Dialog Clean Timer, 1 /*socks 
flag*/,
+   dlg_clean_timer_exec, NULL, 
dlg_clean_timer /*sec*/)0) {
+   LM_ERR(failed to start clean timer routine as 
process\n);
return -1; /* error */
}
}
@@ -1221,6 +1235,11 @@ void dlg_ka_timer_exec(unsigned int ticks, void* param)
dlg_ka_run(ticks);
 }
 
+void dlg_clean_timer_exec(unsigned int ticks, void* param)
+{
+   dlg_clean_run(ticks);
+}
+
 static int fixup_dlg_bye(void** param, int param_no)
 {
char *val;
diff --git a/modules/dialog/dlg_hash.c b/modules/dialog/dlg_hash.c
index bba619a..6f944e1 100644
--- a/modules/dialog/dlg_hash.c
+++ b/modules/dialog/dlg_hash.c
@@ -223,6 +223,38 @@ int dlg_ka_run(ticks_t ti)
return 0;
 }
 
+/**
+ * clean old unconfirmed dialogs
+ *
+ */
+int dlg_clean_run(ticks_t ti)
+{
+   unsigned int i;
+   unsigned int tm;
+   dlg_cell_t *dlg;
+   dlg_cell_t *tdlg;
+
+   tm = (unsigned int)time(NULL);
+   for(i=0; id_table-size; i++)
+   {
+   lock_set_get(d_table-locks, d_table-entries[i].lock_idx);
+   dlg = d_table-entries[i].first;
+   while (dlg) {
+   tdlg = dlg;
+   dlg = dlg-next;
+   if(tdlg-state==DLG_STATE_UNCONFIRMED  
tdlg-init_tstm-300) {
+   /* dialog in early state older than 5min */
+   LM_NOTICE(dialog in early state is too old (%p 
ref %d)\n,
+   tdlg, tdlg-ref);
+   unlink_unsafe_dlg(d_table-entries[i], tdlg);
+   destroy_dlg(tdlg);
+   }
+   }
+   lock_set_release(d_table-locks, d_table-entries[i].lock_idx);
+   }
+   return 0;
+}
+
 /*!
  * \brief Initialize the global dialog table
  * \param size size of the table
@@ -434,6 +466,7 @@ struct dlg_cell* build_new_dlg( str *callid, str *from_uri, 
str *to_uri,
 
memset( dlg, 0, len);
dlg-state = DLG_STATE_UNCONFIRMED;
+   dlg-init_ts = (unsigned int)time(NULL);
 
dlg-h_entry

Re: [sr-dev] t_suspend and t_continue in tm module

2013-07-06 Thread Daniel-Constantin Mierla

Hello,

the patch cannot be applied as it is. The comments contain references to 
request processing, which is obviously wrong. Then I have seen code 
specific to requests, like managing the request uri or dst uri -- these 
fields shouldn't be set for replies, it's ok as safety to clear them up, 
but not cloning.


From the patch I see the new function are only for internal usage, not 
for config file. Are they supposed to be used only in the transaction 
context (i.e., after the transaction is matched for reply)?


Cheers,
Daniel

On 7/4/13 5:24 PM, Richard Good wrote:

Hi

I've finally got working functionality for t-suspend and t_continue 
for SIP responses in the tmp/tm_async_reply_support branch.


I've memory and load tested the branch and have also isolated the 
changes so that if there are problems they will only be experienced if 
you use the new API functions.


However keeping mind that TM can be tricky to program (as mentioned in 
the documentation ;)) - I've included below a summary of the changes 
and a git diff against the latest master.  So the TM experts can have 
a look and see if there are any obvious problems.


If there are no complaints or queries I will commit the changes to 
master next week Friday (July 12).


Regards
Richard.

Change summary:
1.  parser/msg_parser.h:  added new message state FL_RPL_SUSPENDED
2.  tm_load.c: new api functions: *t_suspend_reply*, 
*t_continue_reply* and *t_cancel_suspend_reply*
3.  t_suspend.c/h: new methods: *t_suspend_reply*, *t_continue_reply* 
and *t_cancel_suspend_reply
*4.  tm/t_reply.c: if msg is in state FL_RPL_SUSPENDED then we skip 
sending the reply on
5.  tm/t_reply.c/h: new methods to fake env for responses: 
*faked_env_resp, faked_resp, free_faked_resp

*
6.  API documentation to include new functions: *t_suspend_reply*, 
*t_continue_reply* and *t_cancel_suspend_reply


*
*
*
*
*





On 18 March 2013 14:13, Richard Good richard.g...@smilecoms.com 
mailto:richard.g...@smilecoms.com wrote:


Hi Daniel and other TM experts

We have been working on a prototype for being able to use the
t_suspend() and t_continue() methods for SIP responses.  The
version in branch /tmp/tm_async_reply_support is working, though
still needs to be 100% tested and only works for 1 branch (i.e. no
forking)

Would it be possible for you to have a look at this branch code
and see if we are on the right track.  The code is working but TM
(as mentioned in the documentation ;)) can be tricky to program
and we want to make sure we are not breaking anything, as the goal
is to get this into the master branch.

The changes we have done:

 1. parser/msg_parser.h:  added new message state FL_RPL_SUSPENDED
 2. tm/h_table.h: added int suspended_request to ua_server and int
suspended_reply to ua_client
 3. tm/t_suspend.c:t_suspend
 1. Changed suspend method to check if the message is a
request or response and set the
suspended_request/suspended_reply variable accordingly
 2. If its a request we do as the existing code
 3. If its a response we get the correct uac branch, clone the
msg into t-uac[branch].reply and set the msg state to
FL_RPL_SUSPENDED
 4. tm/t_reply.c: if msg is in state FL_RPL_SUSPENDED then we skip
sending the reply on
 5. tm/t_suspend.c:t_continue
 1. Check if this uas was suspended - if so this is a continue
for a request so continue with existing code
 2. If not then we search for the branch that was suspended
 3. Once branch is found unsuspend the message state
 4. do pre-script, run_top_route and post scripts
 5. Relay the reply using basically the same code we skipped
in step 4

First next step after we confirm we are on the right track is to
add forking support - this will require a new t_continue method
where the calling application passes in the branch of the
suspended reply when wanting to continue.

Any comments/feedback would be appreciated.

Regards

Richard.







On 11 March 2013 14:34, Daniel-Constantin Mierla
mico...@gmail.com mailto:mico...@gmail.com wrote:

Hello,

t_suspend() and t_continue() are only for requests at this moment.

Cheers,
Daniel


On 3/6/13 2:49 PM, Richard Good wrote:

Hi

We are using the t_suspend and t_continue functionality to
asynchronously send Diameter messages.

This works nicely when we suspend and resume on a SIP
request. However in some circumstances we want to send a
Diameter message on a SIP response.

I have found that the SIP responses continue to be relayed
despite being suspended and returning 0 to the cfg file.

I am investigating the cause but before I get any deeper does
anyone know if the t_suspend and t_continue functionality

Re: [sr-dev] git:master: modules/app_lua: fix sr.xavp.get. Get all the values not only the first one.

2013-07-09 Thread Daniel-Constantin Mierla
Hello,

I would find it useful to have the option to return the first one as well, 
being rather common need - makes no sense to loop an consume extra cpu and 
memory. So maybe the right solution is having a function parameter to control 
that or two different functions.

Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com

On 9 Jul 2013, at 15:56, Victor Seva linuxman...@torreviejawireless.org wrote:

 Module: sip-router
 Branch: master
 Commit: 4a79fcdd9965c6c3195601baeb82d489d970aa12
 URL:
 http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4a79fcdd9965c6c3195601baeb82d489d970aa12
 
 Author: Victor Seva linuxman...@torreviejawireless.org
 Committer: Victor Seva linuxman...@torreviejawireless.org
 Date:   Tue Jul  9 15:55:35 2013 +0200
 
 modules/app_lua: fix sr.xavp.get. Get all the values not only the first one.
 
 ---
 
 modules/app_lua/app_lua_sr.c |   65 -
 1 files changed, 50 insertions(+), 15 deletions(-)
 
 diff --git a/modules/app_lua/app_lua_sr.c b/modules/app_lua/app_lua_sr.c
 index 93b89b8..4075ef8 100644
 --- a/modules/app_lua/app_lua_sr.c
 +++ b/modules/app_lua/app_lua_sr.c
 @@ -1151,42 +1151,40 @@ static int lua_sr_push_str_list_table(lua_State *L, 
 struct str_list *list) {
return 1;
 }
 
 +static int lua_sr_push_xavp_table(lua_State *L, sr_xavp_t *xavp);
 +
 /**
 - * creates and push a table to the lua stack with
 - * the elements of the xavp
 + * creates and push a table for the key name in xavp
  */
 -static int lua_sr_push_xavp_table(lua_State *L, sr_xavp_t *xavp) {
 +static void lua_sr_push_xavp_name_table(lua_State *L, sr_xavp_t *xavp, str 
 name) {
lua_Number i = 1;
 -sr_xavp_t *avp = NULL;
 +lua_Number elem = 1;
 +sr_xavp_t *avp = xavp;
 
 -if(xavp-val.type!=SR_XTYPE_XAVP){
 -LM_ERR(%s not xavp?\n, xavp-name.s);
 -return 0;
 +while(avp!=NULL!STR_EQ(avp-name,name))
 +{
 +avp = avp-next;
}
 -avp = xavp-val.v.xavp;
 -
lua_newtable(L);
 +
while(avp!=NULL){
 +lua_pushnumber(L, elem);
switch(avp-val.type) {
case SR_XTYPE_NULL:
lua_pushnil(L);
 -lua_setfield(L, -2, avp-name.s);
break;
case SR_XTYPE_INT:
i = avp-val.v.i;
lua_pushnumber(L, i);
 -lua_setfield(L, -2, avp-name.s);
break;
case SR_XTYPE_STR:
lua_pushlstring(L, avp-val.v.s.s, avp-val.v.s.len);
 -lua_setfield(L, -2, avp-name.s);
break;
case SR_XTYPE_TIME:
case SR_XTYPE_LONG:
case SR_XTYPE_LLONG:
case SR_XTYPE_DATA:
lua_pushnil(L);
 -lua_setfield(L, -2, avp-name.s);
LM_WARN(XAVP type:%d value not supported\n, avp-val.type);
break;
case SR_XTYPE_XAVP:
 @@ -1194,11 +1192,48 @@ static int lua_sr_push_xavp_table(lua_State *L, 
 sr_xavp_t *xavp) {
LM_ERR(xavp:%.*s subtable error. Nil value added\n, 
 avp-name.len, avp-name.s);
lua_pushnil(L);
}
 -lua_setfield(L, -2, avp-name.s);
 +break;
 +default:
 +LM_ERR(xavp:%.*s unknown type: %d. Nil value added\n,
 +avp-name.len, avp-name.s, avp-val.type);
 +lua_pushnil(L);
break;
}
 -avp = avp-next;
 +lua_rawset(L, -3);
 +elem = elem + 1;
 +avp = xavp_get_next(avp);
 +}
 +lua_setfield(L, -2, name.s);
 +}
 +
 +/**
 + * creates and push a table to the lua stack with
 + * the elements of the xavp
 + */
 +static int lua_sr_push_xavp_table(lua_State *L, sr_xavp_t *xavp) {
 +sr_xavp_t *avp = NULL;
 +struct str_list *keys;
 +struct str_list *k;
 +
 +if(xavp-val.type!=SR_XTYPE_XAVP){
 +LM_ERR(%s not xavp?\n, xavp-name.s);
 +return 0;
}
 +avp = xavp-val.v.xavp;
 +keys = xavp_get_list_key_names(xavp);
 +
 +lua_newtable(L);
 +if(keys!=NULL)
 +{
 +do
 +{
 +lua_sr_push_xavp_name_table(L, avp, keys-s);
 +k = keys;
 +keys = keys-next;
 +pkg_free(k);
 +}while(keys!=NULL);
 +}
 +
return 1;
 }
 
 
 
 ___
 sr-dev mailing list
 sr-dev@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] Makefile and environment XXFLAGS

2013-07-10 Thread Daniel-Constantin Mierla

Hello,

On 7/10/13 2:06 AM, Victor Seva wrote:

Hello,

I have a bugreport[0] about hardening [1] and how I try to pass this
flags to the build system [2][3]

Is there any proper way to configure this flags? Should I try to
modify the Makefile.def for use the environment flags and not clean
their values?
probably using X+=... is the way to go instead of X=... for all those 
variables that is needed to get values from environment.


Cheers,
Daniel



Cheers,
Victor


[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690396
[1] http://wiki.debian.org/Hardening
[2] configure phase:
configure: configure-stamp
configure-stamp:
 dh_testdir
 # Add here commands to configure the package.
 $(MAKE) FLAVOUR=kamailio cfg prefix=/usr
cfg_prefix=$(CURDIR)/debian/kamailio \
 cfg_target=/etc/kamailio/ \
 basedir=$(CURDIR)/debian/kamailio \
 skip_modules=$(EXCLUDED_MODULES)
$(EXTRA_EXCLUDED_MODULES) \
 $(shell dpkg-buildflags --export=configure) \
 group_include=kstandard quiet=verbose

 touch configure-stamp
[3] $(shell dpkg-buildflags --export=configure) output:
CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security CPPFLAGS=-D_FORTIFY_SOURCE=2 CXXFLAGS=-g
-O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security FFLAGS=-g -O2 LDFLAGS=-Wl,-z,relro

___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


<    1   2   3   4   5   6   7   8   9   10   >