Merge branch 'master' into v1.6

This commit is contained in:
Ken Rice 2015-10-09 15:27:41 -05:00
commit 08bda5e21b
150 changed files with 5004 additions and 3308 deletions

View File

@ -1,5 +1,5 @@
EXTRA_DIST = EXTRA_DIST =
SUBDIRS = . src build tests/unit SUBDIRS = . src build
AUTOMAKE_OPTIONS = foreign subdir-objects AUTOMAKE_OPTIONS = foreign subdir-objects
NAME = freeswitch NAME = freeswitch
@ -775,3 +775,17 @@ support:
@cp support-d/.screenrc ~ @cp support-d/.screenrc ~
@cp support-d/.bashrc ~ @cp support-d/.bashrc ~
@test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed @test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed
# Using a non-recursive Makefile structure for the automated tests so that the tests have visibility into
# targets in the rest of the FreeSWITCH tree. This greatly simplifies dependency tracking at the expense
# of longer test target names. Since the tests are expected to be run easily and rapidly after minor source
# changes this is the most effective structure.
check_PROGRAMS =
include tests/unit/unit.mk
TESTS = $(check_PROGRAMS)
tests: $(check_PROGRAMS)

78
build/debpkgs.sh Executable file
View File

@ -0,0 +1,78 @@
#!/bin/bash
a='amd64 i386'
c='wheezy jessie stretch sid'
n='1'
T='/tmp/fs.sources.list'
K='/tmp/fs.asc'
while getopts "a:c:n:" flag
do
case $flag in
a) a=$OPTARG;;
c) c=$OPTARG;;
n) n=$OPTARG;;
T) T=$OPTARG;;
K) K=$OPTARG;;
esac
done
if [ "$EUID" -ne 0 ]
then
echo "Build script must be run as root or under sudo"
exit 1
fi
echo "./build/debpkgs.sh script is building FreeSWITCH Debian packages"
VERSION=`cat ./build/next-release.txt`
echo "This Version: $VERSION"
HASH=`git log -n 1 --oneline |cut -d ' ' -f 1`
echo "Commit hash $HASH"
# Use the FreeSWITCH release repo for dependency testing
# The release codename here does not matter, since the util.sh script
# will adapt to the release being built
if [ ! -r "$T" ]
then
echo "deb http://files.freeswitch.org/repo/deb/debian/ jessie main" >> "$T"
fi
# Use the FreeSWITCH release repo key
if [ ! -r "$K" ]
then
cat << EOF > "$K"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQGiBE8jEfIRBAC+Cca0fPQxhyhn0NMsPaMQJgTvqhWb5/f4Mel++kosmUQQ4fJq
4U9NFvpfNyLp5MoHpnlDfAb+e57B2sr47NOJLTh83yQIAnvU+8O0Q4kvMaiiesX5
CisApLBs6Vx28y7VWmLsY3vWu8mC7M+PORKfpBV8DWy/7569wQPx2SCsIwCgzv2T
8YsnYsSVRrrmh46J1o4/ngsD/13ETX4ws/wNN+82RdqUxu7fjc0fNbUAb6XYddAb
1hrw5npQulgUNWkpnVmIDRHDXLNMeT8nZDkxsA8AsT+u7ACfPFa2o3R8w9zOPSO+
oSO0+Puhop2+z1gm6lmfMKq9HpeXG3yt/8zsEVUmOYT9m+vYEVghfpXtACVYheDq
LzUuA/9E9HBiNPVhJ/mEpOk9bZ1gpwr3mjlpUbvX5aGwTJJ+YoTfZOCL7go3uQHn
/sT35WoJ23wJCRlW0SYTFJqCoris9AhI+qw7xRTw9wb+txSI96uhafUUMCn6GLkN
+yAixqDwNHKkdax3GSGJtLB0t67QoBDIpcGog7ZfRMvWP3QLNLQ4RnJlZVNXSVRD
SCBQYWNrYWdlIFNpZ25pbmcgS2V5IDxwYWNrYWdlc0BmcmVlc3dpdGNoLm9yZz6I
YgQTEQIAIgUCTyMR8gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQ127c
dyXgEM879ACffY0HFi+mACtfFYmX/Uk/qGELSP4An1B8D5L4dLFFr1zV9YawQUbz
O9/MuQENBE8jEfIQBAC7vnn855YDuz1gTsUMYDxfIRH5KPmDDEAf1WXoD3QG4qOQ
xVW5nhp/bolh2CacAxdOjZePdhGkkdNOBpcu9NlTNRru0myGN8etbnzP3O5dq0io
VMf23C5u9KPbxwRWS+WFtC4CRFn6DafDI1qa3Gv3CkiBWtKR0Wid2SQLzl3mVwAF
EQP9HlwGjhBfFA26LlSMPhSo0Ll+sdcOJupJ21zmGeg7c0GpBnzDzyyJg04gbahs
xWtW3Y/+B4LGM97o6lnu0OQI7MX5gY1G4Jgu6pgYv8tQd5XyU/CAJUA5VWTxUMIi
JP6qlzm1bz4AAPmGw4mkS1u4N+vai21Zl4iyFIQFeiuU/K2ISQQYEQIACQUCTyMR
8gIbDAAKCRDXbtx3JeAQzxReAJ4uvms1n7xV3CcJPQlM7ndX5MZU3QCgxp8zubcL
/SsMvw7XApSHFs5ooYc=
=Xc8P
-----END PGP PUBLIC KEY BLOCK-----
EOF
fi
./debian/util.sh build-all -a "$a" -c "$c" -T $T -K $K -f ./build/modules.conf.most -j -bn -z9 -v$VERSION-$n~$HASH
if [ $(ls -al ../freeswitch-mod* | wc -l) -lt 10 ]; then false; else true; fi

View File

@ -12,6 +12,7 @@
<image x="0" y="90" scale="180"/> <image x="0" y="90" scale="180"/>
<image x="180" y="90" scale="180"/> <image x="180" y="90" scale="180"/>
</layout> </layout>
<layout name="2x1-zoom" auto-3d-position="true"> <layout name="2x1-zoom" auto-3d-position="true">
<image x="0" y="0" scale="180" hscale="360" zoom="true"/> <image x="0" y="0" scale="180" hscale="360" zoom="true"/>
<image x="180" y="0" scale="180" hscale="360" zoom="true"/> <image x="180" y="0" scale="180" hscale="360" zoom="true"/>
@ -315,6 +316,10 @@
<image x="240" y="300" scale="60"/> <image x="240" y="300" scale="60"/>
<image x="300" y="300" scale="60"/> <image x="300" y="300" scale="60"/>
</layout> </layout>
<layout name="2x1-presenter-zoom" auto-3d-position="true">
<image x="0" y="0" scale="180" hscale="360" zoom="true"/>
<image x="180" y="0" scale="180" hscale="360" zoom="true" reservation_id="presenter"/>
</layout>
<layout name="presenter-dual-vertical"> <layout name="presenter-dual-vertical">
<image x="90" y="0" scale="180" floor-only="true"/> <image x="90" y="0" scale="180" floor-only="true"/>
<image x="90" y="180" scale="180" reservation_id="presenter"/> <image x="90" y="180" scale="180" reservation_id="presenter"/>

View File

@ -150,7 +150,7 @@
<!-- Test each port to make sure it is not in use by some other process before allocating it to RTP --> <!-- Test each port to make sure it is not in use by some other process before allocating it to RTP -->
<!-- <param name="rtp-port-usage-robustness" value="true"/> --> <!-- <param name="rtp-port-usage-robustness" value="true"/> -->
<param name="rtp-enable-zrtp" value="false"/> <param name="rtp-enable-zrtp" value="true"/>
<!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> --> <!-- <param name="core-db-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE'" /> -->
<!-- <param name="core-db-dsn" value="dsn:username:password" /> --> <!-- <param name="core-db-dsn" value="dsn:username:password" /> -->

View File

@ -5,11 +5,9 @@
</settings> </settings>
<profiles> <profiles>
<profile name="default"> <profile name="default-v4">
<param name="bind-local" value="$${local_ip_v4}:8081"/> <param name="bind-local" value="$${local_ip_v4}:8081"/>
<param name="bind-local" value="$${local_ip_v4}:8082" secure="true"/> <param name="bind-local" value="$${local_ip_v4}:8082" secure="true"/>
<param name="bind-local" value="[$${local_ip_v6}]:8081"/>
<param name="bind-local" value="[$${local_ip_v6}]:8082" secure="true"/>
<param name="force-register-domain" value="$${domain}"/> <param name="force-register-domain" value="$${domain}"/>
<param name="secure-combined" value="$${certs_dir}/wss.pem"/> <param name="secure-combined" value="$${certs_dir}/wss.pem"/>
<param name="secure-chain" value="$${certs_dir}/wss.pem"/> <param name="secure-chain" value="$${certs_dir}/wss.pem"/>
@ -18,17 +16,38 @@
<param name="blind-reg" value="false"/> <param name="blind-reg" value="false"/>
<param name="mcast-ip" value="224.1.1.1"/> <param name="mcast-ip" value="224.1.1.1"/>
<param name="mcast-port" value="1337"/> <param name="mcast-port" value="1337"/>
<param name="rtp-ip" value="$${local_ip_v6}"/>
<param name="rtp-ip" value="$${local_ip_v4}"/> <param name="rtp-ip" value="$${local_ip_v4}"/>
<!-- <param name="ext-rtp-ip" value=""/> --> <!-- <param name="ext-rtp-ip" value=""/> -->
<param name="local-network" value="localnet.auto"/> <param name="local-network" value="localnet.auto"/>
<param name="outbound-codec-string" value="OPUS,VP8"/> <param name="outbound-codec-string" value="opus,vp8"/>
<param name="inbound-codec-string" value="OPUS,VP8"/> <param name="inbound-codec-string" value="opus,vp8"/>
<param name="apply-candidate-acl" value="localnet.auto"/> <param name="apply-candidate-acl" value="localnet.auto"/>
<param name="apply-candidate-acl" value="wan_v6.auto"/>
<param name="apply-candidate-acl" value="wan_v4.auto"/> <param name="apply-candidate-acl" value="wan_v4.auto"/>
<param name="apply-candidate-acl" value="rfc1918.auto"/> <param name="apply-candidate-acl" value="rfc1918.auto"/>
<param name="apply-candidate-acl" value="any_v4.auto"/>
<param name="timer-name" value="soft"/>
</profile>
<profile name="default-v6">
<param name="bind-local" value="[$${local_ip_v6}]:8081"/>
<param name="bind-local" value="[$${local_ip_v6}]:8082" secure="true"/>
<param name="force-register-domain" value="$${domain}"/>
<param name="secure-combined" value="$${certs_dir}/wss.pem"/>
<param name="secure-chain" value="$${certs_dir}/wss.pem"/>
<param name="userauth" value="true"/>
<!-- setting this to true will allow anyone to register even with no account so use with care -->
<param name="blind-reg" value="false"/>
<param name="rtp-ip" value="$${local_ip_v6}"/>
<!-- <param name="ext-rtp-ip" value=""/> -->
<param name="outbound-codec-string" value="opus,vp8"/>
<param name="inbound-codec-string" value="opus,vp8"/>
<param name="apply-candidate-acl" value="wan_v6.auto"/>
<param name="apply-candidate-acl" value="rfc1918.auto"/>
<param name="apply-candidate-acl" value="any_v6.auto"/> <param name="apply-candidate-acl" value="any_v6.auto"/>
<param name="apply-candidate-acl" value="wan_v4.auto"/>
<param name="apply-candidate-acl" value="any_v4.auto"/> <param name="apply-candidate-acl" value="any_v4.auto"/>
<param name="timer-name" value="soft"/> <param name="timer-name" value="soft"/>

View File

@ -7,6 +7,15 @@
<action application="conference" data="6070@video-mcu-stereo"/> <action application="conference" data="6070@video-mcu-stereo"/>
</condition> </condition>
</extension> </extension>
<extension name="cdquality_stereo_conferences">
<condition field="destination_number" expression="^(6070).*?-screen$">
<action application="answer"/>
<action application="send_display" data="FreeSWITCH Conference|$1"/>
<action application="set" data="conference_member_flags=join-vid-floor"/>
<action application="conference" data="$1@video-mcu-stereo"/>
</condition>
</extension>
<extension name="conf"> <extension name="conf">
<condition field="destination_number" expression="^6070-moderator$"> <condition field="destination_number" expression="^6070-moderator$">

View File

@ -316,6 +316,10 @@
<image x="240" y="300" scale="60"/> <image x="240" y="300" scale="60"/>
<image x="300" y="300" scale="60"/> <image x="300" y="300" scale="60"/>
</layout> </layout>
<layout name="2x1-presenter-zoom" auto-3d-position="true">
<image x="0" y="0" scale="180" hscale="360" zoom="true" floor="true"/>
<image x="180" y="0" scale="180" hscale="360" zoom="true" reservation_id="presenter"/>
</layout>
<layout name="presenter-dual-vertical"> <layout name="presenter-dual-vertical">
<image x="90" y="0" scale="180" floor-only="true"/> <image x="90" y="0" scale="180" floor-only="true"/>
<image x="90" y="180" scale="180" reservation_id="presenter"/> <image x="90" y="180" scale="180" reservation_id="presenter"/>

View File

@ -834,6 +834,12 @@ AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h]) AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/prctl.h sys/select.h netdb.h execinfo.h sys/time.h])
# Solaris 11 privilege management
AS_CASE([$host],
[*-*-solaris2.11], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([SOLARIS_PRIVILEGES],[1],[Solaris 11 privilege management])])]
)
if test x"$ac_cv_header_wchar_h" = xyes; then if test x"$ac_cv_header_wchar_h" = xyes; then
HAVE_WCHAR_H_DEFINE=1 HAVE_WCHAR_H_DEFINE=1
else else
@ -1665,7 +1671,6 @@ ac_cv_file_dbd_apr_dbd_mysql_c=no
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile
build/Makefile build/Makefile
src/Makefile src/Makefile
tests/unit/Makefile
src/mod/Makefile src/mod/Makefile
src/mod/applications/mod_abstraction/Makefile src/mod/applications/mod_abstraction/Makefile
src/mod/applications/mod_avmd/Makefile src/mod/applications/mod_avmd/Makefile

View File

