aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-11 03:27:05 +0000
committermattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-11 03:27:05 +0000
commitaea8e14fbd9e51adf67e8a890f7b9d931d41cefc (patch)
tree4bb546617ca53811c7ccdd29c3bfccab2bf9775b
parent7354663d87118634f9dcb759d0d576191cabe577 (diff)
Merged revisions 115600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r115600 | mattf | 2008-05-10 22:23:05 -0500 (Sat, 10 May 2008) | 1 line Add Zap MTP2 support to chan_zap ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@115601 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_zap.c8
-rwxr-xr-xconfigure86
-rw-r--r--configure.ac5
-rw-r--r--include/asterisk/autoconfig.h.in6
4 files changed, 99 insertions, 6 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index ece96b70d..6b5e177f1 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -9308,7 +9308,7 @@ static void *ss7_linkset(void *data)
for (i = 0; i < linkset->numsigchans; i++) {
pollers[i].fd = linkset->fds[i];
- pollers[i].events = POLLIN | POLLOUT | POLLPRI;
+ pollers[i].events = ss7_pollflags(ss7, linkset->fds[i]);
pollers[i].revents = 0;
}
@@ -12826,7 +12826,11 @@ static int linkset_addsigchan(int sigchan)
ast_log(LOG_ERROR, "Unable to get parameters for sigchan %d (%s)\n", sigchan, strerror(errno));
return -1;
}
- if ((p.sigtype != ZT_SIG_HDLCFCS) && (p.sigtype != ZT_SIG_HARDHDLC)) {
+ if ((p.sigtype != ZT_SIG_HDLCFCS) && (p.sigtype != ZT_SIG_HARDHDLC)
+#if defined(HAVE_ZAPTEL_SIG_MTP2)
+ && (p.sigtype != ZT_SIG_MTP2)
+#endif
+ ) {
zt_close(link->fds[curfd]);
link->fds[curfd] = -1;
ast_log(LOG_ERROR, "sigchan %d is not in HDLC/FCS mode. See /etc/zaptel.conf\n", sigchan);
diff --git a/configure b/configure
index 714e6bd01..d72fa3863 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 115343 .
+# From configure.ac Revision: 115581 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.6.
#
@@ -970,6 +970,7 @@ PBX_ZAPTEL_ECHOCANPARAMS
PBX_ZAPTEL_TRANSCODE
PBX_ZAPTEL_HWGAIN
PBX_ZAPTEL_NEONMWI
+PBX_ZAPTEL_SIG_MTP2
EDITLINE_LIB
PBX_H323
PBX_IXJUSER
@@ -38788,7 +38789,7 @@ if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
pbxlibdir="-L${SS7_DIR}"
fi
fi
- pbxfuncname="isup_set_generic_name"
+ pbxfuncname="ss7_pollflags"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_SS7_FOUND=yes
else
@@ -46748,6 +46749,84 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+# Check for ZT_SIG_MTP2
+
+ if test "x${PBX_ZAPTEL_SIG_MTP2}" != "x1"; then
+ { echo "$as_me:$LINENO: checking for ZT_SIG_MTP2 in zaptel/zaptel.h" >&5
+echo $ECHO_N "checking for ZT_SIG_MTP2 in zaptel/zaptel.h... $ECHO_C" >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${ZAPTEL_SIG_MTP2_DIR}" != "x"; then
+ ZAPTEL_SIG_MTP2_INCLUDE="-I${ZAPTEL_SIG_MTP2_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${ZAPTEL_SIG_MTP2_INCLUDE}"
+
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <zaptel/zaptel.h>
+int
+main ()
+{
+#if defined(ZT_SIG_MTP2)
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ PBX_ZAPTEL_SIG_MTP2=1
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_SIG_MTP2 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ZAPTEL_SIG_MTP2_VERSION
+_ACEOF
+
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
+
+
# On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
case "${host_os}" in
freebsd*)
@@ -51137,6 +51216,7 @@ PBX_ZAPTEL_ECHOCANPARAMS!$PBX_ZAPTEL_ECHOCANPARAMS$ac_delim
PBX_ZAPTEL_TRANSCODE!$PBX_ZAPTEL_TRANSCODE$ac_delim
PBX_ZAPTEL_HWGAIN!$PBX_ZAPTEL_HWGAIN$ac_delim
PBX_ZAPTEL_NEONMWI!$PBX_ZAPTEL_NEONMWI$ac_delim
+PBX_ZAPTEL_SIG_MTP2!$PBX_ZAPTEL_SIG_MTP2$ac_delim
EDITLINE_LIB!$EDITLINE_LIB$ac_delim
PBX_H323!$PBX_H323$ac_delim
PBX_IXJUSER!$PBX_IXJUSER$ac_delim
@@ -51147,7 +51227,7 @@ CURL_CONFIG!$CURL_CONFIG$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 69; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index 069124c6a..63f037680 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1289,7 +1289,7 @@ AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
AST_EXT_LIB_CHECK([PRI], [pri], [pri_new_bri], [libpri.h])
-AST_EXT_LIB_CHECK([SS7], [ss7], [isup_set_generic_name], [libss7.h])
+AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_pollflags], [libss7.h])
if test "${USE_PWLIB}" != "no"; then
if test -n "${PWLIB_DIR}"; then
@@ -1484,6 +1484,9 @@ AST_C_DEFINE_CHECK([ZAPTEL_NEONMWI], [ZT_EVENT_NEONMWI_ACTIVE], [zaptel/zaptel.h
# Check for channel alarm support
AST_C_COMPILE_CHECK([ZAPTEL_CHANALARMS], [size_t foo = sizeof(struct zt_params_v1)], [zaptel/zaptel.h])
+# Check for ZT_SIG_MTP2
+AST_C_DEFINE_CHECK([ZAPTEL_SIG_MTP2], [ZT_SIG_MTP2], [zaptel/zaptel.h])
+
# On FreeBSD, try old zaptel (0.80 or so) and pretend we have vldtmf
case "${host_os}" in
freebsd*)
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 4887ed5e7..b368c8d28 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -1059,6 +1059,12 @@
/* Define ZAPTEL_NEONMWI headers version */
#undef HAVE_ZAPTEL_NEONMWI_VERSION
+/* Define if your system has the ZAPTEL_SIG_MTP2 headers. */
+#undef HAVE_ZAPTEL_SIG_MTP2
+
+/* Define ZAPTEL_SIG_MTP2 headers version */
+#undef HAVE_ZAPTEL_SIG_MTP2_VERSION
+
/* Define if your system has the ZAPTEL_TRANSCODE headers. */
#undef HAVE_ZAPTEL_TRANSCODE