Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2016 10:47:20 +0000 (UTC)
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r427103 - in head/net/asterisk13: . files
Message-ID:  <201611251047.uAPAlKOP069704@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: madpilot
Date: Fri Nov 25 10:47:20 2016
New Revision: 427103
URL: https://svnweb.freebsd.org/changeset/ports/427103

Log:
  - Update asterisk13 to 13.13.0
  - Make user provided makeopts work again [1]
  
  PR:		214810 [1]
  Submitted by:	yani@pi-greece.eu

Added:
  head/net/asterisk13/files/patch-main_udptl.c   (contents, props changed)
Modified:
  head/net/asterisk13/Makefile
  head/net/asterisk13/distinfo
  head/net/asterisk13/files/patch-res_res__rtp__asterisk.c

Modified: head/net/asterisk13/Makefile
==============================================================================
--- head/net/asterisk13/Makefile	Fri Nov 25 10:46:41 2016	(r427102)
+++ head/net/asterisk13/Makefile	Fri Nov 25 10:47:20 2016	(r427103)
@@ -1,7 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	asterisk
-PORTVERSION=	13.12.2
+PORTVERSION=	13.13.0
 CATEGORIES=	net
 MASTER_SITES=	http://downloads.asterisk.org/pub/telephony/%SUBDIR%/:DEFAULT,g729
 MASTER_SITE_SUBDIR=	asterisk/ \
@@ -250,15 +250,12 @@ post-patch-SYSINFO-on:
 post-patch-SYSINFO-off:
 	@${REINPLACE_CMD} -e '/#define HAVE_SYSINFO 1/d' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e '/%%LIBSYSINFO%%/d' ${WRKSRC}/main/Makefile
-
 .if exists(${FILESDIR}/.asterisk.makeopts)
-USER_MAKEOPTS_FILE=${FILESDIR}/.asterisk.makeopts
-.else
-USER_MAKEOPTS_FILE=
+	${CP} ${USER_MAKEOPTS_FILE} ${WRKSRC}/menuselect.makeopts
 .endif
 
 post-configure:
-	@cd ${WRKSRC} && ${MAKE_CMD} menuselect.makeopts USER_MAKEOPTS="${USER_MAKEOPTS_FILE}"
+	@cd ${WRKSRC} && ${MAKE_CMD} menuselect.makeopts
 	@cd ${WRKSRC} && ./menuselect/menuselect --disable res_timing_kqueue menuselect.makeopts
 	@cd ${WRKSRC} && ./menuselect/menuselect --enable chan_mgcp menuselect.makeopts
 	@cd ${WRKSRC} && ./menuselect/menuselect --enable res_pktccops menuselect.makeopts

Modified: head/net/asterisk13/distinfo
==============================================================================
--- head/net/asterisk13/distinfo	Fri Nov 25 10:46:41 2016	(r427102)
+++ head/net/asterisk13/distinfo	Fri Nov 25 10:47:20 2016	(r427103)
@@ -1,6 +1,6 @@
-TIMESTAMP = 1478858927
-SHA256 (asterisk-13.12.2.tar.gz) = ceb13d09180824cc3925ff7c713ef4b82575710c1fbe72e96844a37c8780b89f
-SIZE (asterisk-13.12.2.tar.gz) = 32701699
+TIMESTAMP = 1479921761
+SHA256 (asterisk-13.13.0.tar.gz) = e35064b5d4c5c766661b34794f4e5fdf15ad683c3121b35e03c9e9f2a3fa9738
+SIZE (asterisk-13.13.0.tar.gz) = 32761401
 SHA256 (asterisk-core-sounds-en-g729-1.5.tar.gz) = 8b28a59cfa53b59c76e0a191704f0708e3d83acffab8c5e6f25dfc599f0123f9
 SIZE (asterisk-core-sounds-en-g729-1.5.tar.gz) = 1551123
 SHA256 (asterisk-moh-opsound-g729-2.03.tar.gz) = 0147ca9a97f0c550227aacb7793499057c4d2c64e021c95f93722f27d5549585