@ -30,9 +30,12 @@ case "$1" in
chown freeswitch $x chown freeswitch $x
done done
if [ ! -d "/etc/freeswitch" ]; then if [ ! -d "/etc/freeswitch" ]; then
mkdir -p /etc/freeswitch/
cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
fi
if [ ! -d "/etc/freeswitch/tls" ]; then
mkdir -p /etc/freeswitch/tls/ mkdir -p /etc/freeswitch/tls/
chown freeswitch:freeswitch /etc/freeswitch/tls chown freeswitch:freeswitch /etc/freeswitch/tls
cp -a /usr/share/freeswitch/conf/vanilla/* /etc/freeswitch/
fi fi
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -3,9 +3,6 @@ set -e
case "$1" in case "$1" in
remove|upgrade|deconfigure) remove|upgrade|deconfigure)
if [ -d /etc/freeswitch ]; then
echo "We're about to remove a configured FreeSWITCH..." >&2
fi
;; ;;
failed-upgrade) failed-upgrade)
;; ;;

63
debian/util.sh vendored
View File

@ -137,10 +137,9 @@ create_orig () {
{ {
set -e set -e
local OPTIND OPTARG local OPTIND OPTARG
local uver="" hrev="" bundle_deps=false modules_list="" zl=9e local uver="" hrev="" bundle_deps=true modules_list="" zl=9e
while getopts 'bm:nv:z:' o "$@"; do while getopts 'bm:nv:z:' o "$@"; do
case "$o" in case "$o" in
b) bundle_deps=true;;
m) modules_list="$OPTARG";; m) modules_list="$OPTARG";;
n) uver="nightly";; n) uver="nightly";;
v) uver="$OPTARG";; v) uver="$OPTARG";;
@ -275,8 +274,9 @@ build_debs () {
{ {
set -e set -e
local OPTIND OPTARG debug_hook=false hookdir="" cow_build_opts="" local OPTIND OPTARG debug_hook=false hookdir="" cow_build_opts=""
local keep_pbuilder_config=false keyring="" custom_keyring="" local keep_pbuilder_config=false keyring="" custom_keyring="/tmp/fs.asc"
local use_custom_sources=false local use_custom_sources=true
local custom_sources_file="/tmp/fs.sources.list"
while getopts 'BbdK:kT:t' o "$@"; do while getopts 'BbdK:kT:t' o "$@"; do
case "$o" in case "$o" in
B) cow_build_opts="--debbuildopts '-B'";; B) cow_build_opts="--debbuildopts '-B'";;
@ -284,11 +284,56 @@ build_debs () {
d) debug_hook=true;; d) debug_hook=true;;
k) keep_pbuilder_config=true;; k) keep_pbuilder_config=true;;
K) custom_keyring="$OPTARG";; K) custom_keyring="$OPTARG";;
t) use_custom_sources=true; custom_sources_file="/etc/apt/sources.list";; t) custom_sources_file="/etc/apt/sources.list";;
T) use_custom_sources=true; custom_sources_file="$OPTARG";; T) custom_sources_file="$OPTARG";;
esac esac
done done
shift $(($OPTIND-1)) shift $(($OPTIND-1))
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
custom_sources_file="/tmp/fs.sources.list"
apt-key exportall > "/tmp/fs.asc"
custom_keyring="/tmp/fs.asc"
fi
if [ "$custom_sources_file" == "" ]; then
# Caller has explicitly set the custom sources file to empty string. They must intend to not use additional mirrors.
use_custom_sources=false
fi
if [[ "$custom_source_file" == "/tmp/fs.sources.list" && ! -e "/tmp/fs.sources.list" ]]; then
echo "deb http://files.freeswitch.org/repo/deb/debian/ jessie main" >> "/tmp/fs.sources.list"
fi
if [[ "$custom_keyring" == "/tmp/fs.asc" && ! -r "/tmp/fs.asc" ]]; then
cat << EOF > "/tmp/fs.asc"
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.12 (GNU/Linux)
mQGiBE8jEfIRBAC+Cca0fPQxhyhn0NMsPaMQJgTvqhWb5/f4Mel++kosmUQQ4fJq
4U9NFvpfNyLp5MoHpnlDfAb+e57B2sr47NOJLTh83yQIAnvU+8O0Q4kvMaiiesX5
CisApLBs6Vx28y7VWmLsY3vWu8mC7M+PORKfpBV8DWy/7569wQPx2SCsIwCgzv2T
8YsnYsSVRrrmh46J1o4/ngsD/13ETX4ws/wNN+82RdqUxu7fjc0fNbUAb6XYddAb
1hrw5npQulgUNWkpnVmIDRHDXLNMeT8nZDkxsA8AsT+u7ACfPFa2o3R8w9zOPSO+
oSO0+Puhop2+z1gm6lmfMKq9HpeXG3yt/8zsEVUmOYT9m+vYEVghfpXtACVYheDq
LzUuA/9E9HBiNPVhJ/mEpOk9bZ1gpwr3mjlpUbvX5aGwTJJ+YoTfZOCL7go3uQHn
/sT35WoJ23wJCRlW0SYTFJqCoris9AhI+qw7xRTw9wb+txSI96uhafUUMCn6GLkN
+yAixqDwNHKkdax3GSGJtLB0t67QoBDIpcGog7ZfRMvWP3QLNLQ4RnJlZVNXSVRD
SCBQYWNrYWdlIFNpZ25pbmcgS2V5IDxwYWNrYWdlc0BmcmVlc3dpdGNoLm9yZz6I
YgQTEQIAIgUCTyMR8gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQ127c
dyXgEM879ACffY0HFi+mACtfFYmX/Uk/qGELSP4An1B8D5L4dLFFr1zV9YawQUbz
O9/MuQENBE8jEfIQBAC7vnn855YDuz1gTsUMYDxfIRH5KPmDDEAf1WXoD3QG4qOQ
xVW5nhp/bolh2CacAxdOjZePdhGkkdNOBpcu9NlTNRru0myGN8etbnzP3O5dq0io
VMf23C5u9KPbxwRWS+WFtC4CRFn6DafDI1qa3Gv3CkiBWtKR0Wid2SQLzl3mVwAF
EQP9HlwGjhBfFA26LlSMPhSo0Ll+sdcOJupJ21zmGeg7c0GpBnzDzyyJg04gbahs
xWtW3Y/+B4LGM97o6lnu0OQI7MX5gY1G4Jgu6pgYv8tQd5XyU/CAJUA5VWTxUMIi
JP6qlzm1bz4AAPmGw4mkS1u4N+vai21Zl4iyFIQFeiuU/K2ISQQYEQIACQUCTyMR
8gIbDAAKCRDXbtx3JeAQzxReAJ4uvms1n7xV3CcJPQlM7ndX5MZU3QCgxp8zubcL
/SsMvw7XApSHFs5ooYc=
=Xc8P
-----END PGP PUBLIC KEY BLOCK-----
EOF
fi
local distro="$(find_distro $1)" dsc="$2" arch="$3" local distro="$(find_distro $1)" dsc="$2" arch="$3"
if [ -z "$distro" ] || [ "$distro" = "auto" ]; then if [ -z "$distro" ] || [ "$distro" = "auto" ]; then
if ! (echo "$dsc" | grep -e '-[0-9]*~[a-z]*+[0-9]*'); then if ! (echo "$dsc" | grep -e '-[0-9]*~[a-z]*+[0-9]*'); then
@ -309,11 +354,13 @@ build_debs () {
fi fi
cow () { cow () {
if ! $use_custom_sources; then if ! $use_custom_sources; then
echo "Using system sources $keyring $distro $custom_sources_file"
cowbuilder "$@" \ cowbuilder "$@" \
--distribution $distro \ --distribution $distro \
--architecture $arch \ --architecture $arch \
--basepath $cow_img --basepath $cow_img
else else
echo "Using custom sources $keyring $distro $custom_sources_file"
cowbuilder "$@" \ cowbuilder "$@" \
--distribution $distro \ --distribution $distro \
--architecture $arch \ --architecture $arch \
@ -459,7 +506,6 @@ commands:
[ This must be run as root! ] [ This must be run as root! ]
-a Specify architectures -a Specify architectures
-b Bundle downloaded libraries in source package
-c Specify distributions -c Specify distributions
-d Enable cowbuilder debug hook -d Enable cowbuilder debug hook
-f <modules.conf> -f <modules.conf>
@ -480,7 +526,7 @@ commands:
Include otherwise avoided module Include otherwise avoided module
-s [ paranoid | reckless ] -s [ paranoid | reckless ]
Set FS bootstrap/build -j flags Set FS bootstrap/build -j flags
-t Use system /etc/apt/sources.list in build environment -t Use system /etc/apt/sources.list in build environment(does not include /etc/apt/sources.list.d/*.list)
-T [/path/to/sources.list] -T [/path/to/sources.list]
Use custom /etc/apt/sources.list in build environment Use custom /etc/apt/sources.list in build environment
-u <suite-postfix> -u <suite-postfix>
@ -521,7 +567,6 @@ commands:
create-orig <treeish> create-orig <treeish>
-b Bundle downloaded libraries in source package
-m [ quicktest | non-dfsg ] -m [ quicktest | non-dfsg ]
Choose custom list of modules to build Choose custom list of modules to build
-n Nightly build -n Nightly build

View File

@ -316,7 +316,14 @@
if(typeof self.localStream.stop == 'function') { if(typeof self.localStream.stop == 'function') {
self.localStream.stop(); self.localStream.stop();
} else { } else {
self.localStream.active = false; if (self.localStream.active){
var tracks = self.localStream.getTracks();
console.error(tracks);
tracks.forEach(function(track, index){
console.log(track);
track.stop();
})
}
} }
self.localStream = null; self.localStream = null;
} }
@ -334,7 +341,14 @@
if(typeof self.options.localVideoStream.stop == 'function') { if(typeof self.options.localVideoStream.stop == 'function') {
self.options.localVideoStream.stop(); self.options.localVideoStream.stop();
} else { } else {
self.options.localVideoStream.active = false; if (self.localVideoStream.active){
var tracks = self.localVideoStream.getTracks();
console.error(tracks);
tracks.forEach(function(track, index){
console.log(track);
track.stop();
})
}
} }
} }
@ -453,7 +467,10 @@
var audio; var audio;
if (obj.options.videoParams && obj.options.screenShare) {//obj.options.videoParams.chromeMediaSource == 'desktop') { if (obj.options.useMic && obj.options.useMic === "none") {
console.log("Microphone Disabled");
audio = false;
} else if (obj.options.videoParams && obj.options.screenShare) {//obj.options.videoParams.chromeMediaSource == 'desktop') {
//obj.options.videoParams = { //obj.options.videoParams = {
// chromeMediaSource: 'screen', // chromeMediaSource: 'screen',
@ -523,6 +540,7 @@
} }
} else { } else {
console.log("Camera Disabled");
video = false; video = false;
useVideo = false; useVideo = false;
} }
@ -590,17 +608,20 @@
console.log("Audio constraints", mediaParams.audio); console.log("Audio constraints", mediaParams.audio);
console.log("Video constraints", mediaParams.video); console.log("Video constraints", mediaParams.video);
if (mediaParams.audio || mediaParams.video) {
getUserMedia({ getUserMedia({
constraints: { constraints: {
audio: mediaParams.audio, audio: mediaParams.audio,
video: mediaParams.video video: mediaParams.video
}, },
video: mediaParams.useVideo, video: mediaParams.useVideo,
onsuccess: onSuccess, onsuccess: onSuccess,
onerror: onError onerror: onError
}); });
} else {
onSuccess(null);
}
@ -1086,12 +1107,8 @@
video: video video: video
}, },
onsuccess: function(e) { onsuccess: function(e) {
if(typeof e.stop == 'function') { e.getTracks().forEach(function(track) {track.stop();});
e.stop(); console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);},
} else {
e.active = false;
}
console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);},
onerror: function(e) {console.error( w + "x" + h + " not supported."); checkRes(cam, func);} onerror: function(e) {console.error( w + "x" + h + " not supported."); checkRes(cam, func);}
}); });
} }
@ -1127,15 +1144,12 @@
video: check_video, video: check_video,
}, },
onsuccess: function(e) { onsuccess: function(e) {
if(typeof e.stop == 'function') { e.getTracks().forEach(function(track) {track.stop();});
e.stop();
} else { console.info("media perm init complete");
e.active = false; if (runtime) {
} setTimeout(runtime, 100, true);
console.info("media perm init complete"); }
if (runtime) {
setTimeout(runtime, 100, true);
}
}, },
onerror: function(e) { onerror: function(e) {
if (check_video && check_audio) { if (check_video && check_audio) {

View File

@ -85,9 +85,6 @@
if (verto.options.deviceParams.useCamera) { if (verto.options.deviceParams.useCamera) {
$.FSRTC.getValidRes(verto.options.deviceParams.useCamera, verto.options.deviceParams.onResCheck); $.FSRTC.getValidRes(verto.options.deviceParams.useCamera, verto.options.deviceParams.onResCheck);
} else {
verto.options.deviceParams.useCamera = "any";
$.FSRTC.getValidRes(undefined, undefined);
} }
if (!verto.options.deviceParams.useMic) { if (!verto.options.deviceParams.useMic) {
@ -2549,7 +2546,7 @@
console.info("Audio Devices", $.verto.audioInDevices); console.info("Audio Devices", $.verto.audioInDevices);
console.info("Video Devices", $.verto.videoDevices); console.info("Video Devices", $.verto.videoDevices);
runtime(); runtime(true);
}); });
} else { } else {
/* of course it's a totally different API CALL with different element names for the same exact thing */ /* of course it's a totally different API CALL with different element names for the same exact thing */
@ -2586,12 +2583,12 @@
console.info("Audio IN Devices", $.verto.audioInDevices); console.info("Audio IN Devices", $.verto.audioInDevices);
console.info("Audio Out Devices", $.verto.audioOutDevices); console.info("Audio Out Devices", $.verto.audioOutDevices);
console.info("Video Devices", $.verto.videoDevices); console.info("Video Devices", $.verto.videoDevices);
runtime(); runtime(true);
}) })
.catch(function(err) { .catch(function(err) {
console.log(" Device Enumeration ERROR: " + err.name + ": " + err.message); console.log(" Device Enumeration ERROR: " + err.name + ": " + err.message);
runtime(); runtime(false);
}); });
} }
@ -2602,9 +2599,24 @@
} }
$.verto.init = function(obj, runtime) { $.verto.init = function(obj, runtime) {
$.FSRTC.checkPerms(function() { if (!obj) {
obj = {};
}
if (!obj.skipPermCheck && !obj.skipDeviceCheck) {
$.FSRTC.checkPerms(function(status) {
checkDevices(runtime);
}, true, true);
} else if (obj.skipPermCheck && !obj.skipDeviceCheck) {
checkDevices(runtime); checkDevices(runtime);
}, true, true); } else if (!obj.skipPermCheck && obj.skipDeviceCheck) {
$.FSRTC.checkPerms(function(status) {
runtime(status);
}, true, true);
} else {
runtime(null);
}
} }
$.verto.genUUID = function () { $.verto.genUUID = function () {

View File

@ -2,3 +2,4 @@ dist/
.tmp/ .tmp/
bower_components/ bower_components/
node_modules/ node_modules/
src/vertoControllers/controllers/AboutController.js

View File

@ -24,15 +24,16 @@ module.exports = function (grunt) {
var debug = grunt.option('debug'); var debug = grunt.option('debug');
var uglify_config = { var uglify_config = {
options: {
sourceMap: true,
sourceMapIncludeSources:true
}
}; };
if (debug) { if (debug) {
uglify_config = { uglify_config['options']['mangle'] = debug ? false : true;
options: { uglify_config['options']['beautify'] = debug ? false : true;
beautify: debug ? true : false, uglify_config['options']['compress'] = debug ? false : true;
compress: debug ? false : true,
mangle: debug ? false : true
}
};
} }
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
@ -62,6 +63,26 @@ module.exports = function (grunt) {
} }
}, },
revision: {
options: {
property: 'meta.revision',
ref: 'HEAD',
short: true
}
},
preprocess: {
options: {
context: {
revision: '<%= meta.revision %>'
}
},
js: {
src: 'src/vertoControllers/controllers/AboutController.source.js',
dest: 'src/vertoControllers/controllers/AboutController.js'
},
},
postcss: { postcss: {
options: { options: {
map: true, map: true,
@ -129,6 +150,8 @@ module.exports = function (grunt) {
], ],
routes: { routes: {
'/partials': 'src/partials', '/partials': 'src/partials',
'/config.json': 'src/config.json',
'/contributors.txt': 'src/contributors.txt',
'/bower_components': './bower_components', '/bower_components': './bower_components',
'/js/src': '../js/src', '/js/src': '../js/src',
'/js': './js' '/js': './js'
@ -283,6 +306,7 @@ module.exports = function (grunt) {
'*.html', '*.html',
'*.json', '*.json',
'partials/**/*.html', 'partials/**/*.html',
'img/*.png',
'images/{,*/}*.{webp}', 'images/{,*/}*.{webp}',
'css/fonts/{,*/}*.*', 'css/fonts/{,*/}*.*',
'sounds/*.*' 'sounds/*.*'
@ -324,6 +348,9 @@ module.exports = function (grunt) {
}, },
}); });
grunt.loadNpmTasks('grunt-git-revision');
grunt.loadNpmTasks('grunt-preprocess');
grunt.registerTask('serve', function (target) { grunt.registerTask('serve', function (target) {
var tasks = [ var tasks = [
'wiredep', 'wiredep',
@ -337,8 +364,12 @@ module.exports = function (grunt) {
grunt.task.run(tasks); grunt.task.run(tasks);
}); });
grunt.registerTask('default', ['build']);
grunt.registerTask('build', [ grunt.registerTask('build', [
'clean:dist', 'clean:dist',
'revision',
'preprocess',
'wiredep', 'wiredep',
'useminPrepare', 'useminPrepare',
'concurrent:dist', 'concurrent:dist',

View File

@ -19,6 +19,8 @@
"grunt-contrib-jshint": "^0.11.0", "grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-uglify": "^0.7.0", "grunt-contrib-uglify": "^0.7.0",
"grunt-contrib-watch": "latest", "grunt-contrib-watch": "latest",
"grunt-preprocess": "latest",
"grunt-git-revision": "latest",
"grunt-filerev": "^2.1.2", "grunt-filerev": "^2.1.2",
"grunt-newer": "^1.1.0", "grunt-newer": "^1.1.0",
"grunt-ng-annotate": "^0.9.2", "grunt-ng-annotate": "^0.9.2",

View File

@ -3,5 +3,6 @@
"Ítalo Rossi <italo@evolux.net.br>", "Ítalo Rossi <italo@evolux.net.br>",
"Stefan Yohansson <stefan@evolux.net.br>", "Stefan Yohansson <stefan@evolux.net.br>",
"João Mesquita <jmesquita@indicium.com.ar>", "João Mesquita <jmesquita@indicium.com.ar>",
"Ken Rice <krice@freeswitch.org>" "Ken Rice <krice@freeswitch.org>",
"Brian West <brian@freeswitch.org>"
] ]

View File

@ -8,6 +8,18 @@ body {
padding-top: 60px; padding-top: 60px;
} }
.ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 160px;
display: inline-block;
}
.clickable {
cursor: pointer;
}
.inline-block { .inline-block {
display: inline-block; display: inline-block;
} }
@ -110,6 +122,10 @@ button.btn i {
color: #F45A5A; color: #F45A5A;
} }
.mdi-navigation-more-vert.dark {
color: #333;
}
.incall-number { .incall-number {
font-weight: bold; font-weight: bold;
padding-top: 22px; padding-top: 22px;
@ -223,6 +239,29 @@ button.btn i {
} }
} }
/* --- Splash Screen --- */
.splash-errors {
background: rgba(249, 21, 21, 0.55);
color: white;
padding: 8px;
margin-top: 11px;
}
.splash-errors ul {
padding-start: 0em;
-moz-padding-start: 0em;
-webkit-padding-start: 0em;
padding-start: 0em;
}
.splash-errors li {
background-color: rgba(154, 36, 36, 0.28);
padding: 8px;
font-weight: bold;
list-style: none;
}
/* --- End of Splash Screen --- */
/* --- Modal settings page --- */ /* --- Modal settings page --- */
@ -231,6 +270,10 @@ body .modal-body .btn-group .btn.active {
color: #EEE; color: #EEE;
} }
.dedicated_encoder {
color: #0B3A84;
}
/* --- End of Modal settings page --- */ /* --- End of Modal settings page --- */
@ -857,10 +900,31 @@ body .modal-body .btn-group .btn.active {
width: 160px; width: 160px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-top: 5px;
white-space: nowrap; white-space: nowrap;
} }
.members-number {
font-size: 10px;
}
.members-badges {
font-size: 10px;
text-transform: uppercase;
margin-top: -2px;
}
.badge-floor span {
display: inline-block;
}
.lock-floor {
position: relative;
top: -3px;
display: inline-block;
font-size: 10px;
color: #FFF;
}
.chat-members .chat-member-item { .chat-members .chat-member-item {
padding: 8px 16px; padding: 8px 16px;
height: 56px; height: 56px;
@ -892,7 +956,8 @@ body .modal-body .btn-group .btn.active {
margin: 0; margin: 0;
font-size: 16px; font-size: 16px;
display: inline-block; display: inline-block;
line-height: 18px; line-height: 16px;
margin-top: -3px;
} }
.chat-members .chat-members-status i { .chat-members .chat-members-status i {

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -98,15 +98,18 @@
<script type="text/javascript" src="src/vertoApp/vertoApp.module.js"></script> <script type="text/javascript" src="src/vertoApp/vertoApp.module.js"></script>
<script type="text/javascript" src="src/vertoControllers/vertoControllers.module.js"></script> <script type="text/javascript" src="src/vertoControllers/vertoControllers.module.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/SplashScreenController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/BrowserUpgradeController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/BrowserUpgradeController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ChatController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/ChatController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ContributorsController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/ContributorsController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/AboutController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/DialPadController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/DialPadController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/InCallController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/InCallController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/LoginController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/LoginController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/MainController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/MainController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/MenuController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/MenuController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ModalDialpadController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/ModalDialpadController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ModalWsReconnectController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ModalLoginInformationController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/ModalLoginInformationController.js"></script>
<script type="text/javascript" src="src/vertoControllers/controllers/ModalSettingsController.js"></script> <script type="text/javascript" src="src/vertoControllers/controllers/ModalSettingsController.js"></script>
@ -118,10 +121,13 @@
<script type="text/javascript" src="src/vertoService/vertoService.module.js"></script> <script type="text/javascript" src="src/vertoService/vertoService.module.js"></script>
<script type="text/javascript" src="src/vertoService/services/vertoService.js"></script> <script type="text/javascript" src="src/vertoService/services/vertoService.js"></script>
<script type="text/javascript" src="src/vertoService/services/configService.js"></script>
<script type="text/javascript" src="src/vertoService/services/eventQueueService.js"></script>
<script type="text/javascript" src="src/storageService/storageService.module.js"></script> <script type="text/javascript" src="src/storageService/storageService.module.js"></script>
<script type="text/javascript" src="src/storageService/services/storage.js"></script> <script type="text/javascript" src="src/storageService/services/storage.js"></script>
<script type="text/javascript" src="src/storageService/services/call_history.js"></script> <script type="text/javascript" src="src/storageService/services/call_history.js"></script>
<script type="text/javascript" src="src/storageService/services/splash_screen.js"></script>
<!-- endbuild --> <!-- endbuild -->

View File

@ -0,0 +1,22 @@
<div class="modal-header">
</div>
<div class="modal-body">
<ul class="contributors">
<li>
<div class="clearfix"><img src="img/vc_logo.png"></div>
</li>
<li>
<div class="clearfix">Version: 0.1.0</div>
</li>
<li>
<div class="clearfix">Git Rev: {{ githash }}</div>
</li>
<li>
<div class="clearfix">Powered By: <a href="https://freeswitch.org/" target="_blank"><img src="img/fs_logo_small.png" height="30"></a></div>
</li>
</ul>
</div>
<div class="modal-footer">
</div>

View File

@ -19,13 +19,23 @@
<div ng-repeat="member in members" class="chat-member-item"> <div ng-repeat="member in members" class="chat-member-item">
<span class="chat-members-avatar"> <span class="chat-members-avatar">
<img gravatar-size="40" gravatar-src-once="member.email" class="img-circle" ng-class="{'chat-member-talking': member.status.audio.talking, 'chat-member-muted': member.status.audio.muted}" /> <img gravatar-size="40" gravatar-src="::member.email" class="img-circle" ng-class="{'chat-member-talking': member.status.audio.talking, 'chat-member-muted': member.status.audio.muted}" />
</span> </span>
<h4 class="chat-members-name"><div class="members-name">{{ member.name }}</div> <small>({{ member.number }})</small></h4> <!-- FIXME(italo): Put this whole block in a flex box to avoid defining fixed width.-->
<h4 class="chat-members-name">
<div class="members-name">{{ member.name }}</div>
<small class="ellipsis members-number">({{ member.number }})</small>
<div class="members-badges">
<div ng-if="member.status.video.floor" class="label badge-floor" ng-class="{'label-danger': member.status.video.floorLocked, 'label-info': !member.status.video.floorLocked}"><i class="mdi mdi-action-https lock-floor" ng-if="member.status.video.floorLocked"></i> <span>Floor</span></div>
<div ng-if="member.status.video.reservationID == 'presenter'" class="label label-warning">Presenter</div>
</div>
</h4>
<div class="pull-right action-buttons chat-members-action" ng-show="verto.data.confRole == 'moderator'"> <div class="pull-right action-buttons chat-members-action" ng-show="verto.data.confRole == 'moderator'">
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-xs dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-xs dropdown-toggle" data-toggle="dropdown">
<i class="mdi-navigation-more-vert" style="margin-right: 0px;"></i> <i class="mdi-navigation-more-vert dark" style="margin-right: 0px;"></i>
</button> </button>
<ul class="dropdown-menu slidedown pull-right"> <ul class="dropdown-menu slidedown pull-right">
<li> <li>
@ -64,6 +74,12 @@
Banner Banner
</a> </a>
</li> </li>
<li>
<a href="" ng-click="confResetBanner(member.id)">
<span class="mdi-fw mdi-content-clear"></span>
Reset Banner
</a>
</li>
<li> <li>
<a href="" ng-click="confVolumeDown(member.id)"> <a href="" ng-click="confVolumeDown(member.id)">
<span class="mdi-fw mdi-av-volume-down"></span> <span class="mdi-fw mdi-av-volume-down"></span>
@ -87,8 +103,8 @@
</div> </div>
<span class="chat-members-status pull-right"> <span class="chat-members-status pull-right">
<i class="in-use" ng-class="{'mdi-av-mic': !member.status.audio.muted, 'mdi-av-mic-off': member.status.audio.muted, 'mic_talking': member.status.audio.talking}"></i> <i ng-click="confMuteMic(member.id)" class="in-use" ng-class="{'clickable': verto.data.confRole == 'moderator', 'mdi-av-mic': !member.status.audio.muted, 'mdi-av-mic-off': member.status.audio.muted, 'mic_talking': member.status.audio.talking}"></i>
<i ng-class="{'mdi-av-videocam': !member.status.video.muted, 'mdi-av-videocam-off': member.status.video.muted, 'in-use': (member.status.video && !member.status.video.muted), 'disabled': !member.status.video}"></i> <i ng-click="confMuteVideo(member.id)" ng-class="{'clickable': verto.data.confRole == 'moderator', 'mdi-av-videocam': !member.status.video.muted, 'mdi-av-videocam-off': member.status.video.muted, 'in-use': (member.status.video && !member.status.video.muted), 'disabled': !member.status.video}"></i>
</span> </span>
</div> </div>
</div> </div>

View File

@ -28,6 +28,11 @@
<input type="password" class="form-control" id="login-password" placeholder="Password" ng-model="verto.data.password"> <input type="password" class="form-control" id="login-password" placeholder="Password" ng-model="verto.data.password">
</div> </div>
<div class="form-group" ng-hide="!advanced">
<label class="control-label" for="login-callerid">Caller ID</label>
<input type="text" class="form-control" id="login-callerid" placeholder="Caller ID" ng-model="verto.data.callerid">
</div>
<div class="form-group" ng-hide="!advanced"> <div class="form-group" ng-hide="!advanced">
<label class="control-label" for="login-hostname">Hostname</label> <label class="control-label" for="login-hostname">Hostname</label>
<input type="text" class="form-control" id="login-hostname" placeholder="Hostname" ng-model="verto.data.hostname"> <input type="text" class="form-control" id="login-hostname" placeholder="Hostname" ng-model="verto.data.hostname">

View File

@ -13,7 +13,7 @@
<span class="icon-bar"></span> <span class="icon-bar"></span>
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
<a class="navbar-brand" href="#/"> <a class="navbar-brand" href="javascript:void(0)">
Verto Communicator Verto Communicator
</a> </a>
</div> </div>
@ -58,9 +58,15 @@
</ul> </ul>
</li> </li>
<li class="navbar-item-icon"> <li class="navbar-item-icon">
<a href="" ng-click="showContributors()"> <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<i class="mdi-action-loyalty"></i> <i class="mdi-action-loyalty"></i>
<span class="caret"></span>
</a> </a>
<ul class="dropdown-menu" role="menu">
<li><a href="" ng-click="showAbout()">About</a></li>
<li><a href="" ng-click="showContributors()">Contributors</a></li>
<li><a href="https://freeswitch.org/confluence/x/MQCT" target="_blank">Help</a></li>
</ul>
</li> </li>
</ul> </ul>

View File

@ -23,6 +23,10 @@
<input type="password" class="form-control" id="password" placeholder="Password" ng-model="verto.data.password"> <input type="password" class="form-control" id="password" placeholder="Password" ng-model="verto.data.password">
</div> </div>
<div class="form-group">
<label class="control-label" for="callerid">Caller ID</label>
<input type="text" class="form-control" id="callerid" placeholder="Caller ID" ng-model="verto.data.callerid">
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@ -46,12 +46,6 @@
Use STUN Use STUN
</label> </label>
</div> </div>
<div class="checkbox">
<label>
<input type="checkbox" name="use_dedenc" ng-value="mydata.useDedenc" ng-model="mydata.useDedenc">
Use Dedicated Remote Encoder
</label>
</div>
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" name="mirror_input" ng-value="mydata.mirrorInput" ng-model="mydata.mirrorInput"> <input type="checkbox" name="mirror_input" ng-value="mydata.mirrorInput" ng-model="mydata.mirrorInput">
@ -96,10 +90,20 @@
ng-options="item.id as item.label for item in verto.videoQuality"></select> ng-options="item.id as item.label for item in verto.videoQuality"></select>
</div> </div>
<input type="hidden" name="use_dedenc" ng-value="mydata.useDedenc" ng-model="mydata.useDedenc">
<h4>Dedicated Remote Encoder</h4>
<h5>Select a non default bandwidth to use a dedicated remote encoder.</h5>
<div ng-show="mydata.useDedenc" class="dedicated_encoder">
<p>Dedicated Remote Encoder enabled.</b>
</div>
<div class="form-group"> <div class="form-group">
<label for="outgoing-bandwidth">Max outgoing bandwidth:</label> <label for="outgoing-bandwidth">Max outgoing bandwidth:</label>
<select name="outgoing_bandwidth" id="outgoing-bandwidth" class="form-control" <select name="outgoing_bandwidth" id="outgoing-bandwidth" class="form-control"
ng-model="mydata.outgoingBandwidth" ng-model="mydata.outgoingBandwidth"
ng-change="checkUseDedRemoteEncoder(mydata.outgoingBandwidth)"
ng-options="item.id as item.label for item in verto.bandwidth"></select> ng-options="item.id as item.label for item in verto.bandwidth"></select>
</div> </div>
@ -107,6 +111,7 @@
<label for="incoming-bandwidth">Max incoming bandwidth:</label> <label for="incoming-bandwidth">Max incoming bandwidth:</label>
<select name="incoming_bandwidth" id="incoming-bandwidth" class="form-control" <select name="incoming_bandwidth" id="incoming-bandwidth" class="form-control"
ng-model="mydata.incomingBandwidth" ng-model="mydata.incomingBandwidth"
ng-change="checkUseDedRemoteEncoder(mydata.incomingBandwidth)"
ng-options="item.id as item.label for item in verto.bandwidth"></select> ng-options="item.id as item.label for item in verto.bandwidth"></select>
</div> </div>

View File

@ -0,0 +1,21 @@
<div class="centered-block-frame" id="splash_screen">
<div class="col-md-6 centered-block">
<div class="card">
<div class="card-body text-center">
<h2>Loading</h2>
<div class="progress progress-striped active">
<div class="progress-bar" ng-class="{'progress-bar-danger': interrupt_next}" style="width: {{ progress_percentage }}%"></div>
</div>
<div ng-bind="message"></div>
<div class="splash-errors" ng-if="errors.length">
<h4>Errors</h4>
<ul ng-repeat="error in errors">
<li>{{ ::error }}</li>
</ul>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,9 @@
<div class="modal-header">
<h3 class="modal-title">Waiting for server reconnection.</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
</div>

View File

@ -0,0 +1,235 @@
'use strict';
angular
.module('storageService')
.service('splashscreen', ['$rootScope', '$q', 'storage', 'config', 'verto',
function($rootScope, $q, storage, config, verto) {
var checkBrowser = function() {
return $q(function(resolve, reject) {
var activity = 'browser-upgrade';
var result = {
'activity': activity,
'soft': false,
'status': 'success',
'message': 'Checking browser compability.'
};
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia;
if (!navigator.getUserMedia) {
result['status'] = 'error';
result['message'] = 'Error: browser doesn\'t support WebRTC.';
reject(result);
}
resolve(result);
});
};
var checkMediaPerm = function() {
return $q(function(resolve, reject) {
var activity = 'media-perm';
var result = {
'activity': activity,
'soft': false,
'status': 'success',
'message': 'Checking media permissions'
};
verto.mediaPerm(function(status) {
if(!status) {
result['status'] = 'error';
result['message'] = 'Error: Media Permission Denied';
verto.data.mediaPerm = false;
reject(result);
}
verto.data.mediaPerm = true;
resolve(result);
});
});
};
var refreshMediaDevices = function() {
return $q(function(resolve, reject) {
var activity = 'refresh-devices';
var result = {
'status': 'success',
'soft': true,
'activity': activity,
'message': 'Refresh Media Devices.'
};
verto.refreshDevices(function(status) {
verto.refreshDevicesCallback(function() {
resolve(result);
});
});
});
};
var provisionConfig = function() {
return $q(function(resolve, reject) {
var activity = 'provision-config';
var result = {
'status': 'promise',
'soft': true,
'activity': activity,
'message': 'Provisioning configuration.'
};
var configResponse = config.configure();
var configPromise = configResponse.then(
function(response) {
/**
* from angular docs:
* A response status code between 200 and 299 is considered a success status and will result in the success callback being called
*/
if(response.status >= 200 && response.status <= 299) {
return result;
} else {
result['status'] = 'error';
result['message'] = 'Error: Provision failed.';
return result;
}
});
result['promise'] = configPromise;
resolve(result);
});
};
var checkLogin = function() {
return $q(function(resolve, reject) {
var activity = 'check-login';
var result = {
'status': 'success',
'soft': true,
'activity': activity,
'message': 'Checking login.'
};
if(verto.data.connecting || verto.data.connected) {
resolve(result);
return;
};
var checkUserStored = function() {
/**
* if user data saved, use stored data for logon and not connecting
* not connecting prevent two connects
*/
if (storage.data.ui_connected && storage.data.ws_connected && !verto.data.connecting) {
verto.data.name = storage.data.name;
verto.data.email = storage.data.email;
verto.data.login = storage.data.login;
verto.data.password = storage.data.password;
verto.data.connecting = true;
verto.connect(function(v, connected) {
verto.data.connecting = false;
resolve(result);
});
};
};
if(storage.data.ui_connected && storage.data.ws_connected) {
checkUserStored();
} else {
resolve(result);
};
});
};
var progress = [
checkBrowser,
checkMediaPerm,
refreshMediaDevices,
provisionConfig,
checkLogin
];
var progress_message = [
'Checking browser compability.',
'Checking media permissions',
'Refresh Media Devices.',
'Provisioning configuration.',
'Checking login.'
];
var getProgressMessage = function(current_progress) {
if(progress_message[current_progress] != undefined) {
return progress_message[current_progress];
} else {
return 'Please wait...';
}
};
var current_progress = -1;
var progress_percentage = 0;
var calculateProgress = function(index) {
var _progress;
_progress = index + 1;
progress_percentage = (_progress / progress.length) * 100;
return progress_percentage;
};
var nextProgress = function() {
var fn, fn_return, status, interrupt, activity, soft, message, promise;
interrupt = false;
current_progress++;
if(current_progress >= progress.length) {
$rootScope.$emit('progress.complete', current_progress);
return;
}
fn = progress[current_progress];
fn_return = fn();
var emitNextProgress = function(fn_return) {
if(fn_return['promise'] != undefined) {
promise = fn_return['promise'];
}
status = fn_return['status'];
soft = fn_return['soft'];
activity = fn_return['activity'];
message = fn_return['message'];
if(status != 'success') {
interrupt = true;
}
$rootScope.$emit('progress.next', current_progress, status, promise, activity, soft, interrupt, message);
};
fn_return.then(
function(fn_return) {
emitNextProgress(fn_return);
},
function(fn_return) {
emitNextProgress(fn_return);
}
);
};
return {
'next': nextProgress,
'getProgressMessage': getProgressMessage,
'progress_percentage': progress_percentage,
'calculate': calculateProgress
};
}]);

View File

@ -53,6 +53,8 @@
data.userStatus = 'disconnected'; data.userStatus = 'disconnected';
}, },
factoryReset: function() { factoryReset: function() {
localStorage.clear();
// set defaultSettings again
data.$reset(defaultSettings); data.$reset(defaultSettings);
}, },
}; };

