Merge branch 'master' into v1.6
This commit is contained in:
commit
5d97d0892c
19
configure.ac
19
configure.ac
|
@ -377,6 +377,16 @@ if test "$ax_cv_c_compiler_vendor" = "gnu"; then
|
|||
[ac_cv_gcc_supports_w_no_unused_result=no])])
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
AC_MSG_RESULT($ac_cv_gcc_supports_w_no_unused_result)
|
||||
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
AC_CACHE_CHECK([whether compiler supports -Wno-misleading-indentation],
|
||||
[ac_cv_gcc_supports_w_no_misleading_indentation], [
|
||||
CFLAGS="$CFLAGS -Wno-misleading-indentation -Wno-error=misleading-indentation"
|
||||
AC_TRY_COMPILE([],[return 0;],
|
||||
[ac_cv_gcc_supports_w_no_misleading_indentation=yes],
|
||||
[ac_cv_gcc_supports_w_no_misleading_indentation=no])])
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
AC_MSG_RESULT($ac_cv_gcc_supports_w_no_misleading_indentation)
|
||||
fi
|
||||
|
||||
# tweak compiler specific flags
|
||||
|
@ -413,6 +423,9 @@ elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
|
|||
APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
|
||||
APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-unused-result)
|
||||
fi
|
||||
if test "$ac_cv_gcc_supports_w_no_misleading_indentation" = yes; then
|
||||
APR_ADDTO(SWITCH_AM_CFLAGS, -Wno-misleading-indentation)
|
||||
fi
|
||||
if test "${enable_64}" = "yes"; then
|
||||
case "$host" in
|
||||
*darwin*)
|
||||
|
@ -806,7 +819,7 @@ if test "x$have_libz" = "xyes" ; then
|
|||
APR_ADDTO([PLATFORM_CORE_LIBS], [-lz])
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.20.1],[
|
||||
PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
|
||||
AM_CONDITIONAL([HAVE_MPG123],[true])],[
|
||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
|
||||
|
||||
|
@ -1287,7 +1300,7 @@ PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[
|
|||
AM_CONDITIONAL([HAVE_SNDFILE],[true])],[
|
||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])])
|
||||
|
||||
PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.20.1],[
|
||||
PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.16.0],[
|
||||
AM_CONDITIONAL([HAVE_MPG123],[true])],[
|
||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MPG123],[false])])
|
||||
|
||||
|
@ -1366,7 +1379,7 @@ PKG_CHECK_MODULES([OPUS], [opus >= 1.1],[
|
|||
AM_CONDITIONAL([HAVE_OPUS],[true])],[
|
||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_OPUS],[false])])
|
||||
|
||||
PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.1],[
|
||||
PKG_CHECK_MODULES([SOUNDTOUCH], [soundtouch >= 1.7.0],[
|
||||
AM_CONDITIONAL([HAVE_SOUNDTOUCH],[true])],[
|
||||
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SOUNDTOUCH],[false])])
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
/freeswitch-autotools.install
|
||||
/freeswitch-mod-*.install
|
||||
/freeswitch-conf-*.install
|
||||
/freeswitch-init.provided_by
|
||||
/freeswitch-lang-*.install
|
||||
/freeswitch-music-*.install
|
||||
/freeswitch-sounds-*.install
|
||||
|
|
|
@ -373,7 +373,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version})
|
|||
Recommends:
|
||||
freeswitch-doc (= \${binary:Version}),
|
||||
freeswitch-mod-commands (= \${binary:Version}),
|
||||
freeswitch-init (= \${binary:Version}),
|
||||
freeswitch-init,
|
||||
freeswitch-lang (= \${binary:Version}),
|
||||
freeswitch-timezones (= \${binary:Version}),
|
||||
freeswitch-music,
|
||||
|
@ -407,7 +407,7 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
|||
freeswitch-mod-console (= \${binary:Version}),
|
||||
freeswitch-mod-say-en (= \${binary:Version})
|
||||
Recommends:
|
||||
freeswitch-init (= \${binary:Version}),
|
||||
freeswitch-init,
|
||||
freeswitch-lang (= \${binary:Version}),
|
||||
freeswitch-timezones (= \${binary:Version}),
|
||||
freeswitch-meta-codecs (= \${binary:Version}),
|
||||
|
@ -429,6 +429,7 @@ Description: Cross-Platform Scalable Multi-Protocol Soft Switch
|
|||
Package: freeswitch-meta-vanilla
|
||||
Architecture: any
|
||||
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
||||
freeswitch-init,
|
||||
freeswitch-mod-console (= \${binary:Version}),
|
||||
freeswitch-mod-logfile (= \${binary:Version}),
|
||||
freeswitch-mod-enum (= \${binary:Version}),
|
||||
|
@ -462,7 +463,6 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
|||
freeswitch-mod-lua (= \${binary:Version}),
|
||||
freeswitch-mod-say-en (= \${binary:Version}),
|
||||
Recommends:
|
||||
freeswitch-init (= \${binary:Version}),
|
||||
freeswitch-lang (= \${binary:Version}),
|
||||
freeswitch-timezones (= \${binary:Version}),
|
||||
freeswitch-music,
|
||||
|
@ -478,7 +478,7 @@ Package: freeswitch-meta-sorbet
|
|||
Architecture: any
|
||||
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
||||
Recommends:
|
||||
freeswitch-init (= \${binary:Version}),
|
||||
freeswitch-init,
|
||||
freeswitch-lang (= \${binary:Version}),
|
||||
freeswitch-timezones (= \${binary:Version}),
|
||||
freeswitch-meta-codecs (= \${binary:Version}),
|
||||
|
@ -510,7 +510,6 @@ Recommends:
|
|||
freeswitch-mod-lcr (= \${binary:Version}),
|
||||
freeswitch-mod-nibblebill (= \${binary:Version}),
|
||||
freeswitch-mod-oreka (= \${binary:Version}),
|
||||
freeswitch-mod-random (= \${binary:Version}),
|
||||
freeswitch-mod-redis (= \${binary:Version}),
|
||||
freeswitch-mod-rss (= \${binary:Version}),
|
||||
freeswitch-mod-sms (= \${binary:Version}),
|
||||
|
@ -529,7 +528,6 @@ Recommends:
|
|||
freeswitch-mod-pocketsphinx (= \${binary:Version}),
|
||||
freeswitch-mod-tts-commandline (= \${binary:Version}),
|
||||
freeswitch-mod-dialplan-xml (= \${binary:Version}),
|
||||
freeswitch-mod-html5 (= \${binary:Version}),
|
||||
freeswitch-mod-loopback (= \${binary:Version}),
|
||||
freeswitch-mod-rtmp (= \${binary:Version}),
|
||||
freeswitch-mod-skinny (= \${binary:Version}),
|
||||
|
@ -561,8 +559,7 @@ Description: Cross-Platform Scalable Multi-Protocol Soft Switch
|
|||
Package: freeswitch-meta-all
|
||||
Architecture: any
|
||||
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
||||
Recommends:
|
||||
freeswitch-init (= \${binary:Version}),
|
||||
freeswitch-init,
|
||||
freeswitch-lang (= \${binary:Version}),
|
||||
freeswitch-timezones (= \${binary:Version}),
|
||||
freeswitch-meta-codecs (= \${binary:Version}),
|
||||
|
@ -594,17 +591,14 @@ Recommends:
|
|||
freeswitch-mod-hash (= \${binary:Version}),
|
||||
freeswitch-mod-httapi (= \${binary:Version}),
|
||||
freeswitch-mod-http-cache (= \${binary:Version}),
|
||||
freeswitch-mod-ladspa (= \${binary:Version}),
|
||||
freeswitch-mod-lcr (= \${binary:Version}),
|
||||
freeswitch-mod-memcache (= \${binary:Version}),
|
||||
freeswitch-mod-nibblebill (= \${binary:Version}),
|
||||
freeswitch-mod-oreka (= \${binary:Version}),
|
||||
freeswitch-mod-random (= \${binary:Version}),
|
||||
freeswitch-mod-redis (= \${binary:Version}),
|
||||
freeswitch-mod-rss (= \${binary:Version}),
|
||||
freeswitch-mod-sms (= \${binary:Version}),
|
||||
freeswitch-mod-snapshot (= \${binary:Version}),
|
||||
freeswitch-mod-snipe-hunt (= \${binary:Version}),
|
||||
freeswitch-mod-snom (= \${binary:Version}),
|
||||
freeswitch-mod-sonar (= \${binary:Version}),
|
||||
freeswitch-mod-soundtouch (= \${binary:Version}),
|
||||
|
@ -613,7 +607,6 @@ Recommends:
|
|||
freeswitch-mod-stress (= \${binary:Version}),
|
||||
freeswitch-mod-translate (= \${binary:Version}),
|
||||
freeswitch-mod-valet-parking (= \${binary:Version}),
|
||||
freeswitch-mod-vmd (= \${binary:Version}),
|
||||
freeswitch-mod-voicemail (= \${binary:Version}),
|
||||
freeswitch-mod-voicemail-ivr (= \${binary:Version}),
|
||||
freeswitch-mod-flite (= \${binary:Version}),
|
||||
|
@ -624,9 +617,7 @@ Recommends:
|
|||
freeswitch-mod-dialplan-directory (= \${binary:Version}),
|
||||
freeswitch-mod-dialplan-xml (= \${binary:Version}),
|
||||
freeswitch-mod-ldap (= \${binary:Version}),
|
||||
freeswitch-mod-alsa (= \${binary:Version}),
|
||||
freeswitch-mod-dingaling (= \${binary:Version}),
|
||||
freeswitch-mod-html5 (= \${binary:Version}),
|
||||
freeswitch-mod-loopback (= \${binary:Version}),
|
||||
freeswitch-mod-portaudio (= \${binary:Version}),
|
||||
freeswitch-mod-rtmp (= \${binary:Version}),
|
||||
|
@ -635,16 +626,12 @@ Recommends:
|
|||
freeswitch-mod-sofia (= \${binary:Version}),
|
||||
freeswitch-mod-cdr-csv (= \${binary:Version}),
|
||||
freeswitch-mod-cdr-mongodb (= \${binary:Version}),
|
||||
freeswitch-mod-cdr-pg-csv (= \${binary:Version}),
|
||||
freeswitch-mod-cdr-sqlite (= \${binary:Version}),
|
||||
freeswitch-mod-erlang-event (= \${binary:Version}),
|
||||
freeswitch-mod-event-multicast (= \${binary:Version}),
|
||||
freeswitch-mod-event-socket (= \${binary:Version}),
|
||||
freeswitch-mod-event-test (= \${binary:Version}),
|
||||
freeswitch-mod-event-zmq (= \${binary:Version}),
|
||||
freeswitch-mod-json-cdr (= \${binary:Version}),
|
||||
freeswitch-mod-kazoo (= \${binary:Version}),
|
||||
freeswitch-mod-radius-cdr (= \${binary:Version}),
|
||||
freeswitch-mod-snmp (= \${binary:Version}),
|
||||
freeswitch-mod-local-stream (= \${binary:Version}),
|
||||
freeswitch-mod-native-file (= \${binary:Version}),
|
||||
|
@ -666,7 +653,9 @@ Recommends:
|
|||
freeswitch-mod-xml-curl (= \${binary:Version}),
|
||||
freeswitch-mod-xml-rpc (= \${binary:Version}),
|
||||
freeswitch-mod-xml-scgi (= \${binary:Version}),
|
||||
Recommends:
|
||||
Suggests:
|
||||
freeswitch-mod-vmd (= \${binary:Version}),
|
||||
freeswitch-mod-vlc (= \${binary:Version}),
|
||||
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
|
||||
$(debian_wrap "${fs_description}")
|
||||
|
@ -692,7 +681,6 @@ Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
|
|||
freeswitch-mod-silk (= \${binary:Version}),
|
||||
freeswitch-mod-spandsp (= \${binary:Version}),
|
||||
freeswitch-mod-theora (= \${binary:Version}),
|
||||
freeswitch-mod-vp8 (= \${binary:Version})
|
||||
Suggests:
|
||||
freeswitch-mod-ilbc (= \${binary:Version}),
|
||||
freeswitch-mod-siren (= \${binary:Version})
|
||||
|
|
|
@ -525,16 +525,16 @@ Module: event_handlers/mod_format_cdr
|
|||
Description: mod_format_cdr
|
||||
Adds mod_format_cdr.
|
||||
|
||||
Module: event_handlers/mod_json_cdr
|
||||
Description: mod_json_cdr
|
||||
Adds mod_json_cdr.
|
||||
|
||||
Module: event_handlers/mod_kazoo
|
||||
Description: mod_kazoo
|
||||
Adds mod_kazoo.
|
||||
Build-Depends: erlang-dev
|
||||
Depends: erlang
|
||||
|
||||
Module: event_handlers/mod_json_cdr
|
||||
Description: mod_json_cdr
|
||||
Adds mod_json_cdr.
|
||||
|
||||
Module: event_handlers/mod_odbc_cdr
|
||||
Description: mod_odbc_cdr
|
||||
Adds mod_odbc_cdr.
|
||||
|
@ -548,6 +548,10 @@ Description: mod_rayo
|
|||
Adds mod_rayo.
|
||||
Depends: freeswitch-mod-ssml (= ${binary:Version})
|
||||
|
||||
Module: event_handlers/mod_smpp
|
||||
Description: mod_snmp
|
||||
Adds mod_snmp.
|
||||
|
||||
Module: event_handlers/mod_snmp
|
||||
Description: mod_snmp
|
||||
Adds mod_snmp.
|
||||
|
|
|
@ -260,7 +260,6 @@ get_sources () {
|
|||
prefix=`echo $distro | awk -F/ '{print $1}'`
|
||||
suffix="`echo $distro | awk -F/ '{print $2}'`"
|
||||
if test -n "$suffix" ; then full="$tgt_distro/$suffix" ; else full="$tgt_distro" ; fi
|
||||
if [ "$distro" == "trusty" -a "$components" == "main" ] ; then components="main universe"; fi
|
||||
printf "$type $path $full $components\n"
|
||||
done < "$2"
|
||||
}
|
||||
|
@ -293,7 +292,9 @@ build_debs () {
|
|||
if [ "$custom_sources_file" == "/etc/apt/sources.list" ]; then
|
||||
# If you are using the system sources, then it is reasonable that you expect to use all of the supplementary repos too
|
||||
cat /etc/apt/sources.list > /tmp/fs.sources.list
|
||||
for X in /etc/apt/sources.list.d/*; do cat $X >> /tmp/fs.sources.list; done
|
||||
if [ "$(ls -A /etc/apt/sources.list.d)" ]; then
|
||||
for X in /etc/apt/sources.list.d/*; do cat $X >> /tmp/fs.sources.list; done
|
||||
fi
|
||||
custom_sources_file="/tmp/fs.sources.list"
|
||||
apt-key exportall > "/tmp/fs.asc"
|
||||
custom_keyring="/tmp/fs.asc"
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
#pragma clang diagnostic ignored "-Wunused-const-variable"
|
||||
#endif
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static const char rcsid[] =
|
||||
"$Id: sha1.c 680 2003-07-25 21:57:38Z asaddi $";
|
||||
#endif /* !lint */
|
||||
|
|
|
@ -166,11 +166,11 @@ static inline int sem_destroy(sem_t * sem)
|
|||
#define sem_wait(sem) (semaphore_wait(*sem) )
|
||||
#define sem_post(sem) semaphore_signal(*sem)
|
||||
#define sem_destroy(sem) semaphore_destroy(mach_task_self(),*sem)
|
||||
#define thread_sleep(nms) /* { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */
|
||||
#define thread_sleep(nms) { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);}
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#define thread_sleep(nms) sched_yield();/* {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */
|
||||
#define thread_sleep(nms) {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);}
|
||||
#endif
|
||||
/* Not Windows. Assume pthreads */
|
||||
|
||||
|
@ -213,7 +213,7 @@ static INLINE void sync_read(pthread_mutex_t *const mutex, int mb_col,
|
|||
const int nsync) {
|
||||
while (mb_col > (protected_read(mutex, last_row_current_mb_col) - nsync)) {
|
||||
x86_pause_hint();
|
||||
thread_sleep(0);
|
||||
thread_sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Mon Apr 18 10:41:03 CEST 2016
|
||||
Wed Apr 27 16:01:46 EDT 2016
|
||||
|
|
|
@ -218,7 +218,7 @@ fi
|
|||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_INLINE_DEFINE
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
|
||||
|
||||
AC_C_VAR_FUNC
|
||||
AC_C_MACRO_FUNCTION
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#include "config.h"
|
||||
|
||||
#ifndef __LITTLE_ENDIAN
|
||||
#define __LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
#ifndef __BIG_ENDIAN
|
||||
#define __BIG_ENDIAN 4321
|
||||
#endif
|
||||
#ifndef __BYTE_ORDER
|
||||
#ifdef SWITCH_BYTE_ORDER
|
||||
#define __BYTE_ORDER SWITCH_BYTE_ORDER
|
||||
#else
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -558,7 +558,7 @@ int tport_capt_msg_hepv2 (tport_t const *self, msg_t *msg, size_t n,
|
|||
hep_time.tv_usec = now.tv_usec;
|
||||
|
||||
hep_time.captid = mr->mr_agent_id;
|
||||
memcpy((void*)*buffer+buflen, &hep_time, sizeof(struct hep_timehdr));
|
||||
memcpy((char*)*buffer+buflen, &hep_time, sizeof(struct hep_timehdr));
|
||||
buflen += sizeof(struct hep_timehdr);
|
||||
}
|
||||
|
||||
|
@ -596,12 +596,12 @@ int tport_capt_msg_hepv3 (tport_t const *self, msg_t *msg, size_t n,
|
|||
struct hep_generic *hg=NULL;
|
||||
unsigned int buflen=0, iplen=0,tlen=0, payload_len = 0;
|
||||
su_time_t now;
|
||||
hep_chunk_ip4_t src_ip4, dst_ip4;
|
||||
hep_chunk_ip4_t src_ip4 = {{0}}, dst_ip4 = {{0}};
|
||||
hep_chunk_t payload_chunk;
|
||||
int orig_n = 0;
|
||||
|
||||
#if SU_HAVE_IN6
|
||||
hep_chunk_ip6_t src_ip6, dst_ip6;
|
||||
hep_chunk_ip6_t src_ip6 = {{0}}, dst_ip6 = {{0}};
|
||||
#endif
|
||||
|
||||
int eth_frame_len = 16000;
|
||||
|
@ -771,26 +771,26 @@ int tport_capt_msg_hepv3 (tport_t const *self, msg_t *msg, size_t n,
|
|||
/* IPv4 */
|
||||
if(su->su_family == AF_INET) {
|
||||
/* SRC IP */
|
||||
memcpy((void*) *buffer+buflen, &src_ip4, sizeof(struct hep_chunk_ip4));
|
||||
memcpy((char*) *buffer+buflen, &src_ip4, sizeof(struct hep_chunk_ip4));
|
||||
buflen += sizeof(struct hep_chunk_ip4);
|
||||
|
||||
memcpy((void*) *buffer+buflen, &dst_ip4, sizeof(struct hep_chunk_ip4));
|
||||
memcpy((char*) *buffer+buflen, &dst_ip4, sizeof(struct hep_chunk_ip4));
|
||||
buflen += sizeof(struct hep_chunk_ip4);
|
||||
}
|
||||
#if SU_HAVE_IN6
|
||||
/* IPv6 */
|
||||
else if(su->su_family == AF_INET6) {
|
||||
/* SRC IPv6 */
|
||||
memcpy((void*) *buffer+buflen, &src_ip4, sizeof(struct hep_chunk_ip6));
|
||||
memcpy((char*) *buffer+buflen, &src_ip6, sizeof(struct hep_chunk_ip6));
|
||||
buflen += sizeof(struct hep_chunk_ip6);
|
||||
|
||||
memcpy((void*) *buffer+buflen, &dst_ip6, sizeof(struct hep_chunk_ip6));
|
||||
memcpy((char*) *buffer+buflen, &dst_ip6, sizeof(struct hep_chunk_ip6));
|
||||
buflen += sizeof(struct hep_chunk_ip6);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* PAYLOAD CHUNK */
|
||||
memcpy((void*) *buffer+buflen, &payload_chunk, sizeof(struct hep_chunk));
|
||||
memcpy((char*) *buffer+buflen, &payload_chunk, sizeof(struct hep_chunk));
|
||||
buflen += sizeof(struct hep_chunk);
|
||||
|
||||
/* PAYLOAD */
|
||||
|
|
|
@ -267,26 +267,15 @@ ssize_t tport_send_stream_ws(tport_t const *self, msg_t *msg,
|
|||
msg_iovec_t iov[],
|
||||
size_t iovlen)
|
||||
{
|
||||
size_t i, j, n, m, size = 0;
|
||||
size_t i, j, m, size = 0;
|
||||
ssize_t nerror;
|
||||
tport_ws_t *wstp = (tport_ws_t *)self;
|
||||
|
||||
enum { WSBUFSIZE = 2048 };
|
||||
wstp->wstp_buflen = 0;
|
||||
|
||||
for (i = 0; i < iovlen; i = j) {
|
||||
char *buf = wstp->wstp_buffer;
|
||||
unsigned wsbufsize = WSBUFSIZE;
|
||||
|
||||
if (i + 1 == iovlen) {
|
||||
buf = NULL; /* Don't bother copying single chunk */
|
||||
}
|
||||
|
||||
if (buf &&
|
||||
(char *)iov[i].siv_base - buf < WSBUFSIZE &&
|
||||
(char *)iov[i].siv_base - buf >= 0) {
|
||||
wsbufsize = buf + WSBUFSIZE - (char *)iov[i].siv_base;
|
||||
assert(wsbufsize <= WSBUFSIZE);
|
||||
}
|
||||
char *buf = NULL;
|
||||
unsigned wsbufsize = sizeof(wstp->wstp_buffer);
|
||||
|
||||
for (j = i, m = 0; buf && j < iovlen; j++) {
|
||||
if (m + iov[j].siv_len > wsbufsize) {
|
||||
|
@ -304,8 +293,20 @@ ssize_t tport_send_stream_ws(tport_t const *self, msg_t *msg,
|
|||
iov[j].siv_base = buf, iov[j].siv_len = m;
|
||||
}
|
||||
|
||||
nerror = ws_feed_buf(&wstp->ws, buf, m);
|
||||
nerror = 0;
|
||||
|
||||
if (m + wstp->wstp_buflen >= wsbufsize) {
|
||||
nerror = -1;
|
||||
errno = ENOMEM;
|
||||
} else {
|
||||
if (memcpy(wstp->wstp_buffer + wstp->wstp_buflen, buf, m)) {
|
||||
wstp->wstp_buflen += m;
|
||||
} else {
|
||||
nerror = -1;
|
||||
errno = ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
SU_DEBUG_9(("tport_ws_writevec: vec %p %p %lu ("MOD_ZD")\n",
|
||||
(void *)&wstp->ws, (void *)iov[i].siv_base, (LU)iov[i].siv_len,
|
||||
nerror));
|
||||
|
@ -317,17 +318,13 @@ ssize_t tport_send_stream_ws(tport_t const *self, msg_t *msg,
|
|||
SU_DEBUG_3(("ws_write: %s\n", strerror(err)));
|
||||
return -1;
|
||||
}
|
||||
|
||||
n = (size_t)nerror;
|
||||
size += n;
|
||||
|
||||
/* Return if the write buffer is full for now */
|
||||
if (n != m)
|
||||
break;
|
||||
}
|
||||
|
||||
ws_send_buf(&wstp->ws, WSOC_TEXT);
|
||||
|
||||
if (wstp->wstp_buflen) {
|
||||
*(wstp->wstp_buffer + wstp->wstp_buflen) = '\0';
|
||||
ws_write_frame(&wstp->ws, WSOC_TEXT, wstp->wstp_buffer, wstp->wstp_buflen);
|
||||
size = wstp->wstp_buflen;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,8 @@ typedef enum {
|
|||
typedef struct tport_ws_s {
|
||||
tport_t wstp_tp[1];
|
||||
wsh_t ws;
|
||||
char *wstp_buffer;
|
||||
char wstp_buffer[65536];
|
||||
size_t wstp_buflen;
|
||||
SU_S8_T ws_initialized;
|
||||
unsigned ws_secure:1;
|
||||
unsigned:0;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <switch.h>
|
||||
#include "ws.h"
|
||||
#include <pthread.h>
|
||||
|
||||
|
@ -146,7 +147,7 @@ static int cheezy_get_var(char *data, char *name, char *buf, size_t buflen)
|
|||
} while((p = (strstr(p,"\n")+1))!=(char *)1);
|
||||
|
||||
|
||||
if (p != (char *)1 && *p!='\0') {
|
||||
if (p && p != (char *)1 && *p!='\0') {
|
||||
char *v, *e = 0;
|
||||
|
||||
v = strchr(p, ':');
|
||||
|
@ -264,7 +265,7 @@ int ws_handshake(wsh_t *wsh)
|
|||
}
|
||||
}
|
||||
|
||||
if (bytes > sizeof(wsh->buffer) -1) {
|
||||
if (bytes > wsh->buflen -1) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@ -362,7 +363,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
|
|||
}
|
||||
}
|
||||
|
||||
} while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 100);
|
||||
} while (r == -1 && err == SSL_ERROR_WANT_READ && wsh->x < 1000);
|
||||
|
||||
goto end;
|
||||
}
|
||||
|
@ -382,9 +383,9 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
|
|||
ms_sleep(10);
|
||||
}
|
||||
}
|
||||
} while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 100);
|
||||
} while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 1000);
|
||||
|
||||
if (wsh->x >= 1000 || (block && wsh->x >= 100)) {
|
||||
if (wsh->x >= 10000 || (block && wsh->x >= 1000)) {
|
||||
r = -1;
|
||||
}
|
||||
|
||||
|
@ -596,7 +597,15 @@ int ws_init(wsh_t *wsh, ws_socket_t sock, SSL_CTX *ssl_ctx, int close_sock, int
|
|||
wsh->close_sock = 1;
|
||||
}
|
||||
|
||||
wsh->buflen = sizeof(wsh->buffer);
|
||||
wsh->buflen = 1024 * 64;
|
||||
wsh->bbuflen = wsh->buflen;
|
||||
|
||||
wsh->buffer = malloc(wsh->buflen);
|
||||
wsh->bbuffer = malloc(wsh->bbuflen);
|
||||
//printf("init %p %ld\n", (void *) wsh->bbuffer, wsh->bbuflen);
|
||||
//memset(wsh->buffer, 0, wsh->buflen);
|
||||
//memset(wsh->bbuffer, 0, wsh->bbuflen);
|
||||
|
||||
wsh->secure = ssl_ctx ? 1 : 0;
|
||||
|
||||
setup_socket(sock);
|
||||
|
@ -644,6 +653,12 @@ void ws_destroy(wsh_t *wsh)
|
|||
SSL_free(wsh->ssl);
|
||||
wsh->ssl = NULL;
|
||||
}
|
||||
|
||||
if (wsh->buffer) free(wsh->buffer);
|
||||
if (wsh->bbuffer) free(wsh->bbuffer);
|
||||
|
||||
wsh->buffer = wsh->bbuffer = NULL;
|
||||
|
||||
}
|
||||
|
||||
ssize_t ws_close(wsh_t *wsh, int16_t reason)
|
||||
|
@ -685,6 +700,20 @@ ssize_t ws_close(wsh_t *wsh, int16_t reason)
|
|||
|
||||
}
|
||||
|
||||
|
||||
uint64_t hton64(uint64_t val)
|
||||
{
|
||||
if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
|
||||
else return __bswap_64(val);
|
||||
}
|
||||
|
||||
uint64_t ntoh64(uint64_t val)
|
||||
{
|
||||
if (__BYTE_ORDER == __BIG_ENDIAN) return (val);
|
||||
else return __bswap_64(val);
|
||||
}
|
||||
|
||||
|
||||
ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
||||
{
|
||||
|
||||
|
@ -692,6 +721,10 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
char *maskp;
|
||||
int ll = 0;
|
||||
int frag = 0;
|
||||
int blen;
|
||||
|
||||
wsh->body = wsh->bbuffer;
|
||||
wsh->packetlen = 0;
|
||||
|
||||
again:
|
||||
need = 2;
|
||||
|
@ -745,12 +778,11 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
int fin = (wsh->buffer[0] >> 7) & 1;
|
||||
int mask = (wsh->buffer[1] >> 7) & 1;
|
||||
|
||||
if (fin) {
|
||||
if (*oc == WSOC_CONTINUATION) {
|
||||
frag = 1;
|
||||
} else {
|
||||
frag = 0;
|
||||
}
|
||||
|
||||
if (!fin && *oc != WSOC_CONTINUATION) {
|
||||
frag = 1;
|
||||
} else if (fin && *oc == WSOC_CONTINUATION) {
|
||||
frag = 0;
|
||||
}
|
||||
|
||||
if (mask) {
|
||||
|
@ -765,23 +797,33 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
|
||||
wsh->plen = wsh->buffer[1] & 0x7f;
|
||||
wsh->payload = &wsh->buffer[2];
|
||||
|
||||
|
||||
if (wsh->plen == 127) {
|
||||
uint64_t *u64;
|
||||
int more = 0;
|
||||
|
||||
need += 8;
|
||||
|
||||
if (need > wsh->datalen) {
|
||||
/* too small - protocol err */
|
||||
*oc = WSOC_CLOSE;
|
||||
return ws_close(wsh, WS_PROTO_ERR);
|
||||
}
|
||||
//*oc = WSOC_CLOSE;
|
||||
//return ws_close(wsh, WS_PROTO_ERR);
|
||||
|
||||
more = ws_raw_read(wsh, wsh->buffer + wsh->datalen, need - wsh->datalen, WS_BLOCK);
|
||||
|
||||
if (more < need - wsh->datalen) {
|
||||
*oc = WSOC_CLOSE;
|
||||
return ws_close(wsh, WS_PROTO_ERR);
|
||||
} else {
|
||||
wsh->datalen += more;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
u64 = (uint64_t *) wsh->payload;
|
||||
wsh->payload += 8;
|
||||
|
||||
wsh->plen = ntohl((u_long)*u64);
|
||||
|
||||
wsh->plen = ntoh64(*u64);
|
||||
} else if (wsh->plen == 126) {
|
||||
uint16_t *u16;
|
||||
|
||||
|
@ -811,16 +853,30 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
return ws_close(wsh, WS_PROTO_ERR);
|
||||
}
|
||||
|
||||
if ((need + wsh->datalen) > (ssize_t)wsh->buflen) {
|
||||
/* too big - Ain't nobody got time fo' dat */
|
||||
*oc = WSOC_CLOSE;
|
||||
return ws_close(wsh, WS_DATA_TOO_BIG);
|
||||
blen = wsh->body - wsh->bbuffer;
|
||||
|
||||
if (need + blen > (ssize_t)wsh->bbuflen) {
|
||||
void *tmp;
|
||||
|
||||
wsh->bbuflen = need + blen + wsh->rplen;
|
||||
|
||||
if ((tmp = realloc(wsh->bbuffer, wsh->bbuflen))) {
|
||||
wsh->bbuffer = tmp;
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
||||
wsh->body = wsh->bbuffer + blen;
|
||||
}
|
||||
|
||||
wsh->rplen = wsh->plen - need;
|
||||
|
||||
|
||||
if (wsh->rplen) {
|
||||
memcpy(wsh->body, wsh->payload, wsh->rplen);
|
||||
}
|
||||
|
||||
while(need) {
|
||||
ssize_t r = ws_raw_read(wsh, wsh->payload + wsh->rplen, need, WS_BLOCK);
|
||||
ssize_t r = ws_raw_read(wsh, wsh->body + wsh->rplen, need, WS_BLOCK);
|
||||
|
||||
if (r < 1) {
|
||||
/* invalid read - protocol err .. */
|
||||
|
@ -837,28 +893,30 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
ssize_t i;
|
||||
|
||||
for (i = 0; i < wsh->datalen; i++) {
|
||||
wsh->payload[i] ^= maskp[i % 4];
|
||||
wsh->body[i] ^= maskp[i % 4];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (*oc == WSOC_PING) {
|
||||
ws_write_frame(wsh, WSOC_PONG, wsh->payload, wsh->rplen);
|
||||
ws_write_frame(wsh, WSOC_PONG, wsh->body, wsh->rplen);
|
||||
goto again;
|
||||
}
|
||||
|
||||
*(wsh->body+wsh->rplen) = '\0';
|
||||
wsh->packetlen += wsh->rplen;
|
||||
wsh->body += wsh->rplen;
|
||||
|
||||
if (frag) {
|
||||
goto again;
|
||||
}
|
||||
|
||||
*data = (uint8_t *)wsh->bbuffer;
|
||||
|
||||
|
||||
*(wsh->payload+wsh->rplen) = '\0';
|
||||
*data = (uint8_t *)wsh->payload;
|
||||
|
||||
//printf("READ[%ld][%d]-----------------------------:\n[%s]\n-------------------------------\n", wsh->rplen, *oc, (char *)*data);
|
||||
//printf("READ[%ld][%d]-----------------------------:\n[%s]\n-------------------------------\n", wsh->packetlen, *oc, (char *)*data);
|
||||
|
||||
|
||||
return wsh->rplen;
|
||||
return wsh->packetlen;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -871,36 +929,6 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
}
|
||||
}
|
||||
|
||||
ssize_t ws_feed_buf(wsh_t *wsh, void *data, size_t bytes)
|
||||
{
|
||||
|
||||
if (bytes + wsh->wdatalen > wsh->buflen) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(wsh->wbuffer + wsh->wdatalen, data, bytes);
|
||||
|
||||
wsh->wdatalen += bytes;
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
ssize_t ws_send_buf(wsh_t *wsh, ws_opcode_t oc)
|
||||
{
|
||||
ssize_t r = 0;
|
||||
|
||||
if (!wsh->wdatalen) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
r = ws_write_frame(wsh, oc, wsh->wbuffer, wsh->wdatalen);
|
||||
|
||||
wsh->wdatalen = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes)
|
||||
{
|
||||
uint8_t hdr[14] = { 0 };
|
||||
|
@ -934,7 +962,7 @@ ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes)
|
|||
hlen += 8;
|
||||
|
||||
u64 = (uint64_t *) &hdr[2];
|
||||
*u64 = htonl(bytes);
|
||||
*u64 = hton64(bytes);
|
||||
}
|
||||
|
||||
if (wsh->write_buffer_len < (hlen + bytes + 1)) {
|
||||
|
|
|
@ -25,6 +25,17 @@
|
|||
//#include "sha1.h"
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
#if defined(_MSC_VER) || defined(__APPLE__) || defined(__FreeBSD__) || (defined(__SVR4) && defined(__sun))
|
||||
#define __bswap_64(x) \
|
||||
x = (x>>56) | \
|
||||
((x<<40) & 0x00FF000000000000) | \
|
||||
((x<<24) & 0x0000FF0000000000) | \
|
||||
((x<<8) & 0x000000FF00000000) | \
|
||||
((x>>8) & 0x00000000FF000000) | \
|
||||
((x>>24) & 0x0000000000FF0000) | \
|
||||
((x>>40) & 0x000000000000FF00) | \
|
||||
(x<<56)
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#ifndef strncasecmp
|
||||
#define strncasecmp _strnicmp
|
||||
|
@ -78,15 +89,17 @@ typedef enum {
|
|||
|
||||
typedef struct wsh_s {
|
||||
ws_socket_t sock;
|
||||
char buffer[65536];
|
||||
char wbuffer[65536];
|
||||
char *buffer;
|
||||
char *bbuffer;
|
||||
char *body;
|
||||
char *uri;
|
||||
size_t buflen;
|
||||
size_t bbuflen;
|
||||
ssize_t datalen;
|
||||
ssize_t wdatalen;
|
||||
char *payload;
|
||||
ssize_t plen;
|
||||
ssize_t rplen;
|
||||
ssize_t packetlen;
|
||||
SSL *ssl;
|
||||
int handshake;
|
||||
uint8_t down;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
|
@ -86,7 +86,7 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
|||
</PreBuildEvent>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;..\..\..\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -123,7 +123,7 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;..\..\..\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_TIMESPEC_DEFINED;_WIN64;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -158,7 +158,7 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
|||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;..\..\..\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_TIMESPEC_DEFINED;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
|
@ -196,7 +196,7 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
|||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\openssl-$(OpenSSLVersion)\include;..\..\..\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_TIMESPEC_DEFINED;_WIN64;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
|
@ -535,4 +535,4 @@ if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#ifndef WIN32 /* currently we support fast acosf computation only on UNIX/Linux */
|
||||
|
||||
|
||||
#include <switch.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -20,8 +23,6 @@
|
|||
#include "avmd_fast_acosf.h"
|
||||
#include "avmd_options.h"
|
||||
|
||||
#ifdef AVMD_FAST_MATH
|
||||
|
||||
|
||||
typedef union {
|
||||
uint32_t i;
|
||||
|
@ -314,7 +315,5 @@ dump_table_summary(void)
|
|||
printf("i [%d] from float [%f]\n", index_from_float(f), f);
|
||||
}
|
||||
|
||||
#endif /* FAST_ACOSF_TESTING */
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* FAST_ACOSF_TESTING */
|
||||
#endif /* WIN32 */
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#ifndef WIN32 /* currently we support fast acosf computation only on UNIX/Linux */
|
||||
/*
|
||||
* @brief Fast arithmetic using precomputed arc cosine table.
|
||||
* @author Eric des Courtis
|
||||
* @par Modifications: Piotr Gregor < piotrek.gregor gmail.com >
|
||||
* Contributor(s):
|
||||
*
|
||||
* Eric des Courtis <eric.des.courtis@benbria.com>
|
||||
* Piotr Gregor <piotrek.gregor gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
|
@ -14,8 +17,6 @@
|
|||
|
||||
/*! \brief Arc cosine table initialization.
|
||||
*
|
||||
* @author Eric des Courtis
|
||||
* @par Modifications: Piotr Gregor < piotrek.gregor gmail.com >
|
||||
* @return 0 on success, negative value otherwise:
|
||||
* -1 can't access arc cos table with error != NOENT,
|
||||
* -2 table creation failed (compute_table)
|
||||
|
@ -26,8 +27,6 @@ extern int init_fast_acosf(void);
|
|||
|
||||
/*! \brief Arc cosine table deinitialization.
|
||||
*
|
||||
* @author Eric des Courtis
|
||||
* @par Modifications: Piotr Gregor < piotrek.gregor gmail.com >
|
||||
* @return 0 on success, negative value otherwise:
|
||||
* -1 munmap failed,
|
||||
* -2 close failed
|
||||
|
@ -36,14 +35,11 @@ extern int destroy_fast_acosf(void);
|
|||
|
||||
/*! \brief Return arc cos for this argument.
|
||||
* @details Uses previously created and mmapped file.
|
||||
* @author Eric des Courtis
|
||||
*/
|
||||
extern float fast_acosf(float x);
|
||||
|
||||
/*! \brief Arc cosine table creation.
|
||||
*
|
||||
* @author Eric des Courtis
|
||||
* @par Modifications: Piotr Gregor < piotrek.gregor gmail.com >
|
||||
* @return 0 on success, negative value otherwise:
|
||||
* -1 fwrite failed,
|
||||
* -2 fclose failed
|
||||
|
@ -51,3 +47,4 @@ extern float fast_acosf(float x);
|
|||
extern int compute_table(void);
|
||||
|
||||
#endif /* __AVMD_FAST_ACOSF_H__ */
|
||||
#endif
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/*
|
||||
* @brief SMA buffer.
|
||||
*
|
||||
* @author Eric des Courtis
|
||||
* @par Modifications: Piotr Gregor < piotrek.gregor gmail.com >
|
||||
* Contributor(s):
|
||||
*
|
||||
* Eric des Courtis <eric.des.courtis@benbria.com>
|
||||
* Piotr Gregor <piotrek.gregor gmail.com>
|
||||
*/
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
<configuration name="avmd.conf" description="AVMD config">
|
||||
<settings>
|
||||
|
||||
<!-- Edit these settings to change default behaviour
|
||||
of each avmd session. Settings can be overwritten
|
||||
by values passed dynamically per each session -->
|
||||
|
||||
|
||||
<!-- Global settings -->
|
||||
|
||||
<!-- define/undefine this to enable/disable printing of avmd
|
||||
intermediate computations to log -->
|
||||
<param name="debug" value="0"/>
|
||||
|
||||
<!-- define/undef this to enable/disable reporting of beep
|
||||
detection status after session ended -->
|
||||
<param name="report_status" value="1"/>
|
||||
|
||||
<!-- define/undefine this to enable/disable faster computation
|
||||
of arcus cosine - table will be created mapping floats
|
||||
to integers and returning arc cos values given these integer
|
||||
indices into table -->
|
||||
<param name="fast_math" value="0"/>
|
||||
<!-- Global settings end -->
|
||||
|
||||
|
||||
<!-- Per call (session) settings. These settings can be overwritten
|
||||
with custom/different values per each avmd session -->
|
||||
|
||||
<!-- define/undefine this to classify avmd beep detection as valid
|
||||
only when there is required number of consecutive elements
|
||||
in the SMA buffer without reset -->
|
||||
<param name="require_continuous_streak" value="1"/>
|
||||
|
||||
<!-- define number of samples to skip starting from the beginning
|
||||
of the frame and after reset -->
|
||||
<param name="sample_n_to_skeep" value="6"/>
|
||||
|
||||
<!-- define/undefine this to enable/disable simplified estimation
|
||||
of frequency based on approximation of sin(x) with (x)
|
||||
in the range x=[0,PI/2] -->
|
||||
<param name="simplified_estimation" value="1"/>
|
||||
|
||||
<!-- define/undefine to enable/disable avmd on internal channel -->
|
||||
<param name="inbound_channel" value="0"/>
|
||||
|
||||
<!-- define/undefine to enable/disable avmd on external channel -->
|
||||
<param name="outbound_channel" value="1"/>
|
||||
<!-- Per call settings end -->
|
||||
</settings>
|
||||
</configuration>
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -91,7 +91,7 @@ api_command_t conference_api_sub_commands[] = {
|
|||
{"pin", (void_fn_t) & conference_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "pin", "<pin#>"},
|
||||
{"nopin", (void_fn_t) & conference_api_sub_pin, CONF_API_SUB_ARGS_SPLIT, "nopin", ""},
|
||||
{"get", (void_fn_t) & conference_api_sub_get, CONF_API_SUB_ARGS_SPLIT, "get", "<parameter-name>"},
|
||||
{"set", (void_fn_t) & conference_api_sub_set, CONF_API_SUB_ARGS_SPLIT, "set", "<max_members|min_members|wait_min_members_timeout|wait_mod_timeout|sound_prefix|caller_id_name|caller_id_number|endconference_grace_time> <value>"},
|
||||
{"set", (void_fn_t) & conference_api_sub_set, CONF_API_SUB_ARGS_SPLIT, "set", "<max_members|sound_prefix|caller_id_name|caller_id_number|endconference_grace_time> <value>"},
|
||||
{"file-vol", (void_fn_t) & conference_api_sub_file_vol, CONF_API_SUB_ARGS_SPLIT, "file-vol", "<vol#>"},
|
||||
{"floor", (void_fn_t) & conference_api_sub_floor, CONF_API_SUB_MEMBER_TARGET, "floor", "<member_id|last>"},
|
||||
{"vid-floor", (void_fn_t) & conference_api_sub_vid_floor, CONF_API_SUB_MEMBER_TARGET, "vid-floor", "<member_id|last> [force]"},
|
||||
|
@ -2510,6 +2510,11 @@ switch_status_t conference_api_sub_record(conference_obj_t *conference, switch_s
|
|||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (conference->conference_video_mode == CONF_VIDEO_MODE_PASSTHROUGH) {
|
||||
stream->write_function(stream, "-ERR Video Passthru enabled, recording not permitted.\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) {
|
||||
stream->write_function(stream, "-ERR Personal Canvas enabled, recording not permitted.\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
@ -2739,15 +2744,6 @@ switch_status_t conference_api_sub_get(conference_obj_t *conference,
|
|||
} else if (strcasecmp(argv[2], "count_ghosts") == 0) {
|
||||
stream->write_function(stream, "%d",
|
||||
conference->count_ghosts);
|
||||
} else if (strcasecmp(argv[2], "min_members") == 0) {
|
||||
stream->write_function(stream, "%d",
|
||||
conference->min_members);
|
||||
} else if (strcasecmp(argv[2], "wait_min_members_timeout") == 0) {
|
||||
stream->write_function(stream, "%d",
|
||||
conference->wait_min_members_timeout);
|
||||
} else if (strcasecmp(argv[2], "wait_mod_timeout") == 0) {
|
||||
stream->write_function(stream, "%d",
|
||||
conference->wait_mod_timeout);
|
||||
} else if (strcasecmp(argv[2], "max_members") == 0) {
|
||||
stream->write_function(stream, "%d",
|
||||
conference->max_members);
|
||||
|
@ -2802,30 +2798,6 @@ switch_status_t conference_api_sub_set(conference_obj_t *conference,
|
|||
} else {
|
||||
ret_status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else if (strcasecmp(argv[2], "min_members") == 0) {
|
||||
int new_min = atoi(argv[3]);
|
||||
if (new_min >= 0 && (!conference->count || conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS))) {
|
||||
stream->write_function(stream, "%d", conference->min_members);
|
||||
conference->min_members = new_min;
|
||||
} else {
|
||||
ret_status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else if (strcasecmp(argv[2], "wait_min_members_timeout") == 0) {
|
||||
int32_t new_min = atoll(argv[3]);
|
||||
if (new_min >= 0 && (!conference->count || conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS))) {
|
||||
stream->write_function(stream, "%d", conference->wait_min_members_timeout);
|
||||
conference->wait_min_members_timeout = new_min;
|
||||
} else {
|
||||
ret_status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else if (strcasecmp(argv[2], "wait_mod_timeout") == 0) {
|
||||
int32_t new_timeout = atoll(argv[3]);
|
||||
if (new_timeout >= 0 && conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) {
|
||||
stream->write_function(stream, "%d", conference->wait_mod_timeout);
|
||||
conference->wait_mod_timeout = new_timeout;
|
||||
} else {
|
||||
ret_status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
} else if (strcasecmp(argv[2], "sound_prefix") == 0) {
|
||||
stream->write_function(stream, "%s",conference->sound_prefix);
|
||||
conference->sound_prefix = switch_core_strdup(conference->pool, argv[3]);
|
||||
|
|
|
@ -969,8 +969,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
|
|||
/* skip frames that are not actual media or when we are muted or silent */
|
||||
if ((conference_utils_member_test_flag(member, MFLAG_TALKING) || member->energy_level == 0 || conference_utils_test_flag(member->conference, CFLAG_AUDIO_ALWAYS))
|
||||
&& conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD)
|
||||
&& (!conference_utils_test_flag(member->conference, CFLAG_WAIT_MIN_MEMBERS) || (member->conference->record_count && member->conference->count >= member->conference->min_recording_participants))) {
|
||||
|
||||
&& (member->conference->count > 1 || (member->conference->record_count && member->conference->count >= member->conference->min_recording_participants))) {
|
||||
switch_audio_resampler_t *read_resampler = member->read_resampler;
|
||||
void *data;
|
||||
uint32_t datalen;
|
||||
|
@ -1378,25 +1377,6 @@ void conference_loop_output(conference_member_t *member)
|
|||
switch_cond_next();
|
||||
}
|
||||
|
||||
if (member->conference->wait_min_members_timeout && switch_epoch_time_now(NULL) - member->join_time >= member->conference->wait_min_members_timeout &&
|
||||
conference_utils_test_flag(member->conference, CFLAG_WAIT_MIN_MEMBERS))
|
||||
{
|
||||
if (!zstr(member->conference->wait_min_members_timeout_message)) {
|
||||
conference_member_play_file(member, member->conference->wait_min_members_timeout_message, 0, SWITCH_TRUE);
|
||||
}
|
||||
member->loop_loop = SWITCH_FALSE;
|
||||
break;
|
||||
}
|
||||
if (member->conference->wait_mod_timeout && switch_epoch_time_now(NULL) - member->join_time >= member->conference->wait_mod_timeout &&
|
||||
conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD))
|
||||
{
|
||||
if (!zstr(member->conference->wait_mod_timeout_message)) {
|
||||
conference_member_play_file(member, member->conference->wait_mod_timeout_message, 0, SWITCH_TRUE);
|
||||
}
|
||||
member->loop_loop = SWITCH_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
} /* Rinse ... Repeat */
|
||||
|
||||
end:
|
||||
|
|
|
@ -724,9 +724,6 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
|
|||
conference->count_ghosts++;
|
||||
} else {
|
||||
conference->count++;
|
||||
if (conference->min_members && conference->count >= conference->min_members) {
|
||||
conference_utils_clear_flag_locked(conference, CFLAG_WAIT_MIN_MEMBERS);
|
||||
}
|
||||
}
|
||||
|
||||
if (conference_utils_member_test_flag(member, MFLAG_ENDCONF)) {
|
||||
|
@ -817,7 +814,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
|
|||
conference_utils_clear_flag(conference, CFLAG_WAIT_MOD);
|
||||
}
|
||||
|
||||
if (!conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS)) {
|
||||
if (conference->count > 1) {
|
||||
if ((conference->moh_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) ||
|
||||
(conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) {
|
||||
/* stop MoH if any */
|
||||
|
@ -829,9 +826,9 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
|
|||
if (conference_utils_test_flag(conference, CFLAG_ENTER_SOUND) && !conference_utils_member_test_flag(member, MFLAG_SILENT)) {
|
||||
if (!zstr(enter_sound)) {
|
||||
conference_file_play(conference, (char *)enter_sound, CONF_DEFAULT_LEADIN,
|
||||
switch_core_session_get_channel(member->session), !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
||||
switch_core_session_get_channel(member->session), 0);
|
||||
} else {
|
||||
conference_file_play(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) ? 0 : 1);
|
||||
conference_file_play(conference, conference->enter_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1194,13 +1191,6 @@ switch_status_t conference_member_del(conference_obj_t *conference, conference_m
|
|||
if (!--conference->end_count) {
|
||||
//conference_utils_set_flag_locked(conference, CFLAG_DESTRUCT);
|
||||
conference->endconference_time = switch_epoch_time_now(NULL);
|
||||
if (conference_utils_member_test_flag(member, MFLAG_MOD) && !zstr(conference->endconf_mod_exit_message)) {
|
||||
conference_file_play(conference, conference->endconf_mod_exit_message, 0, channel, 0);
|
||||
} else {
|
||||
if (!zstr(conference->endconf_message)) {
|
||||
conference_file_play(conference, conference->endconf_message, 0, channel, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1218,7 +1208,7 @@ switch_status_t conference_member_del(conference_obj_t *conference, conference_m
|
|||
if (!exit_sound && conference->exit_sound && conference_utils_test_flag(conference, CFLAG_EXIT_SOUND) && !conference_utils_member_test_flag(member, MFLAG_SILENT)) {
|
||||
conference_file_play(conference, conference->exit_sound, 0, channel, 0);
|
||||
}
|
||||
if (!conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS) && conference->alone_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
||||
if (conference->count == 1 && conference->alone_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !conference_utils_member_test_flag(member, MFLAG_GHOST)) {
|
||||
conference_file_stop(conference, FILE_STOP_ASYNC);
|
||||
conference_file_play(conference, conference->alone_sound, 0, channel, 0);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,11 @@ void conference_record_launch_thread(conference_obj_t *conference, char *path, i
|
|||
return;
|
||||
}
|
||||
|
||||
if (conference->conference_video_mode == CONF_VIDEO_MODE_PASSTHROUGH) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Video Passthru enabled, recording not permitted.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Personal Canvas enabled, recording not permitted.\n");
|
||||
return;
|
||||
|
@ -229,7 +234,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
|
|||
|
||||
flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT;
|
||||
|
||||
if (conference->members_with_video && conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
|
||||
if (conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
|
||||
flags |= SWITCH_FILE_FLAG_VIDEO;
|
||||
if (canvas) {
|
||||
char *orig_path = rec->path;
|
||||
|
|
|
@ -1514,7 +1514,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_write_thread_run(switch_thread_
|
|||
return NULL;
|
||||
}
|
||||
|
||||
switch_core_autobind_cpu();
|
||||
//switch_core_autobind_cpu();
|
||||
|
||||
while(conference_utils_member_test_flag(member, MFLAG_RUNNING)) {
|
||||
if (switch_queue_pop(member->mux_out_queue, &pop) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -2195,6 +2195,21 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
|||
|
||||
video_count = 0;
|
||||
|
||||
if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh, SWITCH_TRUE)) {
|
||||
check_async_file = 1;
|
||||
file_count++;
|
||||
video_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
|
||||
if (conference->fnode && switch_core_file_has_video(&conference->fnode->fh, SWITCH_TRUE)) {
|
||||
check_file = 1;
|
||||
file_count++;
|
||||
video_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
|
||||
|
||||
switch_mutex_lock(conference->member_mutex);
|
||||
for (imember = conference->members; imember; imember = imember->next) {
|
||||
int no_muted = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS);
|
||||
|
@ -2203,11 +2218,17 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
|||
|
||||
if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
|
||||
!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
|
||||
conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || imember->avatar_png_img)
|
||||
conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || (no_av && !imember->avatar_png_img))
|
||||
&& imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY) {
|
||||
video_count++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (video_count != canvas->video_count) {
|
||||
count_changed = 1;
|
||||
}
|
||||
|
||||
canvas->video_count = video_count;
|
||||
switch_mutex_unlock(conference->member_mutex);
|
||||
|
||||
|
@ -2240,10 +2261,21 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
|||
conference_utils_clear_flag(conference, CFLAG_REFRESH_LAYOUT);
|
||||
}
|
||||
|
||||
if (count_changed) {
|
||||
need_refresh = 1;
|
||||
send_keyframe = 1;
|
||||
do_refresh = 100;
|
||||
}
|
||||
|
||||
|
||||
if (file_count != last_file_count) {
|
||||
count_changed = 1;
|
||||
}
|
||||
|
||||
if (count_changed && !personal) {
|
||||
layout_group_t *lg = NULL;
|
||||
video_layout_t *vlayout = NULL;
|
||||
|
||||
|
||||
if (canvas->video_layout_group && (lg = switch_core_hash_find(conference->layout_group_hash, canvas->video_layout_group))) {
|
||||
if ((vlayout = conference_video_find_best_layout(conference, lg, canvas->video_count))) {
|
||||
switch_mutex_lock(conference->member_mutex);
|
||||
|
@ -2252,28 +2284,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count_changed) {
|
||||
need_refresh = 1;
|
||||
send_keyframe = 1;
|
||||
do_refresh = 100;
|
||||
}
|
||||
|
||||
if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh, SWITCH_TRUE)) {
|
||||
check_async_file = 1;
|
||||
file_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
|
||||
if (conference->fnode && switch_core_file_has_video(&conference->fnode->fh, SWITCH_TRUE)) {
|
||||
check_file = 1;
|
||||
file_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
|
||||
if (file_count != last_file_count) {
|
||||
count_changed = 1;
|
||||
}
|
||||
|
||||
last_file_count = file_count;
|
||||
|
||||
|
|
|
@ -318,14 +318,14 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
|||
|
||||
if (conference->perpetual_sound && !conference->async_fnode) {
|
||||
conference_file_play(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1);
|
||||
} else if (conference->moh_sound && ((nomoh == 0 && conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS))
|
||||
} else if (conference->moh_sound && ((nomoh == 0 && conference->count == 1)
|
||||
|| conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) && !conference->async_fnode && !conference->fnode) {
|
||||
conference_file_play(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1);
|
||||
}
|
||||
|
||||
|
||||
/* Find if no one talked for more than x number of second */
|
||||
if (conference->terminate_on_silence && !conference_utils_test_flag(conference, CFLAG_WAIT_MIN_MEMBERS)) {
|
||||
if (conference->terminate_on_silence && conference->count > 1) {
|
||||
int is_talking = 0;
|
||||
|
||||
for (imember = conference->members; imember; imember = imember->next) {
|
||||
|
@ -1102,21 +1102,6 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
|
|||
switch_xml_set_attr_d(x_conference, "enter_sound", "true");
|
||||
}
|
||||
|
||||
if (conference->min_members > 0) {
|
||||
switch_snprintf(i, sizeof(i), "%d", conference->min_members);
|
||||
switch_xml_set_attr_d(x_conference, "min_members", ival);
|
||||
}
|
||||
|
||||
if (conference->wait_min_members_timeout > 0) {
|
||||
switch_snprintf(i, sizeof(i), "%d", conference->wait_min_members_timeout);
|
||||
switch_xml_set_attr_d(x_conference, "wait_min_members_timeout", ival);
|
||||
}
|
||||
|
||||
if (conference->wait_mod_timeout > 0) {
|
||||
switch_snprintf(i, sizeof(i), "%d", conference->wait_mod_timeout);
|
||||
switch_xml_set_attr_d(x_conference, "wait_mod_timeout", ival);
|
||||
}
|
||||
|
||||
if (conference->max_members > 0) {
|
||||
switch_snprintf(i, sizeof(i), "%d", conference->max_members);
|
||||
switch_xml_set_attr_d(x_conference, "max_members", ival);
|
||||
|
@ -1838,12 +1823,9 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
|
||||
/* if the conference exists, get the pointer to it */
|
||||
if (!conference) {
|
||||
const char *max_members_str = NULL;
|
||||
const char *endconference_grace_time_str = NULL;
|
||||
const char *auto_record_str = NULL;
|
||||
const char *min_members_str = NULL;
|
||||
const char *wait_min_members_timeout_str = NULL;
|
||||
const char *wait_mod_timeout_str = NULL;
|
||||
const char *max_members_str;
|
||||
const char *endconference_grace_time_str;
|
||||
const char *auto_record_str;
|
||||
|
||||
/* no conference yet, so check for join-only flag */
|
||||
if (flags_str) {
|
||||
|
@ -1856,9 +1838,9 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
}
|
||||
|
||||
if (mflags[MFLAG_JOIN_ONLY]) {
|
||||
switch_event_t *event = NULL;
|
||||
switch_xml_t jos_xml = NULL;
|
||||
char *val = NULL;
|
||||
switch_event_t *event;
|
||||
switch_xml_t jos_xml;
|
||||
char *val;
|
||||
/* send event */
|
||||
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT);
|
||||
switch_channel_event_set_basic_data(channel, event);
|
||||
|
@ -1917,48 +1899,9 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
/* Set the minimum number of members (once you go above it you cannot go below it) */
|
||||
conference->min = 1;
|
||||
|
||||
/* check for variable used to specify override for min_members */
|
||||
if (!zstr(min_members_str = switch_channel_get_variable(channel, "conference_min_members"))) {
|
||||
uint32_t min_members_val = 0;
|
||||
errno = 0; /* sanity first */
|
||||
min_members_val = strtol(min_members_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) min_members_val < 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||
"conference_min_members variable %s is invalid, not setting a limit\n", min_members_str);
|
||||
} else {
|
||||
conference->min_members = min_members_val;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for variable used to specify override for wait_min_members_timeout */
|
||||
if (!zstr(wait_min_members_timeout_str = switch_channel_get_variable(channel, "conference_wait_min_members_timeout"))) {
|
||||
int32_t wait_min_members_timeout_val = 0;
|
||||
errno = 0; /* sanity first */
|
||||
wait_min_members_timeout_val = strtol(wait_min_members_timeout_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) wait_min_members_timeout_val < 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||
"conference_wait_min_members_timeout variable %s is invalid, not setting a limit\n", wait_min_members_timeout_str);
|
||||
} else {
|
||||
conference->wait_min_members_timeout = wait_min_members_timeout_val;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for variable used to specify override for wait_min_members_timeout */
|
||||
if (!zstr(wait_mod_timeout_str = switch_channel_get_variable(channel, "conference_wait_mod_timeout"))) {
|
||||
int32_t wait_mod_timeout_val = 0;
|
||||
errno = 0; /* sanity first */
|
||||
wait_mod_timeout_val = strtol(wait_mod_timeout_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) wait_mod_timeout_val < 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||
"conference_wait_mod_timeout variable %s is invalid, not setting a limit\n", wait_mod_timeout_str);
|
||||
} else {
|
||||
conference->wait_mod_timeout = wait_mod_timeout_val;
|
||||
}
|
||||
}
|
||||
|
||||
/* check for variable used to specify override for max_members */
|
||||
if (!zstr(max_members_str = switch_channel_get_variable(channel, "conference_max_members"))) {
|
||||
uint32_t max_members_val = 0;
|
||||
uint32_t max_members_val;
|
||||
errno = 0; /* sanity first */
|
||||
max_members_val = strtol(max_members_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) max_members_val < 0 || max_members_val == 1) {
|
||||
|
@ -1971,7 +1914,7 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
|
||||
/* check for variable to override endconference_grace_time profile value */
|
||||
if (!zstr(endconference_grace_time_str = switch_channel_get_variable(channel, "conference_endconference_grace_time"))) {
|
||||
uint32_t grace_time_val = 0;
|
||||
uint32_t grace_time_val;
|
||||
errno = 0; /* sanity first */
|
||||
grace_time_val = strtol(endconference_grace_time_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) grace_time_val < 0) {
|
||||
|
@ -1987,10 +1930,6 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
/* Indicate the conference is dynamic */
|
||||
conference_utils_set_flag_locked(conference, CFLAG_DYNAMIC);
|
||||
|
||||
if (conference->min_members) {
|
||||
conference_utils_set_flag_locked(conference, CFLAG_WAIT_MIN_MEMBERS);
|
||||
}
|
||||
|
||||
/* acquire a read lock on the thread so it can't leave without us */
|
||||
if (switch_thread_rwlock_tryrdlock(conference->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Read Lock Fail\n");
|
||||
|
@ -2024,7 +1963,7 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
int pin_retries = conference->pin_retries;
|
||||
int pin_valid = 0;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
char *supplied_pin_value = NULL;
|
||||
char *supplied_pin_value;
|
||||
|
||||
/* Answer the channel */
|
||||
switch_channel_answer(channel);
|
||||
|
@ -2444,13 +2383,6 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
char *perpetual_sound = NULL;
|
||||
char *moh_sound = NULL;
|
||||
char *outcall_templ = NULL;
|
||||
char *wait_min_members_timeout_message = NULL;
|
||||
char *wait_mod_timeout_message = NULL;
|
||||
char *endconf_mod_exit_message = NULL;
|
||||
char *endconf_message = NULL;
|
||||
uint32_t min_members = 0;
|
||||
int32_t wait_min_members_timeout = 0;
|
||||
int32_t wait_mod_timeout = 0;
|
||||
char *video_layout_name = NULL;
|
||||
char *video_layout_group = NULL;
|
||||
char *video_canvas_size = NULL;
|
||||
|
@ -2464,7 +2396,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
conference_video_mode_t conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH;
|
||||
int conference_video_quality = 1;
|
||||
int auto_kps_debounce = 30000;
|
||||
float fps = 15.0f;
|
||||
float fps = 30.0f;
|
||||
uint32_t max_members = 0;
|
||||
uint32_t announce_count = 0;
|
||||
char *maxmember_sound = NULL;
|
||||
|
@ -2680,14 +2612,6 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
kicked_sound = val;
|
||||
} else if (!strcasecmp(var, "join-only-sound") && !zstr(val)) {
|
||||
join_only_sound = val;
|
||||
} else if (!strcasecmp(var, "wait-min-members-timeout-message") && !zstr(val)) {
|
||||
wait_min_members_timeout_message = val;
|
||||
} else if (!strcasecmp(var, "wait-mod-timeout-message") && !zstr(val)) {
|
||||
wait_mod_timeout_message = val;
|
||||
} else if (!strcasecmp(var, "endconf-mod-exit-message") && !zstr(val)) {
|
||||
endconf_mod_exit_message = val;
|
||||
} else if (!strcasecmp(var, "endconf-message") && !zstr(val)) {
|
||||
endconf_message = val;
|
||||
} else if (!strcasecmp(var, "pin") && !zstr(val)) {
|
||||
pin = val;
|
||||
} else if (!strcasecmp(var, "moderator-pin") && !zstr(val)) {
|
||||
|
@ -2745,27 +2669,6 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
} else if (!strcasecmp(var, "sound-prefix") && !zstr(val)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "override sound-prefix with: %s\n", val);
|
||||
sound_prefix = val;
|
||||
} else if (!strcasecmp(var, "min-members") && !zstr(val)) {
|
||||
errno = 0; /* sanity first */
|
||||
min_members = strtol(val, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) min_members < 0) {
|
||||
min_members = 0; /* set to 0 to disable min counts */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "min-members %s is invalid, not setting a limit\n", val);
|
||||
}
|
||||
} else if (!strcasecmp(var, "wait-min-members-timeout") && !zstr(val)) {
|
||||
errno = 0; /* sanity first */
|
||||
wait_min_members_timeout = strtoll(val, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) wait_min_members_timeout < 0) {
|
||||
wait_min_members_timeout = 0; /* set to 0 to disable timeout waiting for min_members */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "wait-min-members-timeout %s is invalid, not setting a limit\n", val);
|
||||
}
|
||||
} else if (!strcasecmp(var, "wait-mod-timeout") && !zstr(val)) {
|
||||
errno = 0; /* sanity first */
|
||||
wait_mod_timeout = strtoll(val, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
if (errno == ERANGE || errno == EINVAL || (int32_t) wait_mod_timeout < 0) {
|
||||
wait_mod_timeout = 0; /* set to 0 to disable timeout waiting for moderator */
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "wait-mod-timeout %s is invalid, not setting a limit\n", val);
|
||||
}
|
||||
} else if (!strcasecmp(var, "max-members") && !zstr(val)) {
|
||||
errno = 0; /* sanity first */
|
||||
max_members = strtol(val, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
|
||||
|
@ -3173,22 +3076,6 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
conference->is_unlocked_sound = switch_core_strdup(conference->pool, is_unlocked_sound);
|
||||
}
|
||||
|
||||
if (!zstr(wait_min_members_timeout_message)) {
|
||||
conference->wait_min_members_timeout_message = switch_core_strdup(conference->pool, wait_min_members_timeout_message);
|
||||
}
|
||||
|
||||
if (!zstr(wait_mod_timeout_message)) {
|
||||
conference->wait_mod_timeout_message = switch_core_strdup(conference->pool, wait_mod_timeout_message);
|
||||
}
|
||||
|
||||
if (!zstr(endconf_mod_exit_message)) {
|
||||
conference->endconf_mod_exit_message = switch_core_strdup(conference->pool, endconf_mod_exit_message);
|
||||
}
|
||||
|
||||
if (!zstr(endconf_message)) {
|
||||
conference->endconf_message = switch_core_strdup(conference->pool, endconf_message);
|
||||
}
|
||||
|
||||
if (!zstr(energy_level)) {
|
||||
conference->energy_level = atoi(energy_level);
|
||||
if (conference->energy_level < 0) {
|
||||
|
@ -3210,11 +3097,6 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
|
|||
}
|
||||
}
|
||||
|
||||
/* its going to be 0 by default, set to a value otherwise so this should be safe */
|
||||
conference->min_members = min_members;
|
||||
conference->wait_min_members_timeout = wait_min_members_timeout;
|
||||
conference->wait_mod_timeout = wait_mod_timeout;
|
||||
|
||||
if (!zstr(maxmember_sound)) {
|
||||
conference->maxmember_sound = switch_core_strdup(conference->pool, maxmember_sound);
|
||||
}
|
||||
|
|
|
@ -249,7 +249,6 @@ typedef enum {
|
|||
CFLAG_PERSONAL_CANVAS,
|
||||
CFLAG_REFRESH_LAYOUT,
|
||||
CFLAG_VIDEO_MUTE_EXIT_CANVAS,
|
||||
CFLAG_WAIT_MIN_MEMBERS,
|
||||
/////////////////////////////////
|
||||
CFLAG_MAX
|
||||
} conference_flag_t;
|
||||
|
@ -558,13 +557,6 @@ typedef struct conference_obj {
|
|||
int auto_record_canvas;
|
||||
char *record_filename;
|
||||
char *outcall_templ;
|
||||
char *wait_min_members_timeout_message;
|
||||
char *wait_mod_timeout_message;
|
||||
char *endconf_mod_exit_message;
|
||||
char *endconf_message;
|
||||
uint32_t min_members;
|
||||
int32_t wait_min_members_timeout;
|
||||
int32_t wait_mod_timeout;
|
||||
char *video_layout_name;
|
||||
char *video_layout_group;
|
||||
char *video_canvas_bgcolor;
|
||||
|
|
|
@ -385,7 +385,7 @@ ssize_t ws_raw_read(wsh_t *wsh, void *data, size_t bytes, int block)
|
|||
}
|
||||
} while (r == -1 && xp_is_blocking(xp_errno()) && wsh->x < 1000);
|
||||
|
||||
if (wsh->x >= 1000 || (block && wsh->x >= 100)) {
|
||||
if (wsh->x >= 10000 || (block && wsh->x >= 1000)) {
|
||||
r = -1;
|
||||
}
|
||||
|
||||
|
@ -929,7 +929,7 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
ssize_t ws_feed_buf(wsh_t *wsh, void *data, size_t bytes)
|
||||
{
|
||||
|
||||
|
@ -937,9 +937,9 @@ ssize_t ws_feed_buf(wsh_t *wsh, void *data, size_t bytes)
|
|||
return -1;
|
||||
}
|
||||
|
||||
memcpy(wsh->wbuffer + wsh->wdatalen, data, bytes);
|
||||
memcpy((unsigned char *)wsh->write_buffer + wsh->write_buffer_len, data, bytes);
|
||||
|
||||
wsh->wdatalen += bytes;
|
||||
wsh->write_buffer_len += bytes;
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
@ -953,13 +953,13 @@ ssize_t ws_send_buf(wsh_t *wsh, ws_opcode_t oc)
|
|||
return -1;
|
||||
}
|
||||
|
||||
r = ws_write_frame(wsh, oc, wsh->wbuffer, wsh->wdatalen);
|
||||
r = ws_write_frame(wsh, oc, wsh->write_buffer, wsh->write_buffer_len);
|
||||
|
||||
wsh->wdatalen = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ssize_t ws_write_frame(wsh_t *wsh, ws_opcode_t oc, void *data, size_t bytes)
|
||||
{
|
||||
|
|
|
@ -1870,7 +1870,81 @@ SWITCH_DECLARE(void) switch_core_media_prepare_codecs(switch_core_session_t *ses
|
|||
|
||||
}
|
||||
|
||||
static void adjust_jb(switch_core_session_t *session, int new_ptime_ms)
|
||||
{
|
||||
const char *val;
|
||||
switch_media_handle_t *smh;
|
||||
switch_rtp_engine_t *a_engine = NULL;
|
||||
int maxlen = 0;
|
||||
int32_t jb_msec = 0 ;
|
||||
int qlen, maxqlen = 50;
|
||||
|
||||
switch_assert(session);
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
|
||||
|
||||
if ((val = switch_channel_get_variable(session->channel, "jitterbuffer_msec")) || (val = smh->mparams->jb_msec)) {
|
||||
char *p;
|
||||
|
||||
if (!jb_msec) {
|
||||
jb_msec = atoi(val);
|
||||
|
||||
if (strchr(val, 'p') && jb_msec > 0) {
|
||||
jb_msec *= -1;
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3, "Will not adjust JB size, token 'p' not specified\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if ((p = strchr(val, ':'))) {
|
||||
p++;
|
||||
maxlen = atoi(p);
|
||||
|
||||
if (strchr(p, 'p') && maxlen > 0) {
|
||||
maxlen *= -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jb_msec < 0 && jb_msec > -1000) {
|
||||
jb_msec = new_ptime_ms * abs(jb_msec);
|
||||
}
|
||||
|
||||
if (maxlen < 0 && maxlen > -1000) {
|
||||
maxlen = new_ptime_ms * abs(maxlen);
|
||||
}
|
||||
|
||||
if (jb_msec < 10 || jb_msec > 10000) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
|
||||
"Invalid Jitterbuffer spec [%d] must be between 10 and 10000\n", jb_msec);
|
||||
} else {
|
||||
qlen = jb_msec / new_ptime_ms;
|
||||
if (maxlen) {
|
||||
maxqlen = maxlen / new_ptime_ms;
|
||||
}
|
||||
if (maxqlen < qlen) {
|
||||
maxqlen = qlen * 5;
|
||||
}
|
||||
if (switch_rtp_activate_jitter_buffer(a_engine->rtp_session, qlen, maxqlen,
|
||||
a_engine->read_impl.samples_per_packet, a_engine->read_impl.samples_per_second) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
|
||||
SWITCH_LOG_DEBUG, "Adjusting Jitterbuffer to %dms (%d frames) (%d max frames)\n",
|
||||
jb_msec, qlen, maxqlen);
|
||||
switch_channel_set_flag(session->channel, CF_JITTERBUFFER);
|
||||
if (!switch_false(switch_channel_get_variable(session->channel, "rtp_jitter_buffer_plc"))) {
|
||||
switch_channel_set_flag(session->channel, CF_JITTERBUFFER_PLC);
|
||||
}
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
|
||||
SWITCH_LOG_DEBUG, "Error adjusting Jitterbuffer to %dms (%d frames)\n", jb_msec, qlen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void check_jb(switch_core_session_t *session, const char *input, int32_t jb_msec, int32_t maxlen, switch_bool_t silent)
|
||||
{
|
||||
|
@ -2391,25 +2465,22 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
}
|
||||
|
||||
/* check for timing issues */
|
||||
if (smh->media_flags[SCMF_AUTOFIX_TIMING] && engine->check_frames < MAX_CODEC_CHECK_FRAMES) {
|
||||
|
||||
if (smh->media_flags[SCMF_AUTOFIX_TIMING]) {
|
||||
char is_vbr;
|
||||
is_vbr = engine->read_impl.encoded_bytes_per_packet?0:1;
|
||||
|
||||
engine->check_frames++;
|
||||
|
||||
if (!engine->read_impl.encoded_bytes_per_packet) {
|
||||
engine->check_frames = MAX_CODEC_CHECK_FRAMES;
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if (smh->media_flags[SCMF_AUTOFIX_TIMING] && (engine->read_frame.datalen % 10) == 0) {
|
||||
/* CBR */
|
||||
if ((smh->media_flags[SCMF_AUTOFIX_TIMING] && (engine->read_frame.datalen % 10) == 0)
|
||||
&& (engine->check_frames < MAX_CODEC_CHECK_FRAMES) && !is_vbr) {
|
||||
engine->check_frames++;
|
||||
|
||||
if (engine->last_ts && engine->read_frame.datalen != engine->read_impl.encoded_bytes_per_packet) {
|
||||
|
||||
uint32_t codec_ms = (int) (engine->read_frame.timestamp -
|
||||
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
|
||||
|
||||
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Correcting calculated ptime value from %d to %d to compensate for %d lost packet(s)\n", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s). \n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
|
||||
}
|
||||
|
||||
|
@ -2419,7 +2490,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
goto skip;
|
||||
}
|
||||
|
||||
|
||||
if (engine->last_codec_ms && engine->last_codec_ms == codec_ms) {
|
||||
engine->mismatch_count++;
|
||||
}
|
||||
|
@ -2431,8 +2501,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
|
||||
if (codec_ms > 120) { /* yeah right */
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
|
||||
"[%s]: Your phone is trying to send timestamps that suggest an increment of %dms per packet\n"
|
||||
"That seems hard to believe so I am going to go on ahead and um ignore that, mmkay?\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
(int) codec_ms);
|
||||
engine->check_frames = MAX_CODEC_CHECK_FRAMES;
|
||||
goto skip;
|
||||
|
@ -2442,7 +2513,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
|
||||
if (codec_ms != engine->cur_payload_map->codec_ms) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"Asynchronous PTIME not supported, changing our end from %d to %d\n",
|
||||
"[%s]: Asynchronous PTIME not supported, changing our end from %d to %d\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
(int) engine->cur_payload_map->codec_ms,
|
||||
(int) codec_ms
|
||||
);
|
||||
|
@ -2465,6 +2537,52 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||
engine->last_ts = engine->read_frame.timestamp;
|
||||
engine->last_seq = engine->read_frame.seq;
|
||||
|
||||
} else if (smh->media_flags[SCMF_AUTOFIX_TIMING] && is_vbr && switch_rtp_get_jitter_buffer(engine->rtp_session)
|
||||
&& engine->read_frame.timestamp && engine->read_frame.seq) {
|
||||
|
||||
uint32_t codec_ms = (int) (engine->read_frame.timestamp -
|
||||
engine->last_ts) / (engine->read_impl.samples_per_second / 1000);
|
||||
|
||||
if (engine->last_seq && (int) (engine->read_frame.seq - engine->last_seq) > 1) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[%s]: Correcting calculated ptime value from [%d] to [%d] to compensate for [%d] lost packet(s)\n", is_vbr?"VBR":"CBR", codec_ms, codec_ms / (int) (engine->read_frame.seq - engine->last_seq), (int) (engine->read_frame.seq - engine->last_seq - 1));
|
||||
codec_ms = codec_ms / (int) (engine->read_frame.seq - engine->last_seq);
|
||||
}
|
||||
|
||||
engine->last_codec_ms = codec_ms;
|
||||
|
||||
if (codec_ms != engine->cur_payload_map->codec_ms && codec_ms) {
|
||||
|
||||
if (codec_ms > 120) {
|
||||
/*will show too many times with packet loss*/
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3,
|
||||
"[%s]: Remote party is trying to send timestamps that suggest an increment of [%d] ms per packet, which is too high. Ignoring.\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
(int) codec_ms);
|
||||
engine->last_ts = engine->read_frame.timestamp;
|
||||
engine->last_seq = engine->read_frame.seq;
|
||||
goto skip;
|
||||
}
|
||||
|
||||
if (codec_ms != engine->cur_payload_map->codec_ms) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
|
||||
"[%s]: Asynchronous PTIME supported, adjusting JB size. Remote PTIME changed from [%d] to [%d]\n",
|
||||
is_vbr?"VBR":"CBR",
|
||||
(int) engine->cur_payload_map->codec_ms,
|
||||
(int) codec_ms
|
||||
);
|
||||
engine->cur_payload_map->codec_ms = codec_ms;
|
||||
/* adjust audio JB size, but do not substitute the codec */
|
||||
adjust_jb(session,codec_ms);
|
||||
engine->reset_codec = 2;
|
||||
|
||||
if (switch_channel_test_flag(session->channel, CF_CONFERENCE)) {
|
||||
switch_channel_set_flag(session->channel, CF_CONFERENCE_RESET_MEDIA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
engine->last_ts = engine->read_frame.timestamp;
|
||||
engine->last_seq = engine->read_frame.seq;
|
||||
|
||||
} else {
|
||||
engine->mismatch_count = 0;
|
||||
|
|
|
@ -403,8 +403,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
|
|||
config->g_h = context->codec_settings.video.height;
|
||||
config->rc_target_bitrate = context->bandwidth;
|
||||
config->g_lag_in_frames = 0;
|
||||
config->kf_max_dist = 2000;
|
||||
config->g_threads = 1;//(cpus > 1) ? 2 : 1;
|
||||
config->kf_max_dist = 360;//2000;
|
||||
config->g_threads = cpus - 1;//(cpus > 1) ? 2 : 1;
|
||||
|
||||
if (context->is_vp9) {
|
||||
//config->rc_dropframe_thresh = 2;
|
||||
|
@ -435,7 +435,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
|
|||
config->rc_end_usage = VPX_CBR;
|
||||
//config->g_pass = VPX_RC_ONE_PASS;
|
||||
config->kf_mode = VPX_KF_AUTO;
|
||||
config->kf_max_dist = 1000;
|
||||
config->kf_max_dist = 360;//1000;
|
||||
|
||||
//config->kf_mode = VPX_KF_DISABLED;
|
||||
config->rc_resize_allowed = 1;
|
||||
|
@ -545,7 +545,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
|
|||
vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, -8);
|
||||
}
|
||||
|
||||
vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, 100);
|
||||
vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, 1000);
|
||||
vpx_codec_control(&context->encoder, VP8E_SET_TOKEN_PARTITIONS, token_parts);
|
||||
vpx_codec_control(&context->encoder, VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN);
|
||||
|
||||
|
|
Loading…
Reference in New Issue