Index: Makefile
===================================================================
RCS file: /cvs/ports/telephony/kamailio/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile	23 Aug 2012 17:42:27 -0000	1.20
+++ Makefile	4 Sep 2012 06:48:10 -0000
@@ -4,8 +4,7 @@ COMMENT-main =		mature and flexible open
 
 SHARED_ONLY =		Yes
 
-VERSION =		3.2.3
-REVISION =		2
+VERSION =		3.3.1
 DISTNAME =		kamailio-${VERSION}_src
 PKGNAME-main =		kamailio-${VERSION}
 PKGNAME-mysql =		kamailio-mysql-${VERSION}
@@ -28,12 +27,14 @@ PERMIT_PACKAGE_FTP =	Yes
 PERMIT_DISTFILES_CDROM =Yes
 PERMIT_DISTFILES_FTP =	Yes
 
-SHARED_LIBS =		kcore	0.0	# 1.0
-SHARED_LIBS +=		kmi	0.0	# 1.0
-SHARED_LIBS +=		ser_cds	0.0	# 0.1
-SHARED_LIBS +=		srdb1	0.0	# 1.0
-SHARED_LIBS +=		srdb2	0.0	# 1.0
-SHARED_LIBS +=		trie	0.0	# 1.0
+SHARED_LIBS =		kcore	1.0	# 1.0
+SHARED_LIBS +=		kmi	1.0	# 1.0
+SHARED_LIBS +=		ser_cds	1.0	# 0.1
+SHARED_LIBS +=		srdb1	1.0	# 1.0
+SHARED_LIBS +=		srdb2	1.0	# 1.0
+SHARED_LIBS +=		trie	1.0	# 1.0
+SHARED_LIBS +=		binrpc	0.0	# 0.1
+SHARED_LIBS +=		srutils	0.0	# 1.0
 
 MAKE_ENV =		CC="${CC}" LDFLAGS="${LDFLAGS} -pthread" QUIET=verbose
 
@@ -42,9 +43,9 @@ WRKDIST =		${WRKDIR}/kamailio-${VERSION}
 
 MODULES =		devel/gettext
 WANTLIB-main =		c crypto curl db expat pcre pthread ssl xml2 \
-			idn ncurses readline z ${MODGETTEXT_WANTLIB}
+			idn ncurses readline z m ${MODGETTEXT_WANTLIB}
 LIB_DEPENDS-main =	net/curl \
-			databases/db/v4 \
+			databases/db/v4,-main,no_java \
 			devel/pcre \
 			textproc/libxml,-main,no_python \
 			${MODGETTEXT_LIB_DEPENDS}
@@ -74,7 +75,9 @@ MAKE_FLAGS =	FLAVOUR=kamailio \
 		LIBser_cds_VERSION=${LIBser_cds_VERSION} \
 		LIBsrdb1_VERSION=${LIBsrdb1_VERSION} \
 		LIBsrdb2_VERSION=${LIBsrdb2_VERSION} \
-		LIBtrie_VERSION=${LIBtrie_VERSION}
+		LIBtrie_VERSION=${LIBtrie_VERSION} \
+		LIBbinrpc_VERSION=${LIBbinrpc_VERSION} \
+		LIBsrutils_VERSION=${LIBsrutils_VERSION}
 
 PSEUDO_FLAVORS +=	no_postgresql
 .if !${FLAVOR:L:Mno_postgresql}
Index: distinfo
===================================================================
RCS file: /cvs/ports/telephony/kamailio/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo	22 Apr 2012 21:44:24 -0000	1.4
+++ distinfo	4 Sep 2012 06:48:10 -0000
@@ -1,5 +1,2 @@
-MD5 (kamailio-3.2.3_src.tar.gz) = Jzbdj0y0WkA5bga5GE0y6g==
-RMD160 (kamailio-3.2.3_src.tar.gz) = lKT1l14dOyySKXvZE1yaC1x2y3k=
-SHA1 (kamailio-3.2.3_src.tar.gz) = eQqNTbDXXa/heMr3vIlIqoEifys=
-SHA256 (kamailio-3.2.3_src.tar.gz) = ZzJTuz7C8MzLoPzdyMk7OkHaSh9jtSIHNu40jVyj0TE=
-SIZE (kamailio-3.2.3_src.tar.gz) = 7227846
+SHA256 (kamailio-3.3.1_src.tar.gz) = RcFTd2762AnsH4hxDX081XyfgFBQYRN46sz5m+1joSI=
+SIZE (kamailio-3.3.1_src.tar.gz) = 7468878
Index: patches/patch-Makefile_defs
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-Makefile_defs,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile_defs
--- patches/patch-Makefile_defs	12 Jun 2012 23:39:09 -0000	1.2
+++ patches/patch-Makefile_defs	4 Sep 2012 06:48:10 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-Makefile_defs,v 1.2 2012/06/12 23:39:09 sthen Exp $
---- Makefile.defs.orig	Thu Apr 19 15:10:24 2012
-+++ Makefile.defs	Tue Jun 12 23:10:37 2012
+--- Makefile.defs.orig	Thu Aug  2 16:54:15 2012
++++ Makefile.defs	Sun Sep  2 18:52:42 2012
 @@ -422,7 +422,7 @@ endif
  endif
  
@@ -19,7 +19,7 @@ $OpenBSD: patch-Makefile_defs,v 1.2 2012
  bin_target = $(prefix)/$(bin_dir)
  #modules_target = $(prefix)/$(modules_dir)
  lib_target = $(prefix)/$(lib_dir)