Added: head/net/asterisk13/files/patch-main_udptl.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/asterisk13/files/patch-main_udptl.c	Fri Nov 25 10:47:20 2016	(r427103)
@@ -0,0 +1,65 @@
+--- main/udptl.c.orig	2016-11-23 15:26:01 UTC
++++ main/udptl.c
+@@ -1016,6 +1016,9 @@ struct ast_udptl *ast_udptl_new_with_bin
+ 	int i;
+ 	long int flags;
+ 	RAII_VAR(struct udptl_config *, cfg, ao2_global_obj_ref(globals), ao2_cleanup);
++#if defined(__FreeBSD__)
++	int portretryipv4 = 1;
++#endif
+ 
+ 	if (!cfg || !cfg->general) {
+ 		ast_log(LOG_ERROR, "Could not access global udptl options!\n");
+@@ -1039,8 +1042,18 @@ struct ast_udptl *ast_udptl_new_with_bin
+ 		udptl->tx[i].buf_len = -1;
+ 	}
+ 
+-	if ((udptl->fd = socket(ast_sockaddr_is_ipv6(addr) ?
+-					AF_INET6 : AF_INET, SOCK_DGRAM, 0)) < 0) {
++#if defined(__FreeBSD__)
++	udptl->fd = socket(AF_INET6, SOCK_DGRAM, 0);
++	if (udptl->fd < 0) {
++		ast_sockaddr_parse(addr, "0.0.0.0", 0);
++		udptl->fd = socket(AF_INET, SOCK_DGRAM, 0);
++		portretryipv4 = 0;
++	}
++#else
++	udptl->fd = socket(ast_sockaddr_is_ipv6(addr) ?
++			AF_INET6 : AF_INET, SOCK_DGRAM, 0);
++#endif
++	if (udptl->fd < 0) {
+ 		ast_free(udptl);
+ 		ast_log(LOG_WARNING, "Unable to allocate socket: %s\n", strerror(errno));
+ 		return NULL;
+@@ -1079,8 +1092,30 @@ struct ast_udptl *ast_udptl_new_with_bin
+ 		if (x > cfg->general->end)
+ 			x = cfg->general->start;
+ 		if (x == startplace) {
++#if defined(__FreeBSD__)
++			/* Try again with IPv4 if not IPv6 port could be found */
++			if (portretryipv4 == 1) {
++				close(udptl->fd);
++				ast_sockaddr_parse(addr, "0.0.0.0", 0);
++				udptl->fd = socket(AF_INET, SOCK_DGRAM, 0);
++				if (udptl->fd >= 0) {
++					flags = fcntl(udptl->fd, F_GETFL);
++					fcntl(udptl->fd, F_SETFL, flags | O_NONBLOCK);
++					/* Reset the RTP port search parameters */
++					x = (cfg->general->start == cfg->general->end) ? cfg->general->start : (ast_random() % (cfg->general->end - cfg->general->start)) + cfg->general->start;
++					if (cfg->general->use_even_ports && (x & 1)) {
++						++x;
++					}
++					startplace = x;
++					portretryipv4 = 0;
++					continue;
++				}
++			}
++#endif
+ 			ast_log(LOG_WARNING, "No UDPTL ports remaining\n");
+-			close(udptl->fd);
++			if (udptl->fd >= 0) {
++				close(udptl->fd);
++			}
+ 			ast_free(udptl);
+ 			return NULL;
+ 		}

Modified: head/net/asterisk13/files/patch-res_res__rtp__asterisk.c
==============================================================================
--- head/net/asterisk13/files/patch-res_res__rtp__asterisk.c	Fri Nov 25 10:46:41 2016	(r427102)
+++ head/net/asterisk13/files/patch-res_res__rtp__asterisk.c	Fri Nov 25 10:47:20 2016	(r427103)
@@ -1,15 +1,65 @@
-$OpenBSD: patch-res_res_rtp_asterisk_c,v 1.1 2016/07/30 21:12:15 sthen Exp $
-
-Obtained from OpenBSD cvs
-
---- res/res_rtp_asterisk.c.orig	2016-07-21 14:54:02 UTC
+--- res/res_rtp_asterisk.c.orig	2016-11-23 15:26:01 UTC
 +++ res/res_rtp_asterisk.c
-@@ -1357,7 +1357,7 @@ static int ast_rtp_dtls_set_configuratio
- 		return 0;
+@@ -2638,6 +2638,9 @@ static int ast_rtp_new(struct ast_rtp_in
+ {
+ 	struct ast_rtp *rtp = NULL;
+ 	int x, startplace;
++#if defined(__FreeBSD__)
++	int portretryipv4 = 1;
++#endif
+ 
+ 	/* Create a new RTP structure to hold all of our data */
+ 	if (!(rtp = ast_calloc(1, sizeof(*rtp)))) {
+@@ -2658,10 +2661,20 @@ static int ast_rtp_new(struct ast_rtp_in
  	}
  
--#if OPENSSL_VERSION_NUMBER < 0x10002000L
-+#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
- 	rtp->ssl_ctx = SSL_CTX_new(DTLSv1_method());
- #else
- 	rtp->ssl_ctx = SSL_CTX_new(DTLS_method());
+ 	/* Create a new socket for us to listen on and use */
+-	if ((rtp->s =
+-	     create_new_socket("RTP",
+-			       ast_sockaddr_is_ipv4(addr) ? AF_INET  :
+-			       ast_sockaddr_is_ipv6(addr) ? AF_INET6 : -1)) < 0) {
++#if defined(__FreeBSD__)
++	rtp->s = create_new_socket("RTP", AF_INET6);
++	if (rtp->s < 0) {
++		/* create correct addr structure for AF_INET */
++		ast_sockaddr_parse(addr, "0.0.0.0", 0);
++		rtp->s = create_new_socket("RTP", AF_INET);
++		portretryipv4 = 0;
++	}
++#else
++	rtp->s = create_new_socket("RTP",
++			ast_sockaddr_is_ipv4(addr) ? AF_INET  :
++			ast_sockaddr_is_ipv6(addr) ? AF_INET6 : -1);
++#endif
++	if (rtp->s < 0) {
+ 		ast_log(LOG_WARNING, "Failed to create a new socket for RTP instance '%p'\n", instance);
+ 		ast_free(rtp);
+ 		return -1;
+@@ -2688,8 +2701,26 @@ static int ast_rtp_new(struct ast_rtp_in
+ 
+ 		/* See if we ran out of ports or if the bind actually failed because of something other than the address being in use */
+ 		if (x == startplace || (errno != EADDRINUSE && errno != EACCES)) {
++#if defined(__FreeBSD__)
++			/* Try again with IPv4 if not IPv6 port could be found */
++			if (portretryipv4 == 1) {
++				close(rtp->s);
++				ast_sockaddr_parse(addr, "0.0.0.0", 0);
++		                rtp->s = create_new_socket("RTP", AF_INET);
++				if (rtp->s >= 0) {
++					/* Reset the RTP port search parameters */
++					x = (rtpend == rtpstart) ? rtpstart : (ast_random() % (rtpend - rtpstart)) + rtpstart;
++					x = x & ~1;
++					startplace = x;
++					portretryipv4 = 0;
++					continue;
++				}
++			}
++#endif
+ 			ast_log(LOG_ERROR, "Oh dear... we couldn't allocate a port for RTP instance '%p'\n", instance);
+-			close(rtp->s);
++			if (rtp->s >= 0) {
++				close(rtp->s);
++			}
+ 			ast_free(rtp);
+ 			return -1;
+ 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611251047.uAPAlKOP069704>