mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
Merge branch 'master' into v1.2.stable
This commit is contained in:
@@ -336,6 +336,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "libs\win32\libjp
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gennmtab", "libs\win32\xmlrpc-c\gennmtab.2010.vcxproj", "{BED7539C-0099-4A14-AD5D-30828F15A171}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\spandsp\src\msvc\make_math_fixed_tables.2010.vcxproj", "{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
All|Win32 = All|Win32
|
||||
@@ -2054,6 +2056,17 @@ Global
|
||||
{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.Build.0 = Release|Win32
|
||||
{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|x64.ActiveCfg = Release|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x64.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x64.Build.0 = All|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -566,6 +566,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmltok", "libs\win32\xmlrpc
|
||||
{BED7539C-0099-4A14-AD5D-30828F15A171} = {BED7539C-0099-4A14-AD5D-30828F15A171}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\spandsp\src\msvc\make_math_fixed_tables.2010.vcxproj", "{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
All|Win32 = All|Win32
|
||||
@@ -3753,6 +3755,23 @@ Global
|
||||
{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.Build.0 = Release|x64
|
||||
{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64 Setup.ActiveCfg = Release|x64
|
||||
{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x86 Setup.ActiveCfg = Release|x64
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|x64 Setup.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.All|x86 Setup.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x64.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x64 Setup.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Debug|x86 Setup.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|Win32.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|Win32.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x64.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x64.Build.0 = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x64 Setup.ActiveCfg = All|Win32
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}.Release|x86 Setup.ActiveCfg = All|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -3867,6 +3886,7 @@ Global
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
|
||||
@@ -565,6 +565,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmltok", "libs\win32\xmlrpc
|
||||
EndProject
|
||||
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup.2012", "w32\Setup\Setup.2012.wixproj", "{47213370-B933-487D-9F45-BCA26D7E2B6F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\spandsp\src\msvc\make_math_fixed_tables.2012.vcxproj", "{2386B892-35F5-46CF-A0F0-10394D2FBF9B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
All|Win32 = All|Win32
|
||||
@@ -3753,6 +3755,23 @@ Global
|
||||
{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x64 Setup.Build.0 = Release|x64
|
||||
{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x86 Setup.ActiveCfg = Release|x86
|
||||
{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x86 Setup.Build.0 = Release|x86
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.Build.0 = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|x64.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|x64 Setup.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|x86 Setup.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.Build.0 = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.Build.0 = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64 Setup.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x86 Setup.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.Build.0 = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.Build.0 = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64 Setup.ActiveCfg = All|Win32
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x86 Setup.ActiveCfg = All|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -3867,6 +3886,7 @@ Global
|
||||
{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{2386B892-35F5-46CF-A0F0-10394D2FBF9B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
|
||||
{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
|
||||
{1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
{ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
<configuration name="http_cache.conf" description="HTTP GET cache">
|
||||
<settings>
|
||||
<!-- set to true if you want to enable http:// and https:// formats. Do not use if mod_httapi is also loaded -->
|
||||
<param name="enable-file-formats" value="false"/>
|
||||
<param name="max-urls" value="10000"/>
|
||||
<param name="location" value="$${base_dir}/http_cache"/>
|
||||
<param name="default-max-age" value="86400"/>
|
||||
<param name="prefetch-thread-count" value="8"/>
|
||||
<param name="prefetch-queue-size" value="100"/>
|
||||
<!-- absolute path to CA bundle file -->
|
||||
<param name="ssl-cacert" value="$${base_dir}/conf/cacert.pem"/>
|
||||
<!-- verify certificates -->
|
||||
<param name="ssl-verifypeer" value="true"/>
|
||||
<!-- verify host name matches certificate -->
|
||||
<param name="ssl-verifyhost" value="true"/>
|
||||
</settings>
|
||||
</configuration>
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
|
||||
|
||||
<!-- Information for connecting to your database -->
|
||||
<param name="db_username" value="bandwidth.com"/>
|
||||
<param name="db_password" value="password"/>
|
||||
<param name="db_dsn" value="bandwidth.com"/>
|
||||
<param name="odbc-dsn" value="bandwidth.com"/>
|
||||
|
||||
<!-- The database table where your CASH column is located -->
|
||||
<param name="db_table" value="accounts"/>
|
||||
|
||||
@@ -695,14 +695,14 @@
|
||||
<extension name="milliwatt">
|
||||
<condition field="destination_number" expression="^9197$">
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="tone_stream://%(251,0,1004);loops=-1"/>
|
||||
<action application="playback" data="{loops=-1}tone_stream://%(251,0,1004)"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
<extension name="tone_stream">
|
||||
<condition field="destination_number" expression="^9198$">
|
||||
<action application="answer"/>
|
||||
<action application="playback" data="tone_stream://path=${base_dir}/conf/tetris.ttml;loops=10"/>
|
||||
<action application="playback" data="{loops=10}tone_stream://path=${base_dir}/conf/tetris.ttml"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
|
||||
<!--<param name="delete-subs-on-register" value="false"/>-->
|
||||
|
||||
<!-- launch a new thread to process each new inbound register when using heavier backends -->
|
||||
<!-- <param name="inbound-reg-in-new-thread" value="true"/> -->
|
||||
|
||||
<!-- enable rtcp on every channel also can be done per leg basis with rtcp_audio_interval_msec variable set to passthru to pass it across a call-->
|
||||
<!--<param name="rtcp-audio-interval-msec" value="5000"/>-->
|
||||
<!--<param name="rtcp-video-interval-msec" value="5000"/>-->
|
||||
|
||||
Vendored
+15
-5
@@ -74,13 +74,23 @@ To build for a stable branch, do this:
|
||||
dpkg-buildpackage -b -us -uc -Zxz -z9
|
||||
git reset --hard origin/master
|
||||
|
||||
Alternatively, you can build using our automated tools:
|
||||
Alternatively, you can build using our automated tools. To build the
|
||||
source packages and all supported binary packages for sid, wheezy,
|
||||
squeeze on i386 and amd64, run the following as root from a clean
|
||||
Debian 'buildd' image:
|
||||
|
||||
aptitude install cowbuilder
|
||||
aptitude update && aptitude upgrade
|
||||
aptitude install -y \
|
||||
rsync git less cowbuilder ccache \
|
||||
devscripts equivs build-essential
|
||||
mkdir /usr/src/freeswitch
|
||||
git clone git://git.freeswitch.org/freeswitch /usr/src/freeswitch/src
|
||||
cd /usr/src/freeswitch/src
|
||||
# if you only want to build some modules, create a modules.conf
|
||||
# outside the source tree and add -f ../path/to/modules.conf to the
|
||||
# command below.
|
||||
./debian/util.sh build-all -bn -a amd64 -c sid # update as needed
|
||||
# command below. See ./debian/util.sh -h for further usage
|
||||
# information.
|
||||
./debian/util.sh build-all -bn -z9
|
||||
|
||||
The source packages for sounds and music on hold are maintained in a
|
||||
separate repository. Each set of sounds has a separate version number
|
||||
@@ -94,4 +104,4 @@ freeswitch-music-*:
|
||||
git clone https://github.com/traviscross/freeswitch-sounds.git
|
||||
cd freeswitch-sounds && cat debian/README.source
|
||||
|
||||
-- Travis Cross <tc@traviscross.com>, Wed, 3 Oct 2012 02:15:24 +0000
|
||||
-- Travis Cross <tc@traviscross.com>, Mon, 11 Mar 2013 17:09:33 +0000
|
||||
|
||||
Vendored
+1
@@ -405,6 +405,7 @@ Description: mod_opal
|
||||
Module: endpoints/mod_portaudio
|
||||
Description: mod_portaudio
|
||||
Adds mod_portaudio.
|
||||
Build-Depends: libasound2-dev
|
||||
|
||||
Module: endpoints/mod_reference
|
||||
Description: mod_reference
|
||||
|
||||
Vendored
+7
-4
@@ -205,12 +205,13 @@ EOF
|
||||
create_dsc () {
|
||||
{
|
||||
set -e
|
||||
local OPTIND OPTARG modules_conf="" modules_list="" speed="normal"
|
||||
while getopts 'f:m:s:' o "$@"; do
|
||||
local OPTIND OPTARG modules_conf="" modules_list="" speed="normal" zl=9
|
||||
while getopts 'f:m:s:z:' o "$@"; do
|
||||
case "$o" in
|
||||
f) modules_conf="$OPTARG";;
|
||||
m) modules_list="$OPTARG";;
|
||||
s) speed="$OPTARG";;
|
||||
z) zl="$OPTARG";;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND-1))
|
||||
@@ -233,11 +234,12 @@ create_dsc () {
|
||||
reckless) sed -i ./debian/rules \
|
||||
-e '/\.stamp-build:/{:l2 n; /make/{s/$/ -j/; :l3 n; b l3}; b l2};' ;;
|
||||
esac
|
||||
[ "$zl" -ge "1" ] || zl=1
|
||||
git add debian/rules
|
||||
git rm -rf --ignore-unmatch libs/libg722_1 libs/ilbc
|
||||
dch -b -m -v "$dver" --force-distribution -D "$suite" "Nightly build."
|
||||
git add debian/changelog && git commit -m "nightly v$orig_ver"
|
||||
dpkg-source -i.* -Zxz -z9 -b .
|
||||
dpkg-source -i.* -Zxz -z${zl} -b .
|
||||
dpkg-genchanges -S > ../$(dsc_base)_source.changes
|
||||
local dsc="../$(dsc_base).dsc"
|
||||
git reset --hard HEAD^ && git clean -fdx
|
||||
@@ -325,7 +327,7 @@ build_all () {
|
||||
o) orig="$OPTARG";;
|
||||
s) dsc_opts="$dsc_opts -s$OPTARG";;
|
||||
v) orig_opts="$orig_opts -v$OPTARG";;
|
||||
z) orig_opts="$orig_opts -z$OPTARG";;
|
||||
z) orig_opts="$orig_opts -z$OPTARG"; dsc_opts="$dsc_opts -z$OPTARG";;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND-1))
|
||||
@@ -414,6 +416,7 @@ commands:
|
||||
Choose custom list of modules to build
|
||||
-s [ paranoid | reckless ]
|
||||
Set FS bootstrap/build -j flags
|
||||
-z Set compression level
|
||||
|
||||
create-orig <treeish>
|
||||
|
||||
|
||||
+27
-4
@@ -1,7 +1,30 @@
|
||||
freeswitch (1.2.5.2)
|
||||
Maintenance release/bug fixes
|
||||
freeswitch (1.2.5.1)
|
||||
Maintenance release/bug fixes
|
||||
freeswitch (1.2.7)
|
||||
change fs_encode to support raw files to wav or to other raw
|
||||
check for vm caller id info later so if its transfered it gets the updated details
|
||||
freeswitch (1.2.6)
|
||||
core_sqldb: sql tuning by changing 2 Indices
|
||||
freeswitch-core: database corruption handling
|
||||
freeswitch-core: use system time as reference for FS uptime, instead of monotonic
|
||||
freeswitch-core: hide sensitive dtmfs
|
||||
freeswitch-core: record g729 calls to g729 wav files, playback g729 wav files
|
||||
freeswitch-core: STUN: XOR_MAPPED_ADDRESS attribute not handled
|
||||
freeswitch-core: option to record session when bridged only
|
||||
mod_callcenter: simple periodic announcement
|
||||
mod_callcenter: New members joining queue don't ring agents when max-wait-time-with-no-agent-time-reached is 0
|
||||
mod_curl: add curl content-type option
|
||||
mod_curl: adding ability to transmit a file using CURL from API or dialplan app
|
||||
mod_directory: option to search by first and last name
|
||||
mod_dptools: add option to allow any key to terminate playback or record
|
||||
mod_event_socket: enable dual-stack (IPv4/IPv6) listening in mod_event_socket on Windows
|
||||
mod_lcr: Add 'round-robin' feature to carrer gateways
|
||||
mod_local_stream: add an event (or filter) for mod_localstream PLAYBACK_START and PLAYBACK_STOP
|
||||
mod_nibblebill: fix mod_nibblebill to use pgsql in core
|
||||
mod_sofia: pass User-to-User header to variable-space
|
||||
mod_sofia: option for freeswitch to trust users authed by proxy
|
||||
mod_spandsp: Spandsp directory for making modem links
|
||||
mod_voicemail: added voicemail call paging
|
||||
build: building works on Visual Studio 2012
|
||||
config: updating mod_cidlookup default configuration to use OpenCNAM as an example
|
||||
freeswitch (1.2.5)
|
||||
mod_lua: Enable mod_lua to use native pgsql dbh support (r:2cea7f0f)
|
||||
mod_sofia: Add att_xfer_destination_number variable to indicate the original destination number of the attended transfer leg on REFER for semi-attended transfer scenarios. (r:893cd7be)
|
||||
|
||||
@@ -629,7 +629,7 @@
|
||||
<prompt phrase="The system is going down for maintenance." filename="ivr-system_down_for_maintenance.wav"/>
|
||||
<prompt phrase="The system will be back up in approximately..." filename="ivr-system_back_up_in_approximately.wav"/>
|
||||
<prompt phrase="To grab a cold pop, press..." filename=""/>
|
||||
<prompt phrase="" filename=""/>
|
||||
<prompt phrase="It's all there, black and white, clear as crystal! You stole fizzy lifting drinks! You bumped into the ceiling which now has to be washed and sterilized, so you get nothing! You lose! Good day, sir!" filename=""/>
|
||||
<prompt phrase="" filename=""/>
|
||||
<prompt phrase="" filename=""/>
|
||||
<prompt phrase="" filename=""/>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
The FreeSWITCH Portal Project
|
||||
Copyright (C) 2013-2013, Seven Du <dujinfang@gmail.com>
|
||||
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is The FreeSWITCH Portal Project Software/Application
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Seven Du <dujinfang@gmail.com>
|
||||
Portions created by the Initial Developer are Copyright (C)
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Seven Du <dujinfang@gmail.com>
|
||||
@@ -0,0 +1,64 @@
|
||||
# The FreeSWITCH Portal Project
|
||||
|
||||
The FreeSWITCH Portal Project is designed to show an intuitive view of the FreeSWITCH internals.
|
||||
|
||||
It can be used by FreeSWITCH funs, administrators, developers etc.
|
||||
|
||||
It does not aims to replace GUIs such as fusionPBX or blue.box.
|
||||
|
||||
It would be very easy to use and super helpful for new FreeSWITCH users.
|
||||
|
||||
## Philosophy
|
||||
|
||||
To provide a GUI out of the box without depends on external resources like PHP or a webserver such as Apache or Nginx.
|
||||
|
||||
Mainly developed with static html and Javascripts, and perhaps some lua scripts can help do some more magic things later.
|
||||
|
||||
## Install
|
||||
|
||||
Assume you installed FreeSWITCH in the default place - /usr/local/freeswitch, you can do
|
||||
|
||||
cd /usr/local/freeswitch/htdocs
|
||||
git clone https://github.com/seven1240/FreeSWITCH-Portal.git portal
|
||||
|
||||
In FreeSWITCH you need to
|
||||
|
||||
load mod_xml_rpc
|
||||
|
||||
Open your browser (Only Chrome is tested) and go to
|
||||
|
||||
http://localhost:8080/portal/index.html
|
||||
|
||||
If you it asking for username and password you can find them in /usr/local/freeswitch/conf/autoload_configs/xml\_rpc.conf.xml. For more information see <http://wiki.freeswitch.org/wiki/Mod_xml_rpc> .
|
||||
|
||||
## Todo
|
||||
|
||||
* Websocket: by add websocket support in FreeSWITCH we can see channel changes lively, I have some working code as a patch to mod\_event\_socket.
|
||||
|
||||
* Modify users: A raw idea to add a new user would be something like below and reloadxml.
|
||||
|
||||
sed -e 's/1000/new-user/g' 1000.xml > new-user.xml
|
||||
|
||||
* Modify dialplan and/or other XMLs: possible to use some online XML editor and can save the XML with some lua or C code at the backend, although there are security concerns.
|
||||
|
||||
* Store information in DB: I guess the Dbh handle in lua should can do something like this.
|
||||
|
||||
* Web terminal: With terminal.js like things and websocket we can really build a web version of fs_cli
|
||||
|
||||
* rtmp web client support to make and receive calls
|
||||
|
||||
* WebRTC?
|
||||
|
||||
* Logging, Event Debugging or SIP tracing: Yeah, more magic
|
||||
|
||||
* i18n
|
||||
|
||||
## Security
|
||||
|
||||
The primary goal is to help new users learn and use FreeSWITCH. Please DON'T put this on your production server as I haven't think anything about security.
|
||||
|
||||
## Development
|
||||
|
||||
I started this project to learn how to use [bootstrap](twitter.github.com/bootstrap/index.html) and [ember.js](twitter.github.com/bootstrap/index.html), the latter said it is a framework for creating **ambitious** web applications.
|
||||
|
||||
Contributions and patches are welcome.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+6158
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
+2276
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+20
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,373 @@
|
||||
/*
|
||||
* The FreeSWITCH Portal Project
|
||||
* Copyright (C) 2013-2013, Seven Du <dujinfang@gmail.com>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The FreeSWITCH Portal Project Software/Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
*
|
||||
*
|
||||
* fsportal.js -- The FreeSWITCH Portal Project
|
||||
*
|
||||
*/
|
||||
|
||||
var App = Ember.Application.create({
|
||||
LOG_TRANSITIONS: true,
|
||||
rootElement: $('#container'),
|
||||
total: 0,
|
||||
ready: function(){
|
||||
}
|
||||
});
|
||||
|
||||
App.CallsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// Set the IndexController's `title`
|
||||
// controller.set('title', "My App");
|
||||
// alert("a")
|
||||
console.log("callsRoute");
|
||||
App.callsController.load();
|
||||
}//,
|
||||
// renderTemplate: function() {
|
||||
// this.render('calls');
|
||||
// }
|
||||
});
|
||||
|
||||
App.ChannelsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// Set the IndexController's `title`
|
||||
// controller.set('title', "My App");
|
||||
// alert("a")
|
||||
console.log("callsRoute");
|
||||
App.channelsController.load();
|
||||
}//,
|
||||
// renderTemplate: function() {
|
||||
// this.render('calls');
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
App.ShowApplicationsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// Set the Controller's `title`
|
||||
controller.set('title', "ShowApplications");
|
||||
console.log("showApplications");
|
||||
App.applicationsController.load();
|
||||
}//,
|
||||
// renderTemplate: function() {
|
||||
// this.render('calls');
|
||||
// }
|
||||
});
|
||||
|
||||
App.ShowEndpointsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
// Set the Controller's `title`
|
||||
controller.set('title', "ShowEndpoints");
|
||||
console.log(controller);
|
||||
App.showEndpointsController.load();
|
||||
}//,
|
||||
// renderTemplate: function() {
|
||||
// this.render('calls');
|
||||
// }
|
||||
});
|
||||
|
||||
App.ShowCodecsRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
App.showCodecsController.load();
|
||||
}
|
||||
});
|
||||
|
||||
App.UsersRoute = Ember.Route.extend({
|
||||
setupController: function(controller) {
|
||||
App.usersController.load();
|
||||
}
|
||||
});
|
||||
|
||||
App.Router.map(function(){
|
||||
this.route("calls");
|
||||
this.route("channels");
|
||||
this.route("showApplications");
|
||||
this.route("showEndpoints");
|
||||
this.route("showCodecs");
|
||||
this.route("showFiles");
|
||||
this.route("showAPIs");
|
||||
this.route("show");
|
||||
this.route("users");
|
||||
this.route("about", { path: "/about" });
|
||||
});
|
||||
|
||||
App.User = Em.Object.extend({
|
||||
id: null,
|
||||
context: null,
|
||||
domain: null,
|
||||
group: null,
|
||||
contact: null
|
||||
});
|
||||
|
||||
App.Call = Em.Object.extend({
|
||||
uuid: null,
|
||||
cidName: null,
|
||||
cidNumber: null
|
||||
|
||||
});
|
||||
|
||||
App.Channel = Em.Object.extend({
|
||||
uuid: null,
|
||||
cidName: null,
|
||||
cidNumber: null
|
||||
|
||||
});
|
||||
|
||||
App.callsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.getJSON("/txtapi/show?calls%20as%20json", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
console.log(data.row_count);
|
||||
me.set('total', data.row_count);
|
||||
me.content.clear();
|
||||
if (data.row_count == 0) return;
|
||||
|
||||
// me.pushObjects(data.rows);
|
||||
data.rows.forEach(function(r) {
|
||||
me.pushObject(App.Call.create(r));
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
dump: function(uuid) {
|
||||
var obj = this.content.findProperty("uuid", uuid);
|
||||
console.log(obj.getProperties(["uuid", "cid_num"]));
|
||||
},
|
||||
raw: function() {
|
||||
$.get("/api/show?calls", function(data){
|
||||
$('#aa').html(data);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
App.channelsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
listener: undefined,
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.getJSON("/txtapi/show?channels%20as%20json", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
console.log(data.row_count);
|
||||
me.set('total', data.row_count);
|
||||
me.content.clear();
|
||||
if (data.row_count == 0) return;
|
||||
data.rows.forEach(function(row) {
|
||||
me.pushObject(App.Channel.create(row));
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
delete: function(uuid) {
|
||||
var obj = this.content.findProperty("uuid", uuid);
|
||||
if (obj) this.content.removeObject(obj);// else alert(uuid);
|
||||
},
|
||||
dump: function(uuid) {
|
||||
var obj = this.content.findProperty("uuid", uuid);
|
||||
console.log(obj.getProperties(["uuid", "cid_num"]));
|
||||
},
|
||||
checkEvent: function () { // event_sink with json is not yet support in FS
|
||||
console.log("check");
|
||||
var me = this;
|
||||
if (!this.get("listener")) {
|
||||
$.getJSON("/api/event_sink?command=create-listener&events=ALL&format=json", function(data){
|
||||
console.log(data);
|
||||
if (data.listener) {
|
||||
me.set("listener", data.listener["listen-id"]);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!me.get("listener")) return;
|
||||
|
||||
$.getJSON("/api/event_sink?command=check-listener&listen-id=" +
|
||||
me.get("listener") + "&format=json", function(data){
|
||||
console.log(data);
|
||||
if (!data.listener) {
|
||||
me.set("listener", undefined);
|
||||
} else {
|
||||
data.events.forEach(function(e) {
|
||||
eventCallback(e);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
checkXMLEvent: function() {
|
||||
console.log("check XML Event");
|
||||
var me = this;
|
||||
if (!this.get("listener")) {
|
||||
$.get("/api/event_sink?command=create-listener&events=ALL", function(data){
|
||||
// console.log(data);
|
||||
var listen_id = data.getElementsByTagName("listen-id")[0];
|
||||
if (listen_id) {
|
||||
me.set("listener", listen_id.textContent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!me.get("listener")) return;
|
||||
|
||||
$.get("/api/event_sink?command=check-listener&listen-id=" + me.get("listener"), function(data){
|
||||
// console.log(data);
|
||||
var listener = data.getElementsByTagName("listener")[0];
|
||||
if (!listener) {
|
||||
me.set("listener", undefined);
|
||||
} else {
|
||||
var events = data.getElementsByTagName("event");
|
||||
for (var i=0; i<events.length; i++) {
|
||||
var e = {};
|
||||
var headers = events[i].getElementsByTagName("headers")[0];
|
||||
for (var j=0; j<headers.childNodes.length; j++) {
|
||||
e[headers.childNodes[j].nodeName] = headers.childNodes[j].textContent;
|
||||
}
|
||||
// console.log(e);
|
||||
eventCallback(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
App.applicationsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.getJSON("/txtapi/show?application%20as%20json", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
console.log(data.row_count);
|
||||
me.set('total', data.row_count);
|
||||
me.content.clear();
|
||||
if (data.row_count == 0) return;
|
||||
|
||||
me.pushObjects(data.rows);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
App.showEndpointsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.getJSON("/txtapi/show?endpoints%20as%20json", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
console.log(data.row_count);
|
||||
me.set('total', data.row_count);
|
||||
me.content.clear();
|
||||
if (data.row_count == 0) return;
|
||||
|
||||
me.pushObjects(data.rows);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
App.showCodecsController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.getJSON("/txtapi/show?codec%20as%20json", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
console.log(data.row_count);
|
||||
me.set('total', data.row_count);
|
||||
me.content.clear();
|
||||
if (data.row_count == 0) return;
|
||||
|
||||
me.pushObjects(data.rows);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
App.usersController = Ember.ArrayController.create({
|
||||
content: [],
|
||||
init: function(){
|
||||
},
|
||||
load: function() {
|
||||
var me = this;
|
||||
$.get("/txtapi/list_users", function(data){
|
||||
// var channels = JSON.parse(data);
|
||||
lines = data.split("\n");
|
||||
me.content.clear();
|
||||
var users = [];
|
||||
for (var i=1; i<lines.length; i++) {
|
||||
var line = lines[i];
|
||||
var fields = line.split("|");
|
||||
if (fields.length == 1) break;
|
||||
var user = {
|
||||
id: fields.shift(),
|
||||
context: fields.shift(),
|
||||
domain: fields.shift(),
|
||||
group: fields.shift(),
|
||||
contact: fields.shift(),
|
||||
callgroup: fields.shift(),
|
||||
cid_name: fields.shift(),
|
||||
cid_number: fields.shift()
|
||||
}
|
||||
// me.pushObject(App.User.create(user));
|
||||
users.push(App.User.create(user));
|
||||
}
|
||||
me.pushObjects(users);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
App.initialize();
|
||||
|
||||
|
||||
function eventCallback(data) {
|
||||
console.log(data["Event-Name"]);
|
||||
if (data["Event-Name"] == "CHANNEL_CREATE") {
|
||||
var channel = {
|
||||
uuid: data["Unique-ID"],
|
||||
cid_num: data["Caller-Caller-ID-Number"],
|
||||
dest: data["Caller-Destination-Number"],
|
||||
callstate: data["Channel-Call-State"],
|
||||
direction: data["Call-Direction"]
|
||||
}
|
||||
App.channelsController.pushObject(App.Channel.create(channel));
|
||||
} else if (data["Event-Name"] == "CHANNEL_HANGUP_COMPLETE") {
|
||||
App.channelsController.delete(data["Unique-ID"]);
|
||||
} else if (data["Event-Name"] == "CHANNEL_CALLSTATE") {
|
||||
var obj = App.channelsController.content.findProperty("uuid", data["Unique-ID"]);
|
||||
if (obj) {
|
||||
obj.set("callstate", data["Channel-Call-State"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+5
File diff suppressed because one or more lines are too long
@@ -0,0 +1,383 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
/*
|
||||
* The FreeSWITCH Portal Project
|
||||
* Copyright (C) 2013-2013, Seven Du <dujinfang@gmail.com>
|
||||
*
|
||||
* Version: MPL 1.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is The FreeSWITCH Portal Project Software/Application
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
* Portions created by the Initial Developer are Copyright (C)
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
*
|
||||
*
|
||||
* index.html -- The FreeSWITCH Portal Project
|
||||
*
|
||||
*/
|
||||
-->
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Bootstrap, from Twitter</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<!-- Le styles -->
|
||||
<link href="assets/bootstrap/css/bootstrap.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
|
||||
}
|
||||
</style>
|
||||
<link href="assets/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="assets/js/html5shiv.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Fav and touch icons -->
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
|
||||
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
|
||||
<link rel="shortcut icon" href="assets/ico/favicon.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="brand" href="#">FreeSWITCH Portal</a>
|
||||
<div class="pull-right" id='ws-status' style="padding-top:5px"></div>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<li class="active"><a href="#">Home</a></li>
|
||||
<li><a id="menu-users" href="#users">Users</a></li>
|
||||
<li><a id="menu-calls" href="#calls">Calls</a></li>
|
||||
<li><a id="menu-channels" href="#channels">Channels</a></li>
|
||||
<li><a href="#show">Show</a></li>
|
||||
<li><a href="#about">About</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" id="container">
|
||||
<div id="calls" style="display:none"></div>
|
||||
<div id="channels" style="display:none"></div>
|
||||
</div> <!-- /container -->
|
||||
|
||||
<div id="aa"></div>
|
||||
<script type="text/x-handlebars" data-template-name="index">
|
||||
<h1>Welcome to FreeSWITCH Portal</h1>
|
||||
Welcome
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="showApplications">
|
||||
<h1>Applications</h1>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>Syntax</th>
|
||||
<th>iKey</th>
|
||||
</tr>
|
||||
{{#each App.applicationsController.content}}
|
||||
<tr>
|
||||
<td>{{ name }}</td>
|
||||
<td>{{ description }}</td>
|
||||
<td>{{ syntax }}</td>
|
||||
<td>{{ ikey }}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="showEndpoints">
|
||||
<h1>Endpoints</h1>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th>iKey</th>
|
||||
</tr>
|
||||
{{#each App.showEndpointsController.content}}
|
||||
<tr>
|
||||
<td>{{ type }}</td>
|
||||
<td>{{ name }}</td>
|
||||
<td>{{ ikey }}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="showCodecs">
|
||||
<h1>Codecs</h1>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Name</th>
|
||||
<th>iKey</th>
|
||||
</tr>
|
||||
{{#each App.showCodecsController.content}}
|
||||
<tr>
|
||||
<td>{{ type }}</td>
|
||||
<td>{{ name }}</td>
|
||||
<td>{{ ikey }}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="showFiles">
|
||||
Unimplemented
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="showAPIs">
|
||||
Unimplemented
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="show">
|
||||
<h1>Show</h1>
|
||||
{{#linkTo "showApplications"}} Applications {{/linkTo}} |
|
||||
{{#linkTo "showEndpoints"}} Endpoints {{/linkTo}} |
|
||||
{{#linkTo "showCodecs"}} Codecs {{/linkTo}} |
|
||||
{{#linkTo "showFiles"}} Files {{/linkTo}} |
|
||||
{{#linkTo "showAPIs"}} APIs {{/linkTo}}
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="about">
|
||||
<h1>About FreeSWITCH Portal</h1>
|
||||
<p>
|
||||
The FreeSWITCH Portal Project is Created by <a href="http://www.dujinfang.com">Seven Du</a>.
|
||||
Available with MPL1.1 licence - Same as FreeSWITCH.
|
||||
</p>
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="users">
|
||||
<h1>Users</h1>
|
||||
<div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Context</th>
|
||||
<th>Domain</th>
|
||||
<th>Group</th>
|
||||
<th>Contact</th>
|
||||
<th>Callgroup</th>
|
||||
<th>Caller ID Name</th>
|
||||
<th>Caller ID Number</th>
|
||||
</tr>
|
||||
{{#each App.usersController.content}}
|
||||
<tr>
|
||||
<td>{{ id }}</td>
|
||||
<td>{{ context }}</td>
|
||||
<td>{{ domain }}</td>
|
||||
<td>{{ group }}</td>
|
||||
<td>{{ contact }}</td>
|
||||
<td>{{ callgroup }}</td>
|
||||
<td>{{ cid_name }}</td>
|
||||
<td>{{ cid_number }}</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="calls">
|
||||
<div class="pull-right">
|
||||
<label><input type="checkbox" id="auto_update_calls" value="1" onclick="auto_update_calls();">Auto Update</label>
|
||||
</div>
|
||||
|
||||
<h1>Calls</h1>
|
||||
|
||||
<div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Call UUID</th>
|
||||
<th>CID</th>
|
||||
<th>Dest</th>
|
||||
<th>Call State</th>
|
||||
<th>Direction / Created</th>
|
||||
</tr>
|
||||
{{#each App.callsController.content}}
|
||||
<tr>
|
||||
<td>{{uuid}} <br>{{ b_uuid }}</td>
|
||||
<td>{{ cid_num }}<br>{{ b_cid_num }}</td>
|
||||
<td>{{ dest }}<br>{{ b_dest }}</td>
|
||||
<td>{{ callstate }}<br>{{ b_callstate }}</td>
|
||||
<td>{{ direction }} / {{ b_direction }}<br>
|
||||
<a href='#' {{action "dump" uuid target="App.callsController"}}>{{created}}</a>
|
||||
<!--<a href='#' {{action "raw" uuid target="App.callsController"}}>Raw</a>-->
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/x-handlebars" data-template-name="channels">
|
||||
|
||||
<h1>Channels</h1>
|
||||
|
||||
<div>
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>Call UUID</th>
|
||||
<th>CID</th>
|
||||
<th>Dest</th>
|
||||
<th>Call State</th>
|
||||
<th>Direction / Created</th>
|
||||
</tr>
|
||||
{{#each App.channelsController.content}}
|
||||
<tr>
|
||||
<td>{{uuid}}</td>
|
||||
<td>{{ cid_num }}</td>
|
||||
<td>{{ dest }}<br></td>
|
||||
<td>{{ callstate }}</td>
|
||||
<td>{{ direction }}<br>
|
||||
<a href='#' {{action "dump" uuid target="App.channelsController"}}>{{created}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</script>
|
||||
<!-- Le javascript
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="assets/js/jquery-1.9.1.min.js"></script>
|
||||
<script src="assets/js/handlebars.js"></script>
|
||||
<script src="assets/js/ember-1.0.0-rc.1.js"></script>
|
||||
<script src="assets/js/ember-data.js"></script>
|
||||
<script src="assets/js/fsportal.js"></script>
|
||||
<!--
|
||||
<script src="assets/js/bootstrap-transition.js"></script>
|
||||
<script src="assets/js/bootstrap-alert.js"></script>
|
||||
<script src="assets/js/bootstrap-modal.js"></script>
|
||||
<script src="assets/js/bootstrap-dropdown.js"></script>
|
||||
<script src="assets/js/bootstrap-scrollspy.js"></script>
|
||||
<script src="assets/js/bootstrap-tab.js"></script>
|
||||
<script src="assets/js/bootstrap-tooltip.js"></script>
|
||||
<script src="assets/js/bootstrap-popover.js"></script>
|
||||
<script src="assets/js/bootstrap-button.js"></script>
|
||||
<script src="assets/js/bootstrap-collapse.js"></script>
|
||||
<script src="assets/js/bootstrap-carousel.js"></script>
|
||||
<script src="assets/js/bootstrap-typeahead.js"></script>
|
||||
-->
|
||||
<script type="text/javascript">
|
||||
|
||||
function auto_update_calls() {
|
||||
var x = $('#auto_update_calls')[0];
|
||||
if (typeof x != "undefined" && x.checked) {
|
||||
console.log("tick")
|
||||
App.callsController.load();
|
||||
setTimeout(auto_update_calls, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
// $("#menu-channels").click(function(e){
|
||||
// e.preventDefault();
|
||||
// App.channelsController.load();
|
||||
// $('#calls').hide();
|
||||
// $('#channels').show();
|
||||
// });
|
||||
|
||||
// $("#menu-calls").click(function(e){
|
||||
// e.preventDefault();
|
||||
// App.callsController.load();
|
||||
// $('#channels').hide();
|
||||
// $('#calls').show();
|
||||
// });
|
||||
|
||||
// var callsView = Ember.View.create({
|
||||
// templateName: 'calls',
|
||||
// name: "callsView"
|
||||
// });
|
||||
|
||||
// // $('#container').html('');
|
||||
// callsView.appendTo('#calls');
|
||||
|
||||
// var channelsView = Ember.View.create({
|
||||
// templateName: 'channels',
|
||||
// name: "channelsView"
|
||||
// });
|
||||
// channelsView.appendTo('#channels');
|
||||
|
||||
function dump_call(uuid) {
|
||||
obj = App.callsController.content.findProperty("uuid", uuid);
|
||||
console.log(obj);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var socket = new WebSocket("ws://localhost:8086/socket", "websocket");
|
||||
|
||||
try {
|
||||
socket.onopen = function() {
|
||||
$('#ws-status').html('Socket Connected').css("color", "green");
|
||||
// socket.send("event json all");
|
||||
socket.send("event json CHANNEL_CREATE");
|
||||
socket.send("event json CHANNEL_HANGUP_COMPLETE");
|
||||
socket.send("event json CHANNEL_CALLSTATE");
|
||||
}
|
||||
|
||||
socket.onmessage =function(msg) {
|
||||
// console.log(msg.data);
|
||||
var data = JSON.parse(msg.data);
|
||||
console.log(data["Event-Name"]);
|
||||
|
||||
eventCallback(data);
|
||||
}
|
||||
|
||||
socket.onclose = function(){
|
||||
$('#ws-status').html('Socket Disconnected!').css("color", "red");
|
||||
console.log("socket disconnected, fallback to event_sink");
|
||||
// setInterval("App.channelsController.checkEvent()", 2000);
|
||||
setInterval("App.channelsController.checkXMLEvent()", 2000);
|
||||
}
|
||||
} catch(exception) {
|
||||
alert('Error' + exception);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5187,36 +5187,96 @@ end:
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
SWITCH_STANDARD_API(ftdm_api_exec_usage)
|
||||
{
|
||||
char *mycmd = NULL, *argv[10] = { 0 };
|
||||
int argc = 0;
|
||||
uint32_t chan_id = 0;
|
||||
ftdm_channel_t *chan = NULL;
|
||||
ftdm_span_t *span = NULL;
|
||||
uint32_t tokencnt = 0;
|
||||
/*ftdm_cli_entry_t *entry = NULL;*/
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
|
||||
}
|
||||
|
||||
if (!argc) {
|
||||
stream->write_function(stream, "-ERR invalid args\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (argc < 2) {
|
||||
stream->write_function(stream, "-ERR invalid args\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ftdm_span_find_by_name(argv[0], &span);
|
||||
chan_id = atoi(argv[1]);
|
||||
if (!span) {
|
||||
stream->write_function(stream, "-ERR invalid span\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (chan_id <= 0) {
|
||||
stream->write_function(stream, "-ERR invalid channel\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (chan_id > ftdm_span_get_chan_count(span)) {
|
||||
stream->write_function(stream, "-ERR invalid channel\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
chan = ftdm_span_get_channel(span, chan_id);
|
||||
if (!chan) {
|
||||
stream->write_function(stream, "-ERR channel not configured\n");
|
||||
goto end;
|
||||
}
|
||||
|
||||
tokencnt = ftdm_channel_get_token_count(chan);
|
||||
stream->write_function(stream, "%d", tokencnt);
|
||||
|
||||
end:
|
||||
switch_safe_free(mycmd);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
struct ftdm_cli_entry {
|
||||
const char *name;
|
||||
const char *args;
|
||||
const char *complete;
|
||||
const char *desc;
|
||||
ftdm_cli_function_t execute;
|
||||
switch_api_function_t execute_api;
|
||||
};
|
||||
|
||||
static ftdm_cli_entry_t ftdm_cli_options[] =
|
||||
{
|
||||
{ "list", "", "", ftdm_cmd_list },
|
||||
{ "start", "<span_id|span_name>", "", ftdm_cmd_start_stop },
|
||||
{ "stop", "<span_id|span_name>", "", ftdm_cmd_start_stop },
|
||||
{ "reset", "<span_id|span_name> [<chan_id>]", "", ftdm_cmd_reset },
|
||||
{ "alarms", "<span_id> <chan_id>", "", ftdm_cmd_alarms },
|
||||
{ "dump", "<span_id|span_name> [<chan_id>]", "", ftdm_cmd_dump },
|
||||
{ "sigstatus", "get|set <span_id|span_name> [<chan_id>] [<sigstatus>]", "::[set:get", ftdm_cmd_sigstatus },
|
||||
{ "trace", "<path> <span_id|span_name> [<chan_id>]", "", ftdm_cmd_trace },
|
||||
{ "notrace", "<span_id|span_name> [<chan_id>]", "", ftdm_cmd_notrace },
|
||||
{ "gains", "<rxgain> <txgain> <span_id|span_name> [<chan_id>]", "", ftdm_cmd_gains },
|
||||
{ "dtmf", "on|off <span_id|span_name> [<chan_id>]", "::[on:off", ftdm_cmd_dtmf },
|
||||
{ "queuesize", "<rxsize> <txsize> <span_id|span_name> [<chan_id>]", "", ftdm_cmd_queuesize },
|
||||
{ "iostats", "enable|disable|flush|print <span_id|span_name> <chan_id>", "::[enable:disable:flush:print", ftdm_cmd_iostats },
|
||||
{ "ioread", "<span_id|span_name> <chan_id> [num_times] [interval]", "", ftdm_cmd_ioread },
|
||||
{ "list", "", "", NULL, ftdm_cmd_list, NULL },
|
||||
{ "start", "<span_id|span_name>", "", NULL, ftdm_cmd_start_stop, NULL },
|
||||
{ "stop", "<span_id|span_name>", "", NULL, ftdm_cmd_start_stop, NULL },
|
||||
{ "reset", "<span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_reset, NULL },
|
||||
{ "alarms", "<span_id> <chan_id>", "", NULL, ftdm_cmd_alarms, NULL },
|
||||
{ "dump", "<span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_dump, NULL },
|
||||
{ "sigstatus", "get|set <span_id|span_name> [<chan_id>] [<sigstatus>]", "::[set:get", NULL, ftdm_cmd_sigstatus, NULL },
|
||||
{ "trace", "<path> <span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_trace, NULL },
|
||||
{ "notrace", "<span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_notrace, NULL },
|
||||
{ "gains", "<rxgain> <txgain> <span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_gains, NULL },
|
||||
{ "dtmf", "on|off <span_id|span_name> [<chan_id>]", "::[on:off", NULL, ftdm_cmd_dtmf, NULL },
|
||||
{ "queuesize", "<rxsize> <txsize> <span_id|span_name> [<chan_id>]", "", NULL, ftdm_cmd_queuesize, NULL },
|
||||
{ "iostats", "enable|disable|flush|print <span_id|span_name> <chan_id>", "::[enable:disable:flush:print", NULL, ftdm_cmd_iostats, NULL },
|
||||
{ "ioread", "<span_id|span_name> <chan_id> [num_times] [interval]", "", NULL, ftdm_cmd_ioread, NULL },
|
||||
|
||||
/* Stand-alone commands (not part of the generic ftdm API */
|
||||
{ "ftdm_usage", "<span_id|span_name> <chan_id>", "", "Return channel call count", NULL, ftdm_api_exec_usage },
|
||||
|
||||
/* Fake handlers as they are handled within freetdm library,
|
||||
* we should provide a way inside freetdm to query for completions from signaling modules */
|
||||
{ "core state", "[!]<state_name>", "", NULL },
|
||||
{ "core flag", "[!]<flag-int-value|flag-name> [<span_id|span_name>] [<chan_id>]", "", NULL },
|
||||
{ "core spanflag", "[!]<flag-int-value|flag-name> [<span_id|span_name>]", "", NULL },
|
||||
{ "core calls", "", "", NULL },
|
||||
{ "core state", "[!]<state_name>", "", NULL, NULL, NULL },
|
||||
{ "core flag", "[!]<flag-int-value|flag-name> [<span_id|span_name>] [<chan_id>]", "", NULL, NULL, NULL },
|
||||
{ "core spanflag", "[!]<flag-int-value|flag-name> [<span_id|span_name>]", "", NULL, NULL, NULL },
|
||||
{ "core calls", "", "", NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
static void print_usage(switch_stream_handle_t *stream, ftdm_cli_entry_t *cli)
|
||||
@@ -5233,12 +5293,15 @@ static void print_full_usage(switch_stream_handle_t *stream)
|
||||
stream->write_function(stream, "--------------------------------------------------------------------------------\n");
|
||||
for (i = 0 ; i < ftdm_array_len(ftdm_cli_options); i++) {
|
||||
entry = &ftdm_cli_options[i];
|
||||
if (entry->execute_api) {
|
||||
continue;
|
||||
}
|
||||
stream->write_function(stream, "ftdm %s %s\n", entry->name, entry->args);
|
||||
}
|
||||
stream->write_function(stream, "--------------------------------------------------------------------------------\n");
|
||||
}
|
||||
|
||||
SWITCH_STANDARD_API(ft_function)
|
||||
SWITCH_STANDARD_API(ftdm_api_exec)
|
||||
{
|
||||
char *mycmd = NULL, *argv[10] = { 0 };
|
||||
int argc = 0;
|
||||
@@ -5379,12 +5442,19 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_freetdm_load)
|
||||
freetdm_endpoint_interface->io_routines = &freetdm_io_routines;
|
||||
freetdm_endpoint_interface->state_handler = &freetdm_state_handlers;
|
||||
|
||||
SWITCH_ADD_API(commands_api_interface, "ftdm", "FreeTDM commands", ft_function, "<cmd> <args>");
|
||||
SWITCH_ADD_API(commands_api_interface, "ftdm", "FreeTDM commands", ftdm_api_exec, "<cmd> <args>");
|
||||
for (i = 0 ; i < ftdm_array_len(ftdm_cli_options); i++) {
|
||||
char complete_cli[512];
|
||||
entry = &ftdm_cli_options[i];
|
||||
snprintf(complete_cli, sizeof(complete_cli), "add ftdm %s %s", entry->name, entry->complete);
|
||||
switch_console_set_complete(complete_cli);
|
||||
if (entry->execute_api) {
|
||||
/* This is a stand-alone API */
|
||||
SWITCH_ADD_API(commands_api_interface, entry->name, entry->desc, ftdm_api_exec_usage, entry->args);
|
||||
snprintf(complete_cli, sizeof(complete_cli), "add %s %s", entry->name, entry->complete);
|
||||
switch_console_set_complete(complete_cli);
|
||||
} else {
|
||||
snprintf(complete_cli, sizeof(complete_cli), "add ftdm %s %s", entry->name, entry->complete);
|
||||
switch_console_set_complete(complete_cli);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_ADD_APP(app_interface, "disable_ec", "Disable Echo Canceller", "Disable Echo Canceller", disable_ec_function, "", SAF_NONE);
|
||||
|
||||
@@ -77,7 +77,7 @@ int ftdm_config_open_file(ftdm_config_t *cfg, const char *file_path)
|
||||
|
||||
memset(cfg, 0, sizeof(*cfg));
|
||||
cfg->lockto = -1;
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Configuration file is %s.\n", path);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Configuration file is %s\n", path);
|
||||
f = fopen(path, "r");
|
||||
|
||||
if (!f) {
|
||||
|
||||
@@ -2968,6 +2968,10 @@ static ftdm_status_t ftdm_channel_done(ftdm_channel_t *ftdmchan)
|
||||
ftdm_buffer_zero(ftdmchan->gen_dtmf_buffer);
|
||||
}
|
||||
|
||||
if (ftdmchan->dtmf_buffer) {
|
||||
ftdm_buffer_zero(ftdmchan->dtmf_buffer);
|
||||
}
|
||||
|
||||
if (ftdmchan->digit_buffer) {
|
||||
ftdm_buffer_zero(ftdmchan->digit_buffer);
|
||||
}
|
||||
@@ -5116,6 +5120,7 @@ static ftdm_status_t load_config(void)
|
||||
sprintf(chan_config.group_name, "__default");
|
||||
|
||||
if (!ftdm_config_open_file(&cfg, cfg_name)) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "Failed to open configuration file %s\n", cfg_name);
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,9 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_TERMINATING:
|
||||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_INFO, "Processing SETUP in TERMINATING state, saving SETUP info for later processing\n");
|
||||
case FTDM_CHANNEL_STATE_HANGUP:
|
||||
case FTDM_CHANNEL_STATE_HANGUP_COMPLETE:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Processing SETUP in %s state, saving SETUP info for later processing\n", ftdm_channel_state2str(ftdmchan->state));
|
||||
ftdm_assert(!sngisdn_test_flag(sngisdn_info, FLAG_GLARE), "Trying to save GLARE info, but we already had a glare\n");
|
||||
|
||||
sngisdn_set_flag(sngisdn_info, FLAG_GLARE);
|
||||
|
||||
@@ -566,6 +566,13 @@ sax_core (iksparser *prs, char *buf, int len)
|
||||
if ('>' == c) {
|
||||
old = pos + 1;
|
||||
prs->context = C_CDATA;
|
||||
} else if (']' == c) {
|
||||
/* ]]] scenario */
|
||||
if (prs->cdataHook) {
|
||||
err = prs->cdataHook (prs->user_data, "]", 1);
|
||||
if (IKS_OK != err) return err;
|
||||
}
|
||||
old = pos;
|
||||
} else {
|
||||
if (prs->cdataHook) {
|
||||
err = prs->cdataHook (prs->user_data, "]]", 2);
|
||||
|
||||
@@ -24,7 +24,6 @@ case $target_os in
|
||||
;;
|
||||
*freebsd2* | *freebsd* | *netbsd* | *openbsd* | *osf[12]*)
|
||||
echo "------- START libzrtp configuration for BSD platform ------------"
|
||||
AC_DEFINE(PLATFORM,ZP_BSD,BSD platform)
|
||||
;;
|
||||
hpux* | irix* | linuxaout* | linux* | osf* | solaris2* | sunos4*)
|
||||
echo "------- START libzrtp configuration for Linux platform ------------"
|
||||
@@ -84,12 +83,11 @@ AC_DEFINE(INLINE,[static inline],[Define inline construction for your platform])
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
AM_CONDITIONAL([HAVE_DOXYGEN], [false])
|
||||
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||
if test -z "$DOXYGEN";
|
||||
then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
|
||||
fi
|
||||
|
||||
if test -n "$DOXYGEN"; then
|
||||
if test -z "$DOXYGEN"; then
|
||||
AC_MSG_WARN([Doxygen not found - continuing without Doxygen support])
|
||||
else
|
||||
AM_CONDITIONAL([HAVE_DOXYGEN], [true])
|
||||
AC_CONFIG_FILES([doc/Doxyfile])
|
||||
fi
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#if !defined(ZRTP_PLATFORM)
|
||||
# if defined(ANDROID_NDK)
|
||||
# define ZRTP_PLATFORM ZP_ANDROID
|
||||
# elif defined(__FreeBSD__)
|
||||
# define ZRTP_PLATFORM ZP_BSD
|
||||
# elif defined(linux) || defined(__linux)
|
||||
# include <linux/version.h>
|
||||
# define ZRTP_PLATFORM ZP_LINUX
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
src/v17_v32bis_rx_rrc.h
|
||||
src/v17_v32bis_tx_rrc.h
|
||||
src/v22bis_rx_1200_rrc.h
|
||||
src/v22bis_rx_2400_rrc.h
|
||||
src/v22bis_tx_rrc.h
|
||||
src/v27ter_rx_2400_rrc.h
|
||||
src/v27ter_rx_4800_rrc.h
|
||||
src/v27ter_tx_2400_rrc.h
|
||||
src/v27ter_tx_4800_rrc.h
|
||||
src/v29rx_rrc.h
|
||||
src/v29tx_rrc.h
|
||||
@@ -1,7 +1,7 @@
|
||||
# @synopsis AX_CHECK_ARM_NEON
|
||||
#
|
||||
# Does the machine support the ARM NEON instruction set?
|
||||
# @version 1.0 Dec 31 2012
|
||||
# @version 1.01 Feb 11 2013
|
||||
# @author Steve Underwood
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this file for any
|
||||
|
||||
@@ -780,7 +780,7 @@ static void g1050_core_init(g1050_core_state_t *s, g1050_core_model_t *parms, in
|
||||
/* How far into the first CLEAN interval we are. This is like the route flap initialzation. */
|
||||
s->link_failure_counter = s->link_failure_interval_ticks - 99 - floor(s->link_failure_interval_ticks*q1050_rand());
|
||||
s->link_recovery_counter = s->link_failure_duration_ticks;
|
||||
|
||||
|
||||
s->base_delay = parms->base_regional_delay;
|
||||
s->max_jitter = parms->max_jitter;
|
||||
s->prob_packet_loss = parms->prob_packet_loss/100.0;
|
||||
@@ -1053,7 +1053,7 @@ static int g1050_core_delay(g1050_core_state_t *s,
|
||||
static void g1050_simulate_chunk(g1050_state_t *s)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
s->base_time += 1.0;
|
||||
|
||||
memcpy(&s->segment[0].delays[0], &s->segment[0].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[0].delays[0]));
|
||||
@@ -1116,7 +1116,7 @@ SPAN_DECLARE(g1050_state_t *) g1050_init(int model,
|
||||
mo = &g1050_standard_models[model];
|
||||
|
||||
memset(s, 0, sizeof(*s));
|
||||
|
||||
|
||||
s->packet_rate = packet_rate;
|
||||
s->packet_size = packet_size;
|
||||
|
||||
@@ -1190,7 +1190,7 @@ SPAN_DECLARE(void) g1050_dump_parms(int model, int speed_pattern)
|
||||
{
|
||||
g1050_channel_speeds_t *sp;
|
||||
g1050_model_t *mo;
|
||||
|
||||
|
||||
sp = &g1050_speed_patterns[speed_pattern - 1];
|
||||
mo = &g1050_standard_models[model];
|
||||
|
||||
@@ -1245,8 +1245,8 @@ SPAN_DECLARE(int) g1050_put(g1050_state_t *s, const uint8_t buf[], int len, int
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
element->next = e->next;
|
||||
element->prev = e;
|
||||
element->next = e->next;
|
||||
element->prev = e;
|
||||
e->next = element;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -221,7 +221,7 @@ static float calc_near_line_filter(one_way_line_model_state_t *s, float v)
|
||||
if (++p == s->near_filter_len)
|
||||
p = 0;
|
||||
s->near_buf_ptr = p;
|
||||
|
||||
|
||||
/* Apply the filter */
|
||||
sum = 0.0f;
|
||||
for (j = 0; j < s->near_filter_len; j++)
|
||||
@@ -230,10 +230,10 @@ static float calc_near_line_filter(one_way_line_model_state_t *s, float v)
|
||||
if (++p >= s->near_filter_len)
|
||||
p = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Add noise */
|
||||
sum += awgn(&s->near_noise);
|
||||
|
||||
|
||||
return sum;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -250,7 +250,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v)
|
||||
if (++p == s->far_filter_len)
|
||||
p = 0;
|
||||
s->far_buf_ptr = p;
|
||||
|
||||
|
||||
/* Apply the filter */
|
||||
sum = 0.0f;
|
||||
for (j = 0; j < s->far_filter_len; j++)
|
||||
@@ -259,7 +259,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v)
|
||||
if (++p >= s->far_filter_len)
|
||||
p = 0;
|
||||
}
|
||||
|
||||
|
||||
/* Add noise */
|
||||
sum += awgn(&s->far_noise);
|
||||
|
||||
@@ -267,7 +267,7 @@ static float calc_far_line_filter(one_way_line_model_state_t *s, float v)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
int16_t output[],
|
||||
const int16_t input[],
|
||||
int samples)
|
||||
@@ -302,10 +302,10 @@ SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
in = input[i];
|
||||
|
||||
/* Near end analogue section */
|
||||
|
||||
|
||||
/* Line model filters & noise */
|
||||
out = calc_near_line_filter(s, in);
|
||||
|
||||
|
||||
/* Long distance digital section */
|
||||
|
||||
amp[0] = out;
|
||||
@@ -319,10 +319,10 @@ SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
s->bulk_delay_ptr = 0;
|
||||
|
||||
/* Far end analogue section */
|
||||
|
||||
|
||||
/* Line model filters & noise */
|
||||
out = calc_far_line_filter(s, out);
|
||||
|
||||
|
||||
if (s->mains_interference)
|
||||
{
|
||||
tone_gen(&s->mains_tone, amp, 1);
|
||||
@@ -352,7 +352,7 @@ SPAN_DECLARE(void) one_way_line_model_set_mains_pickup(one_way_line_model_state_
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
|
||||
SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
|
||||
int16_t output1[],
|
||||
const int16_t input1[],
|
||||
int16_t output2[],
|
||||
@@ -486,7 +486,7 @@ SPAN_DECLARE(one_way_line_model_state_t *) one_way_line_model_init(int model, fl
|
||||
/* Put half the noise in each analogue section */
|
||||
awgn_init_dbm0(&s->near_noise, 1234567, noise - 3.02f);
|
||||
awgn_init_dbm0(&s->far_noise, 1234567, noise - 3.02f);
|
||||
|
||||
|
||||
s->dc_offset = 0.0f;
|
||||
s->mains_interference = 0;
|
||||
|
||||
@@ -554,7 +554,7 @@ SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model
|
||||
s->line2.near_co_hybrid_echo = pow(10, echo_level_co2/20.0f);
|
||||
s->line1.near_cpe_hybrid_echo = pow(10, echo_level_cpe1/20.0f);
|
||||
s->line2.near_cpe_hybrid_echo = pow(10, echo_level_cpe2/20.0f);
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
/* Tabulated medium range telephone line response
|
||||
(from p 537, Digital Communication, John G. Proakis */
|
||||
/*
|
||||
amp 1.0 -> 2.15, freq = 3000 Hz -> 3.2, by 0.2 increments
|
||||
amp 1.0 -> 2.15, freq = 3000 Hz -> 3.2, by 0.2 increments
|
||||
delay = 4 ms -> 2.2
|
||||
*/
|
||||
|
||||
@@ -849,7 +849,7 @@ static void generate_ad_edd(void)
|
||||
}
|
||||
//phase = 2.0f*M_PI*f*delay*0.001f;
|
||||
phase = 0.0f;
|
||||
#if defined(HAVE_FFTW3_H)
|
||||
#if defined(HAVE_FFTW3_H)
|
||||
in[i][0] = amp*cosf(phase);
|
||||
in[i][1] = amp*sinf(phase);
|
||||
in[FFT_SIZE - i][0] = in[i][0];
|
||||
@@ -865,7 +865,7 @@ static void generate_ad_edd(void)
|
||||
for (i = 0; i < FFT_SIZE; i++)
|
||||
fprintf(outfile, "%5d %15.5f,%15.5f\n", i, in[i].re, in[i].im);
|
||||
#endif
|
||||
#if defined(HAVE_FFTW3_H)
|
||||
#if defined(HAVE_FFTW3_H)
|
||||
fftw_execute(p);
|
||||
#else
|
||||
fftw_one(p, in, out);
|
||||
@@ -892,7 +892,7 @@ static void generate_ad_edd(void)
|
||||
l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2;
|
||||
for (i = 0; i < LINE_FILTER_SIZE; i++)
|
||||
{
|
||||
|
||||
|
||||
#if defined(HAVE_FFTW3_H)
|
||||
impulse_responses[filter_sets][i] = out[l][0]/pw;
|
||||
#else
|
||||
@@ -1023,9 +1023,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
generate_proakis();
|
||||
generate_ad_edd();
|
||||
|
||||
|
||||
fclose(outfile);
|
||||
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
for (i = 0; i < LINE_FILTER_SIZE; i++)
|
||||
|
||||
@@ -86,7 +86,7 @@ SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s,
|
||||
memcpy(s->tx_pkt[s->next_pkt], buf, len);
|
||||
s->tx_pkt_len[s->next_pkt] = len;
|
||||
s->tx_pkt_seq_no[s->next_pkt] = seq_no;
|
||||
|
||||
|
||||
/* Construct the redundant packet */
|
||||
p = buf2;
|
||||
slot = s->next_pkt;
|
||||
@@ -127,7 +127,7 @@ SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s,
|
||||
uint8_t *p;
|
||||
uint16_t *q;
|
||||
int redundancy_depth;
|
||||
|
||||
|
||||
if (s->rx_queued_pkts)
|
||||
{
|
||||
/* We have some stuff from the last g1050_get() still to deliver */
|
||||
|
||||
@@ -188,7 +188,7 @@ typedef struct
|
||||
|
||||
/*! 3 seconds of predicted delays for the link */
|
||||
double delays[3*G1050_TICKS_PER_SEC];
|
||||
|
||||
|
||||
/*! A count of packets lost on the link. */
|
||||
uint32_t lost_packets;
|
||||
/*! An extra debug count of packets lost on the link. */
|
||||
|
||||
@@ -107,7 +107,7 @@ typedef struct
|
||||
float far_co_hybrid_echo;
|
||||
/*! DC offset impairment */
|
||||
float dc_offset;
|
||||
|
||||
|
||||
/*! Mains pickup impairment */
|
||||
int mains_interference;
|
||||
tone_gen_state_t mains_tone;
|
||||
@@ -122,7 +122,7 @@ typedef struct
|
||||
one_way_line_model_state_t line1;
|
||||
one_way_line_model_state_t line2;
|
||||
float fout1;
|
||||
float fout2;
|
||||
float fout2;
|
||||
} both_ways_line_model_state_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -132,7 +132,7 @@ extern "C"
|
||||
|
||||
SPAN_DECLARE_DATA extern const float *line_models[];
|
||||
|
||||
SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
|
||||
SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
|
||||
int16_t output1[],
|
||||
const int16_t input1[],
|
||||
int16_t output2[],
|
||||
@@ -142,7 +142,7 @@ SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
|
||||
SPAN_DECLARE(void) both_ways_line_model_set_dc(both_ways_line_model_state_t *s, float dc1, float dc2);
|
||||
|
||||
SPAN_DECLARE(void) both_ways_line_model_set_mains_pickup(both_ways_line_model_state_t *s, int f, float level1, float level2);
|
||||
|
||||
|
||||
SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model1,
|
||||
float noise1,
|
||||
float echo_level_cpe1,
|
||||
@@ -156,7 +156,7 @@ SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model
|
||||
|
||||
SPAN_DECLARE(int) both_ways_line_model_release(both_ways_line_model_state_t *s);
|
||||
|
||||
SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s,
|
||||
int16_t output[],
|
||||
const int16_t input[],
|
||||
int samples);
|
||||
|
||||
@@ -272,7 +272,7 @@ SPAN_DECLARE(void) ifft(complex_t data[], int len)
|
||||
SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info)
|
||||
{
|
||||
codec_munge_state_t *s;
|
||||
|
||||
|
||||
if ((s = (codec_munge_state_t *) malloc(sizeof(*s))))
|
||||
{
|
||||
switch (codec)
|
||||
@@ -362,7 +362,7 @@ SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len)
|
||||
static void sf_close_at_exit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < SF_MAX_HANDLE; i++)
|
||||
{
|
||||
if (sf_close_at_exit_list[i])
|
||||
@@ -377,7 +377,7 @@ static void sf_close_at_exit(void)
|
||||
static int sf_record_handle(SNDFILE *handle)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < SF_MAX_HANDLE; i++)
|
||||
{
|
||||
if (sf_close_at_exit_list[i] == NULL)
|
||||
@@ -448,7 +448,7 @@ SPAN_DECLARE(int) sf_close_telephony(SNDFILE *handle)
|
||||
{
|
||||
int res;
|
||||
int i;
|
||||
|
||||
|
||||
if ((res = sf_close(handle)) == 0)
|
||||
{
|
||||
for (i = 0; i < SF_MAX_HANDLE; i++)
|
||||
|
||||
@@ -391,133 +391,89 @@ t42.lo: cielab_luts.h
|
||||
cielab_luts.h: make_cielab_luts$(EXEEXT)
|
||||
./make_cielab_luts$(EXEEXT) >cielab_luts.h
|
||||
|
||||
V17_V32BIS_RX_INCL = v17_v32bis_rx_fixed_rrc.h \
|
||||
v17_v32bis_rx_floating_rrc.h
|
||||
V17_V32BIS_RX_INCL = v17_v32bis_rx_rrc.h
|
||||
|
||||
v17rx.$(OBJEXT): ${V17_V32BIS_RX_INCL}
|
||||
|
||||
v17rx.lo: ${V17_V32BIS_RX_INCL}
|
||||
|
||||
v17_v32bis_rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17_v32bis_rx_fixed_rrc.h
|
||||
v17_v32bis_rx_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_rrc.h
|
||||
|
||||
v17_v32bis_rx_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_floating_rrc.h
|
||||
|
||||
V17_V32BIS_TX_INCL = v17_v32bis_tx_fixed_rrc.h \
|
||||
v17_v32bis_tx_floating_rrc.h
|
||||
V17_V32BIS_TX_INCL = v17_v32bis_tx_rrc.h
|
||||
|
||||
v17tx.$(OBJEXT): ${V17_V32BIS_TX_INCL}
|
||||
|
||||
v17tx.lo: ${V17_V32BIS_TX_INCL}
|
||||
|
||||
v17_v32bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17_v32bis_tx_fixed_rrc.h
|
||||
v17_v32bis_tx_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_rrc.h
|
||||
|
||||
v17_v32bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_floating_rrc.h
|
||||
|
||||
V22BIS_RX_INCL = v22bis_rx_1200_fixed_rrc.h \
|
||||
v22bis_rx_2400_fixed_rrc.h \
|
||||
v22bis_rx_1200_floating_rrc.h \
|
||||
v22bis_rx_2400_floating_rrc.h
|
||||
V22BIS_RX_INCL = v22bis_rx_1200_rrc.h \
|
||||
v22bis_rx_2400_rrc.h
|
||||
|
||||
v22bis_rx.$(OBJEXT): ${V22BIS_RX_INCL}
|
||||
|
||||
v22bis_rx.lo: ${V22BIS_RX_INCL}
|
||||
|
||||
v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h
|
||||
v22bis_rx_1200_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_rrc.h
|
||||
|
||||
v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h
|
||||
v22bis_rx_2400_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_rrc.h
|
||||
|
||||
v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h
|
||||
|
||||
v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h
|
||||
|
||||
V22BIS_TX_INCL = v22bis_tx_fixed_rrc.h \
|
||||
v22bis_tx_floating_rrc.h
|
||||
V22BIS_TX_INCL = v22bis_tx_rrc.h
|
||||
|
||||
v22bis_tx.$(OBJEXT): ${V22BIS_TX_INCL}
|
||||
|
||||
v22bis_tx.lo: ${V22BIS_TX_INCL}
|
||||
|
||||
v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h
|
||||
v22bis_tx_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_rrc.h
|
||||
|
||||
v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h
|
||||
|
||||
V27_RX_INCL = v27ter_rx_2400_fixed_rrc.h \
|
||||
v27ter_rx_4800_fixed_rrc.h \
|
||||
v27ter_rx_2400_floating_rrc.h \
|
||||
v27ter_rx_4800_floating_rrc.h
|
||||
V27_RX_INCL = v27ter_rx_2400_rrc.h \
|
||||
v27ter_rx_4800_rrc.h
|
||||
|
||||
v27ter_rx.$(OBJEXT): ${V27_RX_INCL}
|
||||
|
||||
v27ter_rx.lo: ${V27_RX_INCL}
|
||||
|
||||
v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h
|
||||
v27ter_rx_2400_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_rrc.h
|
||||
|
||||
v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h
|
||||
v27ter_rx_4800_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_rrc.h
|
||||
|
||||
v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h
|
||||
|
||||
v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h
|
||||
|
||||
V27TER_TX_INCL = v27ter_tx_2400_fixed_rrc.h \
|
||||
v27ter_tx_4800_fixed_rrc.h \
|
||||
v27ter_tx_2400_floating_rrc.h \
|
||||
v27ter_tx_4800_floating_rrc.h
|
||||
V27TER_TX_INCL = v27ter_tx_2400_rrc.h \
|
||||
v27ter_tx_4800_rrc.h
|
||||
|
||||
v27ter_tx_.$(OBJEXT): ${V27TER_TX_INCL}
|
||||
|
||||
v27ter_tx.lo: ${V27TER_TX_INCL}
|
||||
|
||||
v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h
|
||||
v27ter_tx_2400_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_rrc.h
|
||||
|
||||
v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h
|
||||
v27ter_tx_4800_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_rrc.h
|
||||
|
||||
v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h
|
||||
|
||||
v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h
|
||||
|
||||
V29_RX_INCL = v29rx_fixed_rrc.h \
|
||||
v29rx_floating_rrc.h
|
||||
V29_RX_INCL = v29rx_rrc.h
|
||||
|
||||
v29rx.$(OBJEXT): ${V29_RX_INCL}
|
||||
|
||||
v29rx.lo: ${V29_RX_INCL}
|
||||
|
||||
v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h
|
||||
v29rx_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_rrc.h
|
||||
|
||||
v29rx_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h
|
||||
|
||||
V29_TX_INCL = v29tx_fixed_rrc.h \
|
||||
v29tx_floating_rrc.h
|
||||
V29_TX_INCL = v29tx_rrc.h
|
||||
|
||||
v29tx.$(OBJEXT): ${V29_TX_INCL}
|
||||
|
||||
v29tx.lo: ${V29_TX_INCL}
|
||||
|
||||
v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h
|
||||
|
||||
v29tx_floating_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h
|
||||
v29tx_rrc.h: make_modem_filter$(EXEEXT)
|
||||
./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_rrc.h
|
||||
|
||||
DSP = libspandsp.dsp
|
||||
VCPROJ8 = libspandsp.2005.vcproj
|
||||
|
||||
@@ -84,7 +84,7 @@ Receiver now waits
|
||||
|
||||
Sender waits 250-300ms after end of 2300Hz tone
|
||||
|
||||
Send ACCT MT QXYZ GG CCC
|
||||
Send ACCT MT QXYZ GG CCC S
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
MT = 2 digit message type (18 preferred, 98 optional)
|
||||
@@ -124,6 +124,74 @@ If kissoff doesn't start within 1.25s of the end of the DTMF, repeat the DTMF me
|
||||
Receiver sends 750-1000ms of 1400Hz as the kissoff tone
|
||||
|
||||
Sender shall make 4 attempts before giving up. One successful kissoff resets the attempt counter
|
||||
|
||||
|
||||
Ademco Express 4/1
|
||||
|
||||
ACCT MT C
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
MT = 2 digit message type (17)
|
||||
C = alarm code
|
||||
S = 1 digit hex checksum
|
||||
|
||||
Ademco Express 4/2
|
||||
|
||||
ACCT MT C Z S
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
MT = 2 digit message type (27)
|
||||
C = 1 digit alarm code
|
||||
Z = 1 digit zone or user number
|
||||
S = 1 digit hex checksum
|
||||
|
||||
Ademco High speed
|
||||
|
||||
ACCT MT PPPPPPPP X S
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
MT = 2 digit message type (55)
|
||||
PPPPPPPP = 8 digit status of each zone
|
||||
X = 1 digit type of information in the PPPPPPPP field
|
||||
S = 1 digit hex checksum
|
||||
|
||||
Each P digit contains one of the following values:
|
||||
1 new alarm
|
||||
2 new opening
|
||||
3 new restore
|
||||
4 new closing
|
||||
5 normal
|
||||
6 outstanding
|
||||
The X field contains one of the following values:
|
||||
0 AlarmNet messages
|
||||
1 ambush or duress
|
||||
2 opening by user (the first P field contains the user number)
|
||||
3 bypass (the P fields indicate which zones are bypassed)
|
||||
4 closing by user (the first P field contain the user number)
|
||||
5 trouble (the P fields contain which zones are in trouble)
|
||||
6 system trouble
|
||||
7 normal message (the P fields indicate zone status)
|
||||
8 low battery (the P fields indicate zone status)
|
||||
9 test (the P fields indicate zone status)
|
||||
|
||||
Ademco Super fast
|
||||
|
||||
ACCT MT PPPPPPPP X S
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
MT = 2 digit message type (56)
|
||||
|
||||
There are versions somewhat like the above, with 8, 16 or 24 'P' digits,
|
||||
and no message type
|
||||
ACCT PPPPPPPP X
|
||||
ACCT PPPPPPPPPPPPPPPP X
|
||||
ACCT PPPPPPPPPPPPPPPPPPPPPPPP X
|
||||
|
||||
ACCT = 4 digit account code (0-9, B-F)
|
||||
PPPPPPPP = 8, 16 or 24 digit status of each zone
|
||||
X = 1 digit status of the communicator
|
||||
S = 1 digit hex checksum
|
||||
|
||||
*/
|
||||
|
||||
struct ademco_code_s
|
||||
@@ -1040,7 +1108,7 @@ SPAN_DECLARE(ademco_contactid_sender_state_t *) ademco_contactid_sender_init(ade
|
||||
|
||||
s->step = 0;
|
||||
s->remaining_samples = ms_to_samples(100);
|
||||
dtmf_tx_init(&s->dtmf);
|
||||
dtmf_tx_init(&s->dtmf, NULL, NULL);
|
||||
/* The specified timing is 50-60ms on, 50-60ms off */
|
||||
dtmf_tx_set_timing(&s->dtmf, 55, 55);
|
||||
return s;
|
||||
|
||||
+23
-23
@@ -88,7 +88,7 @@ static int adsi_tx_get_bit(void *user_data)
|
||||
{
|
||||
int bit;
|
||||
adsi_tx_state_t *s;
|
||||
|
||||
|
||||
s = (adsi_tx_state_t *) user_data;
|
||||
/* This is similar to the async. handling code in fsk.c, but a few special
|
||||
things are needed in the preamble, and postamble of an ADSI message. */
|
||||
@@ -162,7 +162,7 @@ static int adsi_tx_get_bit(void *user_data)
|
||||
static int adsi_tdd_get_async_byte(void *user_data)
|
||||
{
|
||||
adsi_tx_state_t *s;
|
||||
|
||||
|
||||
s = (adsi_tx_state_t *) user_data;
|
||||
if (s->byte_no < s->msg_len)
|
||||
return s->msg[s->byte_no++];
|
||||
@@ -241,7 +241,7 @@ static void adsi_rx_put_bit(void *user_data, int bit)
|
||||
{
|
||||
if (s->msg_len == 0)
|
||||
{
|
||||
/* A message should start DLE SOH, but let's just check
|
||||
/* A message should start DLE SOH, but let's just check
|
||||
we are starting with a DLE for now */
|
||||
if (s->in_progress == (0x80 | DLE))
|
||||
s->msg[s->msg_len++] = (uint8_t) s->in_progress;
|
||||
@@ -302,7 +302,7 @@ static void adsi_tdd_put_async_byte(void *user_data, int byte)
|
||||
{
|
||||
adsi_rx_state_t *s;
|
||||
uint8_t octet;
|
||||
|
||||
|
||||
s = (adsi_rx_state_t *) user_data;
|
||||
//printf("Rx bit %x\n", bit);
|
||||
if (byte < 0)
|
||||
@@ -373,19 +373,19 @@ static void start_tx(adsi_tx_state_t *s)
|
||||
switch (s->standard)
|
||||
{
|
||||
case ADSI_STANDARD_CLASS:
|
||||
fsk_tx_init(&(s->fsktx), &preset_fsk_specs[FSK_BELL202], adsi_tx_get_bit, s);
|
||||
fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_BELL202], adsi_tx_get_bit, s);
|
||||
break;
|
||||
case ADSI_STANDARD_CLIP:
|
||||
case ADSI_STANDARD_ACLIP:
|
||||
case ADSI_STANDARD_JCLIP:
|
||||
fsk_tx_init(&(s->fsktx), &preset_fsk_specs[FSK_V23CH1], adsi_tx_get_bit, s);
|
||||
fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V23CH1], adsi_tx_get_bit, s);
|
||||
break;
|
||||
case ADSI_STANDARD_CLIP_DTMF:
|
||||
dtmf_tx_init(&(s->dtmftx));
|
||||
dtmf_tx_init(&s->dtmftx, NULL, NULL);
|
||||
break;
|
||||
case ADSI_STANDARD_TDD:
|
||||
fsk_tx_init(&(s->fsktx), &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &(s->asynctx));
|
||||
async_tx_init(&(s->asynctx), 5, ASYNC_PARITY_NONE, 2, FALSE, adsi_tdd_get_async_byte, s);
|
||||
fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->asynctx);
|
||||
async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, adsi_tdd_get_async_byte, s);
|
||||
/* Schedule an explicit shift at the start of baudot transmission */
|
||||
s->baudot_shift = 2;
|
||||
break;
|
||||
@@ -403,10 +403,10 @@ SPAN_DECLARE(int) adsi_rx(adsi_rx_state_t *s, const int16_t amp[], int len)
|
||||
s->in_progress -= len;
|
||||
if (s->in_progress <= 0)
|
||||
s->msg_len = 0;
|
||||
dtmf_rx(&(s->dtmfrx), amp, len);
|
||||
dtmf_rx(&s->dtmfrx, amp, len);
|
||||
break;
|
||||
default:
|
||||
fsk_rx(&(s->fskrx), amp, len);
|
||||
fsk_rx(&s->fskrx, amp, len);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -435,20 +435,20 @@ SPAN_DECLARE(adsi_rx_state_t *) adsi_rx_init(adsi_rx_state_t *s,
|
||||
switch (standard)
|
||||
{
|
||||
case ADSI_STANDARD_CLASS:
|
||||
fsk_rx_init(&(s->fskrx), &preset_fsk_specs[FSK_BELL202], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s);
|
||||
fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_BELL202], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s);
|
||||
break;
|
||||
case ADSI_STANDARD_CLIP:
|
||||
case ADSI_STANDARD_ACLIP:
|
||||
case ADSI_STANDARD_JCLIP:
|
||||
fsk_rx_init(&(s->fskrx), &preset_fsk_specs[FSK_V23CH1], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s);
|
||||
fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V23CH1], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s);
|
||||
break;
|
||||
case ADSI_STANDARD_CLIP_DTMF:
|
||||
dtmf_rx_init(&(s->dtmfrx), adsi_rx_dtmf, s);
|
||||
dtmf_rx_init(&s->dtmfrx, adsi_rx_dtmf, s);
|
||||
break;
|
||||
case ADSI_STANDARD_TDD:
|
||||
/* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and
|
||||
ride over the fraction. */
|
||||
fsk_rx_init(&(s->fskrx), &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, adsi_tdd_put_async_byte, s);
|
||||
fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, adsi_tdd_put_async_byte, s);
|
||||
break;
|
||||
}
|
||||
s->standard = standard;
|
||||
@@ -475,19 +475,19 @@ SPAN_DECLARE(int) adsi_tx(adsi_tx_state_t *s, int16_t amp[], int max_len)
|
||||
int len;
|
||||
int lenx;
|
||||
|
||||
len = tone_gen(&(s->alert_tone_gen), amp, max_len);
|
||||
len = tone_gen(&s->alert_tone_gen, amp, max_len);
|
||||
if (s->tx_signal_on)
|
||||
{
|
||||
switch (s->standard)
|
||||
{
|
||||
case ADSI_STANDARD_CLIP_DTMF:
|
||||
if (len < max_len)
|
||||
len += dtmf_tx(&(s->dtmftx), amp, max_len - len);
|
||||
len += dtmf_tx(&s->dtmftx, amp, max_len - len);
|
||||
break;
|
||||
default:
|
||||
if (len < max_len)
|
||||
{
|
||||
if ((lenx = fsk_tx(&(s->fsktx), amp + len, max_len - len)) <= 0)
|
||||
if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0)
|
||||
s->tx_signal_on = FALSE;
|
||||
len += lenx;
|
||||
}
|
||||
@@ -500,7 +500,7 @@ SPAN_DECLARE(int) adsi_tx(adsi_tx_state_t *s, int16_t amp[], int max_len)
|
||||
|
||||
SPAN_DECLARE(void) adsi_tx_send_alert_tone(adsi_tx_state_t *s)
|
||||
{
|
||||
tone_gen_init(&(s->alert_tone_gen), &(s->alert_tone_desc));
|
||||
tone_gen_init(&s->alert_tone_gen, &s->alert_tone_desc);
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -583,7 +583,7 @@ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, in
|
||||
case ADSI_STANDARD_CLIP_DTMF:
|
||||
if (len >= 128)
|
||||
return -1;
|
||||
len -= (int) dtmf_tx_put(&(s->dtmftx), (char *) msg, len);
|
||||
len -= (int) dtmf_tx_put(&s->dtmftx, (char *) msg, len);
|
||||
break;
|
||||
case ADSI_STANDARD_JCLIP:
|
||||
if (len > 128 - 9)
|
||||
@@ -604,7 +604,7 @@ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, in
|
||||
i += len - 2;
|
||||
s->msg[i++] = DLE;
|
||||
s->msg[i++] = ETX;
|
||||
|
||||
|
||||
/* Set the parity bits */
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
@@ -639,7 +639,7 @@ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, in
|
||||
s->msg[len] = (uint8_t) ((-sum) & 0xFF);
|
||||
s->msg_len = len + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Prepare the bit sequencing */
|
||||
s->byte_no = 0;
|
||||
s->bit_pos = 0;
|
||||
@@ -662,7 +662,7 @@ SPAN_DECLARE(adsi_tx_state_t *) adsi_tx_init(adsi_tx_state_t *s, int standard)
|
||||
return NULL;
|
||||
}
|
||||
memset(s, 0, sizeof(*s));
|
||||
tone_gen_descriptor_init(&(s->alert_tone_desc),
|
||||
tone_gen_descriptor_init(&s->alert_tone_desc,
|
||||
2130,
|
||||
-13,
|
||||
2750,
|
||||
|
||||
+107
-94
@@ -35,6 +35,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "spandsp/telephony.h"
|
||||
#include "spandsp/bit_operations.h"
|
||||
#include "spandsp/async.h"
|
||||
|
||||
#include "spandsp/private/async.h"
|
||||
@@ -75,55 +76,13 @@ SPAN_DECLARE(const char *) signal_status_to_str(int status)
|
||||
return "Link disconnected";
|
||||
case SIG_STATUS_LINK_ERROR:
|
||||
return "Link error";
|
||||
case SIG_STATUS_LINK_IDLE:
|
||||
return "Link idle";
|
||||
}
|
||||
return "???";
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s,
|
||||
int data_bits,
|
||||
int parity,
|
||||
int stop_bits,
|
||||
int use_v14,
|
||||
put_byte_func_t put_byte,
|
||||
void *user_data)
|
||||
{
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (async_rx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
s->data_bits = data_bits;
|
||||
s->parity = parity;
|
||||
s->stop_bits = stop_bits;
|
||||
s->use_v14 = use_v14;
|
||||
|
||||
s->put_byte = put_byte;
|
||||
s->user_data = user_data;
|
||||
|
||||
s->byte_in_progress = 0;
|
||||
s->bitpos = 0;
|
||||
s->parity_bit = 0;
|
||||
|
||||
s->parity_errors = 0;
|
||||
s->framing_errors = 0;
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) async_rx_release(async_rx_state_t *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) async_rx_free(async_rx_state_t *s)
|
||||
{
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit)
|
||||
{
|
||||
async_rx_state_t *s;
|
||||
@@ -205,6 +164,106 @@ SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit)
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s,
|
||||
int data_bits,
|
||||
int parity,
|
||||
int stop_bits,
|
||||
int use_v14,
|
||||
put_byte_func_t put_byte,
|
||||
void *user_data)
|
||||
{
|
||||
if (s == NULL)
|
||||
{
|
||||
if ((s = (async_rx_state_t *) malloc(sizeof(*s))) == NULL)
|
||||
return NULL;
|
||||
}
|
||||
s->data_bits = data_bits;
|
||||
s->parity = parity;
|
||||
s->stop_bits = stop_bits;
|
||||
s->use_v14 = use_v14;
|
||||
|
||||
s->put_byte = put_byte;
|
||||
s->user_data = user_data;
|
||||
|
||||
s->byte_in_progress = 0;
|
||||
s->bitpos = 0;
|
||||
s->parity_bit = 0;
|
||||
|
||||
s->parity_errors = 0;
|
||||
s->framing_errors = 0;
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) async_rx_release(async_rx_state_t *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(int) async_rx_free(async_rx_state_t *s)
|
||||
{
|
||||
free(s);
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
|
||||
{
|
||||
async_tx_state_t *s;
|
||||
int bit;
|
||||
int parity_bit;
|
||||
|
||||
s = (async_tx_state_t *) user_data;
|
||||
if (s->bitpos == 0)
|
||||
{
|
||||
if (s->presend_bits > 0)
|
||||
{
|
||||
s->presend_bits--;
|
||||
return 1;
|
||||
}
|
||||
if ((s->byte_in_progress = s->get_byte(s->user_data)) < 0)
|
||||
{
|
||||
if (s->byte_in_progress != SIG_STATUS_LINK_IDLE)
|
||||
return s->byte_in_progress;
|
||||
/* Idle for a bit time. If the get byte call configured a presend
|
||||
time we might idle for longer. */
|
||||
return 1;
|
||||
}
|
||||
s->byte_in_progress &= (0xFFFF >> (16 - s->data_bits));
|
||||
if (s->parity != ASYNC_PARITY_NONE)
|
||||
{
|
||||
parity_bit = parity8(s->byte_in_progress);
|
||||
if (s->parity == ASYNC_PARITY_ODD)
|
||||
parity_bit ^= 1;
|
||||
s->byte_in_progress |= (parity_bit << s->data_bits);
|
||||
s->byte_in_progress |= (0xFFFF << (s->data_bits + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
s->byte_in_progress |= (0xFFFF << s->data_bits);
|
||||
}
|
||||
/* Start bit */
|
||||
bit = 0;
|
||||
s->bitpos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
bit = s->byte_in_progress & 1;
|
||||
s->byte_in_progress >>= 1;
|
||||
if (++s->bitpos > s->total_bits)
|
||||
s->bitpos = 0;
|
||||
}
|
||||
return bit;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(void) async_tx_presend_bits(async_tx_state_t *s, int bits)
|
||||
{
|
||||
s->presend_bits = bits;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s,
|
||||
int data_bits,
|
||||
int parity,
|
||||
@@ -223,16 +282,16 @@ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s,
|
||||
flow control does not exist, so V.14 stuffing is not needed. */
|
||||
s->data_bits = data_bits;
|
||||
s->parity = parity;
|
||||
s->stop_bits = stop_bits;
|
||||
s->total_bits = data_bits + stop_bits;
|
||||
if (parity != ASYNC_PARITY_NONE)
|
||||
s->stop_bits++;
|
||||
|
||||
s->total_bits++;
|
||||
|
||||
s->get_byte = get_byte;
|
||||
s->user_data = user_data;
|
||||
|
||||
s->byte_in_progress = 0;
|
||||
s->bitpos = 0;
|
||||
s->parity_bit = 0;
|
||||
s->presend_bits = 0;
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -249,50 +308,4 @@ SPAN_DECLARE(int) async_tx_free(async_tx_state_t *s)
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data)
|
||||
{
|
||||
async_tx_state_t *s;
|
||||
int bit;
|
||||
|
||||
s = (async_tx_state_t *) user_data;
|
||||
if (s->bitpos == 0)
|
||||
{
|
||||
if ((s->byte_in_progress = s->get_byte(s->user_data)) < 0)
|
||||
{
|
||||
/* No more data */
|
||||
bit = SIG_STATUS_END_OF_DATA;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Start bit */
|
||||
bit = 0;
|
||||
s->parity_bit = 0;
|
||||
s->bitpos++;
|
||||
}
|
||||
}
|
||||
else if (s->bitpos <= s->data_bits)
|
||||
{
|
||||
bit = s->byte_in_progress & 1;
|
||||
s->byte_in_progress >>= 1;
|
||||
s->parity_bit ^= bit;
|
||||
s->bitpos++;
|
||||
}
|
||||
else if (s->parity && s->bitpos == s->data_bits + 1)
|
||||
{
|
||||
if (s->parity == ASYNC_PARITY_ODD)
|
||||
s->parity_bit ^= 1;
|
||||
bit = s->parity_bit;
|
||||
s->bitpos++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Stop bit(s) */
|
||||
bit = 1;
|
||||
if (++s->bitpos > s->data_bits + s->stop_bits)
|
||||
s->bitpos = 0;
|
||||
}
|
||||
return bit;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
/*- End of file ------------------------------------------------------------*/
|
||||
|
||||
@@ -211,7 +211,7 @@ SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode)
|
||||
SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t)
|
||||
{
|
||||
uint8_t buf[3];
|
||||
|
||||
|
||||
buf[0] = s->p.s_regs[3];
|
||||
buf[1] = s->p.s_regs[4];
|
||||
buf[2] = '\0';
|
||||
@@ -375,7 +375,7 @@ SPAN_DECLARE(void) at_reset_call_info(at_state_t *s)
|
||||
{
|
||||
at_call_id_t *call_id;
|
||||
at_call_id_t *next;
|
||||
|
||||
|
||||
for (call_id = s->call_id; call_id; call_id = next)
|
||||
{
|
||||
next = call_id->next;
|
||||
@@ -424,7 +424,7 @@ SPAN_DECLARE(void) at_display_call_info(at_state_t *s)
|
||||
{
|
||||
snprintf(buf,
|
||||
sizeof(buf),
|
||||
"%s=%s",
|
||||
"%s=%s",
|
||||
(call_id->id) ? call_id->id : "NULL",
|
||||
(call_id->value) ? call_id->value : "<NONE>");
|
||||
at_put_response(s, buf);
|
||||
@@ -437,7 +437,7 @@ SPAN_DECLARE(void) at_display_call_info(at_state_t *s)
|
||||
static int parse_num(const char **s, int max_value)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
/* The spec. says no digits is valid, and should be treated as zero. */
|
||||
i = 0;
|
||||
while (isdigit((int) **s))
|
||||
@@ -454,7 +454,7 @@ static int parse_num(const char **s, int max_value)
|
||||
static int parse_hex_num(const char **s, int max_value)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
/* The spec. says a hex value is always 2 digits, and the alpha digits are
|
||||
upper case. */
|
||||
i = 0;
|
||||
@@ -859,7 +859,7 @@ static int process_class1_cmd(at_state_t *s, const char **t)
|
||||
allowed = "24,48,72,73,74,96,97,98,121,122,145,146";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
val = -1;
|
||||
if (!parse_out(s, t, &val, 255, NULL, allowed))
|
||||
return TRUE;
|
||||
@@ -4043,11 +4043,11 @@ static const char *at_cmd_plus_IBC(at_state_t *s, const char *t)
|
||||
/* 0: In-band control service disabled
|
||||
1: In-band control service enabled, 7-bit codes allowed, and top bit insignificant
|
||||
2; In-band control service enabled, 7-bit codes allowed, and 8-bit codes available
|
||||
|
||||
|
||||
Circuits 105, 106, 107, 108, 109, 110, 125, 132, 133, 135, 142 in that order. For each one:
|
||||
0: disabled
|
||||
1: enabled
|
||||
|
||||
|
||||
DCE line connect status reports:
|
||||
0: disabled
|
||||
1: enabled */
|
||||
@@ -4081,9 +4081,9 @@ static const char *at_cmd_plus_IBM(at_state_t *s, const char *t)
|
||||
T3 = entire interval -- N*T2
|
||||
7: report the first time when <T1> is exceeded, and then each time <T2> is exceeded, and then once
|
||||
more when the mark idle period ends; T3 = entire mark idle period -- N*T2 - T1
|
||||
|
||||
|
||||
T1 in units of 10ms
|
||||
|
||||
|
||||
T2 in units of 10ms */
|
||||
locations[0] = NULL;
|
||||
locations[1] = NULL;
|
||||
@@ -4106,7 +4106,7 @@ static const char *at_cmd_plus_ICF(at_state_t *s, const char *t)
|
||||
4: 7 data 2 stop
|
||||
5: 7 data 1 parity 1 stop
|
||||
6: 7 data 1 stop
|
||||
|
||||
|
||||
Parity
|
||||
0: Odd
|
||||
1: Even
|
||||
@@ -4235,7 +4235,7 @@ static const char *at_cmd_plus_MS(at_state_t *s, const char *t)
|
||||
static const char *at_cmd_plus_MSC(at_state_t *s, const char *t)
|
||||
{
|
||||
/* V.250 6.4.8 - Seamless rate change enable */
|
||||
/* 0 Disables V.34 seamless rate change
|
||||
/* 0 Disables V.34 seamless rate change
|
||||
1 Enables V.34 seamless rate change */
|
||||
/* TODO: */
|
||||
t += 4;
|
||||
|
||||
@@ -29,14 +29,14 @@
|
||||
paper somewhere. I can't track down where I got the original from,
|
||||
so that due recognition can be given. The original had no explicit
|
||||
copyright notice, and I hope nobody objects to its use here.
|
||||
|
||||
|
||||
Having a reasonable Gaussian noise generator is pretty important for
|
||||
telephony testing (in fact, pretty much any DSP testing), and this
|
||||
one seems to have served me OK. Since the generation of Gaussian
|
||||
noise is only for test purposes, and not a core system component,
|
||||
I don't intend to worry excessively about copyright issues, unless
|
||||
someone worries me.
|
||||
|
||||
|
||||
The non-core nature of this code also explains why it is unlikely
|
||||
to ever be optimised. */
|
||||
|
||||
|
||||
@@ -647,10 +647,10 @@ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s,
|
||||
s->digits_callback = callback;
|
||||
s->digits_callback_data = user_data;
|
||||
|
||||
s->hits[0] =
|
||||
s->hits[0] =
|
||||
s->hits[1] =
|
||||
s->hits[2] =
|
||||
s->hits[3] =
|
||||
s->hits[3] =
|
||||
s->hits[4] = 0;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
@@ -730,7 +730,7 @@ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples
|
||||
best = 1;
|
||||
second_best = 0;
|
||||
}
|
||||
|
||||
|
||||
for (i = 2; i < 6; i++)
|
||||
{
|
||||
energy[i] = goertzel_result(&s->out[i]);
|
||||
|
||||
@@ -338,7 +338,7 @@ SPAN_DECLARE(void) bert_set_report(bert_state_t *s, int freq, bert_report_func_t
|
||||
s->report_frequency = freq;
|
||||
s->reporter = reporter;
|
||||
s->user_data = user_data;
|
||||
|
||||
|
||||
s->rx.report_countdown = s->report_frequency;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -487,7 +487,7 @@ SPAN_DECLARE(bert_state_t *) bert_init(bert_state_t *s, int limit, int pattern,
|
||||
}
|
||||
s->error_rate = 8;
|
||||
s->rx.measurement_step = MEASUREMENT_STEP;
|
||||
|
||||
|
||||
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
|
||||
span_log_set_protocol(&s->logging, "BERT");
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi)
|
||||
SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z)
|
||||
{
|
||||
complexf_t cc;
|
||||
|
||||
|
||||
cc.re = filter_step(cfi->ref, z->re);
|
||||
cc.im = filter_step(cfi->imf, z->im);
|
||||
return cc;
|
||||
|
||||
+31
-31
@@ -39,37 +39,37 @@
|
||||
|
||||
static const uint32_t crc_itu32_table[] =
|
||||
{
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
|
||||
};
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ SPAN_DECLARE(int16_t) dds_lookup(uint32_t phase)
|
||||
step = DDS_STEPS - step;
|
||||
amp = sine_table[step];
|
||||
if ((phase & (2*DDS_STEPS)))
|
||||
amp = -amp;
|
||||
amp = -amp;
|
||||
return amp;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
+22
-8
@@ -22,7 +22,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*! \file */
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
@@ -129,7 +129,7 @@ SPAN_DECLARE(int) dtmf_rx(dtmf_rx_state_t *s, const int16_t amp[], int samples)
|
||||
limit = sample + (DTMF_SAMPLES_PER_BLOCK - s->current_sample);
|
||||
else
|
||||
limit = samples;
|
||||
/* The following unrolled loop takes only 35% (rough estimate) of the
|
||||
/* The following unrolled loop takes only 35% (rough estimate) of the
|
||||
time of a rolled loop on the machine on which it was developed */
|
||||
for (j = sample; j < limit; j++)
|
||||
{
|
||||
@@ -508,21 +508,31 @@ SPAN_DECLARE(int) dtmf_tx(dtmf_tx_state_t *s, int16_t amp[], int max_samples)
|
||||
if (s->tones.current_section >= 0)
|
||||
{
|
||||
/* Deal with the fragment left over from last time */
|
||||
len = tone_gen(&(s->tones), amp, max_samples);
|
||||
len = tone_gen(&s->tones, amp, max_samples);
|
||||
}
|
||||
while (len < max_samples && (digit = queue_read_byte(&s->queue.queue)) >= 0)
|
||||
|
||||
while (len < max_samples)
|
||||
{
|
||||
/* Step to the next digit */
|
||||
if ((digit = queue_read_byte(&s->queue.queue)) < 0)
|
||||
{
|
||||
/* See if we can get some more digits */
|
||||
if (s->callback == NULL)
|
||||
break;
|
||||
s->callback(s->callback_data);
|
||||
if ((digit = queue_read_byte(&s->queue.queue)) < 0)
|
||||
break;
|
||||
}
|
||||
if (digit == 0)
|
||||
continue;
|
||||
if ((cp = strchr(dtmf_positions, digit)) == NULL)
|
||||
continue;
|
||||
tone_gen_init(&(s->tones), &dtmf_digit_tones[cp - dtmf_positions]);
|
||||
tone_gen_init(&s->tones, &dtmf_digit_tones[cp - dtmf_positions]);
|
||||
s->tones.tone[0].gain = s->low_level;
|
||||
s->tones.tone[1].gain = s->high_level;
|
||||
s->tones.duration[0] = s->on_time;
|
||||
s->tones.duration[1] = s->off_time;
|
||||
len += tone_gen(&(s->tones), amp + len, max_samples - len);
|
||||
len += tone_gen(&s->tones, amp + len, max_samples - len);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
@@ -562,7 +572,9 @@ SPAN_DECLARE(void) dtmf_tx_set_timing(dtmf_tx_state_t *s, int on_time, int off_t
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
SPAN_DECLARE(dtmf_tx_state_t *) dtmf_tx_init(dtmf_tx_state_t *s)
|
||||
SPAN_DECLARE(dtmf_tx_state_t *) dtmf_tx_init(dtmf_tx_state_t *s,
|
||||
digits_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
if (s == NULL)
|
||||
{
|
||||
@@ -572,7 +584,9 @@ SPAN_DECLARE(dtmf_tx_state_t *) dtmf_tx_init(dtmf_tx_state_t *s)
|
||||
memset(s, 0, sizeof(*s));
|
||||
if (!dtmf_tx_inited)
|
||||
dtmf_tx_initialise();
|
||||
tone_gen_init(&(s->tones), &dtmf_digit_tones[0]);
|
||||
s->callback = callback;
|
||||
s->callback_data = user_data;
|
||||
tone_gen_init(&s->tones, &dtmf_digit_tones[0]);
|
||||
dtmf_tx_set_level(s, DEFAULT_DTMF_TX_LEVEL, 0);
|
||||
dtmf_tx_set_timing(s, -1, -1);
|
||||
queue_init(&s->queue.queue, MAX_DTMF_DIGITS, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC);
|
||||
|
||||
@@ -50,13 +50,13 @@
|
||||
/* The FIR taps must be adapted as 32 bit values, to get the necessary finesse
|
||||
in the adaption process. However, they are applied as 16 bit values (bits 30-15
|
||||
of the 32 bit values) in the FIR. For the working 16 bit values, we need 4 sets.
|
||||
|
||||
|
||||
3 of the 16 bit sets are used on a rotating basis. Normally the canceller steps
|
||||
round these 3 sets at regular intervals. Any time we detect double talk, we can go
|
||||
back to the set from two steps ago with reasonable assurance it is a well adapted
|
||||
set. We cannot just go back one step, as we may have rotated the sets just before
|
||||
double talk or tone was detected, and that set may already be somewhat corrupted.
|
||||
|
||||
|
||||
When narrowband energy is detected we need to continue adapting to it, to echo
|
||||
cancel it. However, the adaption will almost certainly be going astray. Broadband
|
||||
(or even complex sequences of narrowband) energy will normally lead to a well
|
||||
@@ -129,7 +129,7 @@ static int narrowband_detect(echo_can_state_t *ec)
|
||||
int score;
|
||||
int len = 32;
|
||||
int alen = 9;
|
||||
|
||||
|
||||
k = ec->curr_pos;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
@@ -292,7 +292,7 @@ SPAN_DECLARE(int) echo_can_release(echo_can_state_t *ec)
|
||||
SPAN_DECLARE(int) echo_can_free(echo_can_state_t *ec)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
fir16_free(&ec->fir_state);
|
||||
free(ec->fir_taps32);
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -361,7 +361,7 @@ static __inline__ int16_t echo_can_hpf(int32_t coeff[2], int16_t amp)
|
||||
{
|
||||
int32_t z;
|
||||
|
||||
/*
|
||||
/*
|
||||
Filter DC, 3dB point is 160Hz (I think), note 32 bit precision required
|
||||
otherwise values do not track down to 0. Zero at DC, Pole at (1-Beta)
|
||||
only real axis. Some chip sets (like Si labs) don't need
|
||||
@@ -371,7 +371,7 @@ static __inline__ int16_t echo_can_hpf(int32_t coeff[2], int16_t amp)
|
||||
Note: removes some low frequency from the signal, this reduces
|
||||
the speech quality when listening to samples through headphones
|
||||
but may not be obvious through a telephone handset.
|
||||
|
||||
|
||||
Note that the 3dB frequency in radians is approx Beta, e.g. for
|
||||
Beta = 2^(-3) = 0.125, 3dB freq is 0.125 rads = 159Hz.
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len)
|
||||
int len;
|
||||
#if defined(LOG_FAX_AUDIO)
|
||||
int required_len;
|
||||
|
||||
|
||||
required_len = max_len;
|
||||
#endif
|
||||
len = 0;
|
||||
@@ -236,7 +236,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len)
|
||||
{
|
||||
/* Pad to the requested length with silence */
|
||||
memset(amp + len, 0, (max_len - len)*sizeof(int16_t));
|
||||
len = max_len;
|
||||
len = max_len;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len)
|
||||
{
|
||||
/* Pad to the requested length with silence */
|
||||
memset(amp, 0, max_len*sizeof(int16_t));
|
||||
len = max_len;
|
||||
len = max_len;
|
||||
}
|
||||
}
|
||||
#if defined(LOG_FAX_AUDIO)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif
|
||||
@@ -55,7 +55,7 @@
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
|
||||
#define MAXPZ 8192
|
||||
#define MAXPZ 8192
|
||||
#define SEQ_LEN 8192
|
||||
#define MAX_FFT_LEN SEQ_LEN
|
||||
|
||||
@@ -139,7 +139,7 @@ void compute_raised_cosine_filter(double coeffs[],
|
||||
int i;
|
||||
int j;
|
||||
int h;
|
||||
|
||||
|
||||
f1 = (1.0 - beta)*alpha;
|
||||
f2 = (1.0 + beta)*alpha;
|
||||
tau = 0.5/alpha;
|
||||
@@ -162,10 +162,10 @@ void compute_raised_cosine_filter(double coeffs[],
|
||||
if (sinc_compensate)
|
||||
{
|
||||
for (i = 1; i <= SEQ_LEN/2; i++)
|
||||
{
|
||||
{
|
||||
x = 3.1415926535*(double) i/(double) SEQ_LEN;
|
||||
vec[i].re *= (x/sin(x));
|
||||
}
|
||||
vec[i].re *= (x/sin(x));
|
||||
}
|
||||
}
|
||||
for (i = 0; i <= SEQ_LEN/2; i++)
|
||||
vec[i].re *= tau;
|
||||
@@ -228,7 +228,7 @@ void truncate_coeffs(double coeffs[], int len, int bits, int hilbert)
|
||||
|
||||
fac = pow(2.0, (double) (bits - 1.0));
|
||||
h = (len - 1)/2;
|
||||
max = (hilbert) ? coeffs[h - 1] : coeffs[h]; /* Max coeff */
|
||||
max = (hilbert) ? coeffs[h - 1] : coeffs[h]; /* Max coeff */
|
||||
scale = (fac - 1.0)/(fac*max);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,6 @@ void compute_raised_cosine_filter(double coeffs[],
|
||||
|
||||
void compute_hilbert_transform(double coeffs[], int len);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -37,42 +37,42 @@ extern "C"
|
||||
#if !defined(HAVE_SINF)
|
||||
static __inline__ float sinf(float x)
|
||||
{
|
||||
return (float) sin((double) x);
|
||||
return (float) sin((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_COSF)
|
||||
static __inline__ float cosf(float x)
|
||||
{
|
||||
return (float) cos((double) x);
|
||||
return (float) cos((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_TANF)
|
||||
static __inline__ float tanf(float x)
|
||||
{
|
||||
return (float) tan((double) x);
|
||||
return (float) tan((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ASINF)
|
||||
static __inline__ float asinf(float x)
|
||||
{
|
||||
return (float) asin((double) x);
|
||||
return (float) asin((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ACOSF)
|
||||
static __inline__ float acosf(float x)
|
||||
{
|
||||
return (float) acos((double) x);
|
||||
return (float) acos((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ATANF)
|
||||
static __inline__ float atanf(float x)
|
||||
{
|
||||
return (float) atan((double) x);
|
||||
return (float) atan((double) x);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@ static __inline__ float atanf(float x)
|
||||
#if !defined(HAVE_ATAN2F)
|
||||
static __inline__ float atan2f(float y, float x)
|
||||
{
|
||||
return (float) atan2((double) y, (double) x);
|
||||
return (float) atan2((double) y, (double) x);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -88,14 +88,14 @@ static __inline__ float atan2f(float y, float x)
|
||||
#if !defined(HAVE_CEILF)
|
||||
static __inline__ float ceilf(float x)
|
||||
{
|
||||
return (float) ceil((double) x);
|
||||
return (float) ceil((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_FLOORF)
|
||||
static __inline__ float floorf(float x)
|
||||
{
|
||||
return (float) floor((double) x);
|
||||
return (float) floor((double) x);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -117,7 +117,7 @@ static __inline__ float expf(float x)
|
||||
#if !defined(HAVE_LOGF)
|
||||
static __inline__ float logf(float x)
|
||||
{
|
||||
return (float) logf((double) x);
|
||||
return (float) logf((double) x);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ const fsk_spec_t preset_fsk_specs[] =
|
||||
4545
|
||||
},
|
||||
{
|
||||
"Weitbrecht 50", /* Used for Internatioal TDD (Telecoms Device for the Deaf) */
|
||||
"Weitbrecht 50", /* Used for international TDD (Telecoms Device for the Deaf) */
|
||||
1600 + 200,
|
||||
1600 - 200,
|
||||
-14,
|
||||
@@ -144,7 +144,7 @@ SPAN_DECLARE(int) fsk_tx_restart(fsk_tx_state_t *s, const fsk_spec_t *spec)
|
||||
s->phase_acc = 0;
|
||||
s->baud_frac = 0;
|
||||
s->current_phase_rate = s->phase_rates[1];
|
||||
|
||||
|
||||
s->shutdown = FALSE;
|
||||
return 0;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ SPAN_DECLARE(int) fsk_rx_restart(fsk_rx_state_t *s, const fsk_spec_t *spec, int
|
||||
|
||||
/* Detect by correlating against the tones we want, over a period
|
||||
of one baud. The correlation must be quadrature. */
|
||||
|
||||
|
||||
/* First we need the quadrature tone generators to correlate
|
||||
against. */
|
||||
s->phase_rate[0] = dds_phase_rate((float) spec->freq_zero);
|
||||
@@ -303,7 +303,7 @@ SPAN_DECLARE(int) fsk_rx_restart(fsk_rx_state_t *s, const fsk_spec_t *spec, int
|
||||
s->frame_state = 0;
|
||||
s->frame_bits = 0;
|
||||
s->last_bit = 0;
|
||||
|
||||
|
||||
/* Initialise a power detector, so sense when a signal is present. */
|
||||
power_meter_init(&(s->power), 4);
|
||||
s->signal_present = 0;
|
||||
|
||||
@@ -367,7 +367,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8
|
||||
else if (wd1 > 18432)
|
||||
wd1 = 18432;
|
||||
s->band[0].nb = (int16_t) wd1;
|
||||
|
||||
|
||||
/* Block 3L, SCALEL */
|
||||
wd1 = (s->band[0].nb >> 6) & 31;
|
||||
wd2 = 8 - (s->band[0].nb >> 11);
|
||||
@@ -375,7 +375,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8
|
||||
s->band[0].det = (int16_t) (wd3 << 2);
|
||||
|
||||
block4(&s->band[0], dlow);
|
||||
|
||||
|
||||
if (!s->eight_k)
|
||||
{
|
||||
/* Block 2H, INVQAH */
|
||||
@@ -394,7 +394,7 @@ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8
|
||||
else if (wd1 > 22528)
|
||||
wd1 = 22528;
|
||||
s->band[1].nb = (int16_t) wd1;
|
||||
|
||||
|
||||
/* Block 3H, SCALEH */
|
||||
wd1 = (s->band[1].nb >> 6) & 31;
|
||||
wd2 = 10 - (s->band[1].nb >> 11);
|
||||
@@ -566,7 +566,7 @@ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const
|
||||
s->band[0].det = (int16_t) (wd3 << 2);
|
||||
|
||||
block4(&s->band[0], dlow);
|
||||
|
||||
|
||||
if (s->eight_k)
|
||||
{
|
||||
/* Just leave the high bits as zero */
|
||||
|
||||
@@ -695,7 +695,7 @@ static uint8_t g726_16_encoder(g726_state_t *s, int16_t amp)
|
||||
int16_t dqsez;
|
||||
int16_t dq;
|
||||
int16_t i;
|
||||
|
||||
|
||||
sezi = predictor_zero(s);
|
||||
sei = sezi + predictor_pole(s);
|
||||
se = sei >> 1;
|
||||
@@ -711,7 +711,7 @@ static uint8_t g726_16_encoder(g726_state_t *s, int16_t amp)
|
||||
|
||||
/* Pole prediction difference */
|
||||
dqsez = sr + (sezi >> 1) - se;
|
||||
|
||||
|
||||
update(s, y, g726_16_witab[i], g726_16_fitab[i], dq, sr, dqsez);
|
||||
return (uint8_t) i;
|
||||
}
|
||||
@@ -773,7 +773,7 @@ static uint8_t g726_24_encoder(g726_state_t *s, int16_t amp)
|
||||
int16_t dq;
|
||||
int16_t i;
|
||||
int y;
|
||||
|
||||
|
||||
sezi = predictor_zero(s);
|
||||
sei = sezi + predictor_pole(s);
|
||||
se = sei >> 1;
|
||||
@@ -789,7 +789,7 @@ static uint8_t g726_24_encoder(g726_state_t *s, int16_t amp)
|
||||
|
||||
/* Pole prediction difference */
|
||||
dqsez = sr + (sezi >> 1) - se;
|
||||
|
||||
|
||||
update(s, y, g726_24_witab[i], g726_24_fitab[i], dq, sr, dqsez);
|
||||
return (uint8_t) i;
|
||||
}
|
||||
@@ -851,7 +851,7 @@ static uint8_t g726_32_encoder(g726_state_t *s, int16_t amp)
|
||||
int16_t dq;
|
||||
int16_t i;
|
||||
int y;
|
||||
|
||||
|
||||
sezi = predictor_zero(s);
|
||||
sei = sezi + predictor_pole(s);
|
||||
se = sei >> 1;
|
||||
@@ -930,7 +930,7 @@ static uint8_t g726_40_encoder(g726_state_t *s, int16_t amp)
|
||||
int16_t dq;
|
||||
int16_t i;
|
||||
int y;
|
||||
|
||||
|
||||
sezi = predictor_zero(s);
|
||||
sei = sezi + predictor_pole(s);
|
||||
se = sei >> 1;
|
||||
@@ -970,7 +970,7 @@ static int16_t g726_40_decoder(g726_state_t *s, uint8_t code)
|
||||
code &= 0x1F;
|
||||
sezi = predictor_zero(s);
|
||||
sei = sezi + predictor_pole(s);
|
||||
|
||||
|
||||
y = step_size(s);
|
||||
dq = reconstruct(code & 0x10, g726_40_dqlntab[code], y);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ SPAN_DECLARE(int) gsm0610_unpack_none(gsm0610_frame_t *s, const uint8_t c[])
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
|
||||
|
||||
i = 0;
|
||||
for (j = 0; j < 8; j++)
|
||||
s->LARc[j] = c[i++];
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
/* The RPE-LTD coder works on a frame by frame basis. The length of
|
||||
the frame is equal to 160 samples. Some computations are done
|
||||
once per frame to produce at the output of the coder the
|
||||
LARc[1..8] parameters which are the coded LAR coefficients and
|
||||
LARc[1..8] parameters which are the coded LAR coefficients and
|
||||
also to realize the inverse filtering operation for the entire
|
||||
frame (160 samples of signal d[0..159]). These parts produce at
|
||||
the output of the coder:
|
||||
@@ -107,7 +107,7 @@ static void encode_a_frame(gsm0610_state_t *s, gsm0610_frame_t *f, const int16_t
|
||||
SPAN_DECLARE(int) gsm0610_set_packing(gsm0610_state_t *s, int packing)
|
||||
{
|
||||
s->packing = packing;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -147,7 +147,7 @@ SPAN_DECLARE(int) gsm0610_pack_none(uint8_t c[], const gsm0610_frame_t *s)
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
|
||||
|
||||
i = 0;
|
||||
for (j = 0; j < 8; j++)
|
||||
c[i++] = (uint8_t) s->LARc[j];
|
||||
@@ -169,33 +169,33 @@ SPAN_DECLARE(int) gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s)
|
||||
{
|
||||
uint16_t sr;
|
||||
int i;
|
||||
|
||||
sr = 0;
|
||||
sr = (sr >> 6) | (s->LARc[0] << 10);
|
||||
sr = (sr >> 6) | (s->LARc[1] << 10);
|
||||
*c++ = (uint8_t) (sr >> 4);
|
||||
sr = (sr >> 5) | (s->LARc[2] << 11);
|
||||
*c++ = (uint8_t) (sr >> 7);
|
||||
sr = (sr >> 5) | (s->LARc[3] << 11);
|
||||
sr = (sr >> 4) | (s->LARc[4] << 12);
|
||||
*c++ = (uint8_t) (sr >> 6);
|
||||
sr = (sr >> 4) | (s->LARc[5] << 12);
|
||||
sr = (sr >> 3) | (s->LARc[6] << 13);
|
||||
*c++ = (uint8_t) (sr >> 7);
|
||||
sr = (sr >> 3) | (s->LARc[7] << 13);
|
||||
|
||||
sr = 0;
|
||||
sr = (sr >> 6) | (s->LARc[0] << 10);
|
||||
sr = (sr >> 6) | (s->LARc[1] << 10);
|
||||
*c++ = (uint8_t) (sr >> 4);
|
||||
sr = (sr >> 5) | (s->LARc[2] << 11);
|
||||
*c++ = (uint8_t) (sr >> 7);
|
||||
sr = (sr >> 5) | (s->LARc[3] << 11);
|
||||
sr = (sr >> 4) | (s->LARc[4] << 12);
|
||||
*c++ = (uint8_t) (sr >> 6);
|
||||
sr = (sr >> 4) | (s->LARc[5] << 12);
|
||||
sr = (sr >> 3) | (s->LARc[6] << 13);
|
||||
*c++ = (uint8_t) (sr >> 7);
|
||||
sr = (sr >> 3) | (s->LARc[7] << 13);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
sr = (sr >> 7) | (s->Nc[i] << 9);
|
||||
*c++ = (uint8_t) (sr >> 5);
|
||||
sr = (sr >> 2) | (s->bc[i] << 14);
|
||||
sr = (sr >> 2) | (s->Mc[i] << 14);
|
||||
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
||||
*c++ = (uint8_t) (sr >> 3);
|
||||
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
||||
*c++ = (uint8_t) (sr >> 8);
|
||||
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
||||
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
||||
sr = (sr >> 7) | (s->Nc[i] << 9);
|
||||
*c++ = (uint8_t) (sr >> 5);
|
||||
sr = (sr >> 2) | (s->bc[i] << 14);
|
||||
sr = (sr >> 2) | (s->Mc[i] << 14);
|
||||
sr = (sr >> 6) | (s->xmaxc[i] << 10);
|
||||
*c++ = (uint8_t) (sr >> 3);
|
||||
sr = (sr >> 3) | (s->xMc[i][0] << 13);
|
||||
*c++ = (uint8_t) (sr >> 8);
|
||||
sr = (sr >> 3) | (s->xMc[i][1] << 13);
|
||||
sr = (sr >> 3) | (s->xMc[i][2] << 13);
|
||||
sr = (sr >> 3) | (s->xMc[i][3] << 13);
|
||||
*c++ = (uint8_t) (sr >> 7);
|
||||
sr = (sr >> 3) | (s->xMc[i][4] << 13);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#define GSM0610_FRAME_LEN 160
|
||||
|
||||
#define GSM0610_MAGIC 0xD
|
||||
#define GSM0610_MAGIC 0xD
|
||||
|
||||
#include "spandsp/private/gsm0610.h"
|
||||
|
||||
|
||||
@@ -59,15 +59,15 @@
|
||||
/* The number of left shifts needed to normalize the 32 bit
|
||||
variable x for positive values on the interval
|
||||
with minimum of
|
||||
minimum of 1073741824 (01000000000000000000000000000000) and
|
||||
minimum of 1073741824 (01000000000000000000000000000000) and
|
||||
maximum of 2147483647 (01111111111111111111111111111111)
|
||||
and for negative values on the interval with
|
||||
minimum of -2147483648 (-10000000000000000000000000000000) and
|
||||
maximum of -1073741824 ( -1000000000000000000000000000000).
|
||||
|
||||
|
||||
In order to normalize the result, the following
|
||||
operation must be done: norm_var1 = x << gsm0610_norm(x);
|
||||
|
||||
|
||||
(That's 'ffs', only from the left, not the right..)
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ int16_t gsm0610_norm(int32_t x)
|
||||
|
||||
/*
|
||||
(From p. 46, end of section 4.2.5)
|
||||
|
||||
|
||||
NOTE: The following lines gives [sic] one correct implementation
|
||||
of the div(num, denum) arithmetic operation. Compute div
|
||||
which is the integer division of num by denom: with
|
||||
@@ -188,7 +188,7 @@ static void gsm0610_vec_vsraw(const int16_t *p, int n, int bits)
|
||||
" addq $2,%%rdx;\n" /* now edx = top-2 */
|
||||
" cmpq %%rdx,%%rsi;\n"
|
||||
" ja 2f;\n"
|
||||
|
||||
|
||||
" movzwl (%%rsi),%%eax;\n"
|
||||
" movd %%eax,%%mm0;\n"
|
||||
" paddsw %%mm2,%%mm0;\n"
|
||||
@@ -251,7 +251,7 @@ static void gsm0610_vec_vsraw(const int16_t *p, int n, int bits)
|
||||
" addl $2,%%edx;\n" /* now edx = top-2 */
|
||||
" cmpl %%edx,%%esi;\n"
|
||||
" ja 2f;\n"
|
||||
|
||||
|
||||
" movzwl (%%esi),%%eax;\n"
|
||||
" movd %%eax,%%mm0;\n"
|
||||
" paddsw %%mm2,%%mm0;\n"
|
||||
@@ -283,7 +283,7 @@ static void autocorrelation(int16_t amp[GSM0610_FRAME_LEN], int32_t L_ACF[9])
|
||||
int16_t *sp;
|
||||
int16_t sl;
|
||||
#endif
|
||||
|
||||
|
||||
/* The goal is to compute the array L_ACF[k]. The signal s[i] must
|
||||
be scaled in order to avoid an overflow situation. */
|
||||
|
||||
@@ -411,7 +411,7 @@ static void autocorrelation(int16_t amp[GSM0610_FRAME_LEN], int32_t L_ACF[9])
|
||||
/* Rescaling of the array s[0..159] */
|
||||
if (scalauto > 0)
|
||||
{
|
||||
assert(scalauto <= 4);
|
||||
assert(scalauto <= 4);
|
||||
for (k = 0; k < GSM0610_FRAME_LEN; k++)
|
||||
amp[k] <<= scalauto;
|
||||
/*endfor*/
|
||||
@@ -480,7 +480,7 @@ static void reflection_coefficients(int32_t L_ACF[9], int16_t r[8])
|
||||
/*endif*/
|
||||
assert(*r != INT16_MIN);
|
||||
if (n == 8)
|
||||
return;
|
||||
return;
|
||||
/*endif*/
|
||||
|
||||
/* Schur recursion */
|
||||
@@ -508,7 +508,7 @@ static void transform_to_log_area_ratios(int16_t r[8])
|
||||
int i;
|
||||
|
||||
/* The following scaling for r[..] and LAR[..] has been used:
|
||||
|
||||
|
||||
r[..] = integer (real_r[..]*32768.); -1 <= real_r < 1.
|
||||
LAR[..] = integer (real_LAR[..] * 16384);
|
||||
with -1.625 <= real_LAR <= 1.625
|
||||
@@ -551,7 +551,7 @@ static void quantization_and_coding(int16_t LAR[8])
|
||||
|
||||
/* This procedure needs four tables; the following equations
|
||||
give the optimum scaling for the constants:
|
||||
|
||||
|
||||
A[0..7] = integer(real_A[0..7] * 1024)
|
||||
B[0..7] = integer(real_B[0..7] * 512)
|
||||
MAC[0..7] = maximum of the LARc[0..7]
|
||||
|
||||
@@ -53,18 +53,18 @@
|
||||
|
||||
/*
|
||||
4.2.0 .. 4.2.3 PREPROCESSING SECTION
|
||||
|
||||
|
||||
After A-law to linear conversion (or directly from the
|
||||
A to D converter) the following scaling is assumed for
|
||||
input to the RPE-LTP algorithm:
|
||||
|
||||
|
||||
in: 0.1.....................12
|
||||
S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.*
|
||||
|
||||
|
||||
Where S is the sign bit, v a valid bit, and * a "don't care" bit.
|
||||
The original signal is called sop[..]
|
||||
|
||||
out: 0.1................... 12
|
||||
|
||||
out: 0.1................... 12
|
||||
S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0
|
||||
*/
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ static void weighting_filter(int16_t x[40],
|
||||
"1:\n"
|
||||
" movq (%%rcx,%%rsi,2),%%mm0;\n"
|
||||
" pmaddwd %%mm1,%%mm0;\n"
|
||||
|
||||
|
||||
" movq 8(%%rcx,%%rsi,2),%%mm4;\n"
|
||||
" pmaddwd %%mm2,%%mm4;\n"
|
||||
" paddd %%mm4,%%mm0;\n"
|
||||
@@ -103,7 +103,7 @@ static void weighting_filter(int16_t x[40],
|
||||
|
||||
" paddd %%mm5,%%mm0;\n" /* Add for roundoff */
|
||||
" psrad $13,%%mm0;\n"
|
||||
" packssdw %%mm0,%%mm0;\n"
|
||||
" packssdw %%mm0,%%mm0;\n"
|
||||
" movd %%mm0,%%eax;\n" /* eax has result */
|
||||
" movw %%ax,(%%rdi,%%rsi,2);\n"
|
||||
" incq %%rsi;\n"
|
||||
@@ -143,7 +143,7 @@ static void weighting_filter(int16_t x[40],
|
||||
"1:\n"
|
||||
" movq (%%ecx,%%esi,2),%%mm0;\n"
|
||||
" pmaddwd %%mm1,%%mm0;\n"
|
||||
|
||||
|
||||
" movq 8(%%ecx,%%esi,2),%%mm4;\n"
|
||||
" pmaddwd %%mm2,%%mm4;\n"
|
||||
" paddd %%mm4,%%mm0;\n"
|
||||
@@ -158,7 +158,7 @@ static void weighting_filter(int16_t x[40],
|
||||
|
||||
" paddd %%mm5,%%mm0;\n" /* Add for roundoff */
|
||||
" psrad $13,%%mm0;\n"
|
||||
" packssdw %%mm0,%%mm0;\n"
|
||||
" packssdw %%mm0,%%mm0;\n"
|
||||
" movd %%mm0,%%eax;\n" /* eax has result */
|
||||
" movw %%ax,(%%edi,%%esi,2);\n"
|
||||
" incl %%esi;\n"
|
||||
@@ -175,8 +175,8 @@ static void weighting_filter(int16_t x[40],
|
||||
|
||||
/* The coefficients of the weighting filter are stored in a table
|
||||
(see table 4.4). The following scaling is used:
|
||||
|
||||
H[0..10] = integer(real_H[0..10] * 8192);
|
||||
|
||||
H[0..10] = integer(real_H[0..10] * 8192);
|
||||
*/
|
||||
/* Initialization of a temporary working array wt[0...49] */
|
||||
|
||||
@@ -205,7 +205,7 @@ static void weighting_filter(int16_t x[40],
|
||||
#define STEP(i,H) (e[k + i] * (int32_t) H)
|
||||
|
||||
/* Every one of these multiplications is done twice,
|
||||
but I don't see an elegant way to optimize this.
|
||||
but I don't see an elegant way to optimize this.
|
||||
Do you?
|
||||
*/
|
||||
result += STEP( 0, -134);
|
||||
@@ -446,14 +446,14 @@ static void apcm_quantization(int16_t xM[13],
|
||||
can be calculated by using the exponent and the mantissa part of
|
||||
xmaxc (logarithmic table).
|
||||
So, this method avoids any division and uses only a scaling
|
||||
of the RPE samples by a function of the exponent. A direct
|
||||
of the RPE samples by a function of the exponent. A direct
|
||||
multiplication by the inverse of the mantissa (NRFAC[0..7]
|
||||
found in table 4.5) gives the 3 bit coded version xMc[0..12]
|
||||
of the RPE samples.
|
||||
*/
|
||||
/* Direct computation of xMc[0..12] using table 4.5 */
|
||||
assert(exp <= 4096 && exp >= -4096);
|
||||
assert(mant >= 0 && mant <= 7);
|
||||
assert(mant >= 0 && mant <= 7);
|
||||
|
||||
temp1 = (int16_t) (6 - exp); /* Normalization by the exponent */
|
||||
temp2 = gsm_NRFAC[mant]; /* Inverse mantissa */
|
||||
|
||||
@@ -97,7 +97,7 @@ static void decode_log_area_ratios(int16_t LARc[8], int16_t *LARpp)
|
||||
analysis and synthesis filters operate with four different sets of
|
||||
coefficients, derived from the previous set of decoded LARs(LARpp(j - 1))
|
||||
and the actual set of decoded LARs (LARpp(j))
|
||||
|
||||
|
||||
(Initial value: LARpp(j - 1)[1..8] = 0.)
|
||||
*/
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s)
|
||||
{
|
||||
if (s->octet_count_report_interval == 0)
|
||||
return;
|
||||
|
||||
|
||||
/* If we are not in octet counting mode, we start it.
|
||||
If we are in octet counting mode, we update it. */
|
||||
if (s->octet_counting_mode)
|
||||
@@ -465,7 +465,7 @@ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s)
|
||||
{
|
||||
s->abort_octets = 0;
|
||||
return 0x7F;
|
||||
}
|
||||
}
|
||||
return s->idle_octet;
|
||||
}
|
||||
if (s->len)
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File RelativePath="ademco_contactid.c"></File>
|
||||
<File RelativePath="adsi.c"></File>
|
||||
<File RelativePath="async.c"></File>
|
||||
<File RelativePath="at_interpreter.c"></File>
|
||||
@@ -123,12 +124,14 @@
|
||||
<File RelativePath="gsm0610_short_term.c"></File>
|
||||
<File RelativePath="hdlc.c"></File>
|
||||
<File RelativePath="ima_adpcm.c"></File>
|
||||
<File RelativePath="image_translate.c"></File>
|
||||
<File RelativePath="logging.c"></File>
|
||||
<File RelativePath="lpc10_analyse.c"></File>
|
||||
<File RelativePath="lpc10_decode.c"></File>
|
||||
<File RelativePath="lpc10_encode.c"></File>
|
||||
<File RelativePath="lpc10_placev.c"></File>
|
||||
<File RelativePath="lpc10_voicing.c"></File>
|
||||
<File RelativePath="math_fixed.c"></File>
|
||||
<File RelativePath="modem_echo.c"></File>
|
||||
<File RelativePath="modem_connect_tones.c"></File>
|
||||
<File RelativePath="noise.c"></File>
|
||||
@@ -143,6 +146,8 @@
|
||||
<File RelativePath="super_tone_rx.c"></File>
|
||||
<File RelativePath="super_tone_tx.c"></File>
|
||||
<File RelativePath="swept_tone.c"></File>
|
||||
<File RelativePath="t4_t6_decode.c"></File>
|
||||
<File RelativePath="t4_t6_encode.c"></File>
|
||||
<File RelativePath="t4_rx.c"></File>
|
||||
<File RelativePath="t4_tx.c"></File>
|
||||
<File RelativePath="t30.c"></File>
|
||||
@@ -154,8 +159,13 @@
|
||||
<File RelativePath="t38_gateway.c"></File>
|
||||
<File RelativePath="t38_non_ecm_buffer.c"></File>
|
||||
<File RelativePath="t38_terminal.c"></File>
|
||||
<File RelativePath="t42.c"></File>
|
||||
<File RelativePath="t81_t82_arith_coding.c"></File>
|
||||
<File RelativePath="t85_decode.c"></File>
|
||||
<File RelativePath="t85_encode.c"></File>
|
||||
<File RelativePath="testcpuid.c"></File>
|
||||
<File RelativePath="time_scale.c"></File>
|
||||
<File RelativePath="timezone.c"></File>
|
||||
<File RelativePath="tone_detect.c"></File>
|
||||
<File RelativePath="tone_generate.c"></File>
|
||||
<File RelativePath="v17rx.c"></File>
|
||||
@@ -174,6 +184,7 @@
|
||||
<File RelativePath="vector_int.c"></File>
|
||||
<File RelativePath=".\msvc\gettimeofday.c"></File>
|
||||
</Filter><Filter Name="Header Files">
|
||||
<File RelativePath="spandsp/ademco_contactid.h"></File>
|
||||
<File RelativePath="spandsp/adsi.h"></File>
|
||||
<File RelativePath="spandsp/async.h"></File>
|
||||
<File RelativePath="spandsp/arctan2.h"></File>
|
||||
@@ -205,8 +216,10 @@
|
||||
<File RelativePath="spandsp/gsm0610.h"></File>
|
||||
<File RelativePath="spandsp/hdlc.h"></File>
|
||||
<File RelativePath="spandsp/ima_adpcm.h"></File>
|
||||
<File RelativePath="spandsp/image_translate.h"></File>
|
||||
<File RelativePath="spandsp/logging.h"></File>
|
||||
<File RelativePath="spandsp/lpc10.h"></File>
|
||||
<File RelativePath="spandsp/math_fixed.h"></File>
|
||||
<File RelativePath="spandsp/modem_echo.h"></File>
|
||||
<File RelativePath="spandsp/modem_connect_tones.h"></File>
|
||||
<File RelativePath="spandsp/noise.h"></File>
|
||||
@@ -222,8 +235,6 @@
|
||||
<File RelativePath="spandsp/super_tone_rx.h"></File>
|
||||
<File RelativePath="spandsp/super_tone_tx.h"></File>
|
||||
<File RelativePath="spandsp/swept_tone.h"></File>
|
||||
<File RelativePath="spandsp/t4_rx.h"></File>
|
||||
<File RelativePath="spandsp/t4_tx.h"></File>
|
||||
<File RelativePath="spandsp/t30.h"></File>
|
||||
<File RelativePath="spandsp/t30_api.h"></File>
|
||||
<File RelativePath="spandsp/t30_fcf.h"></File>
|
||||
@@ -234,8 +245,16 @@
|
||||
<File RelativePath="spandsp/t38_gateway.h"></File>
|
||||
<File RelativePath="spandsp/t38_non_ecm_buffer.h"></File>
|
||||
<File RelativePath="spandsp/t38_terminal.h"></File>
|
||||
<File RelativePath="spandsp/t4_rx.h"></File>
|
||||
<File RelativePath="spandsp/t4_tx.h"></File>
|
||||
<File RelativePath="spandsp/t4_t6_decode.h"></File>
|
||||
<File RelativePath="spandsp/t4_t6_encode.h"></File>
|
||||
<File RelativePath="spandsp/t42.h"></File>
|
||||
<File RelativePath="spandsp/t81_t82_arith_coding.h"></File>
|
||||
<File RelativePath="spandsp/t85.h"></File>
|
||||
<File RelativePath="spandsp/telephony.h"></File>
|
||||
<File RelativePath="spandsp/time_scale.h"></File>
|
||||
<File RelativePath="spandsp/timezone.h"></File>
|
||||
<File RelativePath="spandsp/timing.h"></File>
|
||||
<File RelativePath="spandsp/tone_detect.h"></File>
|
||||
<File RelativePath="spandsp/tone_generate.h"></File>
|
||||
@@ -253,6 +272,7 @@
|
||||
<File RelativePath="spandsp/vector_float.h"></File>
|
||||
<File RelativePath="spandsp/vector_int.h"></File>
|
||||
<File RelativePath="spandsp/version.h"></File>
|
||||
<File RelativePath="spandsp/private/ademco_contactid.h"></File>
|
||||
<File RelativePath="spandsp/private/adsi.h"></File>
|
||||
<File RelativePath="spandsp/private/async.h"></File>
|
||||
<File RelativePath="spandsp/private/at_interpreter.h"></File>
|
||||
@@ -271,6 +291,7 @@
|
||||
<File RelativePath="spandsp/private/gsm0610.h"></File>
|
||||
<File RelativePath="spandsp/private/hdlc.h"></File>
|
||||
<File RelativePath="spandsp/private/ima_adpcm.h"></File>
|
||||
<File RelativePath="spandsp/private/image_translate.h"></File>
|
||||
<File RelativePath="spandsp/private/logging.h"></File>
|
||||
<File RelativePath="spandsp/private/lpc10.h"></File>
|
||||
<File RelativePath="spandsp/private/modem_connect_tones.h"></File>
|
||||
@@ -293,7 +314,13 @@
|
||||
<File RelativePath="spandsp/private/t38_terminal.h"></File>
|
||||
<File RelativePath="spandsp/private/t4_rx.h"></File>
|
||||
<File RelativePath="spandsp/private/t4_tx.h"></File>
|
||||
<File RelativePath="spandsp/private/t4_t6_decode.h"></File>
|
||||
<File RelativePath="spandsp/private/t4_t6_encode.h"></File>
|
||||
<File RelativePath="spandsp/private/t42.h"></File>
|
||||
<File RelativePath="spandsp/private/t81_t82_arith_coding.h"></File>
|
||||
<File RelativePath="spandsp/private/t85.h"></File>
|
||||
<File RelativePath="spandsp/private/time_scale.h"></File>
|
||||
<File RelativePath="spandsp/private/timezone.h"></File>
|
||||
<File RelativePath="spandsp/private/tone_detect.h"></File>
|
||||
<File RelativePath="spandsp/private/tone_generate.h"></File>
|
||||
<File RelativePath="spandsp/private/v17rx.h"></File>
|
||||
|
||||
@@ -342,6 +342,10 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="ademco_contactid.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="adsi.c"
|
||||
>
|
||||
@@ -702,18 +706,15 @@
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\spandsp\private\image_translate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\spandsp\image_translate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/ademco_contactid.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/adsi.h"
|
||||
>
|
||||
@@ -842,6 +843,10 @@
|
||||
RelativePath="spandsp/ima_adpcm.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/image_translate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/logging.h"
|
||||
>
|
||||
@@ -878,6 +883,10 @@
|
||||
RelativePath="spandsp/power_meter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/private/ademco_contactid.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/private/adsi.h"
|
||||
>
|
||||
@@ -950,6 +959,10 @@
|
||||
RelativePath="spandsp/private/ima_adpcm.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/private/image_translate.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="spandsp/private/logging.h"
|
||||
>
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
<ClCompile Include="lpc10_encode.c" />
|
||||
<ClCompile Include="lpc10_placev.c" />
|
||||
<ClCompile Include="lpc10_voicing.c" />
|
||||
<ClCompile Include="math_fixed.c" />
|
||||
<ClCompile Include="modem_echo.c" />
|
||||
<ClCompile Include="modem_connect_tones.c" />
|
||||
<ClCompile Include="noise.c" />
|
||||
@@ -426,6 +427,9 @@
|
||||
<Project>{dee932ab-5911-4700-9eeb-8c7090a0a330}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="msvc\make_math_fixed_tables.2010.vcxproj">
|
||||
<Project>{9d04a840-ce18-4ff5-a6d3-0a2bb92ff2e6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="msvc\make_modem_filter.2010.vcxproj">
|
||||
<Project>{329a6fa0-0fcc-4435-a950-e670aefa9838}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
|
||||
@@ -280,6 +280,9 @@
|
||||
<ClCompile Include="t42.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="math_fixed.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="spandsp\adsi.h">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
@@ -198,6 +198,7 @@
|
||||
<ClCompile Include="lpc10_encode.c" />
|
||||
<ClCompile Include="lpc10_placev.c" />
|
||||
<ClCompile Include="lpc10_voicing.c" />
|
||||
<ClCompile Include="math_fixed.c" />
|
||||
<ClCompile Include="modem_echo.c" />
|
||||
<ClCompile Include="modem_connect_tones.c" />
|
||||
<ClCompile Include="noise.c" />
|
||||
@@ -430,6 +431,9 @@
|
||||
<Project>{dee932ab-5911-4700-9eeb-8c7090a0a330}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="msvc\make_math_fixed_tables.2012.vcxproj">
|
||||
<Project>{2386b892-35f5-46cf-a0f0-10394d2fbf9b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="msvc\make_modem_filter.2012.vcxproj">
|
||||
<Project>{329a6fa0-0fcc-4435-a950-e670aefa9838}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
@@ -438,4 +442,4 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -280,6 +280,9 @@
|
||||
<ClCompile Include="t42.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="math_fixed.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="spandsp\adsi.h">
|
||||
|
||||
@@ -78,7 +78,7 @@ static void remove_dc_bias(float speech[], int len, float sigout[])
|
||||
|
||||
static void eval_amdf(float speech[],
|
||||
int32_t lpita,
|
||||
const int32_t tau[],
|
||||
const int32_t tau[],
|
||||
int32_t ltau,
|
||||
int32_t maxlag,
|
||||
float amdf[],
|
||||
@@ -111,7 +111,7 @@ static void eval_amdf(float speech[],
|
||||
|
||||
static void eval_highres_amdf(float speech[],
|
||||
int32_t lpita,
|
||||
const int32_t tau[],
|
||||
const int32_t tau[],
|
||||
int32_t ltau,
|
||||
float amdf[],
|
||||
int32_t *minptr,
|
||||
@@ -547,11 +547,10 @@ void lpc10_analyse(lpc10_encode_state_t *s, float speech[], int32_t voice[], int
|
||||
{
|
||||
static const int32_t tau[60] =
|
||||
{
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
||||
35, 36, 37, 38, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
|
||||
60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 84, 88, 92, 96,
|
||||
100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144,
|
||||
148, 152, 156
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
||||
35, 36, 37, 38, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58,
|
||||
60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 84, 88, 92, 96,
|
||||
100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156
|
||||
};
|
||||
static const int32_t buflim[4] =
|
||||
{
|
||||
|
||||
@@ -113,8 +113,9 @@ static void bsynz(lpc10_decode_state_t *s,
|
||||
{
|
||||
static const int32_t kexc[25] =
|
||||
{
|
||||
8, -16, 26, -48, 86, -162, 294, -502, 718, -728, 184,
|
||||
672, -610, -672, 184, 728, 718, 502, 294, 162, 86, 48, 26, 16, 8
|
||||
8, -16, 26, -48, 86, -162, 294, -502, 718, -728, 184,
|
||||
672, -610, -672, 184, 728, 718, 502, 294, 162, 86, 48,
|
||||
26, 16, 8
|
||||
};
|
||||
int32_t i;
|
||||
int32_t j;
|
||||
@@ -217,11 +218,11 @@ static void bsynz(lpc10_decode_state_t *s,
|
||||
|
||||
/* Synthesize a single pitch epoch */
|
||||
static int pitsyn(lpc10_decode_state_t *s,
|
||||
int voice[],
|
||||
int voice[],
|
||||
int32_t *pitch,
|
||||
float *rms,
|
||||
float *rc,
|
||||
int32_t ivuv[],
|
||||
int32_t ivuv[],
|
||||
int32_t ipiti[],
|
||||
float *rmsi,
|
||||
float *rci,
|
||||
@@ -917,7 +918,7 @@ static void decode(lpc10_decode_state_t *s,
|
||||
/* If bit 2 of ICORF is set then smooth RMS and RC's, */
|
||||
if ((icorf & bit[1]) != 0)
|
||||
{
|
||||
if ((float) abs(s->drms[1] - s->drms[0]) >= corth[ixcor + 3]
|
||||
if ((float) abs(s->drms[1] - s->drms[0]) >= corth[ixcor + 3]
|
||||
&&
|
||||
(float) abs(s->drms[1] - s->drms[2]) >= corth[ixcor + 3])
|
||||
{
|
||||
@@ -936,7 +937,7 @@ static void decode(lpc10_decode_state_t *s,
|
||||
/* If bit 3 of ICORF is set then smooth pitch */
|
||||
if ((icorf & bit[2]) != 0)
|
||||
{
|
||||
if ((float) abs(s->dpit[1] - s->dpit[0]) >= corth[ixcor - 1]
|
||||
if ((float) abs(s->dpit[1] - s->dpit[0]) >= corth[ixcor - 1]
|
||||
&&
|
||||
(float) abs(s->dpit[1] - s->dpit[2]) >= corth[ixcor - 1])
|
||||
{
|
||||
@@ -1070,7 +1071,7 @@ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *s,
|
||||
s->dei[i] = 0.0f;
|
||||
for (i = 0; i < 3; i++)
|
||||
s->deo[i] = 0.0f;
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -38,13 +38,13 @@ void lpc10_placea(int32_t *ipitch,
|
||||
int32_t af,
|
||||
int32_t vwin[3][2],
|
||||
int32_t awin[3][2],
|
||||
int32_t ewin[3][2],
|
||||
int32_t ewin[3][2],
|
||||
int32_t lframe,
|
||||
int32_t maxwin);
|
||||
|
||||
void lpc10_placev(int32_t *osbuf,
|
||||
int32_t *osptr,
|
||||
int32_t oslen,
|
||||
int32_t oslen,
|
||||
int32_t *obound,
|
||||
int32_t vwin[3][2],
|
||||
int32_t af,
|
||||
@@ -61,8 +61,8 @@ void lpc10_voicing(lpc10_encode_state_t *st,
|
||||
const int32_t buflim[],
|
||||
int32_t half,
|
||||
float *minamd,
|
||||
float *maxamd,
|
||||
int32_t *mintau,
|
||||
float *maxamd,
|
||||
int32_t *mintau,
|
||||
float *ivrc,
|
||||
int32_t *obound);
|
||||
|
||||
|
||||
@@ -111,11 +111,10 @@ static int encode(lpc10_encode_state_t *s,
|
||||
};
|
||||
static const int32_t entau[60] =
|
||||
{
|
||||
19, 11, 27, 25, 29, 21, 23, 22, 30, 14, 15, 7, 39, 38, 46,
|
||||
42, 43, 41, 45, 37, 53, 49, 51, 50, 54, 52, 60, 56, 58, 26,
|
||||
90, 88, 92, 84, 86, 82, 83, 81, 85, 69, 77, 73, 75, 74, 78,
|
||||
70, 71, 67, 99, 97, 113, 112, 114, 98, 106, 104, 108, 100,
|
||||
101, 76
|
||||
19, 11, 27, 25, 29, 21, 23, 22, 30, 14, 15, 7, 39, 38, 46,
|
||||
42, 43, 41, 45, 37, 53, 49, 51, 50, 54, 52, 60, 56, 58, 26,
|
||||
90, 88, 92, 84, 86, 82, 83, 81, 85, 69, 77, 73, 75, 74, 78,
|
||||
70, 71, 67, 99, 97, 113, 112, 114, 98, 106, 104, 108, 100, 101, 76
|
||||
};
|
||||
static const int32_t enadd[8] =
|
||||
{
|
||||
@@ -137,14 +136,14 @@ static int encode(lpc10_encode_state_t *s,
|
||||
};
|
||||
static const int32_t rmst[64] =
|
||||
{
|
||||
1024, 936, 856, 784, 718, 656, 600, 550, 502,
|
||||
460, 420, 384, 352, 328, 294, 270, 246, 226,
|
||||
206, 188, 172, 158, 144, 132, 120, 110, 102,
|
||||
92, 84, 78, 70, 64, 60, 54, 50,
|
||||
46, 42, 38, 34, 32, 30, 26, 24,
|
||||
22, 20, 18, 17, 16, 15, 14, 13,
|
||||
12, 11, 10, 9, 8, 7, 6, 5, 4,
|
||||
3, 2, 1, 0
|
||||
1024, 936, 856, 784, 718, 656, 600, 550,
|
||||
502, 460, 420, 384, 352, 328, 294, 270,
|
||||
246, 226, 206, 188, 172, 158, 144, 132,
|
||||
120, 110, 102, 92, 84, 78, 70, 64,
|
||||
60, 54, 50, 46, 42, 38, 34, 32,
|
||||
30, 26, 24, 22, 20, 18, 17, 16,
|
||||
15, 14, 13, 12, 11, 10, 9, 8,
|
||||
7, 6, 5, 4, 3, 2, 1, 0
|
||||
};
|
||||
|
||||
int32_t idel;
|
||||
@@ -281,7 +280,7 @@ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s,
|
||||
s->z21 = 0.0f;
|
||||
s->z12 = 0.0f;
|
||||
s->z22 = 0.0f;
|
||||
|
||||
|
||||
/* State used by function lpc10_analyse */
|
||||
for (i = 0; i < 540; i++)
|
||||
{
|
||||
@@ -355,7 +354,7 @@ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s,
|
||||
|
||||
/* State used by function lpc10_pack */
|
||||
s->isync = 0;
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -56,7 +56,7 @@ void lpc10_placea(int32_t *ipitch,
|
||||
int32_t af,
|
||||
int32_t vwin[3][2],
|
||||
int32_t awin[3][2],
|
||||
int32_t ewin[3][2],
|
||||
int32_t ewin[3][2],
|
||||
int32_t lframe,
|
||||
int32_t maxwin)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ void lpc10_placea(int32_t *ipitch,
|
||||
int32_t hrange;
|
||||
int ephase;
|
||||
int32_t lrange;
|
||||
|
||||
|
||||
lrange = (af - 2)*lframe + 1;
|
||||
hrange = af*lframe;
|
||||
|
||||
@@ -181,7 +181,7 @@ void lpc10_placea(int32_t *ipitch,
|
||||
|
||||
void lpc10_placev(int32_t *osbuf,
|
||||
int32_t *osptr,
|
||||
int32_t oslen,
|
||||
int32_t oslen,
|
||||
int32_t *obound,
|
||||
int32_t vwin[3][2],
|
||||
int32_t af,
|
||||
|
||||
@@ -57,7 +57,7 @@ static void vparms(int32_t vwin[],
|
||||
int32_t half,
|
||||
float *dither,
|
||||
int32_t *mintau,
|
||||
int32_t *zc,
|
||||
int32_t *zc,
|
||||
int32_t *lbe,
|
||||
int32_t *fbe,
|
||||
float *qs,
|
||||
@@ -207,7 +207,7 @@ void lpc10_voicing(lpc10_encode_state_t *s,
|
||||
const int32_t buflim[],
|
||||
int32_t half,
|
||||
float *minamd,
|
||||
float *maxamd,
|
||||
float *maxamd,
|
||||
int32_t *mintau,
|
||||
float ivrc[],
|
||||
int32_t obound[])
|
||||
@@ -250,7 +250,7 @@ void lpc10_voicing(lpc10_encode_state_t *s,
|
||||
int32_t lbe;
|
||||
float snr2;
|
||||
|
||||
#if (_MSC_VER >= 1400)
|
||||
#if (_MSC_VER >= 1400)
|
||||
__analysis_assume(half >= 0 && half < 2);
|
||||
#endif
|
||||
inbuf_offset = 0;
|
||||
@@ -305,7 +305,7 @@ void lpc10_voicing(lpc10_encode_state_t *s,
|
||||
vparms(vwin,
|
||||
&inbuf[inbuf_offset],
|
||||
&lpbuf[lpbuf_offset],
|
||||
buflim,
|
||||
buflim,
|
||||
half,
|
||||
&s->dither,
|
||||
mintau,
|
||||
|
||||
@@ -468,7 +468,7 @@ typedef struct
|
||||
static trie_node_t *trie_node_create(void)
|
||||
{
|
||||
trie_node_t *s;
|
||||
|
||||
|
||||
if ((s = (trie_node_t *) malloc(sizeof(*s))))
|
||||
{
|
||||
memset(s, 0, sizeof(*s));
|
||||
@@ -481,7 +481,7 @@ static trie_node_t *trie_node_create(void)
|
||||
static trie_t *trie_create(void)
|
||||
{
|
||||
trie_t *s;
|
||||
|
||||
|
||||
if ((s = (trie_t *) malloc(sizeof(*s))))
|
||||
{
|
||||
memset(s, 0, sizeof(*s));
|
||||
@@ -494,7 +494,7 @@ static trie_t *trie_create(void)
|
||||
static void trie_recursive_add_node_numbers(trie_node_t *t)
|
||||
{
|
||||
int index;
|
||||
|
||||
|
||||
if (t)
|
||||
{
|
||||
if (t->first <= t->last)
|
||||
@@ -516,7 +516,7 @@ static void trie_recursive_add_node_numbers(trie_node_t *t)
|
||||
static void trie_recursive_build_packed_trie(trie_node_t *t)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (t)
|
||||
{
|
||||
if (t->first <= t->last)
|
||||
@@ -551,7 +551,7 @@ static void trie_add(trie_t *s, const char *u, size_t len)
|
||||
{
|
||||
/* The character in u we are processing... */
|
||||
index = (unsigned char) u[i];
|
||||
|
||||
|
||||
/* Is there a child node for this character? */
|
||||
if (t->child_list[index] == NULL)
|
||||
{
|
||||
@@ -561,7 +561,7 @@ static void trie_add(trie_t *s, const char *u, size_t len)
|
||||
if (index > t->last)
|
||||
t->last = index;
|
||||
}
|
||||
|
||||
|
||||
/* Move to the new node... and loop */
|
||||
t = t->child_list[index];
|
||||
}
|
||||
@@ -612,7 +612,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
trie_t *s;
|
||||
int i;
|
||||
|
||||
|
||||
s = trie_create();
|
||||
|
||||
for (i = 0; wordlist[i]; i++)
|
||||
|
||||
@@ -64,11 +64,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
/* sRGB to Linear RGB */
|
||||
r = (r > 0.04045f) ? powf((r + 0.055f)/1.055f, 2.4f) : r/12.92f;
|
||||
|
||||
|
||||
printf((i < 255) ? " %f,\n" : " %f\n", r);
|
||||
}
|
||||
printf("};\n");
|
||||
|
||||
|
||||
printf("static const uint8_t linear_to_srgb[4096] =\n");
|
||||
printf("{\n");
|
||||
for (i = 0; i < 4096; i++)
|
||||
|
||||
@@ -66,7 +66,6 @@ static void make_tx_filter(int coeff_sets,
|
||||
double carrier,
|
||||
double baud_rate,
|
||||
double excess_bandwidth,
|
||||
int fixed_point,
|
||||
const char *tag)
|
||||
{
|
||||
int i;
|
||||
@@ -75,8 +74,9 @@ static void make_tx_filter(int coeff_sets,
|
||||
int total_coeffs;
|
||||
double alpha;
|
||||
double beta;
|
||||
double gain;
|
||||
double scaling;
|
||||
double floating_gain;
|
||||
double fixed_gain;
|
||||
double fixed_scaling;
|
||||
double peak;
|
||||
double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1];
|
||||
|
||||
@@ -87,63 +87,63 @@ static void make_tx_filter(int coeff_sets,
|
||||
compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
|
||||
|
||||
/* Find the DC gain of the filter, and adjust the filter to unity gain. */
|
||||
gain = 0.0;
|
||||
floating_gain = 0.0;
|
||||
for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets)
|
||||
gain += coeffs[i];
|
||||
floating_gain += coeffs[i];
|
||||
/* Normalise the gain to 1.0 */
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
coeffs[i] /= gain;
|
||||
gain = 1.0;
|
||||
coeffs[i] /= floating_gain;
|
||||
floating_gain = 1.0;
|
||||
fixed_gain = 1.0;
|
||||
|
||||
if (fixed_point)
|
||||
peak = -1.0;
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
{
|
||||
peak = -1.0;
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
{
|
||||
if (fabs(coeffs[i]) > peak)
|
||||
peak = fabs(coeffs[i]);
|
||||
}
|
||||
scaling = 32767.0;
|
||||
if (peak >= 1.0)
|
||||
{
|
||||
scaling /= peak;
|
||||
gain = 1.0/peak;
|
||||
}
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
coeffs[i] *= scaling;
|
||||
if (fabs(coeffs[i]) > peak)
|
||||
peak = fabs(coeffs[i]);
|
||||
}
|
||||
|
||||
fixed_scaling = 32767.0f;
|
||||
if (peak >= 1.0)
|
||||
{
|
||||
fixed_scaling /= peak;
|
||||
fixed_gain = 1.0/peak;
|
||||
}
|
||||
|
||||
/* Churn out the data as a C source code header file, which can be directly included by the
|
||||
modem code. */
|
||||
printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, gain);
|
||||
printf("#if defined(SPANDSP_USE_FIXED_POINT)\n");
|
||||
printf("#define TX_PULSESHAPER%s_SCALE(x) ((int16_t) (%f*x + ((x >= 0.0) ? 0.5 : -0.5)))\n", tag, fixed_scaling);
|
||||
printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, fixed_gain);
|
||||
printf("#else\n");
|
||||
printf("#define TX_PULSESHAPER%s_SCALE(x) (x)\n", tag);
|
||||
printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, floating_gain);
|
||||
printf("#endif\n");
|
||||
printf("#define TX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets);
|
||||
printf("static const %s tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
(fixed_point) ? "int16_t" : "float",
|
||||
printf("\n");
|
||||
printf("#if defined(SPANDSP_USE_FIXED_POINT)\n");
|
||||
printf("static const int16_t tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
tag,
|
||||
tag,
|
||||
coeffs_per_filter);
|
||||
printf("#else\n");
|
||||
printf("static const float tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
tag,
|
||||
tag,
|
||||
coeffs_per_filter);
|
||||
printf("#endif\n");
|
||||
printf("{\n");
|
||||
for (j = 0; j < coeff_sets; j++)
|
||||
{
|
||||
x = j;
|
||||
printf(" {\n");
|
||||
if (fixed_point)
|
||||
printf(" %8d, /* Filter %d */\n", (int) coeffs[x], j);
|
||||
else
|
||||
printf(" %15.10ff, /* Filter %d */\n", coeffs[x], j);
|
||||
printf(" TX_PULSESHAPER%s_SCALE(%15.10ff), /* Filter %d */\n", tag, coeffs[x], j);
|
||||
for (i = 1; i < coeffs_per_filter - 1; i++)
|
||||
{
|
||||
x = i*coeff_sets + j;
|
||||
if (fixed_point)
|
||||
printf(" %8d,\n", (int) coeffs[x]);
|
||||
else
|
||||
printf(" %15.10ff,\n", coeffs[x]);
|
||||
printf(" TX_PULSESHAPER%s_SCALE(%15.10ff),\n", tag, coeffs[x]);
|
||||
}
|
||||
x = i*coeff_sets + j;
|
||||
if (fixed_point)
|
||||
printf(" %8d\n", (int) coeffs[x]);
|
||||
else
|
||||
printf(" %15.10ff\n", coeffs[x]);
|
||||
printf(" TX_PULSESHAPER%s_SCALE(%15.10ff)\n", tag, coeffs[x]);
|
||||
if (j < coeff_sets - 1)
|
||||
printf(" },\n");
|
||||
else
|
||||
@@ -158,7 +158,6 @@ static void make_rx_filter(int coeff_sets,
|
||||
double carrier,
|
||||
double baud_rate,
|
||||
double excess_bandwidth,
|
||||
int fixed_point,
|
||||
const char *tag)
|
||||
{
|
||||
int i;
|
||||
@@ -169,14 +168,12 @@ static void make_rx_filter(int coeff_sets,
|
||||
int total_coeffs;
|
||||
double alpha;
|
||||
double beta;
|
||||
double gain;
|
||||
double floating_gain;
|
||||
double fixed_gain;
|
||||
double fixed_scaling;
|
||||
double peak;
|
||||
double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1];
|
||||
#if 0
|
||||
complex_t co[MAX_COEFFS_PER_FILTER];
|
||||
#else
|
||||
double cox[MAX_COEFFS_PER_FILTER];
|
||||
#endif
|
||||
|
||||
total_coeffs = coeff_sets*coeffs_per_filter + 1;
|
||||
alpha = baud_rate/(2.0*(double) (coeff_sets*SAMPLE_RATE));
|
||||
@@ -186,84 +183,54 @@ static void make_rx_filter(int coeff_sets,
|
||||
compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta);
|
||||
|
||||
/* Find the DC gain of the filter, and adjust the filter to unity gain. */
|
||||
gain = 0.0;
|
||||
floating_gain = 0.0;
|
||||
for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets)
|
||||
gain += coeffs[i];
|
||||
floating_gain += coeffs[i];
|
||||
/* Normalise the gain to 1.0 */
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
coeffs[i] /= gain;
|
||||
gain = 1.0;
|
||||
coeffs[i] /= floating_gain;
|
||||
floating_gain = 1.0;
|
||||
fixed_gain = 1.0;
|
||||
|
||||
if (fixed_point)
|
||||
peak = -1.0;
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
{
|
||||
peak = -1.0;
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
{
|
||||
if (fabs(coeffs[i]) > peak)
|
||||
peak = fabs(coeffs[i]);
|
||||
}
|
||||
gain = 32767.0;
|
||||
if (peak >= 1.0)
|
||||
gain /= peak;
|
||||
for (i = 0; i < total_coeffs; i++)
|
||||
coeffs[i] *= gain;
|
||||
if (fabs(coeffs[i]) > peak)
|
||||
peak = fabs(coeffs[i]);
|
||||
}
|
||||
fixed_scaling = 32767.0f;
|
||||
if (peak >= 1.0)
|
||||
{
|
||||
fixed_scaling /= peak;
|
||||
fixed_gain = 1.0/peak;
|
||||
}
|
||||
|
||||
/* Churn out the data as a C source code header file, which can be directly included by the
|
||||
modem code. */
|
||||
printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, gain);
|
||||
printf("#if defined(SPANDSP_USE_FIXED_POINT)\n");
|
||||
printf("#define RX_PULSESHAPER%s_SCALE(x) ((int16_t) (%f*x + ((x >= 0.0) ? 0.5 : -0.5)))\n", tag, fixed_scaling);
|
||||
printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, fixed_gain);
|
||||
printf("#else\n");
|
||||
printf("#define RX_PULSESHAPER%s_SCALE(x) (x)\n", tag);
|
||||
printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, floating_gain);
|
||||
printf("#endif\n");
|
||||
printf("#define RX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets);
|
||||
#if 0
|
||||
printf("static const %s rx_pulseshaper%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
(fixed_point) ? "complexi16_t" : "complexf_t",
|
||||
tag,
|
||||
tag,
|
||||
coeffs_per_filter);
|
||||
printf("{\n");
|
||||
for (j = 0; j < coeff_sets; j++)
|
||||
{
|
||||
/* Complex modulate the filter, to make it a complex pulse shaping bandpass filter
|
||||
centred at the nominal carrier frequency. Use the same phase for all the coefficient
|
||||
sets. This means the modem can step the carrier in whole samples, and not worry about
|
||||
the fractional sample shift caused by selecting amongst the various coefficient sets. */
|
||||
for (i = 0; i < coeffs_per_filter; i++)
|
||||
{
|
||||
m = i - (coeffs_per_filter >> 1);
|
||||
x = i*coeff_sets + j;
|
||||
co[i].re = coeffs[x]*cos(carrier*m);
|
||||
co[i].im = coeffs[x]*sin(carrier*m);
|
||||
}
|
||||
printf(" {\n");
|
||||
if (fixed_point)
|
||||
printf(" {%8d, %8d}, /* Filter %d */\n", (int) co[i].re, (int) co[i].im, j);
|
||||
else
|
||||
printf(" {%15.10ff, %15.10ff}, /* Filter %d */\n", co[0].re, co[0].im, j);
|
||||
for (i = 1; i < coeffs_per_filter - 1; i++)
|
||||
{
|
||||
if (fixed_point)
|
||||
printf(" {%8d, %8d},\n", (int) co[i].re, (int) co[i].im);
|
||||
else
|
||||
printf(" {%15.10ff, %15.10ff},\n", co[i].re, co[i].im);
|
||||
}
|
||||
if (fixed_point)
|
||||
printf(" {%8d, %8d}\n", (int) co[i].re, (int) co[i].im);
|
||||
else
|
||||
printf(" {%15.10ff, %15.10ff}\n", co[i].re, co[i].im);
|
||||
if (j < coeff_sets - 1)
|
||||
printf(" },\n");
|
||||
else
|
||||
printf(" }\n");
|
||||
}
|
||||
printf("};\n");
|
||||
#else
|
||||
for (k = 0; k < 2; k++)
|
||||
{
|
||||
printf("static const %s rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
(fixed_point) ? "int16_t" : "float",
|
||||
printf("\n");
|
||||
printf("#if defined(SPANDSP_USE_FIXED_POINT)\n");
|
||||
printf("static const int16_t rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
tag,
|
||||
(k == 0) ? "re" : "im",
|
||||
tag,
|
||||
coeffs_per_filter);
|
||||
printf("#else\n");
|
||||
printf("static const float rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n",
|
||||
tag,
|
||||
(k == 0) ? "re" : "im",
|
||||
tag,
|
||||
coeffs_per_filter);
|
||||
printf("#endif\n");
|
||||
printf("{\n");
|
||||
for (j = 0; j < coeff_sets; j++)
|
||||
{
|
||||
@@ -281,21 +248,10 @@ static void make_rx_filter(int coeff_sets,
|
||||
cox[i] = coeffs[x]*sin(carrier*m);
|
||||
}
|
||||
printf(" {\n");
|
||||
if (fixed_point)
|
||||
printf(" %8d, /* Filter %d */\n", (int) cox[0], j);
|
||||
else
|
||||
printf(" %15.10ff, /* Filter %d */\n", cox[0], j);
|
||||
printf(" RX_PULSESHAPER%s_SCALE(%15.10ff), /* Filter %d */\n", tag, cox[0], j);
|
||||
for (i = 1; i < coeffs_per_filter - 1; i++)
|
||||
{
|
||||
if (fixed_point)
|
||||
printf(" %8d,\n", (int) cox[i]);
|
||||
else
|
||||
printf(" %15.10ff,\n", cox[i]);
|
||||
}
|
||||
if (fixed_point)
|
||||
printf(" %8d\n", (int) cox[i]);
|
||||
else
|
||||
printf(" %15.10ff\n", cox[i]);
|
||||
printf(" RX_PULSESHAPER%s_SCALE(%15.10ff),\n", tag, cox[i]);
|
||||
printf(" RX_PULSESHAPER%s_SCALE(%15.10ff)\n", tag, cox[i]);
|
||||
if (j < coeff_sets - 1)
|
||||
printf(" },\n");
|
||||
else
|
||||
@@ -303,13 +259,12 @@ static void make_rx_filter(int coeff_sets,
|
||||
}
|
||||
printf("};\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stderr, "Usage: make_modem_rx_filter -m <V.17 | V.22bis | V.22bis1200 | V.22bis2400 | V.27ter2400 | V.27ter4800 | V.29> [-i] [-r] [-t]\n");
|
||||
fprintf(stderr, "Usage: make_modem_rx_filter -m <V.17 | V.22bis | V.22bis1200 | V.22bis2400 | V.27ter2400 | V.27ter4800 | V.29> [-r] [-t]\n");
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
|
||||
@@ -321,7 +276,6 @@ int main(int argc, char **argv)
|
||||
int tx_coeffs_per_filter;
|
||||
int opt;
|
||||
int transmit_modem;
|
||||
int fixed_point;
|
||||
double carrier;
|
||||
double baud_rate;
|
||||
double rx_excess_bandwidth;
|
||||
@@ -330,16 +284,12 @@ int main(int argc, char **argv)
|
||||
const char *tx_tag;
|
||||
const char *modem;
|
||||
|
||||
fixed_point = FALSE;
|
||||
transmit_modem = FALSE;
|
||||
modem = "";
|
||||
while ((opt = getopt(argc, argv, "im:rt")) != -1)
|
||||
while ((opt = getopt(argc, argv, "m:rt")) != -1)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'i':
|
||||
fixed_point = TRUE;
|
||||
break;
|
||||
case 'm':
|
||||
modem = optarg;
|
||||
break;
|
||||
@@ -607,7 +557,6 @@ int main(int argc, char **argv)
|
||||
carrier,
|
||||
baud_rate,
|
||||
tx_excess_bandwidth,
|
||||
fixed_point,
|
||||
tx_tag);
|
||||
}
|
||||
else
|
||||
@@ -617,7 +566,6 @@ int main(int argc, char **argv)
|
||||
carrier,
|
||||
baud_rate,
|
||||
rx_excess_bandwidth,
|
||||
fixed_point,
|
||||
rx_tag);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -180,7 +180,7 @@ SPAN_DECLARE(int16_t) fixed_sin(uint16_t x)
|
||||
}
|
||||
z = fixed_sine_table[step] + ((frac*(fixed_sine_table[step_after] - fixed_sine_table[step])) >> 6);
|
||||
if ((x & 0x8000))
|
||||
z = -z;
|
||||
z = -z;
|
||||
return z;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -206,7 +206,7 @@ SPAN_DECLARE(int16_t) fixed_cos(uint16_t x)
|
||||
}
|
||||
z = fixed_sine_table[step] + ((frac*(fixed_sine_table[step_after] - fixed_sine_table[step])) >> 6);
|
||||
if ((x & 0x8000))
|
||||
z = -z;
|
||||
z = -z;
|
||||
return z;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -227,7 +227,7 @@ SPAN_DECLARE(uint16_t) fixed_atan2(int16_t y, int16_t x)
|
||||
return ((y & 0x8000) | 0x4000);
|
||||
abs_x = abs(x);
|
||||
abs_y = abs(y);
|
||||
|
||||
|
||||
if (abs_y < abs_x)
|
||||
{
|
||||
recip = fixed_reciprocal16(abs_x, &shift);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* License along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*! \file */
|
||||
|
||||
/* CNG is 0.5s+-15% of 1100+-38Hz, 3s+-15% off, repeating.
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
ANS/ is 3.3+-0.7s of 2100+-15Hz, with phase reversals (180+-10 degrees, hopping in <1ms) every 450+-25ms.
|
||||
|
||||
ANSam/ is 2100+-1Hz, with phase reversals (180+-10 degrees, hopping in <1ms) every 450+-25ms, and AM with a sinewave of 15+-0.1Hz.
|
||||
ANSam/ is 2100+-1Hz, with phase reversals (180+-10 degrees, hopping in <1ms) every 450+-25ms, and AM with a sinewave of 15+-0.1Hz.
|
||||
The modulated envelope ranges in amplitude between (0.8+-0.01) and (1.2+-0.01) times its average
|
||||
amplitude. It lasts up to 5s, but will be stopped early if the V.8 protocol proceeds. */
|
||||
|
||||
@@ -702,7 +702,7 @@ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx_fillin(modem_connect_tones_rx_st
|
||||
SPAN_DECLARE(int) modem_connect_tones_rx_get(modem_connect_tones_rx_state_t *s)
|
||||
{
|
||||
int x;
|
||||
|
||||
|
||||
x = s->hit;
|
||||
s->hit = MODEM_CONNECT_TONES_NONE;
|
||||
return x;
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
#endif
|
||||
#endif // VC8+
|
||||
|
||||
// disable the following warnings
|
||||
#pragma warning(disable:4100) // The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
||||
// disable the following warnings
|
||||
#pragma warning(disable:4100) // The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored.
|
||||
#pragma warning(disable:4200) // Non standard extension C zero sized array
|
||||
#pragma warning(disable:4706) // assignment within conditional expression
|
||||
#pragma warning(disable:4244) // conversion from 'type1' to 'type2', possible loss of data
|
||||
|
||||
@@ -48,10 +48,10 @@ typedef __int64 int64_t;
|
||||
#endif
|
||||
|
||||
#if !defined(INT16_MAX)
|
||||
#define INT16_MAX 0x7FFF
|
||||
#define INT16_MAX 0x7FFF
|
||||
#endif
|
||||
#if !defined(INT16_MIN)
|
||||
#define INT16_MIN (-INT16_MAX - 1)
|
||||
#define INT16_MIN (-INT16_MAX - 1)
|
||||
#endif
|
||||
|
||||
#if !defined(INT32_MAX)
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="All|Win32">
|
||||
<Configuration>All</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>make_math_fixed_tables</ProjectName>
|
||||
<ProjectGuid>{9D04A840-CE18-4FF5-A6D3-0A2BB92FF2E6}</ProjectGuid>
|
||||
<RootNamespace>make_math_fixed_tables</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='All|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='All|Win32'">$(PlatformName)\make_at_dictionary\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='All|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog $(ProjectName).htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;.\spandsp;.\msvc;..\..\tiff-4.0.2\libtiff;.\generated;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(TargetPath)" >"$(ProjectDir)..\math_fixed_tables.h"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\make_math_fixed_tables.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\make_math_fixed_tables.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="All|Win32">
|
||||
<Configuration>All</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>make_math_fixed_tables</ProjectName>
|
||||
<ProjectGuid>{2386B892-35F5-46CF-A0F0-10394D2FBF9B}</ProjectGuid>
|
||||
<RootNamespace>make_at_dictionary</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='All|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='All|Win32'">$(PlatformName)\make_at_dictionary\$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='All|Win32'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='All|Win32'">
|
||||
<BuildLog>
|
||||
<Path>$(IntDir)BuildLog $(ProjectName).htm</Path>
|
||||
</BuildLog>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;.\spandsp;.\msvc;..\..\tiff-4.0.2\libtiff;.\generated;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(TargetPath)" >"$(ProjectDir)..\math_fixed_tables.h"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\make_math_fixed_tables.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\make_math_fixed_tables.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -53,31 +53,31 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(TargetPath)" -m V.17 -i -r >"$(ProjectDir)..\v17_v32bis_rx_fixed_rrc.h"
|
||||
<Command>"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.17 -i -t >"$(ProjectDir)..\v17_v32bis_tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.22bis1200 -i -r >"$(ProjectDir)..\v22bis_rx_1200_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -i -r >"$(ProjectDir)..\v22bis_rx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -i -t >"$(ProjectDir)..\v22bis_tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.27ter2400 -i -r >"$(ProjectDir)..\v27ter_rx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -i -r >"$(ProjectDir)..\v27ter_rx_4800_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -i -t >"$(ProjectDir)..\v27ter_tx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -i -t >"$(ProjectDir)..\v27ter_tx_4800_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.29 -i -r >"$(ProjectDir)..\v29rx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -i -t >"$(ProjectDir)..\v29tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_floating_rrc.h"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
||||
@@ -54,31 +54,31 @@
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>"$(TargetPath)" -m V.17 -i -r >"$(ProjectDir)..\v17_v32bis_rx_fixed_rrc.h"
|
||||
<Command>"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.17 -i -t >"$(ProjectDir)..\v17_v32bis_tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_rrc.h"
|
||||
"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.22bis1200 -i -r >"$(ProjectDir)..\v22bis_rx_1200_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -i -r >"$(ProjectDir)..\v22bis_rx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -i -t >"$(ProjectDir)..\v22bis_tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_rrc.h"
|
||||
"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.27ter2400 -i -r >"$(ProjectDir)..\v27ter_rx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -i -r >"$(ProjectDir)..\v27ter_rx_4800_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -i -t >"$(ProjectDir)..\v27ter_tx_2400_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -i -t >"$(ProjectDir)..\v27ter_tx_4800_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_floating_rrc.h"
|
||||
|
||||
"$(TargetPath)" -m V.29 -i -r >"$(ProjectDir)..\v29rx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_floating_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -i -t >"$(ProjectDir)..\v29tx_fixed_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_rrc.h"
|
||||
"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_floating_rrc.h"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
|
||||
@@ -101,6 +101,9 @@
|
||||
#include <spandsp/v22bis.h>
|
||||
#include <spandsp/v27ter_rx.h>
|
||||
#include <spandsp/v27ter_tx.h>
|
||||
#if defined(SPANDSP_SUPPORT_V34)
|
||||
#include <spandsp/v34.h>
|
||||
#endif
|
||||
#include <spandsp/v18.h>
|
||||
#include <spandsp/timezone.h>
|
||||
#include <spandsp/t4_rx.h>
|
||||
|
||||
@@ -159,7 +159,7 @@ static int16_t decode(oki_adpcm_state_t *s, uint8_t adpcm)
|
||||
*
|
||||
* x = adpcm & 0x07;
|
||||
* e = (step_size[s->step_index]*(x + x + 1)) >> 3;
|
||||
*
|
||||
*
|
||||
* Seems an obvious improvement on a modern machine, but remember
|
||||
* the truncation errors do not come out the same. It would
|
||||
* not, therefore, be an exact match for what this code is doing.
|
||||
@@ -251,7 +251,7 @@ SPAN_DECLARE(oki_adpcm_state_t *) oki_adpcm_init(oki_adpcm_state_t *s, int bit_r
|
||||
}
|
||||
memset(s, 0, sizeof(*s));
|
||||
s->bit_rate = bit_rate;
|
||||
|
||||
|
||||
return s;
|
||||
}
|
||||
/*- End of function --------------------------------------------------------*/
|
||||
@@ -281,7 +281,7 @@ SPAN_DECLARE(int) oki_adpcm_decode(oki_adpcm_state_t *s,
|
||||
int samples;
|
||||
float z;
|
||||
|
||||
#if (_MSC_VER >= 1400)
|
||||
#if (_MSC_VER >= 1400)
|
||||
__analysis_assume(s->phase >= 0 && s->phase <= 4);
|
||||
#endif
|
||||
samples = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user