-@@ -940,7 +940,7 @@ ifeq	($(ARCH), x86_64)
+@@ -944,7 +944,7 @@ ifeq	($(ARCH), x86_64)
  ifeq		($(CC_NAME), gcc)
  				C_DEFS+=-DCC_GCC_LIKE_ASM
  				#common stuff
@@ -28,7 +28,7 @@ $OpenBSD: patch-Makefile_defs,v 1.2 2012
  			#if gcc 4.5+
  			# don't add '-mtune=$(CPU)' - gcc failure
  ifeq			($(CC_SHORTVER), 4.5+)
-@@ -954,12 +954,8 @@ else
+@@ -958,12 +958,8 @@ else
  			#if gcc 4.2+
  ifeq			($(CC_SHORTVER), 4.2+)
  $(call				set_if_empty,CPU,opteron)
@@ -43,7 +43,7 @@ $OpenBSD: patch-Makefile_defs,v 1.2 2012
  else
  			#if gcc 4.0+
  ifeq			($(CC_SHORTVER), 4.x)
-@@ -1899,9 +1895,10 @@ endif
+@@ -1904,9 +1900,10 @@ endif
  
  ifeq ($(OS), openbsd)
  	C_DEFS+=-DHAVE_SOCKADDR_SA_LEN  -DHAVE_GETHOSTBYNAME2 \
Index: patches/patch-Makefile_libs
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-Makefile_libs,v
retrieving revision 1.1
diff -u -p -r1.1 patch-Makefile_libs
--- patches/patch-Makefile_libs	22 Apr 2012 21:44:24 -0000	1.1
+++ patches/patch-Makefile_libs	4 Sep 2012 06:48:10 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-Makefile_libs,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- Makefile.libs.orig	Tue Jan 31 16:47:40 2012
-+++ Makefile.libs	Tue Feb  7 00:57:41 2012
-@@ -57,14 +57,20 @@ ifeq ($(OS), darwin)
+--- Makefile.libs.orig	Mon Jun 18 14:36:09 2012
++++ Makefile.libs	Sun Jul 29 18:01:15 2012
+@@ -57,14 +57,19 @@ ifeq ($(OS), darwin)
  	NAME_LD_FLAGS= -compatibility_version $(MAJOR_VER).$(MINOR_VER) \
  					-current_version $(MAJOR_VER).$(MINOR_VER).$(BUGFIX_VER) \
  					-install_name $(LIB_INSTALL_NAME)
@@ -9,7 +9,6 @@ $OpenBSD: patch-Makefile_libs,v 1.1 2012
  else
 +ifeq ($(OS), openbsd)
 +	LIB_NAME:=$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX).$(OBSD_VER)
-+	LIB_RUNTIME_NAME:=$(LIB_PREFIX)$(NAME)$(LIB_SUFFIX).$(OBSD_VER)
 +	NAME_LD_FLAGS= $(LIB_SONAME)$(LIB_RUNTIME_NAME)
 +	LIBINAME_F:=
 +else
@@ -23,7 +22,7 @@ $OpenBSD: patch-Makefile_libs,v 1.1 2012
  
  ifeq	($(strip $(compile_for_install)),yes)
  	LIB_INSTALL_NAME:=$(lib_target)/$(LIB_RUNTIME_NAME)
-@@ -111,14 +117,18 @@ endif
+@@ -111,14 +116,18 @@ endif
  $(NAME): $(LIB_RUNTIME_NAME) $(LIB_LINK_NAME) $(LIBINAME_F)
  
  $(LIB_RUNTIME_NAME):
@@ -42,7 +41,7 @@ $OpenBSD: patch-Makefile_libs,v 1.1 2012
  
  .PHONY: link_clean
  link_clean:
-@@ -144,14 +154,18 @@ ifeq ($(OS), freebsd)
+@@ -144,21 +153,31 @@ ifeq ($(OS), freebsd)
  	rm -f $(lib_prefix)/$(lib_dir)/$(LIB_LINK_NAME)
  	cd $(lib_prefix)/$(lib_dir) ; ln -s $(LIB_RUNTIME_NAME) $(LIB_LINK_NAME)
  else
@@ -57,8 +56,22 @@ $OpenBSD: patch-Makefile_libs,v 1.1 2012
  	cd $(lib_prefix)/$(lib_dir) ; ln -s $(LIB_NAME) $(LIB_RUNTIME_NAME) 
  	cd $(lib_prefix)/$(lib_dir) ; ln -s $(LIB_NAME) $(LIB_LINK_NAME) 
  endif
--
 +endif
  
+-
  .PHONY:install-if-newer
++ifeq ($(OS), openbsd)
++install-if-newer: $(lib_prefix)/$(lib_dir)/$(LIB_NAME)
++
++$(lib_prefix)/$(lib_dir)/$(LIB_NAME): $(LIBINAME_F)
++	@$(MAKE) install
++else
  install-if-newer: $(lib_prefix)/$(lib_dir)/$(LIB_RUNTIME_NAME)