View File

@ -19,6 +19,11 @@
vertoApp.config(['$routeProvider', 'gravatarServiceProvider', vertoApp.config(['$routeProvider', 'gravatarServiceProvider',
function($routeProvider, gravatarServiceProvider) { function($routeProvider, gravatarServiceProvider) {
$routeProvider. $routeProvider.
when('/', {
title: 'Loading',
templateUrl: 'partials/splash_screen.html',
controller: 'SplashScreenController'
}).
when('/login', { when('/login', {
title: 'Login', title: 'Login',
templateUrl: 'partials/login.html', templateUrl: 'partials/login.html',
@ -40,7 +45,7 @@
controller: 'BrowserUpgradeController' controller: 'BrowserUpgradeController'
}). }).
otherwise({ otherwise({
redirectTo: '/login' redirectTo: '/'
}); });
gravatarServiceProvider.defaults = { gravatarServiceProvider.defaults = {
@ -49,8 +54,19 @@
} }
]); ]);
vertoApp.run(['$rootScope', '$location', 'toastr', 'prompt', vertoApp.run(['$rootScope', '$location', 'toastr', 'prompt', 'verto',
function($rootScope, $location, toastr, prompt) { function($rootScope, $location, toastr, prompt, verto) {
$rootScope.$on( "$routeChangeStart", function(event, next, current) {
if (!verto.data.connected) {
if ( next.templateUrl === "partials/login.html") {
// pass
} else {
$location.path("/");
}
}
});
$rootScope.$on('$routeChangeSuccess', function(event, current, previous) { $rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
$rootScope.title = current.$$route.title; $rootScope.title = current.$$route.title;
}); });
@ -61,16 +77,6 @@
$rootScope.safeProtocol = true; $rootScope.safeProtocol = true;
} }
$rootScope.checkBrowser = function() {
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia;
if (!navigator.getUserMedia) {
$location.path('/browser-upgrade');
}
};
$rootScope.promptInput = function(title, message, label, callback) { $rootScope.promptInput = function(title, message, label, callback) {
var ret = prompt({ var ret = prompt({

View File

@ -0,0 +1,23 @@
(function() {
'use strict';
angular
.module('vertoControllers')
.controller('AboutController', ['$scope', '$http',
'toastr',
function($scope, $http, toastr) {
var githash = '/* @echo revision */' || 'something is not right';
$scope.githash = githash;
/* leave this here for later, but its not needed right now
$http.get(window.location.pathname + '/contributors.txt')
.success(function(data) {
})
.error(function() {
toastr.error('contributors not found.');
});
*/
}
]);
})();

View File

@ -122,7 +122,7 @@
}); });
$rootScope.$on('members.clear', function(event) { $rootScope.$on('members.clear', function(event) {
$scope.$apply(function() { $scope.$applyAsync(function() {
clearConferenceChat(); clearConferenceChat();
$scope.closeChat(); $scope.closeChat();
}); });
@ -146,13 +146,17 @@
}; };
$scope.confMuteMic = function(memberID) { $scope.confMuteMic = function(memberID) {
console.log('$scope.confMuteMic'); if(verto.data.confRole == 'moderator') {
verto.data.conf.muteMic(memberID); console.log('$scope.confMuteMic');
verto.data.conf.muteMic(memberID);
}
}; };
$scope.confMuteVideo = function(memberID) { $scope.confMuteVideo = function(memberID) {
console.log('$scope.confMuteVideo'); if(verto.data.confRole == 'moderator') {
verto.data.conf.muteVideo(memberID); console.log('$scope.confMuteVideo');
verto.data.conf.muteVideo(memberID);
}
}; };
$scope.confPresenter = function(memberID) { $scope.confPresenter = function(memberID) {
@ -167,7 +171,22 @@
$scope.confBanner = function(memberID) { $scope.confBanner = function(memberID) {
console.log('$scope.confBanner'); console.log('$scope.confBanner');
var text = 'New Banner';
prompt({
title: 'Please insert the banner text',
input: true,
label: '',
value: '',
}).then(function(text) {
if (text) {
verto.data.conf.banner(memberID, text);
}
});
};
$scope.confResetBanner = function(memberID) {
console.log('$scope.confResetBanner');
var text = 'reset';
verto.data.conf.banner(memberID, text); verto.data.conf.banner(memberID, text);
}; };

View File

@ -6,7 +6,8 @@
.controller('ContributorsController', ['$scope', '$http', .controller('ContributorsController', ['$scope', '$http',
'toastr', 'toastr',
function($scope, $http, toastr) { function($scope, $http, toastr) {
$http.get(window.location.pathname + '/contributors.txt') var url = window.location.origin + window.location.pathname;
$http.get(url + 'contributors.txt')
.success(function(data) { .success(function(data) {
var contributors = []; var contributors = [];

View File

@ -4,10 +4,12 @@
angular angular
.module('vertoControllers') .module('vertoControllers')
.controller('DialPadController', ['$rootScope', '$scope', .controller('DialPadController', ['$rootScope', '$scope',
'$http', '$location', 'toastr', 'verto', 'storage', 'CallHistory', '$http', '$location', 'toastr', 'verto', 'storage', 'CallHistory', 'eventQueue',
function($rootScope, $scope, $http, $location, toastr, verto, storage, CallHistory) { function($rootScope, $scope, $http, $location, toastr, verto, storage, CallHistory, eventQueue) {
console.debug('Executing DialPadController.'); console.debug('Executing DialPadController.');
$scope.checkBrowser();
eventQueue.process();
$scope.call_history = CallHistory.all(); $scope.call_history = CallHistory.all();
$scope.history_control = CallHistory.all_control(); $scope.history_control = CallHistory.all_control();
$scope.has_history = Object.keys($scope.call_history).length; $scope.has_history = Object.keys($scope.call_history).length;

View File

@ -10,7 +10,6 @@
console.debug('Executing InCallController.'); console.debug('Executing InCallController.');
$scope.layout = null; $scope.layout = null;
$scope.checkBrowser();
$rootScope.dialpadNumber = ''; $rootScope.dialpadNumber = '';
$scope.callTemplate = 'partials/phone_call.html'; $scope.callTemplate = 'partials/phone_call.html';
$scope.dialpadTemplate = ''; $scope.dialpadTemplate = '';

View File

@ -1,60 +1,23 @@
(function() { (function() {
'use strict'; 'use strict';
angular angular
.module('vertoControllers') .module('vertoControllers')
.controller('LoginController', ['$scope', '$http', '$location', 'verto', .controller('LoginController', ['$scope', '$http', '$location', 'verto',
function($scope, $http, $location, verto) { function($scope, $http, $location, verto) {
$scope.checkBrowser(); var preRoute = function() {
if(verto.data.connected) {
$location.path('/dialpad');
}
}
preRoute();
/* verto.data.name = $scope.storage.data.name;
* Load the Configs before logging in verto.data.email = $scope.storage.data.email;
* with cache buster
*/
$http.get(window.location.pathname + '/config.json?cachebuster=' + Math.floor((Math.random()*1000000)+1)) console.debug('Executing LoginController.');
.success(function(data) { }
]);
/* save these for later as we're about to possibly over write them */
var name = verto.data.name;
var email = verto.data.email;
console.debug("googlelogin: " + data.googlelogin);
if (data.googlelogin){
$scope.googlelogin = data.googlelogin;
$scope.googleclientid = data.googleclientid;
}
angular.extend(verto.data, data);
/**
* use stored data (localStorage) for login, allow config.json to take precedence
*/
if (name != '' && data.name == '') {
verto.data.name = name;
}
if (email != '' && data.email == '') {
verto.data.email = email;
}
if (verto.data.login == '' && verto.data.password == '' && $scope.storage.data.login != '' && $scope.storage.data.password != '') {
verto.data.login = $scope.storage.data.login;
verto.data.password = $scope.storage.data.password;
}
if (verto.data.autologin == "true" && !verto.data.autologin_done) {
console.debug("auto login per config.json");
verto.data.autologin_done = true;
$scope.login();
}
});
verto.data.name = $scope.storage.data.name;
verto.data.email = $scope.storage.data.email;
console.debug('Executing LoginController.');
}
]);
})(); })();

View File

@ -4,7 +4,7 @@
angular angular
.module('vertoControllers') .module('vertoControllers')
.controller('MainController', .controller('MainController',
function($scope, $rootScope, $location, $modal, $timeout, verto, storage, CallHistory, toastr, Fullscreen, prompt) { function($scope, $rootScope, $location, $modal, $timeout, $q, verto, storage, CallHistory, toastr, Fullscreen, prompt, eventQueue) {
console.debug('Executing MainController.'); console.debug('Executing MainController.');
@ -25,57 +25,41 @@
*/ */
$rootScope.dialpadNumber = ''; $rootScope.dialpadNumber = '';
/**
* if user data saved, use stored data for logon
*/
if (storage.data.ui_connected && storage.data.ws_connected) {
$scope.verto.data.name = storage.data.name;
$scope.verto.data.email = storage.data.email;
$scope.verto.data.login = storage.data.login;
$scope.verto.data.password = storage.data.password;
verto.connect(function(v, connected) {
$scope.$apply(function() {
if (connected) {
toastr.success('Nice to see you again.', 'Welcome back');
$location.path('/dialpad');
}
});
});
}
// If verto is not connected, redirects to login page. // If verto is not connected, redirects to login page.
if (!verto.data.connected) { if (!verto.data.connected) {
console.debug('MainController: WebSocket not connected. Redirecting to login.'); console.debug('MainController: WebSocket not connected. Redirecting to login.');
$location.path('/login'); $location.path('/');
} }
$rootScope.$on('config.http.success', function(ev) {
$scope.login(false);
});
/** /**
* Login the user to verto server and * Login the user to verto server and
* redirects him to dialpad page. * redirects him to dialpad page.
*/ */
$scope.login = function() { $scope.login = function(redirect) {
if(redirect == undefined) {
redirect = true;
}
var connectCallback = function(v, connected) { var connectCallback = function(v, connected) {
$scope.$apply(function() { $scope.$apply(function() {
if (connected) { verto.data.connecting = false;
storage.data.ui_connected = verto.data.connected; if (connected) {
storage.data.ws_connected = verto.data.connected; storage.data.ui_connected = verto.data.connected;
storage.data.name = verto.data.name; storage.data.ws_connected = verto.data.connected;
storage.data.email = verto.data.email; storage.data.name = verto.data.name;
storage.data.login = verto.data.login; storage.data.email = verto.data.email;
storage.data.password = verto.data.password; storage.data.login = verto.data.login;
storage.data.password = verto.data.password;
console.debug('Redirecting to dialpad page.'); if (redirect) {
toastr.success('Login successful.', 'Welcome');
$location.path('/dialpad'); $location.path('/dialpad');
} else {
toastr.error('There was an error while trying to login. Please try again.', 'Error');
} }
}
}); });
}; };
verto.data.connecting = true;
verto.connect(connectCallback); verto.connect(connectCallback);
}; };
@ -144,12 +128,16 @@
); );
}; };
$rootScope.openModal = function(templateUrl, controller) { $rootScope.openModal = function(templateUrl, controller, _options) {
var modalInstance = $modal.open({ var options = {
animation: $scope.animationsEnabled, animation: $scope.animationsEnabled,
templateUrl: templateUrl, templateUrl: templateUrl,
controller: controller, controller: controller,
}); };
angular.extend(options, _options);
var modalInstance = $modal.open(options);
modalInstance.result.then( modalInstance.result.then(
function(result) { function(result) {
@ -166,6 +154,36 @@
} }
); );
return modalInstance;
};
$rootScope.$on('ws.close', onWSClose);
$rootScope.$on('ws.login', onWSLogin);
var ws_modalInstance;
function onWSClose(ev, data) {
if(ws_modalInstance) {
return;
};
var options = {
backdrop: 'static',
keyboard: false
};
ws_modalInstance = $scope.openModal('partials/ws_reconnect.html', 'ModalWsReconnectController', options);
};
function onWSLogin(ev, data) {
if(!ws_modalInstance) {
return;
};
ws_modalInstance.close();
ws_modalInstance = null;
};
$scope.showAbout = function() {
$scope.openModal('partials/about.html', 'AboutController');
}; };
$scope.showContributors = function() { $scope.showContributors = function() {
@ -261,22 +279,27 @@
}); });
$rootScope.$on('page.incall', function(event, data) { $rootScope.$on('page.incall', function(event, data) {
if (storage.data.askRecoverCall) { var page_incall = function() {
prompt({ return $q(function(resolve, reject) {
title: 'Oops, Active Call in Course.', if (storage.data.askRecoverCall) {
message: 'It seems you were in a call before leaving the last time. Wanna go back to that?' prompt({
}).then(function() { title: 'Oops, Active Call in Course.',
console.log('redirect to incall page'); message: 'It seems you were in a call before leaving the last time. Wanna go back to that?'
$location.path('/incall'); }).then(function() {
}, function() { console.log('redirect to incall page');
storage.data.userStatus = 'connecting'; $location.path('/incall');
verto.hangup(); }, function() {
storage.data.userStatus = 'connecting';
verto.hangup();
});
} else {
console.log('redirect to incall page');
$location.path('/incall');
}
resolve();
}); });
} else { };
console.log('redirect to incall page'); eventQueue.events.push(page_incall);
$location.path('/incall');
}
}); });
$scope.$on('event:google-plus-signin-success', function (event,authResult) { $scope.$on('event:google-plus-signin-success', function (event,authResult) {
@ -313,7 +336,7 @@
console.log('Google+ Login Failure'); console.log('Google+ Login Failure');
}); });
$rootScope.callActive = function(data) { $rootScope.callActive = function(data, params) {
verto.data.mutedMic = storage.data.mutedMic; verto.data.mutedMic = storage.data.mutedMic;
verto.data.mutedVideo = storage.data.mutedVideo; verto.data.mutedVideo = storage.data.mutedVideo;
@ -331,10 +354,16 @@
storage.data.calling = false; storage.data.calling = false;
storage.data.cur_call = 1; storage.data.cur_call = 1;
$location.path('/incall');
if(params.useVideo) {
$rootScope.$emit('call.video', 'video');
}
}; };
$rootScope.$on('call.active', function(event, data) { $rootScope.$on('call.active', function(event, data, params) {
$rootScope.callActive(data); $rootScope.callActive(data, params);
}); });
$rootScope.$on('call.calling', function(event, data) { $rootScope.$on('call.calling', function(event, data) {
@ -360,11 +389,11 @@
$scope.answerCall(); $scope.answerCall();
storage.data.called_number = data; storage.data.called_number = data;
CallHistory.add(number, 'inbound', true); CallHistory.add(data, 'inbound', true);
$location.path('/incall'); $location.path('/incall');
}, function() { }, function() {
$scope.declineCall(); $scope.declineCall();
CallHistory.add(number, 'inbound', false); CallHistory.add(data, 'inbound', false);
}); });
}); });
@ -380,6 +409,7 @@
if (!verto.data.call) { if (!verto.data.call) {
toastr.warning('There is no call to hangup.'); toastr.warning('There is no call to hangup.');
$location.path('/dialpad'); $location.path('/dialpad');
return;
} }
//var hangupCallback = function(v, hangup) { //var hangupCallback = function(v, hangup) {
@ -394,7 +424,10 @@
if (verto.data.shareCall) { if (verto.data.shareCall) {
verto.screenshareHangup(); verto.screenshareHangup();
} }
verto.hangup(); verto.hangup();
$location.path('/dialpad');
}; };
$scope.answerCall = function() { $scope.answerCall = function() {
@ -403,6 +436,7 @@
verto.data.call.answer({ verto.data.call.answer({
useStereo: storage.data.useStereo, useStereo: storage.data.useStereo,
useCamera: storage.data.selectedVideo, useCamera: storage.data.selectedVideo,
useVideo: storage.data.useVideo,
useMic: storage.data.useMic, useMic: storage.data.useMic,
callee_id_name: verto.data.name, callee_id_name: verto.data.name,
callee_id_number: verto.data.login callee_id_number: verto.data.login

View File

@ -34,6 +34,14 @@
window.location.reload(); window.location.reload();
}; };
}; };
$scope.checkUseDedRemoteEncoder = function(option) {
if ($scope.mydata.incomingBandwidth != 'default' || $scope.mydata.outgoingBandwidth != 'default') {
$scope.mydata.useDedenc = true;
} else {
$scope.mydata.useDedenc = false;
}
};
} }
]); ]);

View File

@ -0,0 +1,15 @@
(function() {
'use strict';
angular
.module('vertoControllers')
.controller('ModalWsReconnectController', ModalWsReconnectController);
ModalWsReconnectController.$inject = ['$scope', 'storage', 'verto'];
function ModalWsReconnectController($scope, storage, verto) {
console.debug('Executing ModalWsReconnectController');
};
})();

View File

@ -0,0 +1,88 @@
(function() {
'use strict';
angular
.module('vertoControllers')
.controller('SplashScreenController', ['$scope', '$rootScope', '$location', '$timeout', 'splashscreen', 'prompt', 'verto',
function($scope, $rootScope, $location, $timeout, splashscreen, prompt, verto) {
console.debug('Executing SplashScreenController.');
$scope.progress_percentage = splashscreen.progress_percentage;
$scope.message = '';
$scope.interrupt_next = false;
$scope.errors = [];
var redirectTo = function(link, activity) {
if(activity) {
if(activity == 'browser-upgrade') {
link = activity;
}
}
$location.path(link);
}
var checkProgressState = function(current_progress, status, promise, activity, soft, interrupt, message) {
$scope.progress_percentage = splashscreen.calculate(current_progress);
$scope.message = message;
if(interrupt && status == 'error') {
$scope.errors.push(message);
if(!soft) {
redirectTo('', activity);
return;
} else {
message = message + '. Continue?';
};
if(!confirm(message)) {
$scope.interrupt_next = true;
};
};
if($scope.interrupt_next) {
return;
};
$scope.message = splashscreen.getProgressMessage(current_progress+1);
return true;
};
$rootScope.$on('progress.next', function(ev, current_progress, status, promise, activity, soft, interrupt, message) {
$timeout(function() {
if(promise) {
promise.then(function(response) {
message = response['message'];
status = response['status'];
if(checkProgressState(current_progress, status, promise, activity, soft, interrupt, message)) {
splashscreen.next();
};
});
return;
}
if(!checkProgressState(current_progress, status, promise, activity, soft, interrupt, message)) {
return;
}
splashscreen.next();
}, 400);
});
$rootScope.$on('progress.complete', function(ev, current_progress) {
$scope.message = 'Complete';
if(verto.data.connected) {
redirectTo('/dialpad');
} else {
redirectTo('/login');
$location.path('/login');
}
});
splashscreen.next();
}]);
})();

View File

@ -2,7 +2,7 @@
'use strict'; 'use strict';
var vertoControllers = angular.module('vertoControllers', [ var vertoControllers = angular.module('vertoControllers', [
'ui.bootstrap', 'ui.bootstrap',
'vertoService', 'vertoService',
'storageService', 'storageService',
'ui.gravatar' 'ui.gravatar'

View File

@ -18,7 +18,7 @@
console.log('Moving the video to element.'); console.log('Moving the video to element.');
jQuery('video').removeClass('hide').appendTo(element); jQuery('video').removeClass('hide').appendTo(element);
jQuery('video').css('display', 'block'); jQuery('video').css('display', 'block');
scope.callActive(); scope.callActive("", {useVideo: true});
element.on('$destroy', function() { element.on('$destroy', function() {
// Move the video back to the body. // Move the video back to the body.

View File

@ -0,0 +1,82 @@
'use strict';
var vertoService = angular.module('vertoService');
vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', 'verto',
function($rootScope, $http, $location, storage, verto) {
var configure = function() {
/**
* Load stored user info into verto service
*/
if(storage.data.name) {
verto.data.name = storage.data.name;
}
if(storage.data.email) {
verto.data.email = storage.data.email;
}
if(storage.data.login) {
verto.data.login = storage.data.login;
}
if(storage.data.password) {
verto.data.password = storage.data.password;
}
/*
* Load the Configs before logging in
* with cache buster
*/
var url = window.location.origin + window.location.pathname;
var httpRequest = $http.get(url + 'config.json?cachebuster=' + Math.floor((Math.random()*1000000)+1));
var httpReturn = httpRequest.then(function(response) {
var data = response.data;
/* save these for later as we're about to possibly over write them */
var name = verto.data.name;
var email = verto.data.email;
console.debug("googlelogin: " + data.googlelogin);
if (data.googlelogin){
verto.data.googlelogin = data.googlelogin;
verto.data.googleclientid = data.googleclientid;
}
angular.extend(verto.data, data);
/**
* use stored data (localStorage) for login, allow config.json to take precedence
*/
if (name != '' && data.name == '') {
verto.data.name = name;
}
if (email != '' && data.email == '') {
verto.data.email = email;
}
if (verto.data.login == '' && verto.data.password == '' && storage.data.login != '' && storage.data.password != '') {
verto.data.login = storage.data.login;
verto.data.password = storage.data.password;
}
if (verto.data.autologin == "true" && !verto.data.autologin_done) {
console.debug("auto login per config.json");
verto.data.autologin_done = true;
}
if(verto.data.autologin && storage.data.name.length && storage.data.email.length && storage.data.login.length && storage.data.password.length) {
$rootScope.$emit('config.http.success', data);
};
return response;
}, function(response) {
$rootScope.$emit('config.http.error', response);
return response;
});
return httpReturn;
};
return {
'configure': configure
};
}]);

View File

@ -0,0 +1,50 @@
'use strict';
angular
.module('vertoService')
.service('eventQueue', ['$rootScope', '$q', 'storage', 'verto',
function($rootScope, $q, storage, verto) {
var events = [];
var next = function() {
var fn, fn_return;
fn = events.shift();
if (fn == undefined) {
$rootScope.$emit('eventqueue.complete');
return;
}
fn_return = fn();
var emitNextProgress = function() {
$rootScope.$emit('eventqueue.next');
};
fn_return.then(
function() {
emitNextProgress();
},
function() {
emitNextProgress();
}
);
};
var process = function() {
$rootScope.$on('eventqueue.next', function (ev){
next();
});
next();
};
return {
'next': next,
'process': process,
'events': events
};
}]);

View File

@ -1,8 +1,8 @@
'use strict'; 'use strict';
/* Controllers */ /* Controllers */
var videoQuality = [];
var videoQuality = [{ var videoQualitySource = [{
id: 'qvga', id: 'qvga',
label: 'QVGA 320x240', label: 'QVGA 320x240',
width: 320, width: 320,
@ -143,8 +143,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
$rootScope.$emit('page.incall', 'call'); $rootScope.$emit('page.incall', 'call');
} }
function callActive(last_state) { function callActive(last_state, params) {
$rootScope.$emit('call.active', last_state); $rootScope.$emit('call.active', last_state, params);
} }
function calling() { function calling() {
@ -158,28 +158,28 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
function updateResolutions(supportedResolutions) { function updateResolutions(supportedResolutions) {
console.debug('Attempting to sync supported and available resolutions'); console.debug('Attempting to sync supported and available resolutions');
var removed = 0; //var removed = 0;
angular.forEach(videoQuality, function(resolution, id) { console.debug("VQ length: " + videoQualitySource.length);
var supported = false; console.debug(supportedResolutions);
angular.forEach(videoQualitySource, function(resolution, id) {
angular.forEach(supportedResolutions, function(res) { angular.forEach(supportedResolutions, function(res) {
var width = res[0]; var width = res[0];
var height = res[1]; var height = res[1];
if(resolution.width == width && resolution.height == height) { if(resolution.width == width && resolution.height == height) {
supported = true; videoQuality.push(resolution);
} }
}); });
if(!supported) {
delete videoQuality[id];
++removed;
}
}); });
videoQuality.length = videoQuality.length - removed; // videoQuality.length = videoQuality.length - removed;
console.debug("VQ length 2: " + videoQuality.length);
data.videoQuality = videoQuality; data.videoQuality = videoQuality;
console.debug(videoQuality);
data.vidQual = (videoQuality.length > 0) ? videoQuality[videoQuality.length - 1].id : null; data.vidQual = (videoQuality.length > 0) ? videoQuality[videoQuality.length - 1].id : null;
console.debug(data.vidQual);
return videoQuality; return videoQuality;
}; };
@ -198,7 +198,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
videoResolution: videoResolution, videoResolution: videoResolution,
bandwidth: bandwidth, bandwidth: bandwidth,
refreshDevicesCallback : function refreshDevicesCallback() { refreshDevicesCallback : function refreshDevicesCallback(callback) {
data.videoDevices = [{ data.videoDevices = [{
id: 'none', id: 'none',
label: 'No Camera' label: 'No Camera'
@ -278,11 +278,19 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
} else { } else {
data.canVideo = true; data.canVideo = true;
} }
if(angular.isFunction(callback)) {
callback();
}
}, },
refreshDevices: function(callback) { refreshDevices: function(callback) {
console.debug('Attempting to refresh the devices.'); console.debug('Attempting to refresh the devices.');
jQuery.verto.refreshDevices(this.refreshDevicesCallback); if(callback) {
jQuery.verto.refreshDevices(callback);
} else {
jQuery.verto.refreshDevices(this.refreshDevicesCallback);
}
}, },
/** /**
@ -364,8 +372,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
} }
}); });
console.log('>>> conf.listVideoLayouts();'); if (data.confRole == "moderator") {
conf.listVideoLayouts(); console.log('>>> conf.listVideoLayouts();');
conf.listVideoLayouts();
}
data.conf = conf; data.conf = conf;
data.liveArray = new $.verto.liveArray( data.liveArray = new $.verto.liveArray(
@ -425,15 +436,20 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
console.log('Has data.liveArray.'); console.log('Has data.liveArray.');
$rootScope.$emit('members.clear'); $rootScope.$emit('members.clear');
data.liveArray = null; data.liveArray = null;
} else { } else {
console.log('Doesn\'t found data.liveArray.'); console.log('Doesn\'t found data.liveArray.');
} }
if (data.conf) {
data.conf.destroy();
data.conf = null;
}
} }
var callbacks = { var callbacks = {
onWSLogin: function(v, success) { onWSLogin: function(v, success) {
data.connected = success; data.connected = success;
$rootScope.$emit('ws.login', success);
console.debug('Connected to verto server:', success); console.debug('Connected to verto server:', success);
if (angular.isFunction(callback)) { if (angular.isFunction(callback)) {
@ -450,6 +466,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
switch (params.pvtData.action) { switch (params.pvtData.action) {
case "conference-liveArray-join": case "conference-liveArray-join":
console.log("conference-liveArray-join"); console.log("conference-liveArray-join");
stopConference();
startConference(v, dialog, params.pvtData); startConference(v, dialog, params.pvtData);
break; break;
case "conference-liveArray-part": case "conference-liveArray-part":
@ -472,6 +489,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
}); });
break; break;
default: default:
console.warn('Got a not implemented message:', msg, dialog, params);
break; break;
} }
}, },
@ -479,9 +497,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
onDialogState: function(d) { onDialogState: function(d) {
if (!data.call) { if (!data.call) {
data.call = d; data.call = d;
if (d.state.name !== 'ringing') {
inCall();
}
} }
console.debug('onDialogState:', d); console.debug('onDialogState:', d);
@ -501,7 +517,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
case "active": case "active":
console.debug('Talking to:', d.cidString()); console.debug('Talking to:', d.cidString());
data.callState = 'active'; data.callState = 'active';
callActive(d.lastState.name); callActive(d.lastState.name, d.params);
break; break;
case "hangup": case "hangup":
console.debug('Call ended with cause: ' + d.cause); console.debug('Call ended with cause: ' + d.cause);
@ -512,21 +528,22 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
if (d.params.screenShare) { if (d.params.screenShare) {
cleanShareCall(that); cleanShareCall(that);
} else { } else {
if (data.liveArray) { stopConference();
data.liveArray.destroy(); if (!that.reloaded) {
cleanCall();
} }
if (data.conf) {
data.conf.destroy();
}
cleanCall();
} }
break; break;
default:
console.warn('Got a not implemented state:', d);
break;
} }
}, },
onWSClose: function(v, success) { onWSClose: function(v, success) {
console.debug('onWSClose:', success); console.debug('onWSClose:', success);
$rootScope.$emit('ws.close', success);
}, },
onEvent: function(v, e) { onEvent: function(v, e) {
@ -538,10 +555,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
function ourBootstrap() { function ourBootstrap() {
// Checking if we have a failed connection attempt before // Checking if we have a failed connection attempt before
// connecting again. // connecting again.
that.refreshDevicesCallback();
if (data.instance && !data.instance.rpcClient.socketReady()) { if (data.instance && !data.instance.rpcClient.socketReady()) {
clearTimeout(data.instance.rpcClient.to); clearTimeout(data.instance.rpcClient.to);
data.instance.logout(); data.instance.logout();
data.instance.login();
return;
}; };
data.instance = new jQuery.verto({ data.instance = new jQuery.verto({
login: data.login + '@' + data.hostname, login: data.login + '@' + data.hostname,
@ -551,22 +569,36 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
ringFile: "sounds/bell_ring2.wav", ringFile: "sounds/bell_ring2.wav",
// TODO: Add options for this. // TODO: Add options for this.
audioParams: { audioParams: {
googEchoCancellation: storage.data.googEchoCancellation || false, googEchoCancellation: storage.data.googEchoCancellation || true,
googNoiseSuppression: storage.data.googNoiseSuppression || false, googNoiseSuppression: storage.data.googNoiseSuppression || true,
googHighpassFilter: storage.data.googHighpassFilter || false googHighpassFilter: storage.data.googHighpassFilter || true
}, },
iceServers: storage.data.useSTUN iceServers: storage.data.useSTUN
}, callbacks); }, callbacks);
data.instance.deviceParams({ // We need to know when user reloaded page and not react to
useCamera: storage.data.selectedVideo, // verto events in order to not stop the reload and redirect user back
useMic: storage.data.selectedAudio, // to the dialpad.
onResCheck: that.refreshVideoResolution that.reloaded = false;
jQuery.verto.unloadJobs.push(function() {
that.reloaded = true;
}); });
data.instance.deviceParams({
useCamera: storage.data.selectedVideo,
useMic: storage.data.selectedAudio,
onResCheck: that.refreshVideoResolution
});
} }
$.verto.init({}, ourBootstrap); if (data.mediaPerm) {
ourBootstrap();
} else {
$.FSRTC.checkPerms(ourBootstrap, true, true);
}
},
mediaPerm: function(callback) {
$.FSRTC.checkPerms(callback, true, true);
}, },
/** /**
@ -616,7 +648,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
var call = data.instance.newCall({ var call = data.instance.newCall({
destination_number: destination, destination_number: destination,
caller_id_name: data.name, caller_id_name: data.name,
caller_id_number: data.login, caller_id_number: data.callerid ? data.callerid : data.email,
outgoingBandwidth: storage.data.outgoingBandwidth, outgoingBandwidth: storage.data.outgoingBandwidth,
incomingBandwidth: storage.data.incomingBandwidth, incomingBandwidth: storage.data.incomingBandwidth,
useVideo: storage.data.useVideo, useVideo: storage.data.useVideo,

View File

@ -30,9 +30,10 @@ self.options.useAudio.play();self.remoteStream=stream;}
function onOfferSDP(self,sdp){self.mediaData.SDP=self.stereoHack(sdp.sdp);console.log("Offer SDP");doCallback(self,"onOfferSDP");} function onOfferSDP(self,sdp){self.mediaData.SDP=self.stereoHack(sdp.sdp);console.log("Offer SDP");doCallback(self,"onOfferSDP");}
$.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stopPeer=function(){if(self.peer){console.log("stopping peer");self.peer.stop();}} $.FSRTC.prototype.answer=function(sdp,onSuccess,onError){this.peer.addAnswerSDP({type:"answer",sdp:sdp},onSuccess,onError);};$.FSRTC.prototype.stopPeer=function(){if(self.peer){console.log("stopping peer");self.peer.stop();}}
$.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';if(moz){self.options.useVideo['mozSrcObject']=null;}else{self.options.useVideo['src']='';}} $.FSRTC.prototype.stop=function(){var self=this;if(self.options.useVideo){self.options.useVideo.style.display='none';if(moz){self.options.useVideo['mozSrcObject']=null;}else{self.options.useVideo['src']='';}}
if(self.localStream){self.localStream.stop();self.localStream=null;} if(self.localStream){if(typeof self.localStream.stop=='function'){self.localStream.stop();}else{if(self.localStream.active){var tracks=self.localStream.getTracks();console.error(tracks);tracks.forEach(function(track,index){console.log(track);track.stop();})}}
self.localStream=null;}
if(self.options.localVideo){self.options.localVideo.style.display='none';if(moz){self.options.localVideo['mozSrcObject']=null;}else{self.options.localVideo['src']='';}} if(self.options.localVideo){self.options.localVideo.style.display='none';if(moz){self.options.localVideo['mozSrcObject']=null;}else{self.options.localVideo['src']='';}}
if(self.options.localVideoStream){self.options.localVideoStream.stop();} if(self.options.localVideoStream){if(typeof self.options.localVideoStream.stop=='function'){self.options.localVideoStream.stop();}else{if(self.localVideoStream.active){var tracks=self.localVideoStream.getTracks();console.error(tracks);tracks.forEach(function(track,index){console.log(track);track.stop();})}}}
if(self.peer){console.log("stopping peer");self.peer.stop();}};$.FSRTC.prototype.getMute=function(){var self=this;return self.enabled;} if(self.peer){console.log("stopping peer");self.peer.stop();}};$.FSRTC.prototype.getMute=function(){var self=this;return self.enabled;}
$.FSRTC.prototype.setMute=function(what){var self=this;var audioTracks=self.localStream.getAudioTracks();for(var i=0,len=audioTracks.length;i<len;i++){switch(what){case"on":audioTracks[i].enabled=true;break;case"off":audioTracks[i].enabled=false;break;case"toggle":audioTracks[i].enabled=!audioTracks[i].enabled;default:break;} $.FSRTC.prototype.setMute=function(what){var self=this;var audioTracks=self.localStream.getAudioTracks();for(var i=0,len=audioTracks.length;i<len;i++){switch(what){case"on":audioTracks[i].enabled=true;break;case"off":audioTracks[i].enabled=false;break;case"toggle":audioTracks[i].enabled=!audioTracks[i].enabled;default:break;}
self.enabled=audioTracks[i].enabled;} self.enabled=audioTracks[i].enabled;}
@ -40,18 +41,18 @@ return!self.enabled;}
$.FSRTC.prototype.createAnswer=function(params){var self=this;self.type="answer";self.remoteSDP=params.sdp;console.debug("inbound sdp: ",params.sdp);function onSuccess(stream){self.localStream=stream;self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:function(stream){return onRemoteStream(self,stream);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,offerSDP:{type:"offer",sdp:self.remoteSDP}});onStreamSuccess(self);} $.FSRTC.prototype.createAnswer=function(params){var self=this;self.type="answer";self.remoteSDP=params.sdp;console.debug("inbound sdp: ",params.sdp);function onSuccess(stream){self.localStream=stream;self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:function(stream){return onRemoteStream(self,stream);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,offerSDP:{type:"offer",sdp:self.remoteSDP}});onStreamSuccess(self);}
function onError(e){onStreamError(self,e);} function onError(e){onStreamError(self,e);}
var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(self.options.useVideo&&self.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:self.options.videoParams,optional:[]},},localVideo:self.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});} var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(self.options.useVideo&&self.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:self.options.videoParams,optional:[]},},localVideo:self.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});};function getMediaParams(obj){var audio;if(obj.options.videoParams&&obj.options.screenShare){console.error("SCREEN SHARE");audio=false;}else{audio={mandatory:obj.options.audioParams,optional:[]};if(obj.options.useMic!=="any"){audio.optional=[{sourceId:obj.options.useMic}]}} getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});};function getMediaParams(obj){var audio;if(obj.options.useMic&&obj.options.useMic==="none"){console.log("Microphone Disabled");audio=false;}else if(obj.options.videoParams&&obj.options.screenShare){console.error("SCREEN SHARE");audio=false;}else{audio={mandatory:obj.options.audioParams,optional:[]};if(obj.options.useMic!=="any"){audio.optional=[{sourceId:obj.options.useMic}]}}
if(obj.options.useVideo&&obj.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:obj.options.videoParams,optional:[]},},localVideo:obj.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});} if(obj.options.useVideo&&obj.options.localVideo){getUserMedia({constraints:{audio:false,video:{mandatory:obj.options.videoParams,optional:[]},},localVideo:obj.options.localVideo,onsuccess:function(e){self.options.localVideoStream=e;console.log("local video ready");},onerror:function(e){console.error("local video error!");}});}
var video={};var bestFrameRate=obj.options.videoParams.vertoBestFrameRate;delete obj.options.videoParams.vertoBestFrameRate;if(window.moz){video=obj.options.videoParams;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;}else{video={mandatory:obj.options.videoParams,optional:[]}} var video={};var bestFrameRate=obj.options.videoParams.vertoBestFrameRate;delete obj.options.videoParams.vertoBestFrameRate;if(window.moz){video=obj.options.videoParams;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;}else{video={mandatory:obj.options.videoParams,optional:[]}}
var useVideo=obj.options.useVideo;if(useVideo&&obj.options.useCamera&&obj.options.useCamera!=="none"){if(!video.optional){video.optional=[];} var useVideo=obj.options.useVideo;if(useVideo&&obj.options.useCamera&&obj.options.useCamera!=="none"){if(!video.optional){video.optional=[];}
if(obj.options.useCamera!=="any"){video.optional.push({sourceId:obj.options.useCamera});} if(obj.options.useCamera!=="any"){video.optional.push({sourceId:obj.options.useCamera});}
if(bestFrameRate&&!window.moz){video.optional.push({minFrameRate:bestFrameRate});}}else{video=false;useVideo=false;} if(bestFrameRate&&!window.moz){video.optional.push({minFrameRate:bestFrameRate});}}else{console.log("Camera Disabled");video=false;useVideo=false;}
return{audio:audio,video:video,useVideo:useVideo};} return{audio:audio,video:video,useVideo:useVideo};}
$.FSRTC.prototype.call=function(profile){checkCompat();var self=this;var screen=false;self.type="offer";if(self.options.videoParams&&self.options.screenShare){screen=true;} $.FSRTC.prototype.call=function(profile){checkCompat();var self=this;var screen=false;self.type="offer";if(self.options.videoParams&&self.options.screenShare){screen=true;}
function onSuccess(stream){self.localStream=stream;if(screen){if(moz){self.constraints.OfferToReceiveVideo=false;}else{self.constraints.mandatory.OfferToReceiveVideo=false;}} function onSuccess(stream){self.localStream=stream;if(screen){if(moz){self.constraints.OfferToReceiveVideo=false;}else{self.constraints.mandatory.OfferToReceiveVideo=false;}}
self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);} self.peer=RTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);}
function onError(e){onStreamError(self,e);} function onError(e){onStreamError(self,e);}
var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});};window.moz=!!navigator.mozGetUserMedia;function RTCPeerConnection(options){var gathering=false,done=false;var w=window,PeerConnection=w.mozRTCPeerConnection||w.webkitRTCPeerConnection,SessionDescription=w.mozRTCSessionDescription||w.RTCSessionDescription,IceCandidate=w.mozRTCIceCandidate||w.RTCIceCandidate;var STUN={url:!moz?'stun:stun.l.google.com:19302':'stun:23.21.150.121'};var iceServers=null;if(options.iceServers){var tmp=options.iceServers;if(typeof(tmp)==="boolean"){tmp=null;} var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(mediaParams.audio||mediaParams.video){getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});}else{onSuccess(null);}};window.moz=!!navigator.mozGetUserMedia;function RTCPeerConnection(options){var gathering=false,done=false;var w=window,PeerConnection=w.mozRTCPeerConnection||w.webkitRTCPeerConnection,SessionDescription=w.mozRTCSessionDescription||w.RTCSessionDescription,IceCandidate=w.mozRTCIceCandidate||w.RTCIceCandidate;var STUN={url:!moz?'stun:stun.l.google.com:19302':'stun:23.21.150.121'};var iceServers=null;if(options.iceServers){var tmp=options.iceServers;if(typeof(tmp)==="boolean"){tmp=null;}
if(tmp&&!(typeof(tmp)=="object"&&tmp.constructor===Array)){console.warn("iceServers must be an array, reverting to default ice servers");tmp=null;} if(tmp&&!(typeof(tmp)=="object"&&tmp.constructor===Array)){console.warn("iceServers must be an array, reverting to default ice servers");tmp=null;}
iceServers={iceServers:tmp||[STUN]};if(!moz&&!tmp){iceServers.iceServers=[STUN];}} iceServers={iceServers:tmp||[STUN]};if(!moz&&!tmp){iceServers.iceServers=[STUN];}}
var optional={optional:[]};if(!moz){optional.optional=[{DtlsSrtpKeyAgreement:true},{RtpDataChannels:options.onChannelMessage?true:false}];} var optional={optional:[]};if(!moz){optional.optional=[{DtlsSrtpKeyAgreement:true},{RtpDataChannels:options.onChannelMessage?true:false}];}
@ -76,7 +77,7 @@ function useless(){log('Error in fake:true');}
function onSdpSuccess(){} function onSdpSuccess(){}
function onSdpError(e){if(options.onChannelError){options.onChannelError(e);} function onSdpError(e){if(options.onChannelError){options.onChannelError(e);}
console.error('sdp error:',e);} console.error('sdp error:',e);}
return{addAnswerSDP:function(sdp,cbSuccess,cbError){peer.setRemoteDescription(new SessionDescription(sdp),cbSuccess?cbSuccess:onSdpSuccess,cbError?cbError:onSdpError);},addICE:function(candidate){peer.addIceCandidate(new IceCandidate({sdpMLineIndex:candidate.sdpMLineIndex,candidate:candidate.candidate}));},peer:peer,channel:channel,sendData:function(message){if(channel){channel.send(message);}},stop:function(){peer.close();if(options.attachStream){options.attachStream.stop();}}};} return{addAnswerSDP:function(sdp,cbSuccess,cbError){peer.setRemoteDescription(new SessionDescription(sdp),cbSuccess?cbSuccess:onSdpSuccess,cbError?cbError:onSdpError);},addICE:function(candidate){peer.addIceCandidate(new IceCandidate({sdpMLineIndex:candidate.sdpMLineIndex,candidate:candidate.candidate}));},peer:peer,channel:channel,sendData:function(message){if(channel){channel.send(message);}},stop:function(){peer.close();if(options.attachStream){if(typeof options.attachStream.stop=='function'){options.attachStream.stop();}else{options.attachStream.active=false;}}}};}
var video_constraints={mandatory:{},optional:[]};function getUserMedia(options){var n=navigator,media;n.getMedia=n.webkitGetUserMedia||n.mozGetUserMedia;n.getMedia(options.constraints||{audio:true,video:video_constraints},streaming,options.onerror||function(e){console.error(e);});function streaming(stream){if(options.localVideo){options.localVideo[moz?'mozSrcObject':'src']=moz?stream:window.webkitURL.createObjectURL(stream);options.localVideo.style.display='block';} var video_constraints={mandatory:{},optional:[]};function getUserMedia(options){var n=navigator,media;n.getMedia=n.webkitGetUserMedia||n.mozGetUserMedia;n.getMedia(options.constraints||{audio:true,video:video_constraints},streaming,options.onerror||function(e){console.error(e);});function streaming(stream){if(options.localVideo){options.localVideo[moz?'mozSrcObject':'src']=moz?stream:window.webkitURL.createObjectURL(stream);options.localVideo.style.display='block';}
if(options.onsuccess){options.onsuccess(stream);} if(options.onsuccess){options.onsuccess(stream);}
media=stream;} media=stream;}
@ -89,11 +90,11 @@ var resList=[[320,180],[320,240],[640,360],[640,480],[1280,720],[1920,1080]];var
var video={mandatory:{},optional:[]} var video={mandatory:{},optional:[]}
if(cam){video.optional=[{sourceId:cam}];} if(cam){video.optional=[{sourceId:cam}];}
w=resList[resI][0];h=resList[resI][1];resI++;video.mandatory={"minWidth":w,"minHeight":h,"maxWidth":w,"maxHeight":h};if(window.moz){video=video.mandatory;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;} w=resList[resI][0];h=resList[resI][1];resI++;video.mandatory={"minWidth":w,"minHeight":h,"maxWidth":w,"maxHeight":h};if(window.moz){video=video.mandatory;if(!video.width)video.width=video.minWidth;if(!video.height)video.height=video.minHeight;if(!video.frameRate)video.frameRate=video.minFrameRate;}
getUserMedia({constraints:{audio:ttl++==0,video:video},onsuccess:function(e){e.stop();console.info(w+"x"+h+" supported.");$.FSRTC.validRes.push([w,h]);checkRes(cam,func);},onerror:function(e){console.error(w+"x"+h+" not supported.");checkRes(cam,func);}});} getUserMedia({constraints:{audio:ttl++==0,video:video},onsuccess:function(e){e.getTracks().forEach(function(track){track.stop();});console.info(w+"x"+h+" supported.");$.FSRTC.validRes.push([w,h]);checkRes(cam,func);},onerror:function(e){console.error(w+"x"+h+" not supported.");checkRes(cam,func);}});}
$.FSRTC.getValidRes=function(cam,func){var used=[];var cached=localStorage.getItem("res_"+cam);if(cached){var cache=$.parseJSON(cached);if(cache){$.FSRTC.validRes=cache.validRes;console.log("CACHED RES FOR CAM "+cam,cache);}else{console.error("INVALID CACHE");} $.FSRTC.getValidRes=function(cam,func){var used=[];var cached=localStorage.getItem("res_"+cam);if(cached){var cache=$.parseJSON(cached);if(cache){$.FSRTC.validRes=cache.validRes;console.log("CACHED RES FOR CAM "+cam,cache);}else{console.error("INVALID CACHE");}
return func?func(cache):null;} return func?func(cache):null;}
$.FSRTC.validRes=[];resI=0;checkRes(cam,func);} $.FSRTC.validRes=[];resI=0;checkRes(cam,func);}
$.FSRTC.checkPerms=function(runtime,check_audio,check_video){getUserMedia({constraints:{audio:check_audio,video:check_video,},onsuccess:function(e){e.stop();console.info("media perm init complete");if(runtime){setTimeout(runtime,100,true)}},onerror:function(e){if(check_video&&check_audio){console.error("error, retesting with audio params only");return $.FSRTC.checkPerms(runtime,check_audio,false);} $.FSRTC.checkPerms=function(runtime,check_audio,check_video){getUserMedia({constraints:{audio:check_audio,video:check_video,},onsuccess:function(e){e.getTracks().forEach(function(track){track.stop();});console.info("media perm init complete");if(runtime){setTimeout(runtime,100,true);}},onerror:function(e){if(check_video&&check_audio){console.error("error, retesting with audio params only");return $.FSRTC.checkPerms(runtime,check_audio,false);}
console.error("media perm init error");if(runtime){runtime(false)}}});}})(jQuery);(function($){$.JsonRpcClient=function(options){var self=this;this.options=$.extend({ajaxUrl:null,socketUrl:null,onmessage:null,login:null,passwd:null,sessid:null,loginParams:null,userVariables:null,getSocket:function(onmessage_cb){return self._getSocket(onmessage_cb);}},options);self.ws_cnt=0;this.wsOnMessage=function(event){self._wsOnMessage(event);};};$.JsonRpcClient.prototype._ws_socket=null;$.JsonRpcClient.prototype._ws_callbacks={};$.JsonRpcClient.prototype._current_id=1;$.JsonRpcClient.prototype.call=function(method,params,success_cb,error_cb){if(!params){params={};} console.error("media perm init error");if(runtime){runtime(false)}}});}})(jQuery);(function($){$.JsonRpcClient=function(options){var self=this;this.options=$.extend({ajaxUrl:null,socketUrl:null,onmessage:null,login:null,passwd:null,sessid:null,loginParams:null,userVariables:null,getSocket:function(onmessage_cb){return self._getSocket(onmessage_cb);}},options);self.ws_cnt=0;this.wsOnMessage=function(event){self._wsOnMessage(event);};};$.JsonRpcClient.prototype._ws_socket=null;$.JsonRpcClient.prototype._ws_callbacks={};$.JsonRpcClient.prototype._current_id=1;$.JsonRpcClient.prototype.call=function(method,params,success_cb,error_cb){if(!params){params={};}
if(this.options.sessid){params.sessid=this.options.sessid;} if(this.options.sessid){params.sessid=this.options.sessid;}
var request={jsonrpc:'2.0',method:method,params:params,id:this._current_id++};if(!success_cb){success_cb=function(e){console.log("Success: ",e);};} var request={jsonrpc:'2.0',method:method,params:params,id:this._current_id++};if(!success_cb){success_cb=function(e){console.log("Success: ",e);};}
@ -127,7 +128,7 @@ for(i=0;i<this._requests.length;i++){call=this._requests[i];batch_request.push(c
success_cb=function(data){self._batchCb(data,handlers,self.all_done_cb);};if(self.jsonrpcclient.options.ajaxUrl===null){throw"$.JsonRpcClient.batch used with no websocket and no http endpoint.";} success_cb=function(data){self._batchCb(data,handlers,self.all_done_cb);};if(self.jsonrpcclient.options.ajaxUrl===null){throw"$.JsonRpcClient.batch used with no websocket and no http endpoint.";}
$.ajax({url:self.jsonrpcclient.options.ajaxUrl,data:$.toJSON(batch_request),dataType:'json',cache:false,type:'POST',error:function(jqXHR,textStatus,errorThrown){self.error_cb(jqXHR,textStatus,errorThrown);},success:success_cb});};$.JsonRpcClient._batchObject.prototype._batchCb=function(result,handlers,all_done_cb){for(var i=0;i<result.length;i++){var response=result[i];if('error'in response){if(response.id===null||!(response.id in handlers)){if('console'in window)console.log(response);}else{handlers[response.id].error_cb(response.error,this);}}else{if(!(response.id in handlers)&&'console'in window){console.log(response);}else{handlers[response.id].success_cb(response.result,this);}}} $.ajax({url:self.jsonrpcclient.options.ajaxUrl,data:$.toJSON(batch_request),dataType:'json',cache:false,type:'POST',error:function(jqXHR,textStatus,errorThrown){self.error_cb(jqXHR,textStatus,errorThrown);},success:success_cb});};$.JsonRpcClient._batchObject.prototype._batchCb=function(result,handlers,all_done_cb){for(var i=0;i<result.length;i++){var response=result[i];if('error'in response){if(response.id===null||!(response.id in handlers)){if('console'in window)console.log(response);}else{handlers[response.id].error_cb(response.error,this);}}else{if(!(response.id in handlers)&&'console'in window){console.log(response);}else{handlers[response.id].success_cb(response.result,this);}}}
if(typeof all_done_cb==='function')all_done_cb(result);};})(jQuery);(function($){var sources=[];var generateGUID=(typeof(window.crypto)!=='undefined'&&typeof(window.crypto.getRandomValues)!=='undefined')?function(){var buf=new Uint16Array(8);window.crypto.getRandomValues(buf);var S4=function(num){var ret=num.toString(16);while(ret.length<4){ret="0"+ret;} if(typeof all_done_cb==='function')all_done_cb(result);};})(jQuery);(function($){var sources=[];var generateGUID=(typeof(window.crypto)!=='undefined'&&typeof(window.crypto.getRandomValues)!=='undefined')?function(){var buf=new Uint16Array(8);window.crypto.getRandomValues(buf);var S4=function(num){var ret=num.toString(16);while(ret.length<4){ret="0"+ret;}
return ret;};return(S4(buf[0])+S4(buf[1])+"-"+S4(buf[2])+"-"+S4(buf[3])+"-"+S4(buf[4])+"-"+S4(buf[5])+S4(buf[6])+S4(buf[7]));}:function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);});};$.verto=function(options,callbacks){var verto=this;$.verto.saved.push(verto);verto.options=$.extend({login:null,passwd:null,socketUrl:null,tag:null,localTag:null,videoParams:{},audioParams:{},loginParams:{},deviceParams:{onResCheck:null},userVariables:{},iceServers:false,ringSleep:6000,sessid:null},options);if(verto.options.deviceParams.useCamera){$.FSRTC.getValidRes(verto.options.deviceParams.useCamera,verto.options.deviceParams.onResCheck);}else{verto.options.deviceParams.useCamera="any";$.FSRTC.getValidRes(undefined,undefined);} return ret;};return(S4(buf[0])+S4(buf[1])+"-"+S4(buf[2])+"-"+S4(buf[3])+"-"+S4(buf[4])+"-"+S4(buf[5])+S4(buf[6])+S4(buf[7]));}:function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=='x'?r:(r&0x3|0x8);return v.toString(16);});};$.verto=function(options,callbacks){var verto=this;$.verto.saved.push(verto);verto.options=$.extend({login:null,passwd:null,socketUrl:null,tag:null,localTag:null,videoParams:{},audioParams:{},loginParams:{},deviceParams:{onResCheck:null},userVariables:{},iceServers:false,ringSleep:6000,sessid:null},options);if(verto.options.deviceParams.useCamera){$.FSRTC.getValidRes(verto.options.deviceParams.useCamera,verto.options.deviceParams.onResCheck);}
if(!verto.options.deviceParams.useMic){verto.options.deviceParams.useMic="any";} if(!verto.options.deviceParams.useMic){verto.options.deviceParams.useMic="any";}
if(!verto.options.deviceParams.useSpeak){verto.options.deviceParams.useSpeak="any";} if(!verto.options.deviceParams.useSpeak){verto.options.deviceParams.useSpeak="any";}
if(verto.options.sessid){verto.sessid=verto.options.sessid;}else{verto.sessid=localStorage.getItem("verto_session_uuid")||generateGUID();localStorage.setItem("verto_session_uuid",verto.sessid);} if(verto.options.sessid){verto.sessid=verto.options.sessid;}else{verto.sessid=localStorage.getItem("verto_session_uuid")||generateGUID();localStorage.setItem("verto_session_uuid",verto.sessid);}
@ -275,7 +276,8 @@ dialog.sendMessage($.verto.enum.message.display,{});};$.verto.dialog.prototype.h
dialog.gotEarly=true;dialog.rtc.answer(params.sdp,function(){console.log("Dialog "+dialog.callID+"Establishing early media");dialog.setState($.verto.enum.state.early);if(dialog.gotAnswer){console.log("Dialog "+dialog.callID+"Answering Channel");dialog.setState($.verto.enum.state.active);}},function(e){console.error(e);dialog.hangup();});console.log("Dialog "+dialog.callID+"EARLY SDP",params.sdp);};$.verto.ENUM=function(s){var i=0,o={};s.split(" ").map(function(x){o[x]={name:x,val:i++};});return Object.freeze(o);};$.verto.enum={};$.verto.enum.states=Object.freeze({new:{requesting:1,recovering:1,ringing:1,destroy:1,answering:1,hangup:1},requesting:{trying:1,hangup:1,active:1},recovering:{answering:1,hangup:1},trying:{active:1,early:1,hangup:1},ringing:{answering:1,hangup:1},answering:{active:1,hangup:1},active:{answering:1,requesting:1,hangup:1,held:1},held:{hangup:1,active:1},early:{hangup:1,active:1},hangup:{destroy:1},destroy:{},purge:{destroy:1}});$.verto.enum.state=$.verto.ENUM("new requesting trying recovering ringing answering early active held hangup destroy purge");$.verto.enum.direction=$.verto.ENUM("inbound outbound");$.verto.enum.message=$.verto.ENUM("display info pvtEvent");$.verto.enum=Object.freeze($.verto.enum);$.verto.saved=[];$.verto.unloadJobs=[];$(window).bind('beforeunload',function(){for(var f in $.verto.unloadJobs){$.verto.unloadJobs[f]();} dialog.gotEarly=true;dialog.rtc.answer(params.sdp,function(){console.log("Dialog "+dialog.callID+"Establishing early media");dialog.setState($.verto.enum.state.early);if(dialog.gotAnswer){console.log("Dialog "+dialog.callID+"Answering Channel");dialog.setState($.verto.enum.state.active);}},function(e){console.error(e);dialog.hangup();});console.log("Dialog "+dialog.callID+"EARLY SDP",params.sdp);};$.verto.ENUM=function(s){var i=0,o={};s.split(" ").map(function(x){o[x]={name:x,val:i++};});return Object.freeze(o);};$.verto.enum={};$.verto.enum.states=Object.freeze({new:{requesting:1,recovering:1,ringing:1,destroy:1,answering:1,hangup:1},requesting:{trying:1,hangup:1,active:1},recovering:{answering:1,hangup:1},trying:{active:1,early:1,hangup:1},ringing:{answering:1,hangup:1},answering:{active:1,hangup:1},active:{answering:1,requesting:1,hangup:1,held:1},held:{hangup:1,active:1},early:{hangup:1,active:1},hangup:{destroy:1},destroy:{},purge:{destroy:1}});$.verto.enum.state=$.verto.ENUM("new requesting trying recovering ringing answering early active held hangup destroy purge");$.verto.enum.direction=$.verto.ENUM("inbound outbound");$.verto.enum.message=$.verto.ENUM("display info pvtEvent");$.verto.enum=Object.freeze($.verto.enum);$.verto.saved=[];$.verto.unloadJobs=[];$(window).bind('beforeunload',function(){for(var f in $.verto.unloadJobs){$.verto.unloadJobs[f]();}
for(var i in $.verto.saved){var verto=$.verto.saved[i];if(verto){verto.purge();verto.logout();}} for(var i in $.verto.saved){var verto=$.verto.saved[i];if(verto){verto.purge();verto.logout();}}
return $.verto.warnOnUnload;});$.verto.videoDevices=[];$.verto.audioInDevices=[];$.verto.audioOutDevices=[];var checkDevices=function(runtime){console.info("enumerating devices");var aud_in=[],aud_out=[],vid=[];if((!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)&&MediaStreamTrack.getSources){MediaStreamTrack.getSources(function(media_sources){for(var i=0;i<media_sources.length;i++){if(media_sources[i].kind=='video'){vid.push(media_sources[i]);}else{aud_in.push(media_sources[i]);}} return $.verto.warnOnUnload;});$.verto.videoDevices=[];$.verto.audioInDevices=[];$.verto.audioOutDevices=[];var checkDevices=function(runtime){console.info("enumerating devices");var aud_in=[],aud_out=[],vid=[];if((!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)&&MediaStreamTrack.getSources){MediaStreamTrack.getSources(function(media_sources){for(var i=0;i<media_sources.length;i++){if(media_sources[i].kind=='video'){vid.push(media_sources[i]);}else{aud_in.push(media_sources[i]);}}
$.verto.videoDevices=vid;$.verto.audioInDevices=aud_in;console.info("Audio Devices",$.verto.audioInDevices);console.info("Video Devices",$.verto.videoDevices);runtime();});}else{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){console.log("enumerateDevices() not supported.");return;} $.verto.videoDevices=vid;$.verto.audioInDevices=aud_in;console.info("Audio Devices",$.verto.audioInDevices);console.info("Video Devices",$.verto.videoDevices);runtime(true);});}else{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){console.log("enumerateDevices() not supported.");return;}
navigator.mediaDevices.enumerateDevices().then(function(devices){devices.forEach(function(device){console.log(device);console.log(device.kind+": "+device.label+" id = "+device.deviceId);if(device.kind==="videoinput"){vid.push({id:device.deviceId,kind:"video",label:device.label});}else if(device.kind==="audioinput"){aud_in.push({id:device.deviceId,kind:"audio_in",label:device.label});}else if(device.kind==="audiooutput"){aud_out.push({id:device.deviceId,kind:"audio_out",label:device.label});}});$.verto.videoDevices=vid;$.verto.audioInDevices=aud_in;$.verto.audioOutDevices=aud_out;console.info("Audio IN Devices",$.verto.audioInDevices);console.info("Audio Out Devices",$.verto.audioOutDevices);console.info("Video Devices",$.verto.videoDevices);runtime();}).catch(function(err){console.log(" Device Enumeration ERROR: "+err.name+": "+err.message);runtime();});}};$.verto.refreshDevices=function(runtime){checkDevices(runtime);} navigator.mediaDevices.enumerateDevices().then(function(devices){devices.forEach(function(device){console.log(device);console.log(device.kind+": "+device.label+" id = "+device.deviceId);if(device.kind==="videoinput"){vid.push({id:device.deviceId,kind:"video",label:device.label});}else if(device.kind==="audioinput"){aud_in.push({id:device.deviceId,kind:"audio_in",label:device.label});}else if(device.kind==="audiooutput"){aud_out.push({id:device.deviceId,kind:"audio_out",label:device.label});}});$.verto.videoDevices=vid;$.verto.audioInDevices=aud_in;$.verto.audioOutDevices=aud_out;console.info("Audio IN Devices",$.verto.audioInDevices);console.info("Audio Out Devices",$.verto.audioOutDevices);console.info("Video Devices",$.verto.videoDevices);runtime(true);}).catch(function(err){console.log(" Device Enumeration ERROR: "+err.name+": "+err.message);runtime(false);});}};$.verto.refreshDevices=function(runtime){checkDevices(runtime);}
$.verto.init=function(obj,runtime){$.FSRTC.checkPerms(function(){checkDevices(runtime);},true,true);} $.verto.init=function(obj,runtime){if(!obj){obj={};}
if(!obj.skipPermCheck&&!obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){checkDevices(runtime);},true,true);}else if(obj.skipPermCheck&&!obj.skipDeviceCheck){checkDevices(runtime);}else if(!obj.skipPermCheck&&obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){runtime(status);},true,true);}else{runtime(null);}}
$.verto.genUUID=function(){return generateGUID();}})(jQuery); $.verto.genUUID=function(){return generateGUID();}})(jQuery);

View File

@ -984,6 +984,8 @@ function refresh_devices()
$("#useshare").append(o); $("#useshare").append(o);
$("#usemic").append(new Option("No Microphone", "none"));
$("#usecamera").selectmenu('refresh', true); $("#usecamera").selectmenu('refresh', true);
$("#usemic").selectmenu('refresh', true); $("#usemic").selectmenu('refresh', true);
@ -1593,7 +1595,7 @@ $(window).load(function() {
$("#search").show(); $("#search").show();
goto_page("enum"); goto_page("enum");
setTimeout(function() { setTimeout(function() {
$.verto.init({}, init); $.verto.init({skipPermCheck: false}, init);
}, 1000); }, 1000);
}); });

View File

@ -16,9 +16,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: autogen.sh,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
#
UNAME=`uname` UNAME=`uname`

View File

@ -16,9 +16,6 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: regression_tests.sh.in,v 1.2 2009/11/20 13:12:24 steveu Exp $
#
STDOUT_DEST=xyzzy STDOUT_DEST=xyzzy
STDERR_DEST=xyzzy2 STDERR_DEST=xyzzy2

View File

@ -21,8 +21,6 @@
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software * License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: timing.h,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $
*/ */
#if !defined(_TIMING_H_) #if !defined(_TIMING_H_)

View File

@ -90,7 +90,7 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit) SPAN_DECLARE(void) async_rx_put_bit(void *user_data, int bit)
{ {
async_rx_state_t *s; async_rx_state_t *s;
@ -215,7 +215,7 @@ SPAN_DECLARE(int) async_rx_free(async_rx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data) SPAN_DECLARE(int) async_tx_get_bit(void *user_data)
{ {
async_tx_state_t *s; async_tx_state_t *s;
int bit; int bit;

View File

@ -161,7 +161,7 @@ static void hdlc_underflow_handler(void *user_data)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len) SPAN_DECLARE(int) fax_rx(fax_state_t *s, int16_t *amp, int len)
{ {
int i; int i;
@ -180,7 +180,7 @@ SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len) SPAN_DECLARE(int) fax_rx_fillin(fax_state_t *s, int len)
{ {
/* To mitigate the effect of lost packets on a packet network we should /* To mitigate the effect of lost packets on a packet network we should
try to sustain the status quo. If there is no receive modem running, keep try to sustain the status quo. If there is no receive modem running, keep
@ -209,7 +209,7 @@ SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len) SPAN_DECLARE(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len)
{ {
int len; int len;
#if defined(LOG_FAX_AUDIO) #if defined(LOG_FAX_AUDIO)

View File

@ -152,7 +152,7 @@ SPAN_DECLARE(const char *) fax_modem_to_str(int modem)
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
//static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) //static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok)
SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) SPAN_DECLARE(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -168,7 +168,7 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len) SPAN_DECLARE(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -206,7 +206,7 @@ static void v17_rx_status_handler(void *user_data, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len) SPAN_DECLARE(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -224,7 +224,7 @@ SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t am
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len) SPAN_DECLARE(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -253,7 +253,7 @@ static void v27ter_rx_status_handler(void *user_data, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len) SPAN_DECLARE(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -271,7 +271,7 @@ SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len) SPAN_DECLARE(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -300,7 +300,7 @@ static void v29_rx_status_handler(void *user_data, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len) SPAN_DECLARE(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;
@ -318,7 +318,7 @@ SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t am
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len) SPAN_DECLARE(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len)
{ {
fax_modems_state_t *s; fax_modems_state_t *s;

View File

@ -200,7 +200,7 @@ SPAN_DECLARE(int) fsk_tx_free(fsk_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len)
{ {
int sample; int sample;
int bit; int bit;
@ -382,7 +382,7 @@ static void report_status_change(fsk_rx_state_t *s, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len) SPAN_DECLARE(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len)
{ {
int buf_ptr; int buf_ptr;
int baudstate; int baudstate;
@ -626,7 +626,7 @@ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) fsk_rx_fillin(fsk_rx_state_t *s, int len) SPAN_DECLARE(int) fsk_rx_fillin(fsk_rx_state_t *s, int len)
{ {
int buf_ptr; int buf_ptr;
int i; int i;

View File

@ -299,7 +299,7 @@ static __inline__ void hdlc_rx_put_bit_core(hdlc_rx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit) SPAN_DECLARE(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit)
{ {
if (new_bit < 0) if (new_bit < 0)
{ {
@ -312,7 +312,7 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte) SPAN_DECLARE(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte)
{ {
int i; int i;
@ -332,7 +332,7 @@ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len) SPAN_DECLARE(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len)
{ {
int i; int i;
@ -517,7 +517,7 @@ SPAN_DECLARE(int) hdlc_tx_corrupt_frame(hdlc_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s) SPAN_DECLARE(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
{ {
int i; int i;
int byte_in_progress; int byte_in_progress;
@ -636,7 +636,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) hdlc_tx_get_bit(hdlc_tx_state_t *s) SPAN_DECLARE(int) hdlc_tx_get_bit(hdlc_tx_state_t *s)
{ {
int txbit; int txbit;
@ -652,7 +652,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_bit(hdlc_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len) SPAN_DECLARE(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len)
{ {
size_t i; size_t i;
int x; int x;

View File

@ -110,9 +110,9 @@ SPAN_DECLARE(const char *) modem_connect_tone_to_str(int tone)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s, SPAN_DECLARE(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s,
int16_t amp[], int16_t amp[],
int len) int len)
{ {
int16_t mod; int16_t mod;
int i; int i;
@ -456,9 +456,9 @@ static void v21_put_bit(void *user_data, int bit)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s, SPAN_DECLARE(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s,
const int16_t amp[], const int16_t amp[],
int len) int len)
{ {
int i; int i;
int16_t notched; int16_t notched;
@ -700,7 +700,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_state_t *s, int len) SPAN_DECLARE(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_state_t *s, int len)
{ {
return 0; return 0;
} }

View File

@ -57,7 +57,7 @@
#include "spandsp/private/silence_gen.h" #include "spandsp/private/silence_gen.h"
SPAN_DECLARE_NONSTD(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len) SPAN_DECLARE(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len)
{ {
if (s->remaining_samples != INT_MAX) if (s->remaining_samples != INT_MAX)
{ {
@ -151,7 +151,7 @@ SPAN_DECLARE(int) silence_gen_free(silence_gen_state_t *s)
/* The following dummy routines, to absorb data, don't really have a proper home, /* The following dummy routines, to absorb data, don't really have a proper home,
so they have been put here. */ so they have been put here. */
SPAN_DECLARE_NONSTD(int) span_dummy_rx(void *user_data, const int16_t amp[], int len) SPAN_DECLARE(int) span_dummy_rx(void *user_data, const int16_t amp[], int len)
{ {
return 0; return 0;
} }
@ -163,7 +163,7 @@ SPAN_DECLARE(int) span_dummy_mod(void *user_data, int16_t amp[], int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len) SPAN_DECLARE(int) span_dummy_rx_fillin(void *user_data, int len)
{ {
return 0; return 0;
} }

View File

@ -156,7 +156,7 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status);
- SIG_STATUS_TRAINING_SUCCEEDED - SIG_STATUS_TRAINING_SUCCEEDED
- SIG_STATUS_TRAINING_FAILED - SIG_STATUS_TRAINING_FAILED
- SIG_STATUS_END_OF_DATA */ - SIG_STATUS_END_OF_DATA */
SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit); SPAN_DECLARE(void) async_rx_put_bit(void *user_data, int bit);
/*! Initialise an asynchronous data receiver context. /*! Initialise an asynchronous data receiver context.
\brief Initialise an asynchronous data receiver context. \brief Initialise an asynchronous data receiver context.
@ -190,7 +190,7 @@ SPAN_DECLARE(void) async_tx_presend_bits(async_tx_state_t *s, int bits);
\brief Get the next bit of a transmitted serial bit stream. \brief Get the next bit of a transmitted serial bit stream.
\param user_data An opaque point which must point to a transmitter context. \param user_data An opaque point which must point to a transmitter context.
\return the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended. */ \return the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended. */
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data); SPAN_DECLARE(int) async_tx_get_bit(void *user_data);
/*! Initialise an asynchronous data transmit context. /*! Initialise an asynchronous data transmit context.
\brief Initialise an asynchronous data transmit context. \brief Initialise an asynchronous data transmit context.

View File

@ -50,7 +50,7 @@ extern "C"
\return The number of samples unprocessed. This should only be non-zero if \return The number of samples unprocessed. This should only be non-zero if
the software has reached the end of the FAX call. the software has reached the end of the FAX call.
*/ */
SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len); SPAN_DECLARE(int) fax_rx(fax_state_t *s, int16_t *amp, int len);
/*! Apply fake T.30 receive processing when a block of audio samples is missing (e.g due /*! Apply fake T.30 receive processing when a block of audio samples is missing (e.g due
to packet loss). to packet loss).
@ -60,7 +60,7 @@ SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len);
\return The number of samples unprocessed. This should only be non-zero if \return The number of samples unprocessed. This should only be non-zero if
the software has reached the end of the FAX call. the software has reached the end of the FAX call.
*/ */
SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len); SPAN_DECLARE(int) fax_rx_fillin(fax_state_t *s, int len);
/*! Apply T.30 transmit processing to generate a block of audio samples. /*! Apply T.30 transmit processing to generate a block of audio samples.
\brief Apply T.30 transmit processing to generate a block of audio samples. \brief Apply T.30 transmit processing to generate a block of audio samples.
@ -70,7 +70,7 @@ SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len);
\return The number of samples actually generated. This will be zero when \return The number of samples actually generated. This will be zero when
there is nothing to send. there is nothing to send.
*/ */
SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len); SPAN_DECLARE(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len);
/*! Select whether silent audio will be sent when FAX transmit is idle. /*! Select whether silent audio will be sent when FAX transmit is idle.
\brief Select whether silent audio will be sent when FAX transmit is idle. \brief Select whether silent audio will be sent when FAX transmit is idle.

View File

@ -64,7 +64,7 @@ extern "C"
#endif #endif
/* TEMPORARY FUDGE */ /* TEMPORARY FUDGE */
SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok); SPAN_DECLARE(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok);
/*! Convert a FAX modem type to a short text description. /*! Convert a FAX modem type to a short text description.
\brief Convert a FAX modem type to a short text description. \brief Convert a FAX modem type to a short text description.
@ -73,14 +73,14 @@ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_accept(void *user_data, const uint8_t
SPAN_DECLARE(const char *) fax_modem_to_str(int modem); SPAN_DECLARE(const char *) fax_modem_to_str(int modem);
/* N.B. the following are currently a work in progress */ /* N.B. the following are currently a work in progress */
SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len);
SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len);
SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len);
SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len);
SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len);
SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len);
SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len); SPAN_DECLARE(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len);
SPAN_DECLARE(void) fax_modems_hdlc_tx_flags(fax_modems_state_t *s, int flags); SPAN_DECLARE(void) fax_modems_hdlc_tx_flags(fax_modems_state_t *s, int flags);

View File

@ -187,7 +187,7 @@ SPAN_DECLARE(void) fsk_tx_set_modem_status_handler(fsk_tx_state_t *s, modem_stat
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len);
/*! Get the current received signal power. /*! Get the current received signal power.
\param s The modem context. \param s The modem context.
@ -228,7 +228,7 @@ SPAN_DECLARE(int) fsk_rx_free(fsk_rx_state_t *s);
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len); SPAN_DECLARE(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len);
/*! Fake processing of a missing block of received FSK modem audio samples /*! Fake processing of a missing block of received FSK modem audio samples
(e.g due to packet loss). (e.g due to packet loss).
@ -237,7 +237,7 @@ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len);
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) fsk_rx_fillin(fsk_rx_state_t *s, int len); SPAN_DECLARE(int) fsk_rx_fillin(fsk_rx_state_t *s, int len);
SPAN_DECLARE(void) fsk_rx_set_put_bit(fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data); SPAN_DECLARE(void) fsk_rx_set_put_bit(fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data);

View File

@ -160,20 +160,20 @@ SPAN_DECLARE(int) hdlc_rx_get_stats(hdlc_rx_state_t *s,
\param s A pointer to an HDLC receiver context. \param s A pointer to an HDLC receiver context.
\param new_bit The bit. \param new_bit The bit.
*/ */
SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit); SPAN_DECLARE(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit);
/*! \brief Put a byte of data to an HDLC receiver. /*! \brief Put a byte of data to an HDLC receiver.
\param s A pointer to an HDLC receiver context. \param s A pointer to an HDLC receiver context.
\param new_byte The byte of data. \param new_byte The byte of data.
*/ */
SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte); SPAN_DECLARE(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte);
/*! \brief Put a series of bytes of data to an HDLC receiver. /*! \brief Put a series of bytes of data to an HDLC receiver.
\param s A pointer to an HDLC receiver context. \param s A pointer to an HDLC receiver context.
\param buf The buffer of data. \param buf The buffer of data.
\param len The length of the data in the buffer. \param len The length of the data in the buffer.
*/ */
SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len); SPAN_DECLARE(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len);
/*! Initialise an HDLC transmitter context. /*! Initialise an HDLC transmitter context.
\brief Initialise an HDLC transmitter context. \brief Initialise an HDLC transmitter context.
@ -250,13 +250,13 @@ SPAN_DECLARE(int) hdlc_tx_abort(hdlc_tx_state_t *s);
\param s A pointer to an HDLC transmitter context. \param s A pointer to an HDLC transmitter context.
\return The next bit for transmission. \return The next bit for transmission.
*/ */
SPAN_DECLARE_NONSTD(int) hdlc_tx_get_bit(hdlc_tx_state_t *s); SPAN_DECLARE(int) hdlc_tx_get_bit(hdlc_tx_state_t *s);
/*! \brief Get the next byte for transmission. /*! \brief Get the next byte for transmission.
\param s A pointer to an HDLC transmitter context. \param s A pointer to an HDLC transmitter context.
\return The next byte for transmission. \return The next byte for transmission.
*/ */
SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s); SPAN_DECLARE(int) hdlc_tx_get_byte(hdlc_tx_state_t *s);
/*! \brief Get the next sequence of bytes for transmission. /*! \brief Get the next sequence of bytes for transmission.
\param s A pointer to an HDLC transmitter context. \param s A pointer to an HDLC transmitter context.
@ -264,7 +264,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s);
\param max_len The number of bytes to get. \param max_len The number of bytes to get.
\return The number of bytes actually got. \return The number of bytes actually got.
*/ */
SPAN_DECLARE_NONSTD(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len); SPAN_DECLARE(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -127,9 +127,9 @@ SPAN_DECLARE(int) modem_connect_tones_tx_free(modem_connect_tones_tx_state_t *s)
\param len The number of samples to generate. \param len The number of samples to generate.
\return The number of samples generated. \return The number of samples generated.
*/ */
SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s, SPAN_DECLARE(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s,
int16_t amp[], int16_t amp[],
int len); int len);
/*! \brief Process a block of samples through an instance of the modem connect /*! \brief Process a block of samples through an instance of the modem connect
tones detector. tones detector.
@ -138,9 +138,9 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *
\param len The number of samples in the array. \param len The number of samples in the array.
\return The number of unprocessed samples. \return The number of unprocessed samples.
*/ */
SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s, SPAN_DECLARE(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s,
const int16_t amp[], const int16_t amp[],
int len); int len);
/*! Fake processing of a missing block of received modem connect tone samples /*! Fake processing of a missing block of received modem connect tone samples
(e.g due to packet loss). (e.g due to packet loss).
@ -149,7 +149,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_state_t *s, int len); SPAN_DECLARE(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_state_t *s, int len);
/*! \brief Test if a modem_connect tone has been detected. /*! \brief Test if a modem_connect tone has been detected.
\param s The context. \param s The context.

View File

@ -41,7 +41,7 @@ extern "C"
\return The number of samples actually generated. This will be zero when \return The number of samples actually generated. This will be zero when
there is nothing to send. there is nothing to send.
*/ */
SPAN_DECLARE_NONSTD(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len); SPAN_DECLARE(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len);
/*! Set a silence generator context to output continuous silence. /*! Set a silence generator context to output continuous silence.
\brief Set a silence generator context to output continuous silence. \brief Set a silence generator context to output continuous silence.
@ -110,7 +110,7 @@ SPAN_DECLARE(int) silence_gen_free(silence_gen_state_t *s);
\param len The length of the signal buffer \param len The length of the signal buffer
\return 0. \return 0.
*/ */
SPAN_DECLARE_NONSTD(int) span_dummy_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE(int) span_dummy_rx(void *user_data, const int16_t amp[], int len);
/*! A dummy routine to use as a signal modifier callback, when we aren't /*! A dummy routine to use as a signal modifier callback, when we aren't
really trying to process the signal. It just returns without affecting really trying to process the signal. It just returns without affecting
@ -131,7 +131,7 @@ SPAN_DECLARE(int) span_dummy_mod(void *user_data, int16_t amp[], int len);
\param len The length of the signal buffer \param len The length of the signal buffer
\return 0. \return 0.
*/ */
SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len); SPAN_DECLARE(int) span_dummy_rx_fillin(void *user_data, int len);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -32,14 +32,16 @@
#if !defined(_STDBOOL_H) #if !defined(_STDBOOL_H)
#define _STDBOOL_H #define _STDBOOL_H
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning (disable: 4005) #pragma warning (disable: 4005)
#endif #endif
#if !defined(__cplusplus) #if !defined(__cplusplus)
#define _Bool int #define _Bool int
#define false 0
#define bool int #define bool int
#define false 0
#define true (!false) #define true (!false)
#else #else

View File

@ -576,7 +576,7 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status);
\brief Get a bit of received non-ECM image data. \brief Get a bit of received non-ECM image data.
\param user_data An opaque pointer, which must point to the T.30 context. \param user_data An opaque pointer, which must point to the T.30 context.
\return The next bit to transmit. */ \return The next bit to transmit. */
SPAN_DECLARE_NONSTD(int) t30_non_ecm_get_bit(void *user_data); SPAN_DECLARE(int) t30_non_ecm_get_bit(void *user_data);
/*! Get a chunk of received non-ECM image data. /*! Get a chunk of received non-ECM image data.
\brief Get a bit of received non-ECM image data. \brief Get a bit of received non-ECM image data.
@ -590,7 +590,7 @@ SPAN_DECLARE(int) t30_non_ecm_get(void *user_data, uint8_t buf[], int max_len);
\brief Process a bit of received non-ECM image data \brief Process a bit of received non-ECM image data
\param user_data An opaque pointer, which must point to the T.30 context. \param user_data An opaque pointer, which must point to the T.30 context.
\param bit The received bit. */ \param bit The received bit. */
SPAN_DECLARE_NONSTD(void) t30_non_ecm_put_bit(void *user_data, int bit); SPAN_DECLARE(void) t30_non_ecm_put_bit(void *user_data, int bit);
/*! Process a chunk of received non-ECM image data. /*! Process a chunk of received non-ECM image data.
\brief Process a chunk of received non-ECM image data \brief Process a chunk of received non-ECM image data
@ -605,7 +605,7 @@ SPAN_DECLARE(void) t30_non_ecm_put(void *user_data, const uint8_t buf[], int len
\param msg The HDLC message. \param msg The HDLC message.
\param len The length of the message, in octets. \param len The length of the message, in octets.
\param ok True if the frame was received without error. */ \param ok True if the frame was received without error. */
SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok); SPAN_DECLARE(void) t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok);
/*! Report the passage of time to the T.30 engine. /*! Report the passage of time to the T.30 engine.
\brief Report the passage of time to the T.30 engine. \brief Report the passage of time to the T.30 engine.

View File

@ -65,7 +65,7 @@ SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len);
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) t31_rx(t31_state_t *s, int16_t amp[], int len);
/*! Fake processing of a missing block of received T.31 modem audio samples /*! Fake processing of a missing block of received T.31 modem audio samples
(e.g due to packet loss). (e.g due to packet loss).
@ -73,7 +73,7 @@ SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len);
\param s The T.31 modem context. \param s The T.31 modem context.
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len); SPAN_DECLARE(int) t31_rx_fillin(t31_state_t *s, int len);
/*! Generate a block of T.31 modem audio samples. /*! Generate a block of T.31 modem audio samples.
\brief Generate a block of T.31 modem audio samples. \brief Generate a block of T.31 modem audio samples.
@ -82,7 +82,7 @@ SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len);
\param max_len The number of samples to be generated. \param max_len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len); SPAN_DECLARE(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len);
SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples); SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples);

View File

@ -288,7 +288,7 @@ SPAN_DECLARE(int) t38_core_send_data_multi_field(t38_core_state_t *s, int data_t
\param len The length of the packet contents. \param len The length of the packet contents.
\param seq_no The packet sequence number. \param seq_no The packet sequence number.
\return 0 for OK, else -1. */ \return 0 for OK, else -1. */
SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no); SPAN_DECLARE(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no);
/*! \brief Process a received T.38 IFP packet from a reliable stream (e.g. TCP). /*! \brief Process a received T.38 IFP packet from a reliable stream (e.g. TCP).
\param s The T.38 context. \param s The T.38 context.
@ -296,7 +296,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8
\param len The length of the packet contents. \param len The length of the packet contents.
\param seq_no The packet sequence number, used for logging purposes. \param seq_no The packet sequence number, used for logging purposes.
\return The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it. */ \return The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it. */
SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no); SPAN_DECLARE(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no);
/*! Set the method to be used for data rate management, as per the T.38 spec. /*! Set the method to be used for data rate management, as per the T.38 spec.
\param s The T.38 context. \param s The T.38 context.

View File

@ -102,7 +102,7 @@ SPAN_DECLARE(int) t38_gateway_free(t38_gateway_state_t *s);
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len);
/*! Apply fake processing when a block of audio samples is missing (e.g due /*! Apply fake processing when a block of audio samples is missing (e.g due
to packet loss). to packet loss).
@ -112,7 +112,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], i
\return The number of samples unprocessed. This should only be non-zero if \return The number of samples unprocessed. This should only be non-zero if
the software has reached the end of the FAX call. the software has reached the end of the FAX call.
*/ */
SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len); SPAN_DECLARE(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len);
/*! Generate a block of FAX audio samples. /*! Generate a block of FAX audio samples.
\brief Generate a block of FAX audio samples. \brief Generate a block of FAX audio samples.
@ -121,7 +121,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len);
\param max_len The number of samples to be generated. \param max_len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len); SPAN_DECLARE(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len);
/*! Control whether error correcting mode (ECM) is allowed. /*! Control whether error correcting mode (ECM) is allowed.
\brief Control whether error correcting mode (ECM) is allowed. \brief Control whether error correcting mode (ECM) is allowed.

View File

@ -124,7 +124,7 @@ SPAN_DECLARE(void) t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_st
/*! \brief Get the next bit of data from a T.38 rate adapting non-ECM buffer context. /*! \brief Get the next bit of data from a T.38 rate adapting non-ECM buffer context.
\param user_data The buffer context, cast to a void pointer. \param user_data The buffer context, cast to a void pointer.
\return The next bit, or one of the values indicating a change of modem status. */ \return The next bit, or one of the values indicating a change of modem status. */
SPAN_DECLARE_NONSTD(int) t38_non_ecm_buffer_get_bit(void *user_data); SPAN_DECLARE(int) t38_non_ecm_buffer_get_bit(void *user_data);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -28,21 +28,17 @@
#if defined(_M_IX86) || defined(_M_X64) #if defined(_M_IX86) || defined(_M_X64)
#if defined(LIBSPANDSP_EXPORTS) #if defined(LIBSPANDSP_EXPORTS)
#define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall #define SPAN_DECLARE(type) __declspec(dllexport) type
#define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
#define SPAN_DECLARE_DATA __declspec(dllexport) #define SPAN_DECLARE_DATA __declspec(dllexport)
#else #else
#define SPAN_DECLARE(type) __declspec(dllimport) type __stdcall #define SPAN_DECLARE(type) __declspec(dllimport) type
#define SPAN_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
#define SPAN_DECLARE_DATA __declspec(dllimport) #define SPAN_DECLARE_DATA __declspec(dllimport)
#endif #endif
#elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__)) #elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__))
#define SPAN_DECLARE(type) __attribute__((visibility("default"))) type #define SPAN_DECLARE(type) __attribute__((visibility("default"))) type
#define SPAN_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
#define SPAN_DECLARE_DATA __attribute__((visibility("default"))) #define SPAN_DECLARE_DATA __attribute__((visibility("default")))
#else #else
#define SPAN_DECLARE(type) /**/ type #define SPAN_DECLARE(type) /**/ type
#define SPAN_DECLARE_NONSTD(type) /**/ type
#define SPAN_DECLARE_DATA /**/ #define SPAN_DECLARE_DATA /**/
#endif #endif

View File

@ -88,7 +88,7 @@ SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descript
SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s); SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s);
SPAN_DECLARE_NONSTD(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples); SPAN_DECLARE(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples);
SPAN_DECLARE(tone_gen_state_t *) tone_gen_init(tone_gen_state_t *s, tone_gen_descriptor_t *t); SPAN_DECLARE(tone_gen_state_t *) tone_gen_init(tone_gen_state_t *s, tone_gen_descriptor_t *t);

View File

@ -284,7 +284,7 @@ SPAN_DECLARE(void) v17_rx_set_modem_status_handler(v17_rx_state_t *s, modem_stat
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len); SPAN_DECLARE(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len);
/*! Fake processing of a missing block of received V.17 modem audio samples. /*! Fake processing of a missing block of received V.17 modem audio samples.
(e.g due to packet loss). (e.g due to packet loss).
@ -293,7 +293,7 @@ SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) v17_rx_fillin(v17_rx_state_t *s, int len); SPAN_DECLARE(int) v17_rx_fillin(v17_rx_state_t *s, int len);
/*! Get a snapshot of the current equalizer coefficients. /*! Get a snapshot of the current equalizer coefficients.
\brief Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients.

View File

@ -155,7 +155,7 @@ SPAN_DECLARE(void) v17_tx_set_modem_status_handler(v17_tx_state_t *s, modem_stat
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -143,7 +143,7 @@ SPAN_DECLARE(int) v18_free(v18_state_t *s);
\param max_len The number of samples to be generated. \param max_len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t amp[], int max_len); SPAN_DECLARE(int) v18_tx(v18_state_t *s, int16_t amp[], int max_len);
/*! Process a block of received V.18 audio samples. /*! Process a block of received V.18 audio samples.
\brief Process a block of received V.18 audio samples. \brief Process a block of received V.18 audio samples.
@ -152,7 +152,7 @@ SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t amp[], int max_len);
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of unprocessed samples. \return The number of unprocessed samples.
*/ */
SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len); SPAN_DECLARE(int) v18_rx(v18_state_t *s, const int16_t amp[], int len);
/*! Fake processing of a missing block of received V.18 audio samples. /*! Fake processing of a missing block of received V.18 audio samples.
(e.g due to packet loss). (e.g due to packet loss).
@ -161,7 +161,7 @@ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len);
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of unprocessed samples. \return The number of unprocessed samples.
*/ */
SPAN_DECLARE_NONSTD(int) v18_rx_fillin(v18_state_t *s, int len); SPAN_DECLARE(int) v18_rx_fillin(v18_state_t *s, int len);
/*! \brief Put a string to a V.18 context's input buffer. /*! \brief Put a string to a V.18 context's input buffer.
\param s The V.18 context. \param s The V.18 context.

View File

@ -78,7 +78,7 @@ extern "C"
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len); SPAN_DECLARE(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len);
/*! Fake processing of a missing block of received V.22bis modem audio samples. /*! Fake processing of a missing block of received V.22bis modem audio samples.
(e.g due to packet loss). (e.g due to packet loss).
@ -86,7 +86,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int l
\param s The modem context. \param s The modem context.
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len); SPAN_DECLARE(int) v22bis_rx_fillin(v22bis_state_t *s, int len);
/*! Get a snapshot of the current equalizer coefficients. /*! Get a snapshot of the current equalizer coefficients.
\brief Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients.
@ -130,7 +130,7 @@ SPAN_DECLARE(void) v22bis_rx_set_qam_report_handler(v22bis_state_t *s, qam_repor
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. */ \return The number of samples actually generated. */
SPAN_DECLARE_NONSTD(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len);
/*! Adjust a V.22bis modem transmit context's power output. /*! Adjust a V.22bis modem transmit context's power output.
\brief Adjust a V.22bis modem transmit context's output power. \brief Adjust a V.22bis modem transmit context's output power.

View File

@ -117,7 +117,7 @@ SPAN_DECLARE(void) v27ter_rx_set_modem_status_handler(v27ter_rx_state_t *s, mode
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len); SPAN_DECLARE(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len);
/*! Fake processing of a missing block of received V.27ter modem audio samples. /*! Fake processing of a missing block of received V.27ter modem audio samples.
(e.g due to packet loss). (e.g due to packet loss).
@ -126,7 +126,7 @@ SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], in
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. \return The number of samples unprocessed.
*/ */
SPAN_DECLARE_NONSTD(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len); SPAN_DECLARE(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len);
/*! Get a snapshot of the current equalizer coefficients. /*! Get a snapshot of the current equalizer coefficients.
\brief Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients.

View File

@ -136,7 +136,7 @@ SPAN_DECLARE(void) v27ter_tx_set_modem_status_handler(v27ter_tx_state_t *s, mode
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -196,7 +196,7 @@ SPAN_DECLARE(void) v29_rx_set_modem_status_handler(v29_rx_state_t *s, modem_stat
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len); SPAN_DECLARE(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len);
/*! Fake processing of a missing block of received V.29 modem audio samples. /*! Fake processing of a missing block of received V.29 modem audio samples.
(e.g due to packet loss). (e.g due to packet loss).
@ -204,7 +204,7 @@ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len)
\param s The modem context. \param s The modem context.
\param len The number of samples to fake. \param len The number of samples to fake.
\return The number of samples unprocessed. */ \return The number of samples unprocessed. */
SPAN_DECLARE_NONSTD(int) v29_rx_fillin(v29_rx_state_t *s, int len); SPAN_DECLARE(int) v29_rx_fillin(v29_rx_state_t *s, int len);
/*! Get a snapshot of the current equalizer coefficients. /*! Get a snapshot of the current equalizer coefficients.
\brief Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients.

View File

@ -167,7 +167,7 @@ SPAN_DECLARE(void) v29_tx_set_modem_status_handler(v29_tx_state_t *s, modem_stat
\param len The number of samples to be generated. \param len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) v29_tx(v29_tx_state_t *s, int16_t amp[], int len); SPAN_DECLARE(int) v29_tx(v29_tx_state_t *s, int16_t amp[], int len);
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -45,7 +45,7 @@ extern "C"
SPAN_DECLARE(const char *) lapm_status_to_str(int status); SPAN_DECLARE(const char *) lapm_status_to_str(int status);
SPAN_DECLARE_NONSTD(void) lapm_receive(void *user_data, const uint8_t *frame, int len, int ok); SPAN_DECLARE(void) lapm_receive(void *user_data, const uint8_t *frame, int len, int ok);
SPAN_DECLARE(void) v42_start(v42_state_t *s); SPAN_DECLARE(void) v42_start(v42_state_t *s);

View File

@ -173,7 +173,7 @@ SPAN_DECLARE(logging_state_t *) v8_get_logging_state(v8_state_t *s);
\param max_len The number of samples to be generated. \param max_len The number of samples to be generated.
\return The number of samples actually generated. \return The number of samples actually generated.
*/ */
SPAN_DECLARE_NONSTD(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len); SPAN_DECLARE(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len);
/*! Process a block of received V.8 audio samples. /*! Process a block of received V.8 audio samples.
\brief Process a block of received V.8 audio samples. \brief Process a block of received V.8 audio samples.
@ -181,7 +181,7 @@ SPAN_DECLARE_NONSTD(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len);
\param amp The audio sample buffer. \param amp The audio sample buffer.
\param len The number of samples in the buffer. \param len The number of samples in the buffer.
*/ */
SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len); SPAN_DECLARE(int) v8_rx(v8_state_t *s, const int16_t *amp, int len);
/*! Log the list of supported modulations. /*! Log the list of supported modulations.
\brief Log the list of supported modulations. \brief Log the list of supported modulations.

View File

@ -6401,7 +6401,7 @@ static void t30_non_ecm_rx_status(void *user_data, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) t30_non_ecm_put_bit(void *user_data, int bit) SPAN_DECLARE(void) t30_non_ecm_put_bit(void *user_data, int bit)
{ {
t30_state_t *s; t30_state_t *s;
int res; int res;
@ -6499,7 +6499,7 @@ SPAN_DECLARE(void) t30_non_ecm_put(void *user_data, const uint8_t buf[], int len
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t30_non_ecm_get_bit(void *user_data) SPAN_DECLARE(int) t30_non_ecm_get_bit(void *user_data)
{ {
int bit; int bit;
t30_state_t *s; t30_state_t *s;
@ -6705,7 +6705,7 @@ static void t30_hdlc_rx_status(void *user_data, int status)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) SPAN_DECLARE(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok)
{ {
t30_state_t *s; t30_state_t *s;

View File

@ -2772,7 +2772,7 @@ static int initial_timed_rx(void *user_data, const int16_t amp[], int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) t31_rx(t31_state_t *s, int16_t amp[], int len)
{ {
int i; int i;
int32_t power; int32_t power;
@ -2822,7 +2822,7 @@ SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len) SPAN_DECLARE(int) t31_rx_fillin(t31_state_t *s, int len)
{ {
/* To mitigate the effect of lost packets on a packet network we should /* To mitigate the effect of lost packets on a packet network we should
try to sustain the status quo. If there is no receive modem running, keep try to sustain the status quo. If there is no receive modem running, keep
@ -2848,7 +2848,7 @@ SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len) SPAN_DECLARE(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len)
{ {
int len; int len;

View File

@ -347,7 +347,7 @@ static __inline__ int classify_seq_no_offset(int expected, int actual)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no) SPAN_DECLARE(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no)
{ {
int i; int i;
int t30_indicator; int t30_indicator;
@ -668,7 +668,7 @@ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no) SPAN_DECLARE(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no)
{ {
int log_seq_no; int log_seq_no;
int ptr; int ptr;

View File

@ -2134,7 +2134,7 @@ static void update_rx_timing(t38_gateway_state_t *s, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len)
{ {
int i; int i;
@ -2153,7 +2153,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], i
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len) SPAN_DECLARE(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len)
{ {
/* To mitigate the effect of lost packets on a packet network we should /* To mitigate the effect of lost packets on a packet network we should
try to sustain the status quo. If there is no receive modem running, keep try to sustain the status quo. If there is no receive modem running, keep
@ -2181,7 +2181,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len) SPAN_DECLARE(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len)
{ {
int len; int len;
#if defined(LOG_FAX_AUDIO) #if defined(LOG_FAX_AUDIO)

View File

@ -85,7 +85,7 @@ static void restart_buffer(t38_non_ecm_buffer_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) t38_non_ecm_buffer_get_bit(void *user_data) SPAN_DECLARE(int) t38_non_ecm_buffer_get_bit(void *user_data)
{ {
t38_non_ecm_buffer_state_t *s; t38_non_ecm_buffer_state_t *s;
int bit; int bit;

View File

@ -119,7 +119,7 @@ SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples) SPAN_DECLARE(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples)
{ {
int samples; int samples;
int limit; int limit;

View File

@ -1229,7 +1229,7 @@ static __inline__ int signal_detect(v17_rx_state_t *s, int16_t amp)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len) SPAN_DECLARE(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
{ {
int i; int i;
int step; int step;
@ -1341,7 +1341,7 @@ SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v17_rx_fillin(v17_rx_state_t *s, int len) SPAN_DECLARE(int) v17_rx_fillin(v17_rx_state_t *s, int len)
{ {
int i; int i;

View File

@ -296,7 +296,7 @@ static __inline__ complexf_t getbaud(v17_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len)
{ {
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t v; complexi16_t v;

View File

@ -978,7 +978,7 @@ static void v18_textphone_put_async_byte(void *user_data, int byte)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t *amp, int max_len) SPAN_DECLARE(int) v18_tx(v18_state_t *s, int16_t *amp, int max_len)
{ {
int len; int len;
int lenx; int lenx;
@ -1006,7 +1006,7 @@ SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t *amp, int max_len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len) SPAN_DECLARE(int) v18_rx(v18_state_t *s, const int16_t amp[], int len)
{ {
if (s->rx_suppression > 0) if (s->rx_suppression > 0)
{ {
@ -1037,7 +1037,7 @@ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v18_rx_fillin(v18_state_t *s, int len) SPAN_DECLARE(int) v18_rx_fillin(v18_state_t *s, int len)
{ {
if (s->rx_suppression > 0) if (s->rx_suppression > 0)
{ {

View File

@ -776,7 +776,7 @@ static __inline__ void process_half_baud(v22bis_state_t *s, const complexf_t *sa
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len) SPAN_DECLARE(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len)
{ {
int i; int i;
int step; int step;
@ -919,7 +919,7 @@ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int l
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len) SPAN_DECLARE(int) v22bis_rx_fillin(v22bis_state_t *s, int len)
{ {
int i; int i;

View File

@ -469,7 +469,7 @@ static complexf_t getbaud(v22bis_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len)
{ {
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t v; complexi16_t v;

View File

@ -828,7 +828,7 @@ static __inline__ int signal_detect(v27ter_rx_state_t *s, int16_t amp)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len) SPAN_DECLARE(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len)
{ {
int i; int i;
int step; int step;
@ -978,7 +978,7 @@ SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], in
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len) SPAN_DECLARE(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len)
{ {
int i; int i;

View File

@ -241,7 +241,7 @@ static complexf_t getbaud(v27ter_tx_state_t *s)
} }
/*- End of function --------------------------------------------------------*/ /*- End of function --------------------------------------------------------*/
SPAN_DECLARE_NONSTD(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len) SPAN_DECLARE(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len)
{ {
#if defined(SPANDSP_USE_FIXED_POINT) #if defined(SPANDSP_USE_FIXED_POINT)
complexi16_t v; complexi16_t v;

Some files were not shown because too many files have changed in this diff Show More