+ 
+ $(lib_prefix)/$(lib_dir)/$(LIB_RUNTIME_NAME): $(LIB_NAME) $(LIBINAME_F)
+ 	@$(MAKE) install
+-
++endif
+ 
+ ifneq ($(strip $(LIBINAME_F)),)
+ $(LIBINAME_F): $(ALLDEP)
Index: patches/patch-lib_binrpc_Makefile
===================================================================
RCS file: patches/patch-lib_binrpc_Makefile
diff -N patches/patch-lib_binrpc_Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_binrpc_Makefile	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- lib/binrpc/Makefile.orig	Sun Jul  8 23:54:42 2012
++++ lib/binrpc/Makefile	Sun Jul  8 23:55:36 2012
+@@ -8,6 +8,7 @@ NAME:=binrpc
+ MAJOR_VER=0
+ MINOR_VER=1
+ BUGFIX_VER=0
++OBSD_VER=$(LIBbinrpc_VERSION)
+ LIBS=
+ 
+ include ../../Makefile.libs
Index: patches/patch-lib_binrpc_binrpc_api_c
===================================================================
RCS file: patches/patch-lib_binrpc_binrpc_api_c
diff -N patches/patch-lib_binrpc_binrpc_api_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_binrpc_binrpc_api_c	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+--- lib/binrpc/binrpc_api.c.orig	Sun Jul 29 23:47:24 2012
++++ lib/binrpc/binrpc_api.c	Sun Jul 29 23:49:21 2012
+@@ -149,10 +149,10 @@ static int connect_unix_sock(char* name, int type, str
+ 	s=-1;
+ 	memset(&ifsun, 0, sizeof (struct sockaddr_un));
+ 	len=strlen(name);
+-	if (len>UNIX_PATH_MAX){
++	if (len>sizeof(ifsun.sun_path)){
+ 		snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, 
+ 				"connect_unix_sock: name too long "
+-				"(%d > %d): %s", len, UNIX_PATH_MAX, name);
++				"(%d > %ld): %s", len, sizeof(ifsun.sun_path), name);
+ 		goto error;
+ 	}
+ 	ifsun.sun_family=AF_UNIX;
+@@ -174,16 +174,16 @@ static int connect_unix_sock(char* name, int type, str
+ 			if (sock_dir==0)
+ 				sock_dir="/tmp";
+ retry:
+-			ret=snprintf(mysun->sun_path, UNIX_PATH_MAX, "%s/" NAME "_%d",
++			ret=snprintf(mysun->sun_path, sizeof(mysun->sun_path), "%s/" NAME "_%d",
+ 							sock_dir, rand()); 
+-			if ((ret<0) ||(ret>=UNIX_PATH_MAX)){
++			if ((ret<0) ||(ret>=sizeof(mysun->sun_path))){
+ 				snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, 
+ 							"connect_unix_sock: buffer overflow while trying to"
+ 							"generate unix datagram socket name");
+ 				goto error;
+ 			}
+ 		}else{
+-			if (strlen(reply_socket)>UNIX_PATH_MAX){
++			if (strlen(reply_socket)>sizeof(mysun->sun_path)){
+ 				snprintf(binrpc_last_errs, sizeof(binrpc_last_errs)-1, 
+ 							"connect_unix_sock: buffer overflow while trying to"
+ 							"use the provided unix datagram socket name (%s)",
Index: patches/patch-lib_srutils_Makefile
===================================================================
RCS file: patches/patch-lib_srutils_Makefile
diff -N patches/patch-lib_srutils_Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_srutils_Makefile	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- lib/srutils/Makefile.orig	Mon Jul  9 00:12:33 2012
++++ lib/srutils/Makefile	Mon Jul  9 00:14:40 2012
+@@ -4,6 +4,7 @@ NAME:=srutils
+ MAJOR_VER=1
+ MINOR_VER=0
+ BUGFIX_VER=0
++OBSD_VER=$(LIBsrutils_VERSION)
+ LIBS= -lm
+ 
+ include ../../Makefile.libs
Index: patches/patch-modules_auth_auth_mod_c
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-modules_auth_auth_mod_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-modules_auth_auth_mod_c
--- patches/patch-modules_auth_auth_mod_c	22 Apr 2012 21:44:24 -0000	1.1
+++ patches/patch-modules_auth_auth_mod_c	4 Sep 2012 06:48:10 -0000
@@ -1,43 +1,33 @@
-$OpenBSD: patch-modules_auth_auth_mod_c,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- modules/auth/auth_mod.c.orig	Thu Apr 19 15:10:24 2012
-+++ modules/auth/auth_mod.c	Sun Apr 22 04:07:24 2012
-@@ -79,6 +79,9 @@ static int mod_init(void);
-  */
- int w_consume_credentials(struct sip_msg* msg, char* s1, char* s2);
- 
-+int w_auth_challenge(struct sip_msg *msg, str *realm, int flags,
-+		int hftype);
-+
- static int pv_proxy_authenticate(struct sip_msg* msg, char* realm,
- 		char *passwd, char *flags);
- static int pv_www_authenticate(struct sip_msg* msg, char* realm,
-@@ -635,6 +638,11 @@ static int auth_send_reply(struct sip_msg *msg, int co
-  */
- int auth_challenge(struct sip_msg *msg, str *realm, int flags, int hftype)
- {
-+    return w_auth_challenge(msg, realm, flags, hftype);
-+}
-+
-+int w_auth_challenge(struct sip_msg *msg, str *realm, int flags, int hftype)
-+{
-     int ret, stale;
-     str hf = {0, 0};
- 	struct qp *qop = NULL;
-@@ -706,7 +714,7 @@ static int proxy_challenge(struct sip_msg *msg, char* 
+$OpenBSD$
+--- modules/auth/auth_mod.c.orig	Thu Aug  2 16:54:14 2012
++++ modules/auth/auth_mod.c	Sun Sep  2 02:51:40 2012
+@@ -737,7 +737,7 @@ static int proxy_challenge(struct sip_msg *msg, char* 
  		goto error;
  	}
  
 -	return auth_challenge(msg, &srealm, vflags, HDR_PROXYAUTH_T);
-+	return w_auth_challenge(msg, &srealm, vflags, HDR_PROXYAUTH_T);
++	return auth_challenge_helper(msg, &srealm, vflags, HDR_PROXYAUTH_T, NULL);
  
  error:
  	if(!(vflags&4)) {
-@@ -739,7 +747,7 @@ static int www_challenge(struct sip_msg *msg, char* re
+@@ -770,7 +770,7 @@ static int www_challenge(struct sip_msg *msg, char* re
  		goto error;
  	}
  
 -	return auth_challenge(msg, &srealm, vflags, HDR_AUTHORIZATION_T);
-+	return w_auth_challenge(msg, &srealm, vflags, HDR_AUTHORIZATION_T);
++	return auth_challenge_helper(msg, &srealm, vflags, HDR_AUTHORIZATION_T, NULL);
+ 
+ error:
+ 	if(!(vflags&4)) {
+@@ -808,9 +808,9 @@ static int w_auth_challenge(struct sip_msg *msg, char*
+ 	}
+ 
+ 	if(msg->REQ_METHOD==METHOD_REGISTER)
+-		return auth_challenge(msg, &srealm, vflags, HDR_AUTHORIZATION_T);
++		return auth_challenge_helper(msg, &srealm, vflags, HDR_AUTHORIZATION_T, NULL);
+ 	else
+-		return auth_challenge(msg, &srealm, vflags, HDR_PROXYAUTH_T);
++		return auth_challenge_helper(msg, &srealm, vflags, HDR_PROXYAUTH_T, NULL);
  
  error:
  	if(!(vflags&4)) {
Index: patches/patch-modules_carrierroute_cr_func_c
===================================================================
RCS file: patches/patch-modules_carrierroute_cr_func_c
diff -N patches/patch-modules_carrierroute_cr_func_c
--- patches/patch-modules_carrierroute_cr_func_c	9 May 2012 21:27:47 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-modules_carrierroute_cr_func_c,v 1.1 2012/05/09 21:27:47 sthen Exp $
---- modules/carrierroute/cr_func.c.orig	Mon Apr 23 19:52:34 2012
-+++ modules/carrierroute/cr_func.c	Mon Apr 23 19:52:45 2012
-@@ -319,7 +319,7 @@ static int actually_rewrite(const struct route_rule *r
- 		len += SIP_URI.len;
- 	}
- 	if ( len > MAX_URI_SIZE ) {
--		LM_ERR("Calculated uri size too large: %d\n", len);
-+		LM_ERR("Calculated uri size too large: %zu\n", len);
- 		return -1;
- 	}
- 
Index: patches/patch-modules_ctl_init_socks_c
===================================================================
RCS file: patches/patch-modules_ctl_init_socks_c
diff -N patches/patch-modules_ctl_init_socks_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_ctl_init_socks_c	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,16 @@
+$OpenBSD$
+--- modules/ctl/init_socks.c.orig	Sun Jul 29 23:51:54 2012
++++ modules/ctl/init_socks.c	Sun Jul 29 23:52:30 2012
+@@ -96,9 +96,9 @@ int init_unix_sock(struct sockaddr_un* su, char* name,
+ 	unlink(name);
+ 	memset(&ifsun, 0, sizeof (struct sockaddr_un));
+ 	len=strlen(name);
+-	if (len>UNIX_PATH_MAX){
+-		LOG(L_ERR, "ERROR: init_unix_sock: name too long (%d > %d): %s\n",
+-				len, UNIX_PATH_MAX, name);
++	if (len>sizeof(ifsun.sun_path)){
++		LOG(L_ERR, "ERROR: init_unix_sock: name too long (%d > %ld): %s\n",
++				len, sizeof(ifsun.sun_path), name);
+ 		goto error;
+ 	}
+ 	ifsun.sun_family=AF_UNIX;
Index: patches/patch-modules_db_mysql_my_cmd_c
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-modules_db_mysql_my_cmd_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-modules_db_mysql_my_cmd_c
--- patches/patch-modules_db_mysql_my_cmd_c	22 Apr 2012 21:44:24 -0000	1.1
+++ patches/patch-modules_db_mysql_my_cmd_c	4 Sep 2012 06:48:10 -0000
@@ -1,6 +1,15 @@
 $OpenBSD: patch-modules_db_mysql_my_cmd_c,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- modules/db_mysql/my_cmd.c.orig	Sun Apr 22 22:25:29 2012
-+++ modules/db_mysql/my_cmd.c	Sun Apr 22 22:25:57 2012
+--- modules/db_mysql/my_cmd.c.orig	Mon Jun 18 14:36:10 2012
++++ modules/db_mysql/my_cmd.c	Sat Jul 28 12:32:54 2012
+@@ -29,7 +29,7 @@
+  */
+ 
+ /* the following macro will break the compile on solaris */
+-#if !defined (__SVR4) && !defined (__sun)
++#if !defined (__SVR4) && !defined (__sun) && !defined (__OpenBSD__)
+    #define _XOPEN_SOURCE 4     /* bsd */
+ #endif
+ #define _XOPEN_SOURCE_EXTENDED 1    /* solaris */
 @@ -47,6 +47,7 @@
  #include "../../ut.h"
  #include "../../dprint.h"
Index: patches/patch-modules_db_mysql_my_cmd_c.orig
===================================================================
RCS file: patches/patch-modules_db_mysql_my_cmd_c.orig
diff -N patches/patch-modules_db_mysql_my_cmd_c.orig
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_db_mysql_my_cmd_c.orig	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,11 @@
+$OpenBSD: patch-modules_db_mysql_my_cmd_c,v 1.1 2012/04/22 21:44:24 sthen Exp $
+--- modules/db_mysql/my_cmd.c.orig	Sun Apr 22 22:25:29 2012
++++ modules/db_mysql/my_cmd.c	Sun Apr 22 22:25:57 2012
+@@ -47,6 +47,7 @@
+ #include "../../ut.h"
+ #include "../../dprint.h"
+ 
++#include <sys/types.h>
+ #include <strings.h>
+ #include <stdio.h>
+ #include <time.h>  /*strptime, XOPEN issue must be >=4 */
Index: patches/patch-modules_k_p_usrloc_ul_db_h
===================================================================
RCS file: patches/patch-modules_k_p_usrloc_ul_db_h
diff -N patches/patch-modules_k_p_usrloc_ul_db_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_k_p_usrloc_ul_db_h	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- modules_k/p_usrloc/ul_db.h.orig	Sat Jul 28 15:44:55 2012
++++ modules_k/p_usrloc/ul_db.h	Sat Jul 28 15:46:57 2012
+@@ -38,7 +38,7 @@
+ #define DB_POL_QUERY 1
+ #define DB_POL_MOD 2
+ 
+-#ifdef __i386__
++#if defined(__i386__) || defined(__OpenBSD__)
+     #define UL_DB_ZERO_TIME 0x80000000
+ #else
+     #define UL_DB_ZERO_TIME 0xFFFFFFFF80000000
Index: patches/patch-modules_k_perl_perl_c
===================================================================
RCS file: patches/patch-modules_k_perl_perl_c
diff -N patches/patch-modules_k_perl_perl_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_k_perl_perl_c	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- modules_k/perl/perl.c.orig	Sat Jul 28 14:50:20 2012
++++ modules_k/perl/perl.c	Sat Jul 28 14:52:07 2012
+@@ -319,6 +319,8 @@ struct mi_root* perl_mi_reload(struct mi_root *cmd_tre
+ static int mod_init(void) {
+ 
+ 	int ret = 0;
++	int argc = 0;
++	char **argv = NULL;
+ 
+ 	if(register_mi_mod(exports.name, mi_cmds)!=0)
+ 	{
+@@ -337,7 +339,7 @@ static int mod_init(void) {
+ 		return -1;
+ 	}
+ 
+-	PERL_SYS_INIT3(NULL, NULL, &environ);
++	PERL_SYS_INIT3(&argc, &argv, &environ);
+ 
+ 	if ((my_perl = parser_init())) {
+ 		ret = 0;
Index: patches/patch-modules_k_pv_pv_time_c
===================================================================
RCS file: patches/patch-modules_k_pv_pv_time_c
diff -N patches/patch-modules_k_pv_pv_time_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_k_pv_pv_time_c	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,30 @@
+$OpenBSD$
+--- modules_k/pv/pv_time.c.orig	Sat Jul 28 16:09:49 2012
++++ modules_k/pv/pv_time.c	Sat Jul 28 16:15:51 2012
+@@ -117,7 +117,7 @@ int pv_get_time(struct sip_msg *msg, pv_param_t *param
+ 	{
+ 		msg_set_time(msg);
+ 		msg_ctx_id_set(msg, &_cfgutils_msgid);
+-		if(localtime_r(&msg->tval.tv_sec, &_cfgutils_ts) == NULL)
++		if(localtime_r((time_t*)&msg->tval.tv_sec, &_cfgutils_ts) == NULL)
+ 		{
+ 			LM_ERR("unable to break time to attributes\n");
+ 			return -1;
+@@ -168,7 +168,7 @@ int pv_get_strftime(struct sip_msg *msg, pv_param_t *p
+ 	{
+ 		msg_set_time(msg);
+ 		msg_ctx_id_set(msg, &_cfgutils_msgid);
+-		if(localtime_r(&msg->tval.tv_sec, &_cfgutils_ts) == NULL)
++		if(localtime_r((time_t*)&msg->tval.tv_sec, &_cfgutils_ts) == NULL)
+ 		{
+ 			LM_ERR("unable to break time to attributes\n");
+ 			return -1;
+@@ -225,7 +225,7 @@ int pv_get_timef(struct sip_msg *msg, pv_param_t *para
+ 
+ 	msg_set_time(msg);
+ 	
+-	s.s = ctime(&msg->tval.tv_sec);
++	s.s = ctime((time_t*)&msg->tval.tv_sec);
+ 	s.len = strlen(s.s)-1;
+ 	return pv_get_strintval(msg, param, res, &s, (int)msg->tval.tv_sec);
+ }
Index: patches/patch-modules_s_ldap_Makefile
===================================================================
RCS file: patches/patch-modules_s_ldap_Makefile
diff -N patches/patch-modules_s_ldap_Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-modules_s_ldap_Makefile	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- modules_s/ldap/Makefile.orig	Sat Jul 28 13:43:41 2012
++++ modules_s/ldap/Makefile	Sat Jul 28 13:43:58 2012
+@@ -8,7 +8,7 @@ NAME=ldap.so
+ 
+ #DEFS += -DLD_TEST
+ 
+-DEFS += -Wall -DOPENLDAP23
++DEFS += -Wall -DOPENLDAP23 -DLDAP_DEPRECATED
+ 
+ # Uncomment this if you have a recent version of libldap with
+ # LD_SCOPE_CHILDREN defined
Index: patches/patch-modules_s_ldap_ld_con_c
===================================================================
RCS file: patches/patch-modules_s_ldap_ld_con_c
diff -N patches/patch-modules_s_ldap_ld_con_c
--- patches/patch-modules_s_ldap_ld_con_c	22 Apr 2012 21:44:24 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-modules_s_ldap_ld_con_c,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- modules_s/ldap/ld_con.c.orig	Sun Apr 22 22:29:03 2012
-+++ modules_s/ldap/ld_con.c	Sun Apr 22 22:30:13 2012
-@@ -37,6 +37,7 @@
- #include "../../dprint.h"
- #include "../../ut.h"
- 
-+#define LDAP_DEPRECATED
- #include <ldap.h>
- #include <stdlib.h>
- #include <string.h>
Index: patches/patch-modules_s_usrloc_ucontact_c
===================================================================
RCS file: patches/patch-modules_s_usrloc_ucontact_c
diff -N patches/patch-modules_s_usrloc_ucontact_c
--- patches/patch-modules_s_usrloc_ucontact_c	9 May 2012 21:27:47 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-$OpenBSD: patch-modules_s_usrloc_ucontact_c,v 1.1 2012/05/09 21:27:47 sthen Exp $
---- modules_s/usrloc/ucontact.c.orig	Thu Apr 19 15:10:25 2012
-+++ modules_s/usrloc/ucontact.c	Mon Apr 23 23:17:24 2012
-@@ -38,6 +38,7 @@
- 
- #include "ucontact.h"
- #include <string.h>             /* memcpy */
-+#include <sys/param.h>
- #include "../../mem/shm_mem.h"
- #include "../../ut.h"
- #include "../../dprint.h"
-@@ -49,8 +50,6 @@
- #include "ul_callback.h"
- #include "reg_avps.h"
- #include "reg_avps_db.h"
--
--#define	MIN(x, y)	((x) < (y) ? (x) : (y))
- 
- /*
-  * Create a new contact structure
Index: patches/patch-modules_sipcapture_sipcapture_c
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-modules_sipcapture_sipcapture_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-modules_sipcapture_sipcapture_c
--- patches/patch-modules_sipcapture_sipcapture_c	9 May 2012 21:27:47 -0000	1.2
+++ patches/patch-modules_sipcapture_sipcapture_c	4 Sep 2012 06:48:10 -0000
@@ -1,6 +1,6 @@
-$OpenBSD: patch-modules_sipcapture_sipcapture_c,v 1.2 2012/05/09 21:27:47 sthen Exp $
---- modules/sipcapture/sipcapture.c.orig	Fri Feb  3 14:37:04 2012
-+++ modules/sipcapture/sipcapture.c	Mon Apr 23 23:04:10 2012
+$OpenBSD$
+--- modules/sipcapture/sipcapture.c.orig	Mon Jul  9 00:10:51 2012
++++ modules/sipcapture/sipcapture.c	Mon Jul  9 00:11:30 2012
 @@ -48,6 +48,7 @@
  #ifndef __USE_BSD
  #define __USE_BSD  /* on linux use bsd version of iphdr (more portable) */
@@ -9,21 +9,3 @@ $OpenBSD: patch-modules_sipcapture_sipca
  #include <netinet/ip.h>
  #define __FAVOR_BSD /* on linux use bsd version of udphdr (more portable) */
  #include <netinet/udp.h>
-@@ -764,6 +765,7 @@ static int sip_capture_store(struct _sipcapture_object
- 	char tmptable[TABLE_LEN];
-         int ret = 0;
-         struct tm *t;
-+        time_t tmp;
-         str dbtable;
- 	               	
- 	if(sco==NULL)
-@@ -774,7 +776,8 @@ static int sip_capture_store(struct _sipcapture_object
- 	
- 	gettimeofday( &tvb, &tz );
- 	
--	t = localtime(&tvb.tv_sec);
-+	tmp = tvb.tv_sec;
-+	t = localtime(&tmp);
- 
- 	db_keys[0] = &id_column;			
-         db_vals[0].type = DB1_INT;
Index: patches/patch-utils_kamctl_kamctl
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-utils_kamctl_kamctl,v
retrieving revision 1.1
diff -u -p -r1.1 patch-utils_kamctl_kamctl
--- patches/patch-utils_kamctl_kamctl	22 Apr 2012 21:44:24 -0000	1.1
+++ patches/patch-utils_kamctl_kamctl	4 Sep 2012 06:48:10 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-utils_kamctl_kamctl,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- utils/kamctl/kamctl.orig	Fri Feb  3 16:43:07 2012
-+++ utils/kamctl/kamctl	Fri Feb  3 16:44:20 2012
+--- utils/kamctl/kamctl.orig	Mon Jun 18 14:36:10 2012
++++ utils/kamctl/kamctl	Mon Jul  9 00:21:55 2012
 @@ -56,7 +56,7 @@ fi
  if [ -f "$MYLIBDIR/kamctl.base" ]; then
  	. "$MYLIBDIR/kamctl.base"
@@ -10,7 +10,7 @@ $OpenBSD: patch-utils_kamctl_kamctl,v 1.
  	exit -1
  fi
  
-@@ -1648,7 +1648,7 @@ openser_stop() {
+@@ -1720,7 +1720,7 @@ openser_stop() {
  options_ping() {
  	myhost=`get_my_host`
  	require_ctlengine
Index: patches/patch-utils_kamctl_kamctl_base
===================================================================
RCS file: /cvs/ports/telephony/kamailio/patches/patch-utils_kamctl_kamctl_base,v
retrieving revision 1.1
diff -u -p -r1.1 patch-utils_kamctl_kamctl_base
--- patches/patch-utils_kamctl_kamctl_base	22 Apr 2012 21:44:24 -0000	1.1
+++ patches/patch-utils_kamctl_kamctl_base	4 Sep 2012 06:48:10 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-utils_kamctl_kamctl_base,v 1.1 2012/04/22 21:44:24 sthen Exp $
---- utils/kamctl/kamctl.base.orig	Fri Feb  3 16:44:39 2012
-+++ utils/kamctl/kamctl.base	Fri Feb  3 16:45:54 2012
-@@ -462,7 +462,7 @@ EOF
+--- utils/kamctl/kamctl.base.orig	Mon Jun 18 14:36:10 2012
++++ utils/kamctl/kamctl.base	Mon Jul  9 00:21:55 2012
+@@ -478,7 +478,7 @@ EOF
  mdbg() {
  	if [ "0$VERBOSE" -ne 0 ] ; then
  		if [ -t 1 -a -z "$NOHLPRINT" ] ; then
@@ -10,7 +10,7 @@ $OpenBSD: patch-utils_kamctl_kamctl_base
  		else
  			echo "$1"
  		fi
-@@ -471,7 +471,7 @@ mdbg() {
+@@ -487,7 +487,7 @@ mdbg() {
  
  mwarn() {
  	if [ -t 1 -a -z "$NOHLPRINT" ] ; then
@@ -19,7 +19,7 @@ $OpenBSD: patch-utils_kamctl_kamctl_base
  	else
  		echo "** WARNING: $1"
  	fi
-@@ -479,7 +479,7 @@ mwarn() {
+@@ -495,7 +495,7 @@ mwarn() {
  
  minfo() {
  	if [ -t 1 -a -z "$NOHLPRINT" ] ; then
@@ -28,7 +28,7 @@ $OpenBSD: patch-utils_kamctl_kamctl_base
  	else
  		echo "** INFO: $1"
  	fi
-@@ -487,7 +487,7 @@ minfo() {
+@@ -503,7 +503,7 @@ minfo() {
  
  mecho() {
  	if [ -t 1 -a -z "$NOHLPRINT" ] ; then
@@ -37,7 +37,7 @@ $OpenBSD: patch-utils_kamctl_kamctl_base
  	else
  		echo "$1"
  	fi
-@@ -495,7 +495,7 @@ mecho() {
+@@ -511,7 +511,7 @@ mecho() {
  
  merr() {
  	if [ -t 1 -a -z "$NOHLPRINT" ] ; then
Index: patches/patch-utils_sercmd_sercmd_c
===================================================================
RCS file: patches/patch-utils_sercmd_sercmd_c
diff -N patches/patch-utils_sercmd_sercmd_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-utils_sercmd_sercmd_c	4 Sep 2012 06:48:10 -0000
@@ -0,0 +1,34 @@
+$OpenBSD$
+--- utils/sercmd/sercmd.c.orig	Sun Jul 29 23:49:56 2012
++++ utils/sercmd/sercmd.c	Sun Jul 29 23:51:28 2012
+@@ -471,9 +471,9 @@ int connect_unix_sock(char* name, int type)
+ 	s=-1;
+ 	memset(&ifsun, 0, sizeof (struct sockaddr_un));
+ 	len=strlen(name);
+-	if (len>UNIX_PATH_MAX){
++	if (len>sizeof(ifsun.sun_path)){
+ 		fprintf(stderr, "ERROR: connect_unix_sock: name too long "
+-				"(%d > %d): %s\n", len, UNIX_PATH_MAX, name);
++				"(%d > %ld): %s\n", len, sizeof(ifsun.sun_path), name);
+ 		goto error;
+ 	}
+ 	ifsun.sun_family=AF_UNIX;
+@@ -493,15 +493,15 @@ int connect_unix_sock(char* name, int type)
+ 			if (sock_dir==0)
+ 				sock_dir="/tmp";
+ retry:
+-			ret=snprintf(mysun.sun_path, UNIX_PATH_MAX, "%s/" NAME "_%d",
++			ret=snprintf(mysun.sun_path, sizeof(mysun.sun_path), "%s/" NAME "_%d",
+ 							sock_dir, rand()); 
+-			if ((ret<0) ||(ret>=UNIX_PATH_MAX)){
++			if ((ret<0) ||(ret>=sizeof(mysun.sun_path))){
+ 				fprintf(stderr, "ERROR: buffer overflow while trying to"
+ 							"generate unix datagram socket name");
+ 				goto error;
+ 			}
+ 		}else{
+-			if (strlen(reply_socket)>UNIX_PATH_MAX){
++			if (strlen(reply_socket)>sizeof(mysun.sun_path)){
+ 				fprintf(stderr, "ERROR: buffer overflow while trying to"
+ 							"use the provided unix datagram socket name (%s)",
+ 							reply_socket);
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/telephony/kamailio/pkg/PLIST-main,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST-main
--- pkg/PLIST-main	22 Apr 2012 21:44:24 -0000	1.2
+++ pkg/PLIST-main	4 Sep 2012 06:48:10 -0000
@@ -17,11 +17,13 @@ lib/kamailio/kamctl/kamctl.unixsock
 lib/kamailio/kamctl/kamdbctl.base
 lib/kamailio/kamctl/kamdbctl.db_berkeley
 lib/kamailio/kamctl/kamdbctl.dbtext
+@lib lib/kamailio/libbinrpc.so.${LIBbinrpc_VERSION}
 @lib lib/kamailio/libkcore.so.${LIBkcore_VERSION}
 @lib lib/kamailio/libkmi.so.${LIBkmi_VERSION}
 @lib lib/kamailio/libser_cds.so.${LIBser_cds_VERSION}
 @lib lib/kamailio/libsrdb1.so.${LIBsrdb1_VERSION}
 @lib lib/kamailio/libsrdb2.so.${LIBsrdb2_VERSION}
+@lib lib/kamailio/libsrutils.so.${LIBsrutils_VERSION}
 @lib lib/kamailio/libtrie.so.${LIBtrie_VERSION}
 lib/kamailio/modules/
 lib/kamailio/modules/async.so
@@ -44,6 +46,7 @@ lib/kamailio/modules/matrix.so
 lib/kamailio/modules/mediaproxy.so
 lib/kamailio/modules/mi_rpc.so
 lib/kamailio/modules/mqueue.so
+lib/kamailio/modules/msrp.so
 lib/kamailio/modules/mtree.so
 lib/kamailio/modules/pdb.so
 lib/kamailio/modules/pipelimit.so
@@ -58,9 +61,11 @@ lib/kamailio/modules/sms.so
 lib/kamailio/modules/textopsx.so
 lib/kamailio/modules/tls.so
 lib/kamailio/modules/tm.so
+lib/kamailio/modules/tmrec.so
 lib/kamailio/modules/topoh.so
 lib/kamailio/modules/utils.so
 lib/kamailio/modules/xhttp.so
+lib/kamailio/modules/xhttp_rpc.so
 lib/kamailio/modules_k/
 lib/kamailio/modules_k/acc.so
 lib/kamailio/modules_k/alias_db.so
@@ -70,6 +75,7 @@ lib/kamailio/modules_k/benchmark.so
 lib/kamailio/modules_k/call_control.so
 lib/kamailio/modules_k/cfgutils.so
 lib/kamailio/modules_k/cpl-c.so
+lib/kamailio/modules_k/db_cluster.so
 lib/kamailio/modules_k/db_text.so
 lib/kamailio/modules_k/dialog.so
 lib/kamailio/modules_k/dispatcher.so
@@ -97,6 +103,7 @@ lib/kamailio/modules_k/pike.so
 lib/kamailio/modules_k/presence.so
 lib/kamailio/modules_k/presence_dialoginfo.so
 lib/kamailio/modules_k/presence_mwi.so
+lib/kamailio/modules_k/presence_profile.so
 lib/kamailio/modules_k/presence_xml.so
 lib/kamailio/modules_k/pua.so
 lib/kamailio/modules_k/pua_bla.so
@@ -198,6 +205,7 @@ share/doc/kamailio/modules/README.matrix
 share/doc/kamailio/modules/README.mediaproxy
 share/doc/kamailio/modules/README.mi_rpc
 share/doc/kamailio/modules/README.mqueue
+share/doc/kamailio/modules/README.msrp
 share/doc/kamailio/modules/README.mtree
 share/doc/kamailio/modules/README.pdb
 share/doc/kamailio/modules/README.pipelimit
@@ -212,9 +220,11 @@ share/doc/kamailio/modules/README.sms
 share/doc/kamailio/modules/README.textopsx
 share/doc/kamailio/modules/README.tls
 share/doc/kamailio/modules/README.tm
+share/doc/kamailio/modules/README.tmrec
 share/doc/kamailio/modules/README.topoh
 share/doc/kamailio/modules/README.utils
 share/doc/kamailio/modules/README.xhttp
+share/doc/kamailio/modules/README.xhttp_rpc
 share/doc/kamailio/modules_k/
 share/doc/kamailio/modules_k/README.acc
 share/doc/kamailio/modules_k/README.alias_db
@@ -224,6 +234,7 @@ share/doc/kamailio/modules_k/README.benc
 share/doc/kamailio/modules_k/README.call_control
 share/doc/kamailio/modules_k/README.cfgutils
 share/doc/kamailio/modules_k/README.cpl-c
+share/doc/kamailio/modules_k/README.db_cluster
 share/doc/kamailio/modules_k/README.db_text
 share/doc/kamailio/modules_k/README.dialog
 share/doc/kamailio/modules_k/README.dispatcher
@@ -251,6 +262,7 @@ share/doc/kamailio/modules_k/README.pike
 share/doc/kamailio/modules_k/README.presence
 share/doc/kamailio/modules_k/README.presence_dialoginfo
 share/doc/kamailio/modules_k/README.presence_mwi
+share/doc/kamailio/modules_k/README.presence_profile
 share/doc/kamailio/modules_k/README.presence_xml
 share/doc/kamailio/modules_k/README.pua
 share/doc/kamailio/modules_k/README.pua_bla
@@ -344,6 +356,7 @@ share/kamailio/db_berkeley/kamailio/dial
 share/kamailio/db_berkeley/kamailio/dialplan
 share/kamailio/db_berkeley/kamailio/dispatcher
 share/kamailio/db_berkeley/kamailio/domain
+share/kamailio/db_berkeley/kamailio/domain_attrs
 share/kamailio/db_berkeley/kamailio/domain_name
 share/kamailio/db_berkeley/kamailio/domainpolicy
 share/kamailio/db_berkeley/kamailio/dr_gateways
@@ -399,6 +412,7 @@ share/kamailio/dbtext/kamailio/dialog_va
 share/kamailio/dbtext/kamailio/dialplan
 share/kamailio/dbtext/kamailio/dispatcher
 share/kamailio/dbtext/kamailio/domain
+share/kamailio/dbtext/kamailio/domain_attrs
 share/kamailio/dbtext/kamailio/domain_name
 share/kamailio/dbtext/kamailio/domainpolicy
 share/kamailio/dbtext/kamailio/dr_gateways
