### README (README.md)
# FreeSWITCH
FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device. Combined with our hosted cloud platform, SignalWire, FreeSWITCH can interconnect with the outside world and scale to any size.
Visit [https://signalwire.com](https://signalwire.com/) or https://github.com/signalwire for more info.
## Getting Started
FreeSWITCH is available on [Github](https://github.com/signalwire/freeswitch) in source code format. You can checkout the development branch and build for many popular platforms including Linux, Windows, MacOSX and BSD. There is an issue tracker and pull request system available as part of the repo online.
See https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/ for more detailed instructions.
## Additional Help
If you need assistance or have an interest in using a commercially supported build, you can contact coreteam@freeswitch.com to learn about professional services to support your project.
## Voice-over-IP services - SIP / SMS - App Integrations
[SignalWire](https://signalwire.com) is the primary sponsor of the FreeSWITCH project and was founded by the original developers of FreeSWITCH. SignalWire provides scalable services to enhance and scale your project such as SMS, SIP, Serverless Application hosting as well as programmable telecom. mod_signalwire which is distributed in this code base allows you to instantly pair with SignalWire and extend your FreeSWITCH.
## Documentation
The main index for documentation is available at:
* https://freeswitch.org/confluence/
### Release notes:
* https://freeswitch.org/confluence/display/FREESWITCH/Release+Notes
### Install from packages
Step by step tutorials to install FreeSWITCH from packages:
* [Using FSGET](/scripts/packaging) [Recommended]
* [Debian](https://freeswitch.org/confluence/display/FREESWITCH/Debian)
* [Raspberry Pi](https://freeswitch.org/confluence/display/FREESWITCH/Raspberry+Pi)
* [CentOS 7](https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7)
### Build from source
Example Dockerfiles to build FreeSWITCH and dependencies from source:
* https://github.com/signalwire/freeswitch/tree/master/docker/examples
Step by step tutorials to build FreeSWITCH with provided dependency packages:
* [Debian](https://freeswitch.org/confluence/display/FREESWITCH/Debian#Debian-buildfromsource) [Recommended]
* [Raspberry Pi](https://freeswitch.org/confluence/display/FREESWITCH/Raspberry+Pi)
* [CentOS 7](https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7)
### How to build Debian packages
* [Using FSDEB](/scripts/packaging/build)
## Downloads
* [Tarballs](https://files.freeswitch.org/releases/freeswitch/)
* [Windows Installer](http://files.freeswitch.org/windows/installer/x64/)
* [Windows Sound Packages](https://github.com/freeswitch/freeswitch-sounds/releases)
## Contributions
GitHub pull requests are the recommended way to contribute to the FreeSWITCH source code:
* https://github.com/signalwire/freeswitch/pulls
## Community
Slack is our chat system where the developers, the FreeSWITCH team, and the most active users are present.
This is the place to get answers faster and chat with other users in real time. All you need to do is enter your email and verify it on the Slack signup page and you are ready to join in the discussion!
Slack Community:
* https://signalwire.community/
Mailing list (ARCHIVED):
* http://lists.freeswitch.org/pipermail/freeswitch-users/
**Thank you for using FreeSWITCH!**
---
### SECURITY (SECURITY.md)
# Security Policy
## Reporting a Vulnerability
Send an e-mail to security@signalwire.com to report a vulnerability. If accepted, we'll create a security advisory and add you and your team as collaborators. Please allow our team sufficient time to resolve the vulnerability before disclosing it; we'll remain in contact about the fix and may ask for your assistance to verify it is resolved.
---
### Conf/Minimal/README (conf/minimal/README.md)
## Minimal FreeSWITCH Configuration
The default "vanilla" configuration that comes with FreeSWITCH has
been designed as a showcase of the configurability of the myriad of
features that FreeSWITCH comes with out of the box. While it is very
helpful in tinkering with FreeSWITCH, it has a lot of extraneous stuff
enabled/configured for use in a production system. This configuration
aims to take the reverse stance -- it attempts to be a starting point
for configuring a new system by "adding" required features (instead of
removing them as one would do if one starts with the default
configuration).
This folder also includes the corresponding `modules.conf` that lists
the modules that are required to get this configuration working.
### Test
This configuration was tested by sending an INVITE (without
registration) using the `siprtp` example program that comes with
PJSIP, and verifying that the info dump is produced on the FreeSWITCH
console.
$ ./siprtp -q -p 1234 "sip:stub@$(my_ip):5080"
### Upstream
The configuration in this folder comes from
[mx4492/freeswitch-minimal-conf](https://github.com/mx4492/freeswitch-minimal-conf/commit/270941d6f2dca279f1bb8762d072940273d5ae11).
### Other Minimal Configurations
* [voxserv/freeswitch_conf_minimal](https://github.com/voxserv/freeswitch_conf_minimal)
---
### Conf/Vanilla/README IMPORTANT (conf/vanilla/README_IMPORTANT.txt)
-= PLEASE READ THIS BEFORE YOU PUT A FreeSWITCH BOX INTO PRODUCTION =-
This configuration, generally known as the "default configuration" for FreeSWITCH, is *NOT* designed to be put into a production environment without some important modifications. Please keep in mind that the default configuration is designed to demonstrate what FreeSWITCH *can* do, not what it *should* do in your specific scenario.
*** SECURING YOUR SERVER ***
By default, FreeSWITCH starts up and does a NATPMP and UPnP request to your router. If your router supports either of these protocols then FreeSWITCH does two things:
#1 - It gets the external IP address, which it uses for SIP communications
#2 - It causes there to be a "pinhole" opened up in the router allowing inbound communications to your FreeSWITCH server
Please re-read #2. Now, please re-read #2 again. If you do not want a pinhole coming through your router then DO NOT USE the "auto-nat" tools. The way to disable the auto-nat (that is, UPnP/NATPMP) checking is to start FreeSWITCH with the "-nonat" flag. Easy enough.
If you are planning on putting a system into production then you had better pay attention to security in other areas as well. If you are behind a firewall then make sure your firewall is actually protecting you. If you have your server on a public-facing Internet connection then we recommend a few things:
#1 - Consider using iptables (Linux/Unix)
#2 - Consider using fail2ban (see http://wiki.freeswitch.org/wiki/Fail2ban)
*** SECURING YOUR USERS ***
By default, the static XML files have 20 "directory users" in conf/directory/10xx.xml, numbered 1000-1019. Also, the default dialplan has routing for calls to those same extension numbers. (NOTE: the directory and the dialplan are 100% separate concepts. Check out chapters 3-5 of the awesome FreeSWITCH book for details.)
The default users all have *very* simple passwords for SIP credentials and voicemail. If you put those into a production system then you are either brave, ignorant, or stupid. Please don't be any of those three things! You have a few choices for handling your users:
#1 - Delete the static XML files and use mod_xml_curl for dynamic users from a back-end database
#2 - Manually edit the static XML user directory files and modify the passwords
#3 - Run the handy randomize-passwords.pl script found in scripts/perl/ subdirectory under the main FreeSWITCH source directory
*** GETTING HELP ***
FreeSWITCH has a thriving on-line community - we welcome you to join us!
IRC: #freeswitch on irc.freenode.net
Mailing List: freeswitch-users on lists.freeswitch.org
You can also get professional FreeSWITCH assistance by visiting http://www.freeswitchsolutions.com or sending an email to consulting@freeswitch.org.
Happy FreeSWITCHing!
---
### Debian/License Reconcile.Yml (debian/license-reconcile.yml)
Rules:
rules:
-
Glob: libs/miniupnpc/*
Matches: Thomas\sBERNARD
Copyright: Thomas Bernard
-
Glob: libs/miniupnpc/bsdqueue.h
Matches: The\sRegents\sof\sthe\sUniversity\sof\sCalifornia.\s+All\srights\sreserved.
Copyright: The Regents of the University of California.
-
Glob: libs/sofia-sip/libsofia-sip-ua/su/poll.c
Matches: Free\sSoftware\sFoundation,\sInc.
Copyright: Free Software Foundation, Inc.
Copyright: Nokia Corporation.
-
Glob: libs/sofia-sip/libsofia-sip-ua/su/strtoull.c
Copyright: Sun Microsystems, Inc.
-
Glob: libs/sofia-sip/libsofia-sip-ua/su/su_md5.c
Copyright: Nokia Corporation
License: LGPL-2.1+
-
Glob: libs/srtp/update.sh
Copyright: Ingate Systems AB
-
Glob: src/g711.c
Matches: Copyright\s\(C\)\s2006\sSteve\sUnderwood
Matches: \spublic\sdomain\sfor\sthe\sbenefit\sof\sall\smankind
Copyright: 2006 Abandoned Steve Underwood
License: public-domain
-
Glob: src/include/g711.h
Matches: Copyright\s\(C\)\s2001\sSteve\sUnderwood
Matches: \spublic\sdomain\sfor\sthe\sbenefit\sof\sall\smankind
Copyright: 2001 Abandoned Steve Underwood
License: public-domain
-
Glob: src/switch_mprintf.c
Matches: the\spublic\sdomain.
License: public-domain
-
Glob: src/switch_xml.c
Matches: without\slimitation\sthe\srights\sto\suse,\scopy,\smodify,\smerge,\spublish,
License: MPL-1.1 or BSD-like
-
Glob: src/include/switch_xml.h
Matches: without\slimitation\sthe\srights\sto\suse,\scopy,\smodify,\smerge,\spublish,
License: MPL-1.1 or BSD-like
-
Glob: src/include/switch_cpp.h
Matches: Author[:]\sYossi\sNeiman\s,\s\(C\)\s2007////\sCopyright[:]
Copyright: 2007 Yossi Neiman
-
Glob: libs/win32/sqlite/*.[ch]
Matches: The\sauthor\sdisclaims\scopyright\sto\sthis\ssource\scode.
Copyright: 2006 Abandoned D. Richard Hipp
License: public-domain
-
Glob: libs/libtpl-1.5/src/tpl.[ch]
Matches: Copyright\s\(c\)\s2005-2010,\sTroy\sD.\sHanson\s+http://tpl.sourceforge.net
Copyright: 2005-2010, Troy D. Hanson
-
Glob: libs/win32/sqlite/parse.c
Matches: The\sauthor\sdisclaims\scopyright\sto\sthis\ssource\scode.
License: public-domain
-
Glob: libs/apr-util/crypto/apr_md5.c
Matches: Licensed\sunder\sthe\sApache\sLicense,\sVersion\s2.0
Matches: THE\sBEER-WARE\sLICENSE
License: RSA and Apache-2.0 and Beerware
Copyright: 1991-1992, RSA Data Security, Inc.
Copyright: 2000-2005 The Apache Software Foundation or its licensors
Copyright: phk@login.dknet.dk
-
Glob: libs/apr-util/*/apr_md[45].[ch]
Matches: Copyright\s\(C\)\s1991-2,\sRSA\sData\sSecurity,\sInc.
Copyright: 1991-1992, RSA Data Security, Inc.
-
Glob: libs/apr/file_io/unix/mktemp.c
Matches: The\sASF\slicenses\sthis\sfile\sto\sYou\sunder\sthe\sApache\sLicense,\sVersion\s2.0
Matches: Copyright\s\(c\)\s1987,\s1993
Matches: The\sRegents\sof\sthe\sUniversity\sof\sCalifornia.\s+All\srights\sreserved.
Copyright: 1987, 1993 The Regents of the University of California
License: Apache-2.0 or BSD-4-clause
-
Glob: libs/apr/strings/apr_strings.c
Matches: The\sASF\slicenses\sthis\sfile\sto\sYou\sunder\sthe\sApache\sLicense,\sVersion\s2.0
Matches: Copyright\s\(c\)\s1987,\s1993
Matches: The\sRegents\sof\sthe\sUniversity\sof\sCalifornia.\s+All\srights\sreserved.
Copyright: 1990, 1993 The Regents of the University of California
License: Apache-2.0 or BSD-4-clause
-
Glob: libs/apr/dso/aix/dso.c
Matches: Copyright\s\(c\)\s1992,1993,1995,1996,1997,1988
Matches: Jens-Uwe\sMager,\sHelios\sSoftware\sGmbH,\sHannover,\sGermany.
Copyright: 1992-1998 Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany.
-
Glob: libs/apr/build/NWGNUtail.inc
Matches: NLM_COPYRIGHT\s=\sLicensed\sto\sthe\sApache\sSoftware\sFoundation\s\(ASF\)\sunder\sone\sor\smore
Copyright: The Apache Software Foundation or its licensors
-
Glob: libs/apr/include/apr_fnmatch.h
Matches: Copyright\s\(c\)\s1992,\s1993
Matches: The\sRegents\sof\sthe\sUniversity\sof\sCalifornia.
Copyright: 1992, 1993 The Regents of the University of California.
-
Glob: libs/apr-util/ldap/apr_ldap_url.c
Matches: Copyright\s2000-2005\sThe\sApache\sSoftware\sFoundation\sor\sits\slicensors
Copyright: 2000-2005 The Apache Software Foundation or its licensors
Matches: Copyright\s1998-2002\sThe\sOpenLDAP\sFoundation
Copyright: 1998-2002 The OpenLDAP Foundation
Matches: Copyright\s\(c\)\s1992-1996\sRegents\sof\sthe\sUniversity\sof\sMichigan.
Copyright: 1992-1996 Regents of the University of Michigan.
Matches: http://www.OpenLDAP.org/license.html\sor\sin\sfile\sLICENSE\sin\sthe
License: Apache-2.0 and OpenLDAP and BSD-like
Justification: silly hack to shut up the 'by' problem
-
Glob: libs/js/*
Matches: Version:\sMPL\s1.1/GPL\s2.0/LGPL\s2.1
Matches: Portions\screated\sby\sthe\sInitial\sDeveloper\sare\sCopyright\s\(C\)\s(1998-|)2000
Matches: GNU\sGeneral\sPublic\sLicense\sVersion\s2\sor\slater
Matches: GNU\sLesser\sGeneral\sPublic\sLicense\sVersion\s2.1\sor\slater
Matches: the\sterms\sof\sany\sone\sof\sthe\sMPL,\sthe\sGPL\sor\sthe\sLGPL.
License: MPL-1.1 or GPL-2+ or LGPL-2.1+
Copyright: 1998-2000 Netscape Communications Corporation.
-
Glob: libs/js/*
Matches: Version:\sMPL\s1.1/GPL\s2.0/LGPL\s2.1
Matches: Portions\screated\sby\sthe\sInitial\sDeveloper\sare\sCopyright\s\(C\)\s(1998-|)2000
License: MPL-1.1 or GPL-2 or LGPL-2.1
Copyright: 1998-2000 Netscape Communications Corporation.
-
Glob: libs/js/*
Matches: the\sLicense\sat\shttp://www.mozilla.org/MPL/
Matches: GNU\sGeneral\sPublic\sLicense\sVersion\s2\sor\slater
License: MPL-1.1 or GPL-2+
-
Glob: libs/libwebsockets/win32port/zlib/inftrees.c
Matches: Copyright\s1995-2010\sMark\sAdler\s.;
Copyright: 1995-2010 Mark Adler
-
Glob: libs/libwebsockets/lib/sha-1.c
Matches: Copyright\s\(C\)\s1995,\s1996,\s1997,\sand\s1998\sWIDE\sProject.
Copyright: 1995-1998 WIDE Project.
-
Glob: libs/libsndfile/programs/common.h
Matches: Copyright\s\(C\)\s1999-2009\sErik\sde\sCastro\sLopo\s
Matches: const\schar\s\*\scopyright\s;
Copyright: 1999-2009 Erik de Castro Lopo
Justification: prevent false-psitive copyright detection
-
Glob: libs/esl/getopt/getopt_long.c
Matches: This\scode\sis\sderived\sfrom\ssoftware\scontributed\sto\sThe\sNetBSD\sFoundation
License: BSD-2-clause
-
Glob: libs/silk/*
Matches: Copyright\s\(c\)\s2006-2011,\sSkype\sLimited.
Matches: THIS\sSOFTWARE\sIS\sPROVIDED\sBY\sTHE\sCOPYRIGHT\sHOLDERS\sAND
Copyright: 2006-2011, Skype Limited.
-
Glob: debian/*
Copyright: 2012 Travis Cross
License: MPL-1.1 or GPL-2+
---
### Docker/README (docker/README.md)
# Docker Setup
These are the official Docker files for master branch and the current release packages.
## Volumes
These containers are set up so that you can mount your freeswitch configuration from a host or data volume container.
To mount freeswitch Configuration
```
-v $(pwd)/configuration:/etc/freeswitch
```
To mount tmp directory for storing recordings, etc
```
-v $(pwd)/tmp:/tmp
```
The container also has a healthcheck where it does a fs_cli status check to make sure the freeswitch service is still running.
## Ports
The container should be run with host networking using `docker run --network host ...`.
If you prefer to (or for some reason must) publish individual ports via `--publish/-p`, refer to this [issue](https://github.com/moby/moby/issues/11185) and this [potential workaround](https://hub.docker.com/r/bettervoice/freeswitch-container/) regarding using docker with large port ranges.
The following ports will be used, depending upon your specific configuration:
- 5060/tcp, 5060/udp, 5080/tcp, 5080/udp - SIP signaling
- 5061/tcp, 5081/tcp - SIPS signaling
- 5066/tcp, 7443/tcp - WebSocket signaling
- 8021/tcp - the Event Socket
- 16384-32768/udp, 64535-65535/udp - media
If you wish to help improve these please submit a pull request at:
https://github.com/signalwire/freeswitch
Thanks,
/b
---
### Docker/Base Image/README (docker/base_image/README.md)
About
-----
This is minimized official FreeSwitch docker container.
Container designed to run on host network.
Size of container decreased to 120MB (54MB compressed)
Significantly increased security:
1) removed all libs except libc, busybox, freeswitch and dependent libs.
2) removed 'system' API command from vanila config
3) updated FreeSwitch default SIP password to random value
Used environment variables
--------------------------
1) ```SOUND_RATES``` - rates of sound files that must be downloaded and installed. Available values ```8000```, ```16000```, ```32000```, ```48000```. May defined multiply values using semicolon as delimiter. Example ```SOUND_RATES=8000:16000```;
2) ```SOUND_TYPES``` - types of sound files that must be downloaded and installed. Available values music, ```en-us-callie```, ```en-us-allison```, ```ru-RU-elena```, ```en-ca-june```, ```fr-ca-june```, ```pt-BR-karina```, ```sv-se-jakob```, ```zh-cn-sinmei```, ```zh-hk-sinmei```. Example ```SOUND_TYPES=music:en-us-callie```;
3) ```EPMD``` - start epmd daemon, useful when you use mod_erlang and mod_kazoo FreeSwitch modules. Available values ```true```, ```false```.
Usage container
---------------
1) Creating volume for sound files. This may be skipped if you not use freeswitch MOH and other sound files.
```sh
docker volume create --name freeswitch-sounds
```
2) Stating container
```sh
docker run --net=host --name freeswitch \
-e SOUND_RATES=8000:16000 \
-e SOUND_TYPES=music:en-us-callie \
-v freeswitch-sounds:/usr/share/freeswitch/sounds \
-v /etc/freeswitch/:/etc/freeswitch \
safarov/freeswitch
```
systemd unit file
-----------------
You can use this systemd unit file on your hosts.
```sh
$ cat /etc/systemd/system/freeswitch-docker.service
[Unit]
Description=freeswitch Container
After=docker.service network-online.target
Requires=docker.service
[Service]
Restart=always
TimeoutStartSec=0
#One ExecStart/ExecStop line to prevent hitting bugs in certain systemd versions
ExecStart=/bin/sh -c 'docker rm -f freeswitch; \
docker run -t --net=host --name freeswitch \
-e SOUND_RATES=8000:16000 \
-e SOUND_TYPES=music:en-us-callie \
-v freeswitch-sounds:/usr/share/freeswitch/sounds \
-v /etc/kazoo/freeswitch/:/etc/freeswitch \
freeswitch'
ExecStop=-/bin/sh -c '/usr/bin/docker stop freeswitch; \
/usr/bin/docker rm -f freeswitch;'
[Install]
WantedBy=multi-user.target
```
Unit file can be placed to ```/etc/systemd/system/freeswitch-docker.service``` and enabled by command
```sh
systemd start freeswitch-docker.service
systemd enable freeswitch-docker.service
```
.bashrc file
------------
To simplify freeswitch management you can add alias for ```fs_cli``` to ```.bashrc``` file as example bellow.
```sh
alias fs_cli='docker exec -i -t freeswitch /usr/bin/fs_cli'
```
How to create custom container
------------------------------
This container created from scratch image by addiding required freeswitch files packaged to tar.gz archive.
To create custom container:
1) install required FreeSwitch packages. Now supported debian dist
```sh
apt-get install freeswitch-conf-vanilla
```
2) clone freeswitch repo
```sh
git clone https://github.com/signalwire/freeswitch.git
```
3) execute ```make_min_archive.sh``` script
```sh
cd freeswitch/docker/base_image
./make_min_archive.sh
```
4) build custom container
```sh
docker build -t freeswitch_custom .
```
Read more
---------
[Dockerfile of official FreeSwitch container](https://github.com/signalwire/freeswitch/tree/master/docker/release)
---
### Docker/Base Image/Sounds Version (docker/base_image/sounds_version.txt)
music 1.0.52
en-us-callie 1.0.51
en-us-allison 1.0.0
ru-RU-elena 1.0.51
en-ca-june 1.0.51
fr-ca-june 1.0.51
pt-BR-karina 1.0.51
sv-se-jakob 1.0.50
zh-cn-sinmei 1.0.51
zh-hk-sinmei 1.0.51
---
### Docker/Coverity/README (docker/coverity/README.md)
# Coverity scan
## Build an image for Coverity
```
docker build -t coverity --build-arg REPOTOKEN= --build-arg COVERITYTOKEN= .
```
## Scan FreeSWITCH using a Coverity image
```
docker run --rm -itv .:/data -e FSBRANCH="master" coverity
```
This will output `freeswitch.tgz` file to the current folder
## Uploading the result to the Coverity server
```
curl --form token= \
--form email=andrey@signalwire.com \
--form file=@freeswitch.tgz \
--form version="Version" \
--form description="Description" \
https://scan.coverity.com/builds?project=FreeSWITCH
```
---
### Docker/Examples/README (docker/examples/README.md)
##### Dockerfile examples showing how to build FreeSWITCH without installing FreeSWITCH repo.
[Debian 11](https://github.com/signalwire/freeswitch/blob/dockerfile/docker/examples/Debian11/Dockerfile "Debian 11")
---
### How To Make Your Own Ca Correctly (docs/how_to_make_your_own_ca_correctly.txt)
Someone should probably turn this into a nice how-to:
Here is how I did it.
wget http://files.freeswitch.org/downloads/ssl.ca-0.1.tar.gz
tar zxfv ssl.ca-0.1.tar.gz
cd ssl.ca-0.1/
perl -i -pe 's/md5/sha2/g' *.sh
perl -i -pe 's/1024/4096/g' *.sh
./new-root-ca.sh
./new-server-cert.sh self.bkw.org
./sign-server-cert.sh self.bkw.org
cat self.bkw.org.crt self.bkw.org.key > /usr/local/freeswitch/certs/wss.pem
Setup Apache:
default-ssl:
SSLCertificateFile /usr/local/freeswitch/certs/wss.pem
SSLCertificateKeyFile /usr/local/freeswitch/certs/wss.pem
SSLCertificateChainFile /usr/local/freeswitch/certs/wss.pem
Setup Sofia TLS:
cat self.bkw.org.crt self.bkw.org.key > /usr/local/freeswitch/certs/agent.pem
cat ca.crt > /usr/local/freeswitch/certs/cafile.pem
vars.xml:
Restart FreeSWITCH.
Now make sure your system has ca.crt imported so it will trust your new found hotness.
TEST:
openssl s_client -connect self.bkw.org:443
openssl s_client -connect self.bkw.org:5061
openssl s_client -connect self.bkw.org:5081
openssl s_client -connect self.bkw.org:8082
Depending on what you've setup you'll see:
subject=/C=US/ST=Oklahoma/L=McAlester/O=Tonka Truck/OU=Secure Web Server/CN=self.bkw.org/emailAddress=brian@bkw.org
issuer=/C=US/ST=Oklahoma/L=McAlester/O=Whizzzzzzy Bang Bang/OU=Certification Services Division/CN=WBB Root CA/emailAddress=brian@bkw.org
Or there abouts.
---
### JavaScript (docs/JavaScript.txt)
Session Methods
=======================================
session.streamFile
Usage:
session.streamFile(file, timer, callback);
file = Path to the file to play (ie /tmp/file.wav)
timer = Timer to use for async mode. (optional)
callback = Which function to fire when a dtmf digit is pressed. (optional)
Callback return values and meanings:
seek:ms - +1000 or -1000 will seek 1000ms forward or backwards, seek 0 will start the file over.
speed: - +1,-1 or 0 for normal speed. (valid ranges are +1,+2, 0 or -1,-2)
pause: - toggles pause and play modes on the file.
You can also return arbitrary values and act on them as you
wish. In our example we return "hangup" when the caller
press the * key on the keypad.
Example:
function on_dtmf(digits)
{
if (digits == "3") {
return "seek:+1000";
}
if (digits == "1") {
return "seek:-1000";
}
if (digits == "*") {
return "hangup";
}
}
session.answer();
while(session.ready()) {
return_value = session.streamFile("/tmp/demo.wav", "", "on_dtmf");
if (return_value == "hangup") {
session.hangup(); // or break;
}
}
To Document(these are in mod_spidermonkey already and just need
documentation and examples):
Methods:
session.recordFile
session.speak
session.getDigits
session.answer
session.ready
session.waitForAnswer
session.hangup
session.execute
Properties:
session.name
session.state
session.dialplan
session.caller_id_name
session.caller_id_num
session.network_addr
session.ani
session.ani2
session.destination
Methods:
DB.exec
DB.next
DB.fetch
DB.prepare
Properties
DB.path
Methods:
teletone.generate
teletone.onDTMF
teletone.addTone
Properties:
teletone.name
Other functions:
console_log
include
email
bridge
apiExecute
If you have CURL installed:
fetchURLHash
fetchURLFile
---
### Zrtp Agpl 3.0 (docs/zrtp_agpl-3.0.txt)
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
.
---
### Phrase/README (docs/phrase/README.TXT)
What are these files?
These files outline the various phrases used in the mod_say_xx.c modules.
Most of these will require matching mod_say_xx.c files to actually use along
with the recorded sound files in the various languages. phrase.pl can be used
to automatically generate or verify all the files exist for a particular
language. If you are capable of recording each language please do so and
contribute them to the project. As phrases are added, the files will need to be
updated for the respective phrase_xx.xml file.
make_checks.sh - script to compare phrase_en.xml with other language xml files.
Script output contains prompt elements with attributes:
translated - value 'false' or not displayed;
translated-to - translation value if exists;
more-then-one-translation - displayed if exist two or more for given wav file.
How can you contribute?
You can contribute via patches posted to the mailing list or at
https://freeswitch.org/jira, if possible please record the sound files
for testing. We also need voicemail_xx.xml macros updated for each language.
Thanks,
Brian West
FreeSWITCH.org
---
### Fonts/OFL (fonts/OFL.txt)
Copyright (c) , (),
with Reserved Font Name .
Copyright (c) , (),
with Reserved Font Name .
Copyright (c) , ().
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
---
### Htdocs/License (htdocs/license.txt)
Copyright (c) 2005, Fabricio Zuardi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---
### Htdocs/Portal/README (htdocs/portal/README.md)
# 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 .
## 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.
---
### Libs/Apr/CMakeLists (libs/apr/CMakeLists.txt)
cmake_minimum_required(VERSION 2.6)
INCLUDE_DIRECTORIES(include/)
add_definitions(-DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK)
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/libs/apr/include/arch/unix/ ./include)
SET (apr_SRCS
passwd/apr_getpass.c
strings/apr_cpystrn.c
strings/apr_strnatcmp.c
strings/apr_strings.c
strings/apr_strtok.c
strings/apr_fnmatch.c
strings/apr_snprintf.c
tables/apr_tables.c
tables/apr_hash.c
atomic/unix/apr_atomic.c
dso/unix/dso.c
file_io/unix/flock.c
file_io/unix/readwrite.c
file_io/unix/filepath_util.c
file_io/unix/seek.c
file_io/unix/dir.c
file_io/unix/mktemp.c
file_io/unix/filedup.c
file_io/unix/tempdir.c
file_io/unix/filepath.c
file_io/unix/pipe.c
file_io/unix/open.c
file_io/unix/filestat.c
file_io/unix/copy.c
file_io/unix/fileacc.c
file_io/unix/fullrw.c
locks/unix/thread_rwlock.c
locks/unix/thread_mutex.c
locks/unix/thread_cond.c
locks/unix/proc_mutex.c
locks/unix/global_mutex.c
memory/unix/apr_pools.c
misc/unix/charset.c
misc/unix/env.c
misc/unix/version.c
misc/unix/rand.c
misc/unix/start.c
misc/unix/errorcodes.c
misc/unix/getopt.c
misc/unix/otherchild.c
mmap/unix/mmap.c
mmap/unix/common.c
network_io/unix/sockaddr.c
network_io/unix/sockopt.c
network_io/unix/sendrecv.c
network_io/unix/multicast.c
network_io/unix/sockets.c
network_io/unix/inet_ntop.c
network_io/unix/inet_pton.c
poll/unix/epoll.c
poll/unix/select.c
poll/unix/poll.c
poll/unix/port.c
poll/unix/kqueue.c
random/unix/sha2.c
random/unix/apr_random.c
random/unix/sha2_glue.c
shmem/unix/shm.c
support/unix/waitio.c
threadproc/unix/procsup.c
threadproc/unix/thread.c
threadproc/unix/signals.c
threadproc/unix/proc.c
threadproc/unix/threadpriv.c
time/unix/time.c
time/unix/timestr.c
user/unix/userinfo.c
user/unix/groupinfo.c)
ADD_LIBRARY(apr STATIC ${apr_SRCS})
#/bin/sh /Users/shaneburrell/freeswitch-svn-real/libs/apr/libtool --silent --mode=link gcc -g -O2 -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I./include -I/Users/shaneburrell/freeswitch-svn-real/arch/unix -I./include/arch/unix -I/Users/shaneburrell/freeswitch-svn-real -version-info 2:8:2 -o libapr-1.la -rpath /usr/local/freeswitch/lib passwd/apr_getpass.lo strings/apr_cpystrn.lo strings/apr_strnatcmp.lo strings/apr_strings.lo strings/apr_strtok.lo strings/apr_fnmatch.lo strings/apr_snprintf.lo tables/apr_tables.lo tables/apr_hash.lo atomic/unix/apr_atomic.lo dso/unix/dso.lo file_io/unix/flock.lo file_io/unix/readwrite.lo file_io/unix/filepath_util.lo file_io/unix/seek.lo file_io/unix/dir.lo file_io/unix/mktemp.lo file_io/unix/filedup.lo file_io/unix/tempdir.lo file_io/unix/filepath.lo file_io/unix/pipe.lo file_io/unix/open.lo file_io/unix/filestat.lo file_io/unix/copy.lo file_io/unix/fileacc.lo file_io/unix/fullrw.lo locks/unix/thread_rwlock.lo locks/unix/thread_mutex.lo locks/unix/thread_cond.lo locks/unix/proc_mutex.lo locks/unix/global_mutex.lo memory/unix/apr_pools.lo misc/unix/charset.lo misc/unix/env.lo misc/unix/version.lo misc/unix/rand.lo misc/unix/start.lo misc/unix/errorcodes.lo misc/unix/getopt.lo misc/unix/otherchild.lo mmap/unix/mmap.lo mmap/unix/common.lo network_io/unix/sockaddr.lo network_io/unix/sockopt.lo network_io/unix/sendrecv.lo network_io/unix/multicast.lo network_io/unix/sockets.lo network_io/unix/inet_ntop.lo network_io/unix/inet_pton.lo poll/unix/epoll.lo poll/unix/select.lo poll/unix/poll.lo poll/unix/port.lo poll/unix/kqueue.lo random/unix/sha2.lo random/unix/apr_random.lo random/unix/sha2_glue.lo shmem/unix/shm.lo support/unix/waitio.lo threadproc/unix/procsup.lo threadproc/unix/thread.lo threadproc/unix/signals.lo threadproc/unix/proc.lo threadproc/unix/threadpriv.lo time/unix/time.lo time/unix/timestr.lo user/unix/userinfo.lo user/unix/groupinfo.lo -ldl -lpthread
#awk -f /Users/shaneburrell/freeswitch-svn-real/libs/apr/build/make_var_export.awk /Users/shaneburrell/freeswitch-svn-real/apr_thread_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_env.h /Users/shaneburrell/freeswitch-svn-real/apr_poll.h /Users/shaneburrell/freeswitch-svn-real/apr_fnmatch.h /Users/shaneburrell/freeswitch-svn-real/apr_global_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_pools.h /Users/shaneburrell/freeswitch-svn-real/apr_want.h /Users/shaneburrell/freeswitch-svn-real/apr_file_io.h /Users/shaneburrell/freeswitch-svn-real/apr_version.h /Users/shaneburrell/freeswitch-svn-real/apr_mmap.h /Users/shaneburrell/freeswitch-svn-real/apr_dso.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_proc.h /Users/shaneburrell/freeswitch-svn-real/apr_errno.h /Users/shaneburrell/freeswitch-svn-real/apr_shm.h /Users/shaneburrell/freeswitch-svn-real/apr_network_io.h /Users/shaneburrell/freeswitch-svn-real/apr_signal.h /Users/shaneburrell/freeswitch-svn-real/apr_user.h /Users/shaneburrell/freeswitch-svn-real/apr_support.h /Users/shaneburrell/freeswitch-svn-real/apr_atomic.h /Users/shaneburrell/freeswitch-svn-real/apr_random.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_cond.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_rwlock.h /Users/shaneburrell/freeswitch-svn-real/apr_getopt.h /Users/shaneburrell/freeswitch-svn-real/apr_inherit.h /Users/shaneburrell/freeswitch-svn-real/apr_strings.h /Users/shaneburrell/freeswitch-svn-real/apr_general.h /Users/shaneburrell/freeswitch-svn-real/apr_proc_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_tables.h /Users/shaneburrell/freeswitch-svn-real/apr_ring.h /Users/shaneburrell/freeswitch-svn-real/apr_file_info.h /Users/shaneburrell/freeswitch-svn-real/apr_allocator.h /Users/shaneburrell/freeswitch-svn-real/apr_portable.h /Users/shaneburrell/freeswitch-svn-real/apr_hash.h /Users/shaneburrell/freeswitch-svn-real/apr_time.h /Users/shaneburrell/freeswitch-svn-real/apr_lib.h > export_vars.c
#awk -f /Users/shaneburrell/freeswitch-svn-real/libs/apr/build/make_exports.awk /Users/shaneburrell/freeswitch-svn-real/apr_thread_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_env.h /Users/shaneburrell/freeswitch-svn-real/apr_poll.h /Users/shaneburrell/freeswitch-svn-real/apr_fnmatch.h /Users/shaneburrell/freeswitch-svn-real/apr_global_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_pools.h /Users/shaneburrell/freeswitch-svn-real/apr_want.h /Users/shaneburrell/freeswitch-svn-real/apr_file_io.h /Users/shaneburrell/freeswitch-svn-real/apr_version.h /Users/shaneburrell/freeswitch-svn-real/apr_mmap.h /Users/shaneburrell/freeswitch-svn-real/apr_dso.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_proc.h /Users/shaneburrell/freeswitch-svn-real/apr_errno.h /Users/shaneburrell/freeswitch-svn-real/apr_shm.h /Users/shaneburrell/freeswitch-svn-real/apr_network_io.h /Users/shaneburrell/freeswitch-svn-real/apr_signal.h /Users/shaneburrell/freeswitch-svn-real/apr_user.h /Users/shaneburrell/freeswitch-svn-real/apr_support.h /Users/shaneburrell/freeswitch-svn-real/apr_atomic.h /Users/shaneburrell/freeswitch-svn-real/apr_random.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_cond.h /Users/shaneburrell/freeswitch-svn-real/apr_thread_rwlock.h /Users/shaneburrell/freeswitch-svn-real/apr_getopt.h /Users/shaneburrell/freeswitch-svn-real/apr_inherit.h /Users/shaneburrell/freeswitch-svn-real/apr_strings.h /Users/shaneburrell/freeswitch-svn-real/apr_general.h /Users/shaneburrell/freeswitch-svn-real/apr_proc_mutex.h /Users/shaneburrell/freeswitch-svn-real/apr_tables.h /Users/shaneburrell/freeswitch-svn-real/apr_ring.h /Users/shaneburrell/freeswitch-svn-real/apr_file_info.h /Users/shaneburrell/freeswitch-svn-real/apr_allocator.h /Users/shaneburrell/freeswitch-svn-real/apr_portable.h /Users/shaneburrell/freeswitch-svn-real/apr_hash.h /Users/shaneburrell/freeswitch-svn-real/apr_time.h /Users/shaneburrell/freeswitch-svn-real/apr_lib.h > exports.c
#gcc -E -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I./include -I/Users/shaneburrell/freeswitch-svn-real/arch/unix -I./include/arch/unix -I/Users/shaneburrell/freeswitch-svn-real exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> apr.exp
#gcc -E -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I./include -I/Users/shaneburrell/freeswitch-svn-real/arch/unix -I./include/arch/unix -I/Users/shaneburrell/freeswitch-svn-real export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$/d' >> apr.exp
---
### Libs/Libnatpmp/Changelog (libs/libnatpmp/Changelog.txt)
$Id: Changelog.txt,v 1.14 2009/03/10 10:15:30 nanard Exp $
2009/03/10:
Trying to have windows get gateway working if not using DHCP
2009/02/27:
dont include declspec.h if not under WIN32.
2009/01/23:
Prefixed the libraries name with lib
2008/10/06:
Fixed a memory leak in getdefaultgateway() (USE_SYSCTL_NET_ROUTE)
2008/07/03:
Adding WIN32 code from Robbie Hanson
2008/06/30:
added a Solaris implementation for getgateway().
added a LICENCE file to the distribution
2008/05/29:
Anonymous unions are forbidden in ANSI C. That was causing problems with
non-GCC compilers.
2008/04/28:
introduced strnatpmperr()
improved natpmpc.c sample
make install now install the binary
2007/12/13:
Fixed getgateway.c for working under OS X ;)
Fixed values for NATPMP_PROTOCOL_TCP and NATPMP_PROTOCOL_UDP
2007/12/11:
Fixed getgateway.c for compilation under Mac OS X
2007/12/01:
added some comments in .h
2007/11/30:
implemented almost everything
---
### Libs/Libscgi/Protocol (libs/libscgi/protocol.txt)
SCGI: A Simple Common Gateway Interface alternative
Neil Schemenauer
2008-06-23
1. Introduction
The SCGI protocol is a replacement for the Common Gateway Interface
(CGI) protocol. It is a standard for applications to interface with
HTTP servers. It is similar to FastCGI but is designed to be easier
to implement.
In this document, a string of 8-bit bytes may be written in two
different forms: as a series of hexadecimal numbers between angle
brackets, or as a sequence of ASCII characters between double quotes.
For example, <68 65 6c 6c 6f 20 77 6f 72 6c 64 21> is a string of
length 12; it is the same as the string "hello world!". Note that
these notations are part of this document, not part of the protocol.
2. Protocol
The client connects to a SCGI server over a reliable stream protocol
allowing transmission of 8-bit bytes. The client begins by sending a
request. See section 3 for the format of the request. When the SCGI
server sees the end of the request it sends back a response and closes
the connection. The format of the response is not specified by this
protocol.
3. Request Format
A request consists of a number of headers and a body. The format of
the headers is:
headers ::= header*
header ::= name NUL value NUL
name ::= notnull+
value ::= notnull*
notnull ::= <01> | <02> | <03> | ... |
NUL = <00>
Duplicate names are not allowed in the headers. The first header
must have the name "CONTENT_LENGTH" and a value that is a nonempty
sequence of ASCII digits giving the of the body length in decimal.
The "CONTENT_LENGTH" header must always be present, even if its
value is "0". There must also always be a header with the name
"SCGI" and a value of "1". In order to facilitate the transition
from CGI, standard CGI environment variables should be provided as
SCGI headers.
The headers are sent encoded as a netstring. Netstring encoding is
explained in section 4. The body is sent following the headers and
its length is specified by the "CONTENT_LENGTH" header.
4. Netstrings
Any string of 8-bit bytes may be encoded as [len]":"[string]",". Here
[string] is the string and [len] is a nonempty sequence of ASCII
digits giving the length of [string] in decimal. The ASCII digits are
<30> for 0, <31> for 1, and so on up through <39> for 9. Extra zeros
at the front of [len] are prohibited: [len] begins with <30> exactly
when [string] is empty.
For example, the string "hello world!" is encoded as <31 32 3a 68 65
6c 6c 6f 20 77 6f 72 6c 64 21 2c>, i.e., "12:hello world!,". The empty
string is encoded as "0:,".
[len]":"[string]"," is called a netstring. [string] is called the
interpretation of the netstring.
5. Example
The web server (a SCGI client) opens a connection and sends the
concatenation of the following strings:
"70:"
"CONTENT_LENGTH" <00> "27" <00>
"SCGI" <00> "1" <00>
"REQUEST_METHOD" <00> "POST" <00>
"REQUEST_URI" <00> "/deepthought" <00>
","
"What is the answer to life?"
The SCGI server sends the following response:
"Status: 200 OK" <0d 0a>
"Content-Type: text/plain" <0d 0a>
"" <0d 0a>
"42"
The SCGI server closes the connection.
6. Copyright
This document has been placed in the public domain.
/* vim: set ai tw=74 et sw=4 sts=4: */
---
### Libs/Libteletone/CMakeLists (libs/libteletone/CMakeLists.txt)
cmake_minimum_required(VERSION 2.6)
INCLUDE_DIRECTORIES(include/)
SET ( teletone_SRCS src/libteletone.h src/libteletone_detect.c src/libteletone_detect.h src/libteletone_generate.c src/libteletone_generate.h)
ADD_LIBRARY(teletone STATIC ${teletone_SRCS})
---
### Libs/Libvpx/CONTRIBUTING (libs/libvpx/CONTRIBUTING.md)
# How to Contribute
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Code reviews
All submissions, including submissions by project members, require review. We
use a [Gerrit](https://www.gerritcodereview.com) instance hosted at
https://chromium-review.googlesource.com for this purpose. See the
[WebM Project page](https://www.webmproject.org/code/contribute/submitting-patches/)
for additional details.
## Community Guidelines
This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
---
### Libs/Libvpx/Build Debug/Non Greedy Mv Test Files/Estimation 16x16 (libs/libvpx/build_debug/non_greedy_mv_test_files/estimation_16x16.txt)
30,45
12,8;12,8;12,8;12,8;12,8;12,9;12,9;12,9;12,9;12,9;12,9;11,10;11,10;11,10;11,10;11,11;11,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,11;9,4;10,12;11,12;11,12;11,12;11,5;10,11;10,-1;12,8;12,8;12,8;12,8;12,8;12,9;12,9;12,9;12,9;12,9;12,10;11,10;11,10;11,10;11,10;11,11;11,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,11;11,13;11,11;11,12;11,12;11,12;10,9;10,11;10,-1;11,8;12,8;12,8;12,8;12,8;12,9;12,9;12,9;12,9;11,9;11,10;11,10;11,10;11,10;11,11;11,11;11,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;12,12;11,12;11,12;11,12;11,12;11,11;10,11;10,11;10,-1;12,8;12,8;12,8;12,8;12,9;11,9;11,9;11,9;11,9;11,9;11,10;11,10;11,10;11,11;11,11;11,11;11,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,14;10,13;10,8;10,11;10,0;12,8;12,8;12,8;12,8;11,9;11,9;11,9;11,9;11,9;11,10;11,10;11,10;12,11;11,11;11,11;11,11;12,11;12,12;12,12;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,13;9,13;10,24;10,12;10,11;10,0;11,8;11,8;12,8;12,9;11,9;10,9;11,9;11,9;11,10;11,10;11,10;11,10;11,11;11,11;9,10;11,11;12,12;13,12;12,12;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,13;10,9;10,7;9,11;9,0;11,8;11,9;10,9;11,9;11,9;10,9;10,9;10,9;11,10;11,10;11,10;11,11;11,11;11,11;11,11;11,12;11,12;11,12;11,12;11,12;11,12;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,10;9,11;9,11;9,0;11,9;11,9;10,9;10,9;10,9;10,9;9,9;10,10;10,10;11,10;11,11;11,11;11,11;11,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,11;9,9;9,10;9,11;9,0;11,9;11,9;11,9;10,9;10,9;9,9;7,9;9,10;10,10;11,10;11,11;11,11;12,12;12,12;11,12;11,12;12,12;19,14;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;10,12;8,-2;8,12;8,12;8,0;11,9;11,9;11,9;11,9;10,9;10,9;10,10;10,10;10,10;11,11;11,11;11,13;12,12;13,12;10,12;3,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;9,11;9,25;8,12;7,11;7,0;11,9;11,9;11,9;11,9;11,9;10,9;10,10;10,10;11,10;11,11;11,11;11,11;12,11;11,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;9,12;8,15;7,13;6,11;5,0;11,9;11,9;11,9;11,9;11,9;11,10;11,10;11,10;11,10;11,11;11,11;12,11;12,10;12,11;12,11;12,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;9,13;9,14;8,14;6,11;4,11;3,0;12,9;12,9;12,9;12,9;12,10;11,10;11,10;11,10;11,10;11,10;12,11;12,11;12,11;12,11;12,11;12,11;12,12;12,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;9,12;9,14;9,15;8,16;5,15;1,12;0,0;12,9;12,9;12,9;12,9;12,10;12,10;12,10;11,10;11,10;12,10;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,13;9,13;9,14;8,16;7,17;3,16;-2,12;-5,7;12,10;12,10;13,9;14,10;13,10;12,10;12,10;12,10;12,10;12,10;12,11;13,11;13,11;13,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,13;10,13;9,14;9,15;7,16;6,18;0,18;-8,12;-19,3;12,10;12,10;13,10;13,10;13,10;12,10;12,10;12,10;12,10;12,10;13,11;13,11;14,11;13,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,13;10,13;9,14;9,15;7,16;4,17;-1,17;-13,12;-30,-2;12,11;12,10;11,10;16,10;14,10;12,10;12,10;12,10;12,10;12,10;13,10;14,10;18,10;13,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,14;10,14;10,16;9,17;5,18;0,19;-12,14;-39,-11;12,11;12,11;12,10;12,10;12,10;12,10;12,11;12,11;12,11;12,11;12,10;12,10;12,10;12,10;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;11,13;10,14;9,15;8,16;7,18;3,19;-4,17;-13,6;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;11,13;10,13;9,14;8,15;7,17;5,17;1,15;-3,2;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;10,13;10,13;11,14;9,14;9,16;8,16;5,13;0,-2;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;10,13;9,13;9,14;9,14;8,13;3,-5;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;12,11;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,12;10,12;10,13;10,13;9,13;9,13;9,12;4,-7;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;10,12;10,12;10,13;10,13;10,13;10,13;10,13;10,12;6,3;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,13;10,13;10,13;10,12;10,12;10,13;10,13;11,14;10,14;8,12;2,-1;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;10,13;10,13;11,13;10,13;10,13;10,13;10,13;10,13;9,13;8,13;6,12;0,-6;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;10,13;10,13;10,13;10,13;10,13;10,13;10,13;10,14;11,14;10,14;10,14;8,14;5,13;-1,-10;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;10,13;11,13;11,13;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,12;11,13;11,13;11,13;11,14;10,14;9,13;9,13;9,13;9,14;9,14;9,14;9,14;9,14;9,14;7,13;5,12;2,0;10,13;10,12;9,12;9,12;10,12;11,12;11,13;10,13;10,12;10,12;10,12;11,12;11,12;11,13;10,13;10,13;10,13;10,13;10,13;11,13;11,12;11,13;11,13;11,13;11,12;11,12;11,12;11,13;11,13;10,14;10,14;9,15;9,15;10,15;8,13;8,13;8,15;7,14;6,13;7,13;8,14;8,14;5,13;4,12;2,-1;10,13;7,12;7,12;7,12;8,12;8,11;8,12;8,13;8,13;9,12;9,11;9,12;9,12;9,12;9,12;9,12;7,13;7,13;8,13;8,12;8,12;8,13;9,13;10,13;11,13;11,13;10,13;10,13;10,14;10,15;10,16;9,17;7,18;6,16;5,12;8,15;8,15;1,13;1,10;4,10;6,12;7,15;4,14;3,12;2,1;-1,13;5,12;6,12;4,12;6,11;5,9;2,5;3,6;0,1;6,9;6,10;3,10;6,11;4,11;3,10;3,10;1,8;-7,3;-6,-1;3,8;4,10;2,12;-11,13;1,13;-4,13;-6,13;-6,13;0,13;-3,14;0,15;0,15;1,16;-11,13;1,14;3,13;-2,5;-8,2;-17,-8;-3,0;0,6;1,10;2,11;-1,10;2,11;1,0;
---
### Libs/Libvpx/Build Debug/Non Greedy Mv Test Files/Exhaust 16x16 (libs/libvpx/build_debug/non_greedy_mv_test_files/exhaust_16x16.txt)
30,45
6,4;12,14;6,16;24,9;30,2;7,11;11,12;13,10;12,12;30,11;9,13;10,11;4,11;1,-7;7,-13;9,-32;1,-12;22,9;29,5;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;28,-9;12,12;12,12;12,12;12,12;10,5;12,12;0,-1;9,29;14,3;4,31;11,24;-10,7;5,23;-15,-32;13,6;13,6;0,6;27,3;10,9;12,11;14,3;2,-19;-4,14;16,-13;12,12;17,10;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;6,18;10,17;9,12;12,12;12,12;12,12;3,9;26,12;-16,-1;8,31;11,-10;17,-17;16,-22;13,14;10,18;12,12;12,11;20,-23;3,9;7,4;12,13;10,13;12,12;15,24;11,-6;12,12;12,12;11,11;12,11;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;14,9;12,12;12,12;12,12;12,12;24,17;4,11;17,12;-32,-1;12,8;13,11;13,-4;13,25;14,-26;12,12;20,-8;12,12;12,12;13,12;13,12;12,12;12,12;14,11;11,13;3,8;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;14,16;5,6;5,12;-32,-1;12,11;13,14;12,13;12,12;8,-2;12,20;11,13;12,14;12,12;12,12;10,7;11,-10;13,14;11,13;12,12;-16,-10;12,12;12,13;9,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;16,25;12,12;18,12;-32,-1;12,13;12,12;16,14;16,30;11,7;10,-4;11,15;12,12;9,22;13,15;11,-12;12,12;12,12;12,6;4,-22;12,12;12,12;15,24;12,9;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;15,9;19,6;27,12;-32,-1;11,5;13,26;6,-20;13,8;13,-2;8,-14;12,22;10,1;11,-14;13,24;15,10;14,17;12,-8;12,12;11,-9;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;5,12;-32,-1;12,12;9,-8;12,12;30,1;25,-3;12,12;12,17;8,14;8,24;8,-2;7,20;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;8,16;8,10;12,12;-32,-1;9,11;5,6;14,1;-4,27;12,12;19,7;-18,-32;22,-20;11,20;11,16;10,20;12,12;12,12;12,12;12,12;12,12;12,12;31,-22;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;7,-4;12,12;13,12;-32,-1;12,12;12,12;11,4;12,12;12,20;12,7;12,12;10,20;13,8;19,-1;12,11;24,19;13,8;14,6;11,9;2,16;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;11,11;14,26;17,12;12,12;-32,-1;20,18;10,10;15,-17;14,-2;12,12;11,26;13,27;10,12;13,14;23,9;8,20;17,0;12,12;12,11;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;10,13;12,1;13,12;-32,-1;16,11;12,12;9,13;22,0;-32,-5;9,8;15,6;-8,-2;12,12;10,-21;12,3;12,12;8,3;12,12;12,12;12,23;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;11,11;7,12;31,-1;8,16;11,7;11,18;11,9;12,3;13,-4;5,24;8,17;12,12;12,14;12,12;-9,14;7,-2;12,16;15,6;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,14;11,12;21,-1;13,20;27,-9;11,6;14,8;7,22;19,7;4,1;-24,21;12,19;11,18;9,-24;14,-20;12,7;13,-28;10,15;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;13,12;24,-32;14,5;9,18;25,-26;24,-27;12,11;10,16;7,26;12,12;17,17;13,4;6,18;12,20;30,3;16,17;12,16;12,12;12,-21;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;6,-32;12,12;12,12;-16,11;12,12;10,11;25,-9;27,5;22,28;8,13;13,3;12,30;-5,-8;18,-31;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-9,-32;13,12;12,12;12,3;18,29;15,-9;1,19;-9,14;-3,-3;-21,8;13,6;-12,12;-2,-13;20,-32;-19,-31;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-24,-30;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;27,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;11,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-5,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-21,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,15;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-29,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;17,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;1,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-15,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-31,-1;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,9;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;3,-1;12,12;12,12;17,20;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;-13,-1;12,12;12,12;-8,25;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;21,-1;-2,5;-3,25;-18,27;1,-31;0,17;-9,26;-23,27;-23,20;-27,18;1,30;3,15;0,0;3,22;3,5;0,0;0,0;0,0;-17,-18;-15,-16;-1,15;-4,9;2,11;-13,-2;2,13;-5,16;-7,-2;-7,7;0,18;-5,-11;0,-10;0,0;2,-5;-5,-32;4,-27;2,21;-8,7;-8,1;-17,-10;-4,-1;-13,0;-8,5;1,10;0,-1;4,12;5,-1;
---
### Libs/Libvpx/Build Debug/Non Greedy Mv Test Files/Ground Truth 16x16 (libs/libvpx/build_debug/non_greedy_mv_test_files/ground_truth_16x16.txt)
30,45
12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;12,12;
---
### Libs/Libvpx/Build Debug/Non Greedy Mv Test Files/LocalVar 16x16 (libs/libvpx/build_debug/non_greedy_mv_test_files/localVar_16x16.txt)
30,45
0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,1;0,0,0,0;0,0,0,0;0,0,0,1;0,0,0,0;1,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,2,2,4;25,115,115,529;196,644,644,2116;225,420,420,784;576,696,696,841;4900,3920,3920,3136;9604,6664,6664,4624;9,120,120,1600;1024,2208,2208,4761;3249,5016,5016,7744;484,1870,1870,7225;9,288,288,9216;64,384,384,2304;324,882,882,2401;10404,8058,8058,6241;1936,2332,2332,2809;196,322,322,529;1,10,10,100;4,16,16,64;4,100,100,2500;1156,2482,2482,5329;3600,5160,5160,7396;81,594,594,4356;0,0,0,1521;0,0,0,10000;1,134,134,17956;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;1,0,0,0;1,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,4;25,110,110,484;196,560,560,1600;529,713,713,961;1296,2196,2196,3721;4096,6784,6784,11236;6889,9960,9960,14400;441,1659,1659,6241;1764,2520,2520,3600;4225,4875,4875,5625;529,2208,2208,9216;36,558,558,8649;36,276,276,2116;529,1564,1564,4624;9801,11088,11088,12544;3600,4620,4620,5929;225,360,360,576;4,2,2,1;1,9,9,81;1,44,44,1936;2025,3060,3060,4624;4624,4760,4760,4900;16,168,168,1764;0,0,0,1681;0,0,0,10609;1,133,133,17689;9,0,0,0;1,0,0,0;4,0,0,0;9,0,0,0;9,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;1,1,1,1;0,0,0,0;0,0,0,0;0,0,0,0;1,-1,-1,1;0,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;0,0,0,0;0,0,0,9;81,198,198,484;225,540,540,1296;2209,2162,2162,2116;6400,5760,5760,5184;6241,7347,7347,8649;7396,7998,7998,8649;8464,7084,7084,5929;2916,4104,4104,5776;3249,6498,6498,12996;784,3724,3724,17689;400,1820,1820,8281;784,1288,1288,2116;1849,1935,1935,2025;8649,4650,4650,2500;4624,3060,3060,2025;1089,891,891,729;625,175,175,49;81,0,0,0;441,693,693,1089;3969,4347,4347,4761;2809,2862,2862,2916;0,0,0,0;0,0,0,2116;0,0,0,10816;1,134,134,17956;1,1,1,1;16,0,0,0;25,0,0,0;9,0,0,0;25,0,0,0;1,0,0,0;1,0,0,0;4,0,0,0;9,0,0,0;9,0,0,0;9,3,3,1;9,3,3,1;1,0,0,0;4,2,2,1;1,0,0,0;0,0,0,0;4,2,2,1;4,4,4,4;1,0,0,0;1,4,4,16;196,378,378,729;256,784,784,2401;4624,4692,4692,4761;16384,8960,8960,4900;6889,4067,4067,2401;8649,3534,3534,1444;17689,8246,8246,3844;6889,8798,8798,11236;4761,8832,8832,16384;1024,4032,4032,15876;3136,5656,5656,10201;6400,5920,5920,5476;5776,5700,5700,5625;6724,7626,7626,8649;2916,5130,5130,9025;7744,6688,6688,5776;5184,3528,3528,2401;4225,2665,2665,1681;4356,3564,3564,2916;7056,3528,3528,1764;2500,600,600,144;1,0,0,0;0,0,0,225;0,0,0,10404;1,-135,-135,18225;16,0,0,0;25,5,5,1;25,0,0,0;36,0,0,0;16,0,0,0;9,0,0,0;9,0,0,0;9,0,0,0;9,3,3,1;16,0,0,0;25,0,0,0;25,0,0,0;25,10,10,4;4,4,4,4;4,6,6,9;1,0,0,0;4,2,2,1;1,0,0,0;0,0,0,0;1,9,9,81;576,720,720,900;100,450,450,2025;1849,1763,1763,1681;8464,5796,5796,3969;3969,5733,5733,8281;5041,6177,6177,7569;7921,7476,7476,7056;8100,7740,7740,7396;6561,6075,6075,5625;1296,2088,2088,3364;4489,3618,3618,2916;7056,4368,4368,2704;5041,4331,4331,3721;4900,5530,5530,6241;1849,3311,3311,5929;7225,4930,4930,3364;6084,3744,3744,2304;7396,5934,5934,4761;6241,7110,7110,8100;8100,8730,8730,9409;5184,5688,5688,6241;1,35,35,1225;1,54,54,2916;0,0,0,11881;1,-137,-137,18769;64,0,0,0;49,0,0,0;16,-4,-4,1;25,0,0,0;25,0,0,0;36,0,0,0;25,0,0,0;36,0,0,0;16,0,0,0;9,0,0,0;16,0,0,0;9,0,0,0;25,0,0,0;25,0,0,0;16,4,4,1;100,10,10,1;49,14,14,4;25,10,10,4;36,0,0,0;36,96,96,256;1764,1680,1680,1600;1600,1880,1880,2209;1024,1184,1184,1369;1681,1517,1517,1369;2704,3484,3484,4489;2025,3330,3330,5476;2809,2915,2915,3025;4489,5293,5293,6241;5329,6132,6132,7056;1764,2100,2100,2500;3025,2090,2090,1444;3249,1596,1596,784;1764,2310,2310,3025;4489,6164,6164,8464;1521,2808,2808,5184;729,810,810,900;900,330,330,121;1764,882,882,441;2025,1530,1530,1156;5041,5467,5467,5929;3136,4144,4144,5476;0,0,0,676;0,0,0,289;0,0,0,12321;1,-139,-139,19321;9,0,0,0;9,0,0,0;36,0,0,0;9,0,0,0;4,0,0,0;9,0,0,0;9,0,0,0;9,0,0,0;9,0,0,0;9,0,0,0;4,0,0,0;9,0,0,0;9,0,0,0;121,0,0,0;36,0,0,0;1089,231,231,49;1225,210,210,36;1369,185,185,25;1225,245,245,49;1764,1218,1218,841;3364,3654,3654,3969;3969,5292,5292,7056;4761,5313,5313,5929;2704,2964,2964,3249;2209,3290,3290,4900;1681,2952,2952,5184;3721,4453,4453,5329;12321,12432,12432,12544;9025,9405,9405,9801;2116,2392,2392,2704;2704,2704,2704,2704;2304,2256,2256,2209;1089,2244,2244,4624;4761,7176,7176,10816;900,1890,1890,3969;100,150,150,225;324,342,342,361;576,600,600,625;441,945,945,2025;3600,4860,4860,6561;441,1092,1092,2704;1,2,2,4;0,0,0,3025;0,0,0,12100;0,0,0,19881;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;4,0,0,0;9,0,0,0;9,18,18,36;256,320,320,400;1600,720,720,324;2209,611,611,169;3249,798,798,196;3364,522,522,81;3600,600,600,100;4761,1725,1725,625;2916,2376,2376,1936;2809,2703,2703,2601;6084,3900,3900,2500;3844,2914,2914,2209;3249,2850,2850,2500;3600,3480,3480,3364;9025,7505,7505,6241;19321,15846,15846,12996;6889,9545,9545,13225;1225,2485,2485,5041;1600,1640,1640,1681;961,1147,1147,1369;729,1431,1431,2809;4489,5025,5025,5625;400,920,920,2116;81,108,108,144;576,336,336,196;576,552,552,529;289,1139,1139,4489;2304,3984,3984,6889;4,58,58,841;0,0,0,0;0,0,0,1849;0,0,0,12544;1,-144,-144,20736;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;9,0,0,0;0,0,0,0;4,0,0,0;4,0,0,0;4,0,0,0;16,0,0,0;9,0,0,0;121,11,11,1;484,22,22,1;576,24,24,1;1024,32,32,1;529,138,138,36;1681,451,451,121;2304,2928,2928,3721;3969,5355,5355,7225;4096,3776,3776,3481;6889,4980,4980,3600;3249,4161,4161,5329;1296,3276,3276,8281;4900,7280,7280,10816;17424,15972,15972,14641;8100,11070,11070,15129;3600,5100,5100,7225;576,1272,1272,2809;841,1102,1102,1444;400,620,620,961;144,228,228,361;1936,924,924,441;225,315,315,441;25,125,125,625;1444,1292,1292,1156;256,480,480,900;169,728,728,3136;1156,2754,2754,6561;9,117,117,1521;4,68,68,1156;9,174,174,3364;1,114,114,12996;1,-149,-149,22201;4,0,0,0;1,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;4,0,0,0;4,0,0,0;1,0,0,0;1,0,0,0;0,0,0,25;4,0,0,0;196,0,0,0;400,0,0,0;400,0,0,0;1225,315,315,81;2116,414,414,81;1936,616,616,196;2601,1530,1530,900;5929,4774,4774,3844;4624,4964,4964,5329;7225,4760,4760,3136;3969,3276,3276,2704;1024,2560,2560,6400;9216,9600,9600,10000;12321,10989,10989,9801;5476,7104,7104,9216;3364,4292,4292,5476;289,578,578,1156;676,286,286,121;256,96,96,36;49,105,105,225;784,672,672,576;144,180,180,225;64,136,136,289;1444,988,988,676;144,252,252,441;144,696,696,3364;1296,3132,3132,7569;1,46,46,2116;4,94,94,2209;1,61,61,3721;0,0,0,14400;1,-150,-150,22500;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;9,48,48,256;900,600,600,400;1521,507,507,169;1936,440,440,100;3364,580,580,100;4225,585,585,81;3969,693,693,121;4225,1755,1755,729;4356,3234,3234,2401;3136,2912,2912,2704;5776,3192,3192,1764;5041,3550,3550,2500;4624,5236,5236,5929;13456,10672,10672,8464;7744,8096,8096,8464;4225,4290,4290,4356;2601,2499,2499,2401;324,720,720,1600;676,728,728,784;169,286,286,484;256,288,288,324;1369,851,851,529;289,374,374,484;225,300,300,400;961,651,651,441;196,280,280,400;256,768,768,2304;1681,3772,3772,8464;1,53,53,2809;1,0,0,0;0,0,0,0;0,0,0,14161;0,0,0,22801;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,9;256,0,0,0;441,0,0,0;625,50,50,4;784,56,56,4;1089,132,132,16;841,232,232,64;2025,945,945,441;2116,2162,2162,2209;1296,2268,2268,3969;3025,2585,2585,2209;6084,4992,4992,4096;5476,5550,5550,5625;6084,3900,3900,2500;5041,2911,2911,1681;1225,1365,1365,1521;2025,1980,1980,1936;784,980,980,1225;961,682,682,484;529,552,552,576;1156,1258,1258,1369;2209,2021,2021,1849;576,744,744,961;625,650,650,676;961,930,930,900;576,432,432,324;289,884,884,2704;3025,4895,4895,7921;2209,1974,1974,1764;16,0,0,0;16,204,204,2601;1,118,118,13924;1,141,141,19881;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;0,0,0,9;0,0,0,0;1,0,0,0;1,0,0,0;9,3,3,1;9,6,6,4;16,8,8,4;16,68,68,289;1681,1681,1681,1681;2401,2842,2842,3364;576,1560,1560,4225;1296,2556,2556,5041;8836,8272,8272,7744;2116,2668,2668,3364;1600,1120,1120,784;2025,1530,1530,1156;1444,1330,1330,1225;1849,1677,1677,1521;400,740,740,1369;1444,1596,1596,1764;676,1222,1222,2209;1849,2107,2107,2401;1521,1677,1677,1849;676,1066,1066,1681;1521,1716,1716,1936;441,882,882,1764;900,1230,1230,1681;256,784,784,2401;3136,3472,3472,3844;7396,6450,6450,5625;3136,2352,2352,1764;256,1056,1056,4356;1,107,107,11449;4,278,278,19321;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;1,0,0,0;4,0,0,0;4,0,0,0;4,0,0,0;4,0,0,0;4,0,0,0;9,6,6,4;100,390,390,1521;3136,3304,3304,3481;3844,3100,3100,2500;484,1254,1254,3249;4624,5916,5916,7569;10201,8585,8585,7225;1024,1536,1536,2304;1369,1591,1591,1849;2025,1710,1710,1444;1600,1400,1400,1225;1369,1369,1369,1369;400,680,680,1156;1369,1147,1147,961;1521,1131,1131,841;2025,1080,1080,576;1521,897,897,529;1521,1014,1014,676;2209,1598,1598,1156;441,609,609,841;1024,832,832,676;361,627,627,1089;1521,1326,1326,1156;3136,2632,2632,2209;8100,5940,5940,4356;3136,5488,5488,9604;9,393,393,17161;7056,5376,5376,4096;0,0,0,0;0,0,0,0;0,0,0,1;9,0,0,0;0,0,0,0;0,0,0,0;0,0,0,1;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;1,0,0,0;0,0,0,0;9,0,0,0;144,0,0,0;256,0,0,0;100,0,0,0;256,112,112,49;576,408,408,289;3025,1925,1925,1225;2704,2808,2808,2916;1764,2814,2814,4489;7744,6864,6864,6084;5329,5256,5256,5184;1369,1850,1850,2500;961,1302,1302,1764;1521,1560,1560,1600;1936,1628,1628,1369;1600,1400,1400,1225;1600,1280,1280,1024;1681,1517,1517,1369;3249,2451,2451,1849;2401,1960,1960,1600;2209,1504,1504,1024;2209,1598,1598,1156;2209,2021,2021,1849;1089,1221,1221,1369;1369,1258,1258,1156;1156,1190,1190,1225;1521,1287,1287,1089;1156,1088,1088,1024;3969,3528,3528,3136;4096,6720,6720,11025;25,670,670,17956;8836,6298,6298,4489;0,0,0,1;9,3,3,1;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;1,0,0,0;0,0,0,0;0,0,0,81;400,280,280,196;900,210,210,49;784,140,140,25;961,589,589,361;1369,1221,1221,1089;2401,2107,2107,1849;2704,3068,3068,3481;4624,4556,4556,4489;4489,3819,3819,3249;2025,1845,1845,1681;1521,1287,1287,1089;961,1116,1116,1296;1225,1365,1365,1521;3136,2072,2072,1369;2704,1976,1976,1444;2401,1960,1960,1600;2704,1820,1820,1225;2601,1530,1530,900;1225,1015,1015,841;1764,1218,1218,841;2209,1645,1645,1225;1444,1406,1406,1369;1444,1406,1406,1369;1681,1722,1722,1764;2025,1980,1980,1936;2809,1802,1802,1156;1849,1849,1849,1849;2601,3672,3672,5184;2916,6912,6912,16384;16,660,660,27225;7921,5785,5785,4225;1,6,6,36;400,120,120,36;144,36,36,9;225,0,0,0;64,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;0,0,0,0;64,0,0,0;0,0,0,0;0,0,0,0;361,0,0,0;1,0,0,0;256,16,16,1;576,24,24,1;961,217,217,49;2304,1248,1248,676;3136,2856,2856,2601;2916,3402,3402,3969;4225,3835,3835,3481;3025,2970,2970,2916;1681,1804,1804,1936;1156,1088,1088,1024;1600,1320,1320,1089;625,825,825,1089;1024,768,768,576;2401,686,686,196;3025,935,935,289;2209,1081,1081,529;3136,1344,1344,576;2401,1519,1519,961;729,999,999,1369;1600,1600,1600,1600;2025,1845,1845,1681;1225,1400,1400,1600;1849,946,946,484;2209,658,658,196;2025,1170,1170,676;2601,765,765,225;2601,1224,1224,576;3136,3360,3360,3600;3025,5500,5500,10000;225,1905,1905,16129;7569,6438,6438,5476;676,910,910,1225;4225,2210,2210,1156;1444,684,684,324;1521,39,39,1;1444,38,38,1;1444,152,152,16;1296,468,468,169;1296,576,576,256;1024,480,480,225;961,496,496,256;1156,544,544,256;1369,666,666,324;1600,680,680,289;625,275,275,121;841,348,348,144;1600,920,920,529;2209,2021,2021,1849;3481,3304,3304,3136;5041,3550,3550,2500;3844,3162,3162,2601;4225,3120,3120,2304;1369,1295,1295,1225;625,800,800,1024;841,1218,1218,1764;1521,1092,1092,784;225,255,255,289;784,588,588,441;961,558,558,324;1849,817,817,361;1521,741,741,361;1764,756,756,324;2116,828,828,324;900,660,660,484;1444,950,950,625;1444,874,874,529;1296,792,792,484;1369,703,703,361;1936,968,968,484;1089,660,660,400;1156,714,714,441;2209,1504,1504,1024;1444,1064,1064,784;1444,1558,1558,1681;529,1426,1426,3844;144,756,756,3969;1521,3315,3315,7225;3600,4320,4320,5184;2401,1666,1666,1156;2116,460,460,100;2025,405,405,81;2401,490,490,100;2025,540,540,144;1296,612,612,289;1936,1364,1364,961;1936,1672,1672,1444;1444,1064,1064,784;1089,528,528,256;1681,1066,1066,676;1936,1496,1496,1156;1849,1419,1419,1089;2116,2070,2070,2025;4096,4096,4096,4096;2809,3445,3445,4225;5776,5624,5624,5476;2916,3348,3348,3844;1521,1053,1053,729;1156,1020,1020,900;289,578,578,1156;676,702,702,729;1089,1089,1089,1089;400,500,500,625;400,220,220,121;169,156,156,144;400,240,240,144;361,133,133,49;289,187,187,121;529,322,322,196;324,180,180,100;576,216,216,81;441,252,252,144;400,240,240,144;256,144,144,81;529,276,276,144;400,320,320,256;484,594,594,729;1156,1088,1088,1024;625,525,525,441;729,945,945,1225;225,750,750,2500;144,732,732,3721;1225,2450,2450,4900;576,1296,1296,2916;2209,1175,1175,625;676,364,364,196;1296,576,576,256;1296,756,756,441;900,630,630,441;1600,840,840,441;5041,1562,1562,484;5041,1917,1917,729;5041,2059,2059,841;3721,1952,1952,1024;676,962,962,1369;1444,1292,1292,1156;784,840,840,900;1024,1440,1440,2025;4624,3876,3876,3249;3136,2912,2912,2704;5476,2738,2738,1369;1849,731,731,289;961,620,620,400;676,572,572,484;441,399,399,361;1369,999,999,729;1024,960,960,900;729,810,810,900;324,324,324,324;144,72,72,36;36,30,30,25;25,15,15,9;36,24,24,16;9,12,12,16;36,24,24,16;81,54,54,36;49,42,42,36;25,20,20,16;25,15,15,9;49,42,42,36;81,81,81,81;3969,1512,1512,576;2025,1530,1530,1156;2209,1269,1269,729;2401,2107,2107,1849;400,1220,1220,3721;144,720,720,3600;2025,3330,3330,5476;3249,4788,4788,7056;3844,4402,4402,5041;2500,2350,2350,2209;3721,3477,3477,3249;2601,2703,2703,2809;1369,1554,1554,1764;3136,3472,3472,3844;8100,5490,5490,3721;9604,4410,4410,2025;14884,5002,5002,1681;10609,5768,5768,3136;2401,2450,2450,2500;2401,1176,1176,576;2025,1125,1125,625;2601,1683,1683,1089;5776,3192,3192,1764;3249,2964,2964,2704;3481,3186,3186,2916;1849,1935,1935,2025;1296,1224,1224,1156;676,702,702,729;729,837,837,961;1296,1260,1260,1225;900,900,900,900;729,702,702,676;441,252,252,144;289,170,170,100;64,128,128,256;81,72,72,64;25,20,20,16;16,12,12,9;9,9,9,9;49,49,49,49;81,72,72,64;25,20,20,16;9,3,3,1;9,3,3,1;25,295,295,3481;8281,9737,9737,11449;5329,6935,6935,9025;4225,4355,4355,4489;3969,4032,4032,4096;729,2430,2430,8100;144,744,744,3844;2916,3618,3618,4489;5476,4366,4366,3481;2809,2385,2385,2025;4624,3400,3400,2500;4489,4489,4489,4489;2401,2352,2352,2304;2209,1410,1410,900;2500,2100,2100,1764;6889,4399,4399,2809;8464,5060,5060,3025;11881,5886,5886,2916;7569,5220,5220,3600;5184,5040,5040,4900;5184,5112,5112,5041;5625,5625,5625,5625;6400,6800,6800,7225;8281,8190,8190,8100;2916,3564,3564,4356;2209,1974,1974,1764;1936,1584,1584,1296;625,675,675,729;841,870,870,900;484,660,660,900;625,550,550,484;729,702,702,676;676,728,728,784;169,169,169,169;100,0,0,0;25,20,20,16;144,96,96,64;9,9,9,9;4,0,0,0;1,1,1,1;9,15,15,25;81,81,81,81;81,63,63,49;4,4,4,4;1,0,0,0;16,104,104,676;4356,4356,4356,4356;5476,5328,5328,5184;2401,3332,3332,4624;3844,5332,5332,7396;900,3060,3060,10404;121,638,638,3364;3721,5063,5063,6889;4225,3575,3575,3025;4096,2176,2176,1156;5041,2982,2982,1764;4096,2688,2688,1764;4096,2816,2816,1936;3249,3477,3477,3721;3136,4032,4032,5184;5041,4899,4899,4761;5184,4680,4680,4225;5184,4464,4464,3844;3969,4032,4032,4096;4900,4410,4410,3969;5625,4500,4500,3600;6400,5120,5120,4096;5776,4560,4560,3600;5476,3774,3774,2601;1681,1722,1722,1764;1156,1088,1088,1024;1156,986,986,841;289,374,374,484;576,480,480,400;400,420,420,441;289,289,289,289;289,204,204,144;225,150,150,100;49,42,42,36;1,1,1,1;1,1,1,1;25,20,20,16;81,45,45,25;1,3,3,9;1,1,1,1;0,0,0,1;9,21,21,49;225,195,195,169;64,64,64,64;1,3,3,9;784,784,784,784;4624,3468,3468,2601;4761,2691,2691,1521;3969,2205,2205,1225;6084,4056,4056,2704;1296,2412,2412,4489;529,1426,1426,3844;4225,5980,5980,8464;4225,4875,4875,5625;5041,4544,4544,4096;4356,4422,4422,4489;3364,4292,4292,5476;5776,5700,5700,5625;4761,4278,4278,3844;3844,3534,3534,3249;4225,3770,3770,3364;4225,3315,3315,2601;4356,2838,2838,1849;3136,1904,1904,1156;3136,1792,1792,1024;4489,2345,2345,1225;4900,2170,2170,961;3364,1682,1682,841;2209,1739,1739,1369;784,1064,1064,1444;529,667,667,841;441,462,462,484;361,323,323,289;256,256,256,256;196,182,182,169;49,28,28,16;9,3,3,1;9,15,15,25;100,90,90,81;49,56,56,64;9,6,6,4;4,6,6,9;144,84,84,49;1,4,4,16;1,2,2,4;0,0,0,1;4,6,6,9;121,99,99,81;121,132,132,144;361,646,646,1156;2304,3504,3504,5329;5184,5112,5112,5041;4489,2613,2613,1521;5776,1672,1672,484;5041,4402,4402,3844;576,2496,2496,10816;529,1403,1403,3721;2916,4320,4320,6400;3136,4480,4480,6400;5184,5544,5544,5929;5929,5467,5467,5041;3481,3717,3717,3969;4489,4355,4355,4225;5929,5313,5313,4761;3969,4725,4725,5625;3136,3584,3584,4096;2401,2156,2156,1936;2601,1836,1836,1296;1936,1452,1452,1089;1681,861,861,441;1936,308,308,49;1936,176,176,16;1600,560,560,196;1849,1290,1290,900;1156,918,918,729;1369,777,777,441;324,306,306,289;225,150,150,100;64,40,40,25;9,3,3,1;1,0,0,0;1,0,0,0;1,0,0,0;16,16,16,16;81,99,99,121;100,110,110,121;49,42,42,36;196,84,84,36;169,52,52,16;36,12,12,4;1,3,3,9;49,35,35,25;121,44,44,16;361,361,361,361;3364,1914,1914,1089;3481,2301,2301,1521;4356,4686,4686,5041;2704,4524,4524,7569;3364,4698,4698,6561;2304,4992,4992,10816;324,2376,2376,17424;529,1449,1449,3969;2401,2450,2450,2500;2209,2115,2115,2025;3249,1881,1881,1089;3136,1848,1848,1089;2304,2016,2016,1764;1936,2332,2332,2809;3969,3843,3843,3721;2916,2700,2700,2500;1156,816,816,576;676,234,234,81;841,174,174,36;961,248,248,64;784,168,168,36;484,132,132,36;529,184,184,64;841,464,464,256;961,1054,1054,1156;1764,2772,2772,4356;3025,3795,3795,4761;1024,896,896,784;1024,64,64,4;625,0,0,0;400,20,20,1;121,11,11,1;1,0,0,0;0,0,0,0;1,0,0,0;16,8,8,4;64,80,80,100;225,330,330,484;225,405,405,729;529,598,598,676;324,324,324,324;169,156,156,144;121,143,143,169;289,391,391,529;2500,2750,2750,3025;2304,2448,2448,2601;1444,608,608,256;1681,615,615,225;1296,612,612,289;961,589,589,361;1444,2166,2166,3249;324,1674,1674,8649;484,1386,1386,3969;1521,78,78,4;441,21,21,1;324,18,18,1;121,55,55,25;400,300,300,225;841,464,464,256;1369,481,481,169;1369,777,777,441;361,285,285,225;225,75,75,25;225,45,45,9;256,48,48,9;256,48,48,9;225,30,30,4;196,42,42,9;324,162,162,81;225,210,210,196;841,435,435,225;1156,1020,1020,900;2704,3172,3172,3721;3136,4256,4256,5776;2704,3692,3692,5041;2209,2538,2538,2916;1156,1020,1020,900;484,242,242,121;361,19,19,1;256,0,0,0;196,-14,-14,1;196,0,0,0;484,22,22,1;900,90,90,9;1600,280,280,49;841,725,725,625;576,744,744,961;64,184,184,529;441,1029,1029,2401;2500,2500,2500,2500;81,99,99,121;25,20,20,16;121,132,132,144;196,168,168,144;81,54,54,36;121,440,440,1600;64,608,608,5776;49,784,784,12544;324,306,306,289;1,8,8,64;0,0,0,0;0,0,0,4;9,12,12,16;169,52,52,16;196,84,84,36;400,480,480,576;196,364,364,676;81,72,72,64;49,28,28,16;100,60,60,36;81,45,45,25;64,40,40,25;81,45,45,25;81,54,54,36;100,90,90,81;169,182,182,196;196,168,168,144;841,145,145,25;784,84,84,9;1089,297,297,81;1156,544,544,256;1225,910,910,676;1369,1295,1295,1225;1156,1122,1122,1089;676,572,572,484;529,368,368,256;625,375,375,225;841,638,638,484;2401,1617,1617,1089;5929,3619,3619,2209;4489,2881,2881,1849;1600,680,680,289;16,56,56,196;441,966,966,2116;1600,1560,1560,1521;36,48,48,64;1,2,2,4;16,12,12,9;64,64,64,64;81,99,99,121;64,328,328,1681;1,71,71,5041;49,777,777,12321;289,17,17,1;0,0,0,0;0,0,0,1;0,0,0,1;4,4,4,4;9,3,3,1;25,45,45,81;121,297,297,729;144,288,288,576;36,36,36,36;25,10,10,4;64,16,16,4;49,21,21,9;64,16,16,4;49,14,14,4;81,36,36,16;64,64,64,64;121,132,132,144;196,210,210,225;64,80,80,100;9,12,12,16;64,16,16,4;144,12,12,1;441,21,21,1;961,0,0,0;729,0,0,0;441,0,0,0;361,0,0,0;400,0,0,0;900,150,150,25;3249,969,969,289;8281,3458,3458,1444;10000,6700,6700,4489;3025,3795,3795,4761;16,120,120,900;400,340,340,289;2500,2100,2100,1764;64,248,248,961;4,12,12,36;4,4,4,4;36,12,12,4;121,99,99,81;144,480,480,1600;4,138,138,4761;64,592,592,5476;576,0,0,0;0,0,0,0;0,0,0,1;49,0,0,0;1,2,2,4;9,6,6,4;169,182,182,196;64,120,120,225;81,108,108,144;16,4,4,1;25,10,10,4;49,14,14,4;49,14,14,4;64,8,8,1;25,10,10,4;16,8,8,4;16,12,12,9;36,18,18,9;25,30,30,36;64,40,40,25;9,9,9,9;4,4,4,4;729,0,0,0;9,0,0,0;961,0,0,0;961,0,0,0;676,0,0,0;289,0,0,0;529,0,0,0;289,0,0,0;784,56,56,4;1936,88,88,4;784,140,140,25;3721,244,244,16;16,12,12,9;100,100,100,100;1849,1247,1247,841;1024,992,992,961;1,20,20,400;4,6,6,9;16,4,4,1;25,15,15,9;81,36,36,16;1,15,15,225;9,213,213,5041;
---
### Libs/Libvpx/Third Party/Googletest/Src/README (libs/libvpx/third_party/googletest/src/README.md)
### Generic Build Instructions
#### Setup
To build GoogleTest and your tests that use it, you need to tell your build
system where to find its headers and source files. The exact way to do it
depends on which build system you use, and is usually straightforward.
### Build with CMake
GoogleTest comes with a CMake build script
([CMakeLists.txt](https://github.com/google/googletest/blob/master/CMakeLists.txt))
that can be used on a wide range of platforms ("C" stands for cross-platform.).
If you don't have CMake installed already, you can download it for free from
.
CMake works by generating native makefiles or build projects that can be used in
the compiler environment of your choice. You can either build GoogleTest as a
standalone project or it can be incorporated into an existing CMake build for
another project.
#### Standalone CMake Project
When building GoogleTest as a standalone project, the typical workflow starts
with
```
git clone https://github.com/google/googletest.git -b release-1.10.0
cd googletest # Main directory of the cloned repository.
mkdir build # Create a directory to hold the build output.
cd build
cmake .. # Generate native build scripts for GoogleTest.
```
The above command also includes GoogleMock by default. And so, if you want to
build only GoogleTest, you should replace the last command with
```
cmake .. -DBUILD_GMOCK=OFF
```
If you are on a \*nix system, you should now see a Makefile in the current
directory. Just type `make` to build GoogleTest. And then you can simply install
GoogleTest if you are a system administrator.
```
make
sudo make install # Install in /usr/local/ by default
```
If you use Windows and have Visual Studio installed, a `gtest.sln` file and
several `.vcproj` files will be created. You can then build them using Visual
Studio.
On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated.
#### Incorporating Into An Existing CMake Project
If you want to use GoogleTest in a project which already uses CMake, the easiest
way is to get installed libraries and headers.
* Import GoogleTest by using `find_package` (or `pkg_check_modules`). For
example, if `find_package(GTest CONFIG REQUIRED)` succeeds, you can use the
libraries as `GTest::gtest`, `GTest::gmock`.
And a more robust and flexible approach is to build GoogleTest as part of that
project directly. This is done by making the GoogleTest source code available to
the main build and adding it using CMake's `add_subdirectory()` command. This
has the significant advantage that the same compiler and linker settings are
used between GoogleTest and the rest of your project, so issues associated with
using incompatible libraries (eg debug/release), etc. are avoided. This is
particularly useful on Windows. Making GoogleTest's source code available to the
main build can be done a few different ways:
* Download the GoogleTest source code manually and place it at a known
location. This is the least flexible approach and can make it more difficult
to use with continuous integration systems, etc.
* Embed the GoogleTest source code as a direct copy in the main project's
source tree. This is often the simplest approach, but is also the hardest to
keep up to date. Some organizations may not permit this method.
* Add GoogleTest as a git submodule or equivalent. This may not always be
possible or appropriate. Git submodules, for example, have their own set of
advantages and drawbacks.
* Use CMake to download GoogleTest as part of the build's configure step. This
approach doesn't have the limitations of the other methods.
The last of the above methods is implemented with a small piece of CMake code
that downloads and pulls the GoogleTest code into the main build.
Just add to your `CMakeLists.txt`:
```cmake
include(FetchContent)
FetchContent_Declare(
googletest
# Specify the commit you depend on and update it regularly.
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# Now simply link against gtest or gtest_main as needed. Eg
add_executable(example example.cpp)
target_link_libraries(example gtest_main)
add_test(NAME example_test COMMAND example)
```
Note that this approach requires CMake 3.14 or later due to its use of the
`FetchContent_MakeAvailable()` command.
##### Visual Studio Dynamic vs Static Runtimes
By default, new Visual Studio projects link the C runtimes dynamically but
GoogleTest links them statically. This will generate an error that looks
something like the following: gtest.lib(gtest-all.obj) : error LNK2038: mismatch
detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value
'MDd_DynamicDebug' in main.obj
GoogleTest already has a CMake option for this: `gtest_force_shared_crt`
Enabling this option will make gtest link the runtimes dynamically too, and
match the project in which it is included.
#### C++ Standard Version
An environment that supports C++11 is required in order to successfully build
GoogleTest. One way to ensure this is to specify the standard in the top-level
project, for example by using the `set(CMAKE_CXX_STANDARD 11)` command. If this
is not feasible, for example in a C project using GoogleTest for validation,
then it can be specified by adding it to the options for cmake via the
`DCMAKE_CXX_FLAGS` option.
### Tweaking GoogleTest
GoogleTest can be used in diverse environments. The default configuration may
not work (or may not work well) out of the box in some environments. However,
you can easily tweak GoogleTest by defining control macros on the compiler
command line. Generally, these macros are named like `GTEST_XYZ` and you define
them to either 1 or 0 to enable or disable a certain feature.
We list the most frequently used macros below. For a complete list, see file
[include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/master/googletest/include/gtest/internal/gtest-port.h).
### Multi-threaded Tests
GoogleTest is thread-safe where the pthread library is available. After
`#include "gtest/gtest.h"`, you can check the
`GTEST_IS_THREADSAFE` macro to see whether this is the case (yes if the macro is
`#defined` to 1, no if it's undefined.).
If GoogleTest doesn't correctly detect whether pthread is available in your
environment, you can force it with
-DGTEST_HAS_PTHREAD=1
or
-DGTEST_HAS_PTHREAD=0
When GoogleTest uses pthread, you may need to add flags to your compiler and/or
linker to select the pthread library, or you'll get link errors. If you use the
CMake script, this is taken care of for you. If you use your own build script,
you'll need to read your compiler and linker's manual to figure out what flags
to add.
### As a Shared Library (DLL)
GoogleTest is compact, so most users can build and link it as a static library
for the simplicity. You can choose to use GoogleTest as a shared library (known
as a DLL on Windows) if you prefer.
To compile *gtest* as a shared library, add
-DGTEST_CREATE_SHARED_LIBRARY=1
to the compiler flags. You'll also need to tell the linker to produce a shared
library instead - consult your linker's manual for how to do it.
To compile your *tests* that use the gtest shared library, add
-DGTEST_LINKED_AS_SHARED_LIBRARY=1
to the compiler flags.
Note: while the above steps aren't technically necessary today when using some
compilers (e.g. GCC), they may become necessary in the future, if we decide to
improve the speed of loading the library (see
for details). Therefore you are recommended
to always add the above flags when using GoogleTest as a shared library.
Otherwise a future release of GoogleTest may break your build script.
### Avoiding Macro Name Clashes
In C++, macros don't obey namespaces. Therefore two libraries that both define a
macro of the same name will clash if you `#include` both definitions. In case a
GoogleTest macro clashes with another library, you can force GoogleTest to
rename its macro to avoid the conflict.
Specifically, if both GoogleTest and some other code define macro FOO, you can
add
-DGTEST_DONT_DEFINE_FOO=1
to the compiler flags to tell GoogleTest to change the macro's name from `FOO`
to `GTEST_FOO`. Currently `FOO` can be `FAIL`, `SUCCEED`, or `TEST`. For
example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write
GTEST_TEST(SomeTest, DoesThis) { ... }
instead of
TEST(SomeTest, DoesThis) { ... }
in order to define a test.
---
### Libs/Libvpx/Third Party/Googletest/Src/Include/Gtest/Internal/Custom/README (libs/libvpx/third_party/googletest/src/include/gtest/internal/custom/README.md)
# Customization Points
The custom directory is an injection point for custom user configurations.
## Header `gtest.h`
### The following macros can be defined:
* `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of
`OsStackTraceGetterInterface`.
* `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See
`testing::TempDir` for semantics and signature.
## Header `gtest-port.h`
The following macros can be defined:
### Flag related macros:
* `GTEST_FLAG(flag_name)`
* `GTEST_USE_OWN_FLAGFILE_FLAG_` - Define to 0 when the system provides its
own flagfile flag parsing.
* `GTEST_DECLARE_bool_(name)`
* `GTEST_DECLARE_int32_(name)`
* `GTEST_DECLARE_string_(name)`
* `GTEST_DEFINE_bool_(name, default_val, doc)`
* `GTEST_DEFINE_int32_(name, default_val, doc)`
* `GTEST_DEFINE_string_(name, default_val, doc)`
### Logging:
* `GTEST_LOG_(severity)`
* `GTEST_CHECK_(condition)`
* Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too.
### Threading:
* `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided.
* `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal`
are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)`
and `GTEST_DEFINE_STATIC_MUTEX_(mutex)`
* `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)`
* `GTEST_LOCK_EXCLUDED_(locks)`
### Underlying library support features
* `GTEST_HAS_CXXABI_H_`
### Exporting API symbols:
* `GTEST_API_` - Specifier for exported symbols.
## Header `gtest-printers.h`
* See documentation at `gtest/gtest-printers.h` for details on how to define a
custom printer.
---
### Libs/Libvpx/Third Party/Libwebm/AUTHORS (libs/libvpx/third_party/libwebm/AUTHORS.TXT)
# Names should be added to this file like so:
# Name or Organization
Google Inc.
---
### Libs/Libvpx/Third Party/Libwebm/LICENSE (libs/libvpx/third_party/libwebm/LICENSE.TXT)
Copyright (c) 2010, Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Google nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---
### Libs/Libvpx/Third Party/Libwebm/PATENTS (libs/libvpx/third_party/libwebm/PATENTS.TXT)
Additional IP Rights Grant (Patents)
------------------------------------
"These implementations" means the copyrightable works that implement the WebM
codecs distributed by Google as part of the WebM Project.
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this section) patent license to
make, have made, use, offer to sell, sell, import, transfer, and otherwise
run, modify and propagate the contents of these implementations of WebM, where
such license applies only to those patent claims, both currently owned by
Google and acquired in the future, licensable by Google that are necessarily
infringed by these implementations of WebM. This grant does not include claims
that would be infringed only as a consequence of further modification of these
implementations. If you or your agent or exclusive licensee institute or order
or agree to the institution of patent litigation or any other patent
enforcement activity against any entity (including a cross-claim or
counterclaim in a lawsuit) alleging that any of these implementations of WebM
or any code incorporated within any of these implementations of WebM
constitute direct or contributory patent infringement, or inducement of
patent infringement, then any patent rights granted to you under this License
for these implementations of WebM shall terminate as of the date such
litigation is filed.
---
### Libs/Libyuv/README (libs/libyuv/README.md)
**libyuv** is an open source project that includes YUV scaling and conversion functionality.
* Scale YUV to prepare content for compression, with point, bilinear or box filter.
* Convert to YUV from webcam formats for compression.
* Convert to RGB formats for rendering/effects.
* Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode.
* Optimized for SSSE3/AVX2 on x86/x64.
* Optimized for Neon on Arm.
* Optimized for MSA on Mips.
### Development
See [Getting started][1] for instructions on how to get started developing.
You can also browse the [docs directory][2] for more documentation.
[1]: ./docs/getting_started.md
[2]: ./docs/
---
### Libs/Libyuv/CMakeLists (libs/libyuv/CMakeLists.txt)
# CMakeLists for libyuv
# Originally created for "roxlu build system" to compile libyuv on windows
# Run with -DTEST=ON to build unit tests
PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
OPTION( TEST "Built unit tests" OFF )
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
SET ( ly_src_dir ${ly_base_dir}/source )
SET ( ly_inc_dir ${ly_base_dir}/include )
SET ( ly_tst_dir ${ly_base_dir}/unit_test )
SET ( ly_lib_name yuv )
SET ( ly_lib_static ${ly_lib_name} )
SET ( ly_lib_shared ${ly_lib_name}_shared )
FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc )
LIST ( SORT ly_source_files )
FILE ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc )
LIST ( SORT ly_unittest_sources )
INCLUDE_DIRECTORIES( BEFORE ${ly_inc_dir} )
# this creates the static library (.a)
ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} )
# this creates the shared library (.so)
ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} )
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" )
SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" )
# this creates the conversion tool
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
INCLUDE ( FindJPEG )
if (JPEG_FOUND)
include_directories( ${JPEG_INCLUDE_DIR} )
target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
add_definitions( -DHAVE_JPEG )
endif()
if(TEST)
find_library(GTEST_LIBRARY gtest)
if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources")
if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
add_library(gtest STATIC ${gtest_sources})
include_directories(${GTEST_SRC_DIR})
include_directories(${GTEST_SRC_DIR}/include)
set(GTEST_LIBRARY gtest)
else()
message(FATAL_ERROR "TEST is set but unable to find gtest library")
endif()
endif()
add_executable(libyuv_unittest ${ly_unittest_sources})
target_link_libraries(libyuv_unittest ${ly_lib_name} ${GTEST_LIBRARY})
find_library(PTHREAD_LIBRARY pthread)
if(NOT PTHREAD_LIBRARY STREQUAL "PTHREAD_LIBRARY-NOTFOUND")
target_link_libraries(libyuv_unittest pthread)
endif()
if (JPEG_FOUND)
target_link_libraries(libyuv_unittest ${JPEG_LIBRARY})
endif()
if(NACL AND NACL_LIBC STREQUAL "newlib")
target_link_libraries(libyuv_unittest glibc-compat)
endif()
find_library(GFLAGS_LIBRARY gflags)
if(NOT GFLAGS_LIBRARY STREQUAL "GFLAGS_LIBRARY-NOTFOUND")
target_link_libraries(libyuv_unittest gflags)
add_definitions(-DLIBYUV_USE_GFLAGS)
endif()
endif()
# install the conversion tool, .so, .a, and all the header files
INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin )
INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib )
INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin )
INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include )
# create the .deb and .rpm packages using cpack
INCLUDE ( CM_linux_packages.cmake )
---
### Libs/Libyuv/Docs/Deprecated Builds (libs/libyuv/docs/deprecated_builds.md)
# Deprecated Builds
Older documentation on build configs which are no longer supported.
## Pre-requisites
You'll need to have depot tools installed: https://www.chromium.org/developers/how-tos/install-depot-tools
Refer to chromium instructions for each platform for other prerequisites.
## Getting the Code
Create a working directory, enter it, and run:
gclient config https://chromium.googlesource.com/libyuv/libyuv
gclient sync
Then you'll get a .gclient file like:
solutions = [
{ "name" : "libyuv",
"url" : "https://chromium.googlesource.com/libyuv/libyuv",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"safesync_url": "",
},
];
For iOS add `;target_os=['ios'];` to your OSX .gclient and run `GYP_DEFINES="OS=ios" gclient sync.`
Browse the Git reprository: https://chromium.googlesource.com/libyuv/libyuv/+/master
### Android
For Android add `;target_os=['android'];` to your Linux .gclient
solutions = [
{ "name" : "libyuv",
"url" : "https://chromium.googlesource.com/libyuv/libyuv",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"safesync_url": "",
},
];
target_os = ["android", "unix"];
Then run:
export GYP_DEFINES="OS=android"
gclient sync
Caveat: Theres an error with Google Play services updates. If you get the error "Your version of the Google Play services library is not up to date", run the following:
cd chromium/src
./build/android/play_services/update.py download
cd ../..
For Windows the gclient sync must be done from an Administrator command prompt.
The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, Linux: make). This generation can also be forced manually: `gclient runhooks`
To get just the source (not buildable):
git clone https://chromium.googlesource.com/libyuv/libyuv
## Building the Library and Unittests
### Windows
set GYP_DEFINES=target_arch=ia32
call python gyp_libyuv -fninja -G msvs_version=2013
ninja -j7 -C out\Release
ninja -j7 -C out\Debug
set GYP_DEFINES=target_arch=x64
call python gyp_libyuv -fninja -G msvs_version=2013
ninja -C out\Debug_x64
ninja -C out\Release_x64
#### Building with clangcl
set GYP_DEFINES=clang=1 target_arch=ia32
call python tools\clang\scripts\update.py
call python gyp_libyuv -fninja libyuv_test.gyp
ninja -C out\Debug
ninja -C out\Release
### OSX
Clang 64 bit shown. Remove `clang=1` for GCC and change x64 to ia32 for 32 bit.
GYP_DEFINES="clang=1 target_arch=x64" ./gyp_libyuv
ninja -j7 -C out/Debug
ninja -j7 -C out/Release
GYP_DEFINES="clang=1 target_arch=ia32" ./gyp_libyuv
ninja -j7 -C out/Debug
ninja -j7 -C out/Release
### iOS
http://www.chromium.org/developers/how-tos/build-instructions-ios
Add to .gclient last line: `target_os=['ios'];`
armv7
GYP_DEFINES="OS=ios target_arch=armv7 target_subarch=arm32" GYP_CROSSCOMPILE=1 GYP_GENERATOR_FLAGS="output_dir=out_ios" ./gyp_libyuv
ninja -j7 -C out_ios/Debug-iphoneos libyuv_unittest
ninja -j7 -C out_ios/Release-iphoneos libyuv_unittest
arm64
GYP_DEFINES="OS=ios target_arch=arm64 target_subarch=arm64" GYP_CROSSCOMPILE=1 GYP_GENERATOR_FLAGS="output_dir=out_ios" ./gyp_libyuv
ninja -j7 -C out_ios/Debug-iphoneos libyuv_unittest
ninja -j7 -C out_ios/Release-iphoneos libyuv_unittest
both armv7 and arm64 (fat)
GYP_DEFINES="OS=ios target_arch=armv7 target_subarch=both" GYP_CROSSCOMPILE=1 GYP_GENERATOR_FLAGS="output_dir=out_ios" ./gyp_libyuv
ninja -j7 -C out_ios/Debug-iphoneos libyuv_unittest
ninja -j7 -C out_ios/Release-iphoneos libyuv_unittest
simulator
GYP_DEFINES="OS=ios target_arch=ia32 target_subarch=arm32" GYP_CROSSCOMPILE=1 GYP_GENERATOR_FLAGS="output_dir=out_sim" ./gyp_libyuv
ninja -j7 -C out_sim/Debug-iphonesimulator libyuv_unittest
ninja -j7 -C out_sim/Release-iphonesimulator libyuv_unittest
### Android
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
Add to .gclient last line: `target_os=['android'];`
armv7
GYP_DEFINES="OS=android" GYP_CROSSCOMPILE=1 ./gyp_libyuv
ninja -j7 -C out/Debug yuv_unittest_apk
ninja -j7 -C out/Release yuv_unittest_apk
arm64
GYP_DEFINES="OS=android target_arch=arm64 target_subarch=arm64" GYP_CROSSCOMPILE=1 ./gyp_libyuv
ninja -j7 -C out/Debug yuv_unittest_apk
ninja -j7 -C out/Release yuv_unittest_apk
ia32
GYP_DEFINES="OS=android target_arch=ia32" GYP_CROSSCOMPILE=1 ./gyp_libyuv
ninja -j7 -C out/Debug yuv_unittest_apk
ninja -j7 -C out/Release yuv_unittest_apk
GYP_DEFINES="OS=android target_arch=ia32 android_full_debug=1" GYP_CROSSCOMPILE=1 ./gyp_libyuv
ninja -j7 -C out/Debug yuv_unittest_apk
mipsel
GYP_DEFINES="OS=android target_arch=mipsel" GYP_CROSSCOMPILE=1 ./gyp_libyuv
ninja -j7 -C out/Debug yuv_unittest_apk
ninja -j7 -C out/Release yuv_unittest_apk
arm32 disassembly:
third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -d out/Release/obj/source/libyuv.row_neon.o
arm64 disassembly:
third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d out/Release/obj/source/libyuv.row_neon64.o
Running tests:
build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=*
Running test as benchmark:
build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1"
Running test with C code:
build/android/test_runner.py gtest -s libyuv_unittest -t 7200 --verbose --release --gtest_filter=* -a "--libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1"
#### Building with GN
gn gen out/Release "--args=is_debug=false target_cpu=\"x86\""
gn gen out/Debug "--args=is_debug=true target_cpu=\"x86\""
ninja -C out/Release
ninja -C out/Debug
### Building Offical with GN
gn gen out/Official "--args=is_debug=false is_official_build=true is_chrome_branded=true"
ninja -C out/Official
#### Building mips with GN
mipsel
gn gen out/Default "--args=is_debug=false target_cpu=\"mipsel\" target_os = \"android\" mips_arch_variant = \"r6\" mips_use_msa = true is_component_build = true is_clang = false"
ninja -C out/Default
mips64el
gn gen out/Default "--args=is_debug=false target_cpu=\"mips64el\" target_os = \"android\" mips_arch_variant = \"r6\" mips_use_msa = true is_component_build = true is_clang = false"
ninja -C out/Default
### Linux
GYP_DEFINES="target_arch=x64" ./gyp_libyuv
ninja -j7 -C out/Debug
ninja -j7 -C out/Release
GYP_DEFINES="target_arch=ia32" ./gyp_libyuv
ninja -j7 -C out/Debug
ninja -j7 -C out/Release
#### CentOS
On CentOS 32 bit the following work around allows a sync:
export GYP_DEFINES="host_arch=ia32"
gclient sync
### Windows Shared Library
Modify libyuv.gyp from 'static_library' to 'shared_library', and add 'LIBYUV_BUILDING_SHARED_LIBRARY' to 'defines'.
gclient runhooks
After this command follow the building the library instructions above.
If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows
### Build targets
ninja -C out/Debug libyuv
ninja -C out/Debug libyuv_unittest
ninja -C out/Debug compare
ninja -C out/Debug yuvconvert
ninja -C out/Debug psnr
ninja -C out/Debug cpuid
## Building the Library with make
### Linux
make -j7 V=1 -f linux.mk
make -j7 V=1 -f linux.mk clean
make -j7 V=1 -f linux.mk CXX=clang++
## Building the Library with cmake
Install cmake: http://www.cmake.org/
Default debug build:
mkdir out
cd out
cmake ..
cmake --build .
Release build/install
mkdir out
cd out
cmake -DCMAKE_INSTALL_PREFIX="/usr/lib" -DCMAKE_BUILD_TYPE="Release" ..
cmake --build . --config Release
sudo cmake --build . --target install --config Release
### Windows 8 Phone
Pre-requisite:
* Install Visual Studio 2012 and Arm to your environment.
Then:
call "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
or with Visual Studio 2013:
call "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
nmake /f winarm.mk clean
nmake /f winarm.mk
### Windows Shared Library
Modify libyuv.gyp from 'static_library' to 'shared_library', and add 'LIBYUV_BUILDING_SHARED_LIBRARY' to 'defines'. Then run this.
gclient runhooks
After this command follow the building the library instructions above.
If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows
### 64 bit Windows
set GYP_DEFINES=target_arch=x64
gclient runhooks V=1
### ARM Linux
export GYP_DEFINES="target_arch=arm"
export CROSSTOOL=``/arm-none-linux-gnueabi
export CXX=$CROSSTOOL-g++
export CC=$CROSSTOOL-gcc
export AR=$CROSSTOOL-ar
export AS=$CROSSTOOL-as
export RANLIB=$CROSSTOOL-ranlib
gclient runhooks
## Running Unittests
### Windows
out\Release\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter="*"
### OSX
out/Release/libyuv_unittest --gtest_filter="*"
### Linux
out/Release/libyuv_unittest --gtest_filter="*"
Replace --gtest_filter="*" with specific unittest to run. May include wildcards. e.g.
out/Release/libyuv_unittest --gtest_filter=libyuvTest.I420ToARGB_Opt
## CPU Emulator tools
### Intel SDE (Software Development Emulator)
Pre-requisite: Install IntelSDE for Windows: http://software.intel.com/en-us/articles/intel-software-development-emulator
Then run:
c:\intelsde\sde -hsw -- out\release\libyuv_unittest.exe --gtest_filter=*
## Memory tools
### Running Dr Memory memcheck for Windows
Pre-requisite: Install Dr Memory for Windows and add it to your path: http://www.drmemory.org/docs/page_install_windows.html
set GYP_DEFINES=build_for_tool=drmemory target_arch=ia32
call python gyp_libyuv -fninja -G msvs_version=2013
ninja -C out\Debug
drmemory out\Debug\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=*
### Running UBSan
See Chromium instructions for sanitizers: https://www.chromium.org/developers/testing/undefinedbehaviorsanitizer
Sanitizers available: TSan, MSan, ASan, UBSan, LSan
GYP_DEFINES='ubsan=1' gclient runhooks
ninja -C out/Release
### Running Valgrind memcheck
Memory errors and race conditions can be found by running tests under special memory tools. [Valgrind] [1] is an instrumentation framework for building dynamic analysis tools. Various tests and profilers are built upon it to find memory handling errors and memory leaks, for instance.
[1]: http://valgrind.org
solutions = [
{ "name" : "libyuv",
"url" : "https://chromium.googlesource.com/libyuv/libyuv",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
"libyuv/chromium/src/third_party/valgrind": "https://chromium.googlesource.com/chromium/deps/valgrind/binaries",
},
"safesync_url": "",
},
]
Then run:
GYP_DEFINES="clang=0 target_arch=x64 build_for_tool=memcheck" python gyp_libyuv
ninja -C out/Debug
valgrind out/Debug/libyuv_unittest
For more information, see http://www.chromium.org/developers/how-tos/using-valgrind
### Running Thread Sanitizer (TSan)
GYP_DEFINES="clang=0 target_arch=x64 build_for_tool=tsan" python gyp_libyuv
ninja -C out/Debug
valgrind out/Debug/libyuv_unittest
For more info, see http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer
### Running Address Sanitizer (ASan)
GYP_DEFINES="clang=0 target_arch=x64 build_for_tool=asan" python gyp_libyuv
ninja -C out/Debug
valgrind out/Debug/libyuv_unittest
For more info, see http://dev.chromium.org/developers/testing/addresssanitizer
## Benchmarking
The unittests can be used to benchmark.
### Windows
set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=999
set LIBYUV_FLAGS=-1
out\Release\libyuv_unittest.exe --gtest_filter=*I420ToARGB_Opt
### Linux and Mac
LIBYUV_WIDTH=1280 LIBYUV_HEIGHT=720 LIBYUV_REPEAT=1000 out/Release/libyuv_unittest --gtest_filter=*I420ToARGB_Opt
libyuvTest.I420ToARGB_Opt (547 ms)
Indicates 0.547 ms/frame for 1280 x 720.
## Making a change
gclient sync
git checkout -b mycl -t origin/master
git pull
git add -u
git commit -m "my change"
git cl lint
git cl try
git cl upload -r a-reviewer@chomium.org -s
git cl land
---
### Libs/Libyuv/Docs/Environment Variables (libs/libyuv/docs/environment_variables.md)
# Introduction
For test purposes, environment variables can be set to control libyuv behavior. These should only be used for testing, to narrow down bugs or to test performance.
# CPU
By default the cpu is detected and the most advanced form of SIMD is used. But you can disable instruction sets selectively, or completely, falling back on C code. Set the variable to 1 to disable the specified instruction set.
## All CPUs
LIBYUV_DISABLE_ASM
## Intel CPUs
LIBYUV_DISABLE_X86
LIBYUV_DISABLE_SSE2
LIBYUV_DISABLE_SSSE3
LIBYUV_DISABLE_SSE41
LIBYUV_DISABLE_SSE42
LIBYUV_DISABLE_AVX
LIBYUV_DISABLE_AVX2
LIBYUV_DISABLE_ERMS
LIBYUV_DISABLE_FMA3
LIBYUV_DISABLE_F16C
LIBYUV_DISABLE_AVX512BW
LIBYUV_DISABLE_AVX512VL
LIBYUV_DISABLE_AVX512VBMI
LIBYUV_DISABLE_AVX512VBMI2
LIBYUV_DISABLE_AVX512VBITALG
LIBYUV_DISABLE_AVX512VPOPCNTDQ
LIBYUV_DISABLE_GFNI
## ARM CPUs
LIBYUV_DISABLE_NEON
## MIPS CPUs
LIBYUV_DISABLE_MSA
LIBYUV_DISABLE_MMI
# Test Width/Height/Repeat
The unittests default to a small image (128x72) to run fast. This can be set by environment variable to test a specific resolutions.
You can also repeat the test a specified number of iterations, allowing benchmarking and profiling.
set LIBYUV_WIDTH=1280
set LIBYUV_HEIGHT=720
set LIBYUV_REPEAT=999
set LIBYUV_FLAGS=-1
set LIBYUV_CPU_INFO=-1
---
### Libs/Libyuv/Docs/Filtering (libs/libyuv/docs/filtering.md)
# Introduction
This document discusses the current state of filtering in libyuv. An emphasis on maximum performance while avoiding memory exceptions, and minimal amount of code/complexity. See future work at end.
# LibYuv Filter Subsampling
There are 2 challenges with subsampling
1. centering of samples, which involves clamping on edges
2. clipping a source region
Centering depends on scale factor and filter mode.
# Down Sampling
If scaling down, the stepping rate is always src_width / dst_width.
dx = src_width / dst_width;
e.g. If scaling from 1280x720 to 640x360, the step thru the source will be 2.0, stepping over 2 pixels of source for each pixel of destination.
Centering, depends on filter mode.
*Point* downsampling takes the middle pixel.
x = dx >> 1;
For odd scale factors (e.g. 3x down) this is exactly the middle. For even scale factors, this rounds up and takes the pixel to the right of center. e.g. scale of 4x down will take pixel 2.
**Bilinear** filter, uses the 2x2 pixels in the middle.
x = dx / 2 - 0.5;
For odd scale factors (e.g. 3x down) this is exactly the middle, and point sampling is used.
For even scale factors, this evenly filters the middle 2x2 pixels. e.g. 4x down will filter pixels 1,2 at 50% in both directions.
**Box** filter averages the entire box so sampling starts at 0.
x = 0;
For a scale factor of 2x down, this is equivalent to bilinear.
# Up Sampling
**Point** upsampling use stepping rate of src_width / dst_width and a starting coordinate of 0.
x = 0;
dx = src_width / dst_width;
e.g. If scaling from 640x360 to 1280x720 the step thru the source will be 0.0, stepping half a pixel of source for each pixel of destination. Each pixel is replicated by the scale factor.
**Bilinear** filter stretches such that the first pixel of source maps to the first pixel of destination, and the last pixel of source maps to the last pixel of destination.
x = 0;
dx = (src_width - 1) / (dst_width - 1);
This method is not technically correct, and will likely change in the future.
* It is inconsistent with the bilinear down sampler. The same method could be used for down sampling, and then it would be more reversible, but that would prevent specialized 2x down sampling.
* Although centered, the image is slightly magnified.
* The filtering was changed in early 2013 - previously it used:
x = 0;
dx = (src_width - 1) / (dst_width - 1);
Which is the correct scale factor, but shifted the image left, and extruded the last pixel. The reason for the change was to remove the extruding code from the low level row functions, allowing 3 functions to sshare the same row functions - ARGBScale, I420Scale, and ARGBInterpolate. Then the one function was ported to many cpu variations: SSE2, SSSE3, AVX2, Neon and 'Any' version for any number of pixels and alignment. The function is also specialized for 0,25,50,75%.
The above goes still has the potential to read the last pixel 100% and last pixel + 1 0%, which may cause a memory exception. So the left pixel goes to a fraction less than the last pixel, but filters in the minimum amount of it, and the maximum of the last pixel.
dx = FixedDiv((src_width << 16) - 0x00010001, (dst << 16) - 0x00010000);
**Box** filter for upsampling switches over to Bilinear.
# Scale snippet:
#define CENTERSTART(dx, s) (dx < 0) ? -((-dx >> 1) + s) : ((dx >> 1) + s)
#define FIXEDDIV1(src, dst) FixedDiv((src << 16) - 0x00010001, \
(dst << 16) - 0x00010000);
// Compute slope values for stepping.
void ScaleSlope(int src_width, int src_height,
int dst_width, int dst_height,
FilterMode filtering,
int* x, int* y, int* dx, int* dy) {
assert(x != NULL);
assert(y != NULL);
assert(dx != NULL);
assert(dy != NULL);
assert(src_width != 0);
assert(src_height != 0);
assert(dst_width > 0);
assert(dst_height > 0);
if (filtering == kFilterBox) {
// Scale step for point sampling duplicates all pixels equally.
*dx = FixedDiv(Abs(src_width), dst_width);
*dy = FixedDiv(src_height, dst_height);
*x = 0;
*y = 0;
} else if (filtering == kFilterBilinear) {
// Scale step for bilinear sampling renders last pixel once for upsample.
if (dst_width <= Abs(src_width)) {
*dx = FixedDiv(Abs(src_width), dst_width);
*x = CENTERSTART(*dx, -32768);
} else if (dst_width > 1) {
*dx = FIXEDDIV1(Abs(src_width), dst_width);
*x = 0;
}
if (dst_height <= src_height) {
*dy = FixedDiv(src_height, dst_height);
*y = CENTERSTART(*dy, -32768); // 32768 = -0.5 to center bilinear.
} else if (dst_height > 1) {
*dy = FIXEDDIV1(src_height, dst_height);
*y = 0;
}
} else if (filtering == kFilterLinear) {
// Scale step for bilinear sampling renders last pixel once for upsample.
if (dst_width <= Abs(src_width)) {
*dx = FixedDiv(Abs(src_width), dst_width);
*x = CENTERSTART(*dx, -32768);
} else if (dst_width > 1) {
*dx = FIXEDDIV1(Abs(src_width), dst_width);
*x = 0;
}
*dy = FixedDiv(src_height, dst_height);
*y = *dy >> 1;
} else {
// Scale step for point sampling duplicates all pixels equally.
*dx = FixedDiv(Abs(src_width), dst_width);
*dy = FixedDiv(src_height, dst_height);
*x = CENTERSTART(*dx, 0);
*y = CENTERSTART(*dy, 0);
}
// Negative src_width means horizontally mirror.
if (src_width < 0) {
*x += (dst_width - 1) * *dx;
*dx = -*dx;
src_width = -src_width;
}
}
# Future Work
Point sampling should ideally be the same as bilinear, but pixel by pixel, round to nearest neighbor. But as is, it is reversible and exactly matches ffmpeg at all scale factors, both up and down. The scale factor is
dx = src_width / dst_width;
The step value is centered for down sample:
x = dx / 2;
Or starts at 0 for upsample.
x = 0;
Bilinear filtering is currently correct for down sampling, but not for upsampling.
Upsampling is stretching the first and last pixel of source, to the first and last pixel of destination.
dx = (src_width - 1) / (dst_width - 1);
x = 0;
It should be stretching such that the first pixel is centered in the middle of the scale factor, to match the pixel that would be sampled for down sampling by the same amount. And same on last pixel.
dx = src_width / dst_width;
x = dx / 2 - 0.5;
This would start at -0.5 and go to last pixel + 0.5, sampling 50% from last pixel + 1.
Then clamping would be needed. On GPUs there are numerous ways to clamp.
1. Clamp the coordinate to the edge of the texture, duplicating the first and last pixel.
2. Blend with a constant color, such as transparent black. Typically best for fonts.
3. Mirror the UV coordinate, which is similar to clamping. Good for continuous tone images.
4. Wrap the coordinate, for texture tiling.
5. Allow the coordinate to index beyond the image, which may be the correct data if sampling a subimage.
6. Extrapolate the edge based on the previous pixel. pixel -0.5 is computed from slope of pixel 0 and 1.
Some of these are computational, even for a GPU, which is one reason textures are sometimes limited to power of 2 sizes.
We do care about the clipping case, where allowing coordinates to become negative and index pixels before the image is the correct data. But normally for simple scaling, we want to clamp to the edge pixel. For example, if bilinear scaling from 3x3 to 30x30, we’d essentially want 10 pixels of each of the original 3 pixels. But we want the original pixels to land in the middle of each 10 pixels, at offsets 5, 15 and 25. There would be filtering between 5 and 15 between the original pixels 0 and 1. And filtering between 15 and 25 from original pixels 1 and 2. The first 5 pixels are clamped to pixel 0 and the last 5 pixels are clamped to pixel 2.
The easiest way to implement this is copy the original 3 pixels to a buffer, and duplicate the first and last pixels. 0,1,2 becomes 0, 0,1,2, 2. Then implement a filtering without clamping. We call this source extruding. Its only necessary on up sampling, since down sampler will always have valid surrounding pixels.
Extruding is practical when the image is already copied to a temporary buffer. It could be done to the original image, as long as the original memory is restored, but valgrind and/or memory protection would disallow this, so it requires a memcpy to a temporary buffer, which may hurt performance. The memcpy has a performance advantage, from a cache point of view, that can actually make this technique faster, depending on hardware characteristics.
Vertical extrusion can be done with a memcpy of the first/last row, or clamping a pointer.
The other way to implement clamping is handle the edges with a memset. e.g. Read first source pixel and memset the first 5 pixels. Filter pixels 0,1,2 to 5 to 25. Read last pixel and memset the last 5 pixels. Blur is implemented with this method like this, which has 3 loops per row - left, middle and right.
Box filter is only used for 2x down sample or more. Its based on integer sized boxes. Technically it should be filtered edges, but thats substantially slower (roughly 100x), and at that point you may as well do a cubic filter which is more correct.
Box filter currently sums rows into a row buffer. It does this with
Mirroring will use the same slope as normal, but with a negative.
The starting coordinate needs to consider the scale factor and filter. e.g. box filter of 30x30 to 3x3 with mirroring would use -10 for step, but x = 20. width (30) - dx.
Step needs to be accurate, so it uses an integer divide. This is as much as 5% of the profile. An approximated divide is substantially faster, but the inaccuracy causes stepping beyond the original image boundaries. 3 general solutions:
1. copy image to buffer with padding. allows for small errors in stepping.
2. hash the divide, so common values are quickly found.
3. change api so caller provides the slope.
---
### Libs/Libyuv/Docs/Formats (libs/libyuv/docs/formats.md)
# Introduction
Formats (FOURCC) supported by libyuv are detailed here.
# Core Formats
There are 2 core formats supported by libyuv - I420 and ARGB. All YUV formats can be converted to/from I420. All RGB formats can be converted to/from ARGB.
Filtering functions such as scaling and planar functions work on I420 and/or ARGB.
# OSX Core Media Pixel Formats
This is how OSX formats map to libyuv
enum {
kCMPixelFormat_32ARGB = 32, FOURCC_BGRA
kCMPixelFormat_32BGRA = 'BGRA', FOURCC_ARGB
kCMPixelFormat_24RGB = 24, FOURCC_RAW
kCMPixelFormat_16BE555 = 16, Not supported.
kCMPixelFormat_16BE565 = 'B565', Not supported.
kCMPixelFormat_16LE555 = 'L555', FOURCC_RGBO
kCMPixelFormat_16LE565 = 'L565', FOURCC_RGBP
kCMPixelFormat_16LE5551 = '5551', FOURCC_RGBO
kCMPixelFormat_422YpCbCr8 = '2vuy', FOURCC_UYVY
kCMPixelFormat_422YpCbCr8_yuvs = 'yuvs', FOURCC_YUY2
kCMPixelFormat_444YpCbCr8 = 'v308', FOURCC_I444 ?
kCMPixelFormat_4444YpCbCrA8 = 'v408', Not supported.
kCMPixelFormat_422YpCbCr16 = 'v216', Not supported.
kCMPixelFormat_422YpCbCr10 = 'v210', FOURCC_V210 previously. Removed now.
kCMPixelFormat_444YpCbCr10 = 'v410', Not supported.
kCMPixelFormat_8IndexedGray_WhiteIsZero = 0x00000028, Not supported.
};
# FOURCC (Four Charactacter Code) List
The following is extracted from video_common.h as a complete list of formats supported by libyuv.
enum FourCC {
// 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed.
FOURCC_I420 = FOURCC('I', '4', '2', '0'),
FOURCC_I422 = FOURCC('I', '4', '2', '2'),
FOURCC_I444 = FOURCC('I', '4', '4', '4'),
FOURCC_I400 = FOURCC('I', '4', '0', '0'),
FOURCC_NV21 = FOURCC('N', 'V', '2', '1'),
FOURCC_NV12 = FOURCC('N', 'V', '1', '2'),
FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'),
FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'),
FOURCC_H010 = FOURCC('H', '0', '1', '0'), // unofficial fourcc. 10 bit lsb
// 1 Secondary YUV format: row biplanar.
FOURCC_M420 = FOURCC('M', '4', '2', '0'),
// 11 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp, 1 10 bpc
FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'),
FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'),
FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'),
FOURCC_AR30 = FOURCC('A', 'R', '3', '0'), // 10 bit per channel. 2101010.
FOURCC_AB30 = FOURCC('A', 'B', '3', '0'), // ABGR version of 10 bit
FOURCC_24BG = FOURCC('2', '4', 'B', 'G'),
FOURCC_RAW = FOURCC('r', 'a', 'w', ' '),
FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'),
FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE.
FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE.
FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE.
// 1 Primary Compressed YUV format.
FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'),
// 8 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias.
FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'),
FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'),
FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'),
FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420.
FOURCC_J420 = FOURCC('J', '4', '2', '0'),
FOURCC_J400 = FOURCC('J', '4', '0', '0'), // unofficial fourcc
FOURCC_H420 = FOURCC('H', '4', '2', '0'), // unofficial fourcc
FOURCC_H422 = FOURCC('H', '4', '2', '2'), // unofficial fourcc
// 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc.
FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420.
FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422.
FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444.
FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2.
FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac.
FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY.
FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac.
FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG.
FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac.
FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR.
FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW.
FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG.
FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB
FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB
FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO.
FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP.
FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO.
# Planar YUV
The following formats contains a full size Y plane followed by 1 or 2
planes for UV: I420, I422, I444, I400, NV21, NV12, I400
The size (subsampling) of the UV varies.
I420, NV12 and NV21 are half width, half height
I422, NV16 and NV61 are half width, full height
I444, NV24 and NV42 are full width, full height
I400 and J400 have no chroma channel.
# The ARGB FOURCC
There are 4 ARGB layouts - ARGB, BGRA, ABGR and RGBA. ARGB is most common by far, used for screen formats, and windows webcam drivers.
The fourcc describes the order of channels in a ***register***.
A fourcc provided by capturer, can be thought of string, e.g. "ARGB".
On little endian machines, as an int, this would have 'A' in the lowest byte. The FOURCC macro reverses the order:
#define FOURCC(a, b, c, d) (((uint32)(a)) | ((uint32)(b) << 8) | ((uint32)(c) << 16) | ((uint32)(d) << 24))
So the "ARGB" string, read as an uint32, is
FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B')
If you were to read ARGB pixels as uint32's, the alpha would be in the high byte, and the blue in the lowest byte. In memory, these are stored little endian, so 'B' is first, then 'G', 'R' and 'A' last.
When calling conversion functions, the names match the FOURCC, so in this case it would be I420ToARGB().
All formats can be converted to/from ARGB.
Most 'planar_functions' work on ARGB (e.g. ARGBBlend).
Some are channel order agnostic (e.g. ARGBScale).
Some functions are symmetric (e.g. ARGBToBGRA is the same as BGRAToARGB, so its a macro).
ARGBBlend expects preattenuated ARGB. The R,G,B are premultiplied by alpha. Other functions don't care.
# RGB24 and RAW
There are 2 RGB layouts - RGB24 (aka 24BG) and RAW
RGB24 is B,G,R in memory
RAW is R,G,B in memory
# AR30 and XR30
AR30 is 2 10 10 10 ARGB stored in little endian order.
The 2 bit alpha has 4 values. Here are the comparable 8 bit alpha values.
0 - 0. 00000000b = 0x00 = 0
1 - 33%. 01010101b = 0x55 = 85
2 - 66%. 10101010b = 0xaa = 170
3 - 100%. 11111111b = 0xff = 255
The 10 bit RGB values range from 0 to 1023.
XR30 is the same as AR30 but with no alpha channel.
# NV12 and NV21
NV12 is a biplanar format with a full sized Y plane followed by a single
chroma plane with weaved U and V values.
NV21 is the same but with weaved V and U values.
The 12 in NV12 refers to 12 bits per pixel. NV12 has a half width and half
height chroma channel, and therefore is a 420 subsampling.
NV16 is 16 bits per pixel, with half width and full height. aka 422.
NV24 is 24 bits per pixel with full sized chroma channel. aka 444.
---
### Libs/Libyuv/Docs/Getting Started (libs/libyuv/docs/getting_started.md)
# Getting Started
How to get and build the libyuv code.
## Pre-requisites
You'll need to have depot tools installed: https://www.chromium.org/developers/how-tos/install-depot-tools
Refer to chromium instructions for each platform for other prerequisites.
## Getting the Code
Create a working directory, enter it, and run:
gclient config --name src https://chromium.googlesource.com/libyuv/libyuv
gclient sync
Then you'll get a .gclient file like:
solutions = [
{ "name" : "src",
"url" : "https://chromium.googlesource.com/libyuv/libyuv",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"safesync_url": "",
},
];
For iOS add `;target_os=['ios'];` to your OSX .gclient and run `gclient sync.`
Browse the Git reprository: https://chromium.googlesource.com/libyuv/libyuv/+/master
### Android
For Android add `;target_os=['android'];` to your Linux .gclient
solutions = [
{ "name" : "src",
"url" : "https://chromium.googlesource.com/libyuv/libyuv",
"deps_file" : "DEPS",
"managed" : True,
"custom_deps" : {
},
"safesync_url": "",
},
];
target_os = ["android", "linux"];
Then run:
gclient sync
To get just the source (not buildable):
git clone https://chromium.googlesource.com/libyuv/libyuv
## Building the Library and Unittests
### Windows
call gn gen out\Release "--args=is_debug=false target_cpu=\"x64\""
call gn gen out\Debug "--args=is_debug=true target_cpu=\"x64\""
ninja -v -C out\Release
ninja -v -C out\Debug
call gn gen out\Release "--args=is_debug=false target_cpu=\"x86\""
call gn gen out\Debug "--args=is_debug=true target_cpu=\"x86\""
ninja -v -C out\Release
ninja -v -C out\Debug
### macOS and Linux
gn gen out/Release "--args=is_debug=false"
gn gen out/Debug "--args=is_debug=true"
ninja -v -C out/Release
ninja -v -C out/Debug
### Building Offical with GN
gn gen out/Official "--args=is_debug=false is_official_build=true is_chrome_branded=true"
ninja -C out/Official
### iOS
http://www.chromium.org/developers/how-tos/build-instructions-ios
Add to .gclient last line: `target_os=['ios'];`
arm64
gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"arm64\""
gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false target_cpu=\"arm64\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
ios simulator
gn gen out/Release "--args=is_debug=false target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
gn gen out/Debug "--args=is_debug=true target_os=\"ios\" ios_enable_code_signing=false use_xcode_clang=true target_cpu=\"x86\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
ios disassembly
otool -tV ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt
### Android
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
Add to .gclient last line: `target_os=['android'];`
arm64
gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"arm64\""
gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"arm64\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
armv7
gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"arm\""
gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"arm\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
ia32
gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"x86\""
gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"x86\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
mips
gn gen out/Release "--args=is_debug=false target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true"
gn gen out/Debug "--args=is_debug=true target_os=\"android\" target_cpu=\"mips64el\" mips_arch_variant=\"r6\" mips_use_msa=true is_component_build=true"
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
arm disassembly:
third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv/row_common.o >row_common.txt
third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon.o >row_neon.txt
third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt
Caveat: Disassembly may require optimize_max be disabled in BUILD.gn
Running tests:
out/Release/bin/run_libyuv_unittest -vv --gtest_filter=*
Running test as benchmark:
out/Release/bin/run_libyuv_unittest -vv --gtest_filter=* --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=-1 --libyuv_cpu_info=-1
Running test with C code:
out/Release/bin/run_libyuv_unittest -vv --gtest_filter=* --libyuv_width=1280 --libyuv_height=720 --libyuv_repeat=999 --libyuv_flags=1 --libyuv_cpu_info=1
### Build targets
ninja -C out/Debug libyuv
ninja -C out/Debug libyuv_unittest
ninja -C out/Debug compare
ninja -C out/Debug yuvconvert
ninja -C out/Debug psnr
ninja -C out/Debug cpuid
### ARM Linux
gn gen out/Release "--args=is_debug=false target_cpu=\"arm64\""
gn gen out/Debug "--args=is_debug=true target_cpu=\"arm64\""
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
### MIPS Linux
mips
gn gen out/Release "--args=is_debug=false target_os=\"linux\" target_cpu=\"mips64el\" mips_arch_variant=\"loongson3\" mips_use_mmi=true is_component_build=false use_sysroot=false use_gold=false"
gn gen out/Debug "--args=is_debug=true target_os=\"linux\" target_cpu=\"mips64el\" mips_arch_variant=\"loongson3\" mips_use_mmi=true is_component_build=false use_sysroot=false use_gold=false"
ninja -v -C out/Debug libyuv_unittest
ninja -v -C out/Release libyuv_unittest
## Building the Library with make
### Linux
make V=1 -f linux.mk
make V=1 -f linux.mk clean
make V=1 -f linux.mk CXX=clang++
## Building the library with cmake
Install cmake: http://www.cmake.org/
### Default debug build:
mkdir out
cd out
cmake ..
cmake --build .
### Release build/install
mkdir out
cd out
cmake -DCMAKE_INSTALL_PREFIX="/usr/lib" -DCMAKE_BUILD_TYPE="Release" ..
cmake --build . --config Release
sudo cmake --build . --target install --config Release
### Build RPM/DEB packages
mkdir out
cd out
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
make package
## Setup for Arm Cross compile
See also https://www.ccoderun.ca/programming/2015-12-20_CrossCompiling/index.html
sudo apt-get install ssh dkms build-essential linux-headers-generic
sudo apt-get install kdevelop cmake git subversion
sudo apt-get install graphviz doxygen doxygen-gui
sudo apt-get install manpages manpages-dev manpages-posix manpages-posix-dev
sudo apt-get install libboost-all-dev libboost-dev libssl-dev
sudo apt-get install rpm terminator fish
sudo apt-get install g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
### Build psnr tool
cd util
arm-linux-gnueabihf-g++ psnr_main.cc psnr.cc ssim.cc -o psnr
arm-linux-gnueabihf-objdump -d psnr
## Running Unittests
### Windows
out\Release\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter="*"
### macOS and Linux
out/Release/libyuv_unittest --gtest_filter="*"
Replace --gtest_filter="*" with specific unittest to run. May include wildcards.
out/Release/libyuv_unittest --gtest_filter=*I420ToARGB_Opt
## CPU Emulator tools
### Intel SDE (Software Development Emulator)
Pre-requisite: Install IntelSDE: http://software.intel.com/en-us/articles/intel-software-development-emulator
Then run:
c:\intelsde\sde -hsw -- out\Release\libyuv_unittest.exe --gtest_filter=*
~/intelsde/sde -skx -- out/Release/libyuv_unittest --gtest_filter=**I420ToARGB_Opt
### Intel Architecture Code Analyzer
Inset these 2 macros into assembly code to be analyzed:
IACA_ASM_START
IACA_ASM_END
Build the code as usual, then run iaca on the object file.
~/iaca-lin64/bin/iaca.sh -reduceout -arch HSW out/Release/obj/libyuv_internal/compare_gcc.o
## Sanitizers
gn gen out/Release "--args=is_debug=false is_msan=true"
ninja -v -C out/Release
Sanitizers available: asan, msan, tsan, ubsan, lsan, ubsan_vptr
### Running Dr Memory memcheck for Windows
Pre-requisite: Install Dr Memory for Windows and add it to your path: http://www.drmemory.org/docs/page_install_windows.html
drmemory out\Debug\libyuv_unittest.exe --gtest_catch_exceptions=0 --gtest_filter=*
---
### Libs/Libyuv/Docs/Rotation (libs/libyuv/docs/rotation.md)
# Introduction
Rotation by multiplies of 90 degrees allows mobile devices to rotate webcams from landscape to portrait. The higher level functions ConvertToI420 and ConvertToARGB allow rotation of any format. Optimized functionality is supported for I420, ARGB, NV12 and NV21.
# ConvertToI420
int ConvertToI420(const uint8* src_frame, size_t src_size,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int crop_x, int crop_y,
int src_width, int src_height,
int crop_width, int crop_height,
enum RotationMode rotation,
uint32 format);
This function crops, converts, and rotates. You should think of it in that order.
* Crops the original image, which is src_width x src_height, to crop_width x crop_height. At this point the image is still not rotated.
* Converts the cropped region to I420. Supports inverted source for src_height negative.
* Rotates by 90, 180 or 270 degrees.
The buffer the caller provides should account for rotation. Be especially important to get stride of the destination correct.
e.g.
640 x 480 NV12 captured
Crop to 640 x 360
Rotate by 90 degrees to 360 x 640.
Caller passes stride of 360 for Y and 360 / 2 for U and V.
Caller passes crop_width of 640, crop_height of 360.
# ConvertToARGB
int ConvertToARGB(const uint8* src_frame, size_t src_size,
uint8* dst_argb, int dst_stride_argb,
int crop_x, int crop_y,
int src_width, int src_height,
int crop_width, int crop_height,
enum RotationMode rotation,
uint32 format);
Same as I420, but implementation is less optimized - reads columns and writes rows, 16 bytes at a time.
# I420Rotate
int I420Rotate(const uint8* src_y, int src_stride_y,
const uint8* src_u, int src_stride_u,
const uint8* src_v, int src_stride_v,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int src_width, int src_height, enum RotationMode mode);
Destination is rotated, so pass dst_stride_y etc that consider rotation.
Rotate by 180 can be done in place, but 90 and 270 can not.
Implementation (Neon/SSE2) uses 8 x 8 block transpose, so best efficiency is with sizes and pointers that are aligned to 8.
Cropping can be achieved by adjusting the src_y/u/v pointers and src_width, src_height.
Lower level plane functions are provided, allowing other planar formats to be rotated. (e.g. I444)
For other planar YUV formats (I444, I422, I411, I400, NV16, NV24), the planar functions are exposed and can be called directly
// Rotate a plane by 0, 90, 180, or 270.
int RotatePlane(const uint8* src, int src_stride,
uint8* dst, int dst_stride,
int src_width, int src_height, enum RotationMode mode);
# ARGBRotate
LIBYUV_API
int ARGBRotate(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb, int dst_stride_argb,
int src_width, int src_height, enum RotationMode mode);
Same as I420, but implementation is less optimized - reads columns and writes rows.
Rotate by 90, or any angle, can be achieved using ARGBAffine.
# Mirror - Horizontal Flip
Mirror functions for horizontally flipping an image, which can be useful for 'self view' of a webcam.
int I420Mirror(const uint8* src_y, int src_stride_y,
const uint8* src_u, int src_stride_u,
const uint8* src_v, int src_stride_v,
uint8* dst_y, int dst_stride_y,
uint8* dst_u, int dst_stride_u,
uint8* dst_v, int dst_stride_v,
int width, int height);
int ARGBMirror(const uint8* src_argb, int src_stride_argb,
uint8* dst_argb, int dst_stride_argb,
int width, int height);
Mirror functionality can also be achieved with the I420Scale and ARGBScale functions by passing negative width and/or height.
# Invert - Vertical Flip
Inverting can be achieved with almost any libyuv function by passing a negative source height.
I420Mirror and ARGBMirror can also be used to rotate by 180 degrees by passing a negative height.
# Cropping - Vertical Flip
When cropping from a subsampled format like NV21, the method of setting the start pointers wont work for odd crop start y on the UV plane.
If the height after cropping will be odd, invert the source - point to the last row, negate the strides, and pass negative height, which
will re-invert the image as the conversion outputs.
---
### Libs/Libyuv/Tools Libyuv/Msan/Blacklist (libs/libyuv/tools_libyuv/msan/blacklist.txt)
# The rules in this file are only applied at compile time.
# Because the Chrome buildsystem does not automatically touch the files
# mentioned here, changing this file requires clobbering all MSan bots.
#
# Please think twice before you add or remove these rules.
# This is a stripped down copy of Chromium's blacklist.txt, to enable
# adding libyuv-specific blacklist entries.
---
### Libs/Libyuv/Tools Libyuv/Ubsan/Blacklist (libs/libyuv/tools_libyuv/ubsan/blacklist.txt)
#############################################################################
# UBSan blacklist.
# Please think twice before you add or remove these rules.
# This is a stripped down copy of Chromium's blacklist.txt, to enable
# adding WebRTC-specific blacklist entries.
#############################################################################
# YASM does some funny things that UBsan doesn't like.
# https://crbug.com/489901
src:*/third_party/yasm/*
#############################################################################
# Ignore system libraries.
src:*/usr/*
---
### Libs/Libyuv/Tools Libyuv/Ubsan/Vptr Blacklist (libs/libyuv/tools_libyuv/ubsan/vptr_blacklist.txt)
#############################################################################
# UBSan vptr blacklist.
# Function and type based blacklisting use a mangled name, and it is especially
# tricky to represent C++ types. For now, any possible changes by name manglings
# are simply represented as wildcard expressions of regexp, and thus it might be
# over-blacklisted.
#
# Please think twice before you add or remove these rules.
#
# This is a stripped down copy of Chromium's vptr_blacklist.txt, to enable
# adding libyuv-specific blacklist entries.
#############################################################################
# Using raw pointer values.
#
# A raw pointer value (16) is used to infer the field offset by
# GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET.
# Example:
# src:*/third_party/protobuf/src/google/protobuf/compiler/plugin.pb.cc
#############################################################################
# UBsan goes into an infinite recursion when __dynamic_cast instrumented with
# "vptr". See crbug.com/609786.
src:*/third_party/libc\+\+abi/trunk/src/private_typeinfo.cpp
---
### Libs/Libyuv/Tools Libyuv/Valgrind/Memcheck/Suppressions (libs/libyuv/tools_libyuv/valgrind/memcheck/suppressions.txt)
# This file is used in addition to the one already maintained in Chrome.
# It acts as a place holder for future additions for this project.
# It must exist for the Python wrapper script to work properly.
# There are two of suppressions in this file.
# 1. third_party libraries
# 2. libyuv stuff
# 3. libjingle stuff (talk folder)
#-----------------------------------------------------------------------
# third_party libraries
{
bug_729
Memcheck:Free
fun:_ZdaPv
...
fun:_ZN7testing8internal12UnitTestImplD1Ev
...
}
# libyuv (empty so far)
---
### Libs/Libyuv/Tools Libyuv/Valgrind/Memcheck/Suppressions Mac (libs/libyuv/tools_libyuv/valgrind/memcheck/suppressions_mac.txt)
# This file is used in addition to the one already maintained in Chrome.
# It acts as a place holder for future additions for this project.
# It must exist for the Python wrapper script to work properly.
---
### Libs/Libyuv/Tools Libyuv/Valgrind/Memcheck/Suppressions Win32 (libs/libyuv/tools_libyuv/valgrind/memcheck/suppressions_win32.txt)
# This file is used in addition to the one already maintained in Chrome.
# It acts as a place holder for future additions for this project.
# It must exist for the Python wrapper script to work properly.
---
### Libs/Libyuv/Unit Test/Testdata/Arm V7 (libs/libyuv/unit_test/testdata/arm_v7.txt)
Processor : ARMv7 Processor rev 5 (v7l)
BogoMIPS : 795.44
Features : swp half thumb fastmult vfp edsp iwmmxt thumbee vfpv3 vfpv3d16
CPU implementer : 0x56
CPU architecture: 7
CPU variant : 0x0
CPU part : 0x581
CPU revision : 5
Hardware : OLPC XO-1.75
Revision : 0000
Serial : 0000000000000000
---
### Libs/Libyuv/Unit Test/Testdata/Juno (libs/libyuv/unit_test/testdata/juno.txt)
Processor : AArch64 Processor rev 0 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant : 0x0
CPU part : 0xd07
CPU revision : 0
Hardware : Juno
---
### Libs/Miniupnpc/Changelog (libs/miniupnpc/Changelog.txt)
$Id: Changelog.txt,v 1.80 2009/04/17 21:21:19 nanard Exp $
miniUPnP client Changelog.
2009/04/17:
updating python module
Use strtoull() when using C99
2009/02/28:
Fixed miniwget.c for compiling under sun
2008/12/18:
cleanup in Makefile (thanks to Paul de Weerd)
minissdpc.c : win32 compatibility
miniupnpc.c : changed xmlns prefix from 'm' to 'u'
Removed NDEBUG (using DEBUG)
2008/10/14:
Added the ExternalHost argument to DeletePortMapping()
2008/10/11:
Added the ExternalHost argument to AddPortMapping()
Put a correct User-Agent: header in HTTP requests.
VERSION 1.2 :
2008/10/07:
Update docs
2008/09/25:
Integrated sameport patch from Dario Meloni : Added a "sameport"
argument to upnpDiscover().
2008/07/18:
small modif to make Clang happy :)
2008/07/17:
#define SOAPPREFIX "s" in miniupnpc.c in order to remove SOAP-ENV...
2008/07/14:
include declspec.h in installation (to /usr/include/miniupnpc)
VERSION 1.1 :
2008/07/04:
standard options for install/ln instead of gnu-specific stuff.
2008/07/03:
now builds a .dll and .lib with win32. (mingw32)
2008/04/28:
make install now install the binary of the upnpc tool
2008/04/27:
added testupnpigd.py
added error strings for miniupnpc "internal" errors
improved python module error/exception reporting.
2008/04/23:
Completely rewrite igd_desc_parse.c in order to be compatible with
Linksys WAG200G
Added testigddescparse
updated python module
VERSION 1.0 :
2008/02/21:
put some #ifdef DEBUG around DisplayNameValueList()
2008/02/18:
Improved error reporting in upnpcommands.c
UPNP_GetStatusInfo() returns LastConnectionError
2008/02/16:
better error handling in minisoap.c
improving display of "valid IGD found" in upnpc.c
2008/02/03:
Fixing UPNP_GetValidIGD()
improved make install :)
2007/12/22:
Adding upnperrors.c/h to provide a strupnperror() function
used to translate UPnP error codes to string.
2007/12/19:
Fixing getDevicesFromMiniSSDPD()
improved error reporting of UPnP functions
2007/12/18:
It is now possible to specify a different location for MiniSSDPd socket.
working with MiniSSDPd is now more efficient.
python module improved.
2007/12/16:
improving error reporting
2007/12/13:
Try to improve compatibility by using HTTP/1.0 instead of 1.1 and
XML a bit different for SOAP.
2007/11/25:
fixed select() call for linux
2007/11/15:
Added -fPIC to CFLAG for better shared library code.
2007/11/02:
Fixed a potential socket leak in miniwget2()
2007/10/16:
added a parameter to upnpDiscover() in order to allow the use of another
interface than the default multicast interface.
2007/10/12:
Fixed the creation of symbolic link in Makefile
2007/10/08:
Added man page
2007/10/02:
fixed memory bug in GetUPNPUrls()
2007/10/01:
fixes in the Makefile
Added UPNP_GetIGDFromUrl() and adapted the sample program accordingly.
Added SONAME in the shared library to please debian :)
fixed MS Windows compilation (minissdpd is not available under MS Windows).
2007/09/25:
small change to Makefile to be able to install in a different location
(default is /usr)
2007/09/24:
now compiling both shared and static library
2007/09/19:
Cosmetic changes on upnpc.c
2007/09/02:
adapting to new miniSSDPd (release version ?)
2007/08/31:
Usage of miniSSDPd to skip discovery process.
2007/08/27:
fixed python module to allow compilation with Python older than Python 2.4
2007/06/12:
Added a python module.
2007/05/19:
Fixed compilation under MinGW
2007/05/15:
fixed a memory leak in AddPortMapping()
Added testupnpreplyparse executable to check the parsing of
upnp soap messages
minixml now ignore namespace prefixes.
2007/04/26:
upnpc now displays external ip address with -s or -l
2007/04/11:
changed MINIUPNPC_URL_MAXSIZE to 128 to accomodate the "BT Voyager 210"
2007/03/19:
cleanup in miniwget.c
2007/03/01:
Small typo fix...
2007/01/30:
Now parsing the HTTP header from SOAP responses in order to
get content-length value.
2007/01/29:
Fixed the Soap Query to speedup the HTTP request.
added some Win32 DLL stuff...
2007/01/27:
Fixed some WIN32 compatibility issues
2006/12/14:
Added UPNPIGD_IsConnected() function in miniupnp.c/.h
Added UPNP_GetValidIGD() in miniupnp.c/.h
cleaned upnpc.c main(). now using UPNP_GetValidIGD()
2006/12/07:
Version 1.0-RC1 released
2006/12/03:
Minor changes to compile under SunOS/Solaris
2006/11/30:
made a minixml parser validator program
updated minixml to handle attributes correctly
2006/11/22:
Added a -r option to the upnpc sample thanks to Alexander Hubmann.
2006/11/19:
Cleanup code to make it more ANSI C compliant
2006/11/10:
detect and display local lan address.
2006/11/04:
Packets and Bytes Sent/Received are now unsigned int.
2006/11/01:
Bug fix thanks to Giuseppe D'Angelo
2006/10/31:
C++ compatibility for .h files.
Added a way to get ip Address on the LAN used to reach the IGD.
2006/10/25:
Added M-SEARCH to the services in the discovery process.
2006/10/22:
updated the Makefile to use makedepend, added a "make install"
update Makefile
2006/10/20:
fixing the description url parsing thanks to patch sent by
Wayne Dawe.
Fixed/translated some comments.
Implemented a better discover process, first looking
for IGD then for root devices (as some devices only reply to
M-SEARCH for root devices).
2006/09/02:
added freeUPNPDevlist() function.
2006/08/04:
More command line arguments checking
2006/08/01:
Added the .bat file to compile under Win32 with minGW32
2006/07/31:
Fixed the rootdesc parser (igd_desc_parse.c)
2006/07/20:
parseMSEARCHReply() is now returning the ST: line as well
starting changes to detect several UPnP devices on the network
2006/07/19:
using GetCommonLinkProperties to get down/upload bitrate
---
### Libs/Srtp/README (libs/srtp/README.md)
[](https://github.com/cisco/libsrtp/actions/workflows/cmake.yml)
[](https://travis-ci.org/cisco/libsrtp)
[](https://scan.coverity.com/projects/cisco-libsrtp)
[](https://oss-fuzz-build-logs.storage.googleapis.com/index.html#libsrtp)
# Introduction to libSRTP
This package provides an implementation of the Secure Real-time
Transport Protocol (SRTP), the Universal Security Transform (UST), and
a supporting cryptographic kernel. The SRTP API is documented in include/srtp.h,
and the library is in libsrtp2.a (after compilation).
This document describes libSRTP, the Open Source Secure RTP library
from Cisco Systems, Inc. RTP is the Real-time Transport Protocol, an
IETF standard for the transport of real-time data such as telephony,
audio, and video, defined by [RFC 3550](https://tools.ietf.org/html/rfc3550).
Secure RTP (SRTP) is an RTP profile for providing confidentiality to RTP data
and authentication to the RTP header and payload. SRTP is an IETF Standard,
defined in [RFC 3711](https://tools.ietf.org/html/rfc3711), and was developed
in the IETF Audio/Video Transport (AVT) Working Group. This library supports
all of the mandatory features of SRTP, but not all of the optional features. See
the [Supported Features](#supported-features) section for more detailed information.
This document is also used to generate the documentation files in the /doc/
folder where a more detailed reference to the libSRTP API and related functions
can be created (requires installing doxygen.). The reference material is created
automatically from comments embedded in some of the C header files. The
documentation is organized into modules in order to improve its clarity. These
modules do not directly correspond to files. An underlying cryptographic kernel
provides much of the basic functionality of libSRTP but is mostly undocumented
because it does its work behind the scenes.
--------------------------------------------------------------------------------
# Contact Us
- [libsrtp@lists.packetizer.com](mailto:libsrtp@lists.packetizer.com) general mailing list for news / announcements / discussions. This is an open list, see
[https://lists.packetizer.com/mailman/listinfo/libsrtp](https://lists.packetizer.com/mailman/listinfo/libsrtp) for singing up.
- [libsrtp-security@lists.packetizer.com](mailto:libsrtp-security@lists.packetizer.com) for disclosing security issues to the libsrtp maintenance team. This is a closed list but anyone can send to it.
--------------------------------------------------------------------------------
## Contents
- [Introduction to libSRTP](#introduction-to-libsrtp)
- [Contact Us](#contact-us)
- [Contents](#contents)
- [License and Disclaimer](#license-and-disclaimer)
- [libSRTP Overview](#libsrtp-overview)
- [Secure RTP Background](#secure-rtp-background)
- [Supported Features](#supported-features)
- [Implementation Notes](#implementation-notes)
- [Installing and Building libSRTP](#installing-and-building-libsrtp)
- [Changing Build Configuration](#changing-build-configuration)
- [Using Visual Studio](#using-visual-studio)
- [Applications](#applications)
- [Example Code](#example-code)
- [Credits](#credits)
- [References](#references)
--------------------------------------------------------------------------------
# License and Disclaimer
libSRTP is distributed under the following license, which is included
in the source code distribution. It is reproduced in the manual in
case you got the library from another source.
> Copyright (c) 2001-2017 Cisco Systems, Inc. All rights reserved.
>
> Redistribution and use in source and binary forms, with or without
> modification, are permitted provided that the following conditions
> are met:
>
> - Redistributions of source code must retain the above copyright
> notice, this list of conditions and the following disclaimer.
> - Redistributions in binary form must reproduce the above copyright
> notice, this list of conditions and the following disclaimer in
> the documentation and/or other materials provided with the distribution.
> - Neither the name of the Cisco Systems, Inc. nor the names of its
> contributors may be used to endorse or promote products derived
> from this software without specific prior written permission.
>
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
> COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
> INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
> (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
> STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
> OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
# libSRTP Overview
libSRTP provides functions for protecting RTP and RTCP. RTP packets
can be encrypted and authenticated (using the `srtp_protect()`
function), turning them into SRTP packets. Similarly, SRTP packets
can be decrypted and have their authentication verified (using the
`srtp_unprotect()` function), turning them into RTP packets. Similar
functions apply security to RTCP packets.
The typedef `srtp_stream_t` points to a structure holding all of the
state associated with an SRTP stream, including the keys and
parameters for cipher and message authentication functions and the
anti-replay data. A particular `srtp_stream_t` holds the information
needed to protect a particular RTP and RTCP stream. This datatype
is intentionally opaque in order to better seperate the libSRTP
API from its implementation.
Within an SRTP session, there can be multiple streams, each
originating from a particular sender. Each source uses a distinct
stream context to protect the RTP and RTCP stream that it is
originating. The typedef `srtp_t` points to a structure holding all of
the state associated with an SRTP session. There can be multiple
stream contexts associated with a single `srtp_t`. A stream context
cannot exist indepent from an `srtp_t`, though of course an `srtp_t` can
be created that contains only a single stream context. A device
participating in an SRTP session must have a stream context for each
source in that session, so that it can process the data that it
receives from each sender.
In libSRTP, a session is created using the function `srtp_create()`.
The policy to be implemented in the session is passed into this
function as an `srtp_policy_t` structure. A single one of these
structures describes the policy of a single stream. These structures
can also be linked together to form an entire session policy. A linked
list of `srtp_policy_t` structures is equivalent to a session policy.
In such a policy, we refer to a single `srtp_policy_t` as an *element*.
An `srtp_policy_t` structure contains two `srtp_crypto_policy_t` structures
that describe the cryptograhic policies for RTP and RTCP, as well as
the SRTP master key and the SSRC value. The SSRC describes what to
protect (e.g. which stream), and the `srtp_crypto_policy_t` structures
describe how to protect it. The key is contained in a policy element
because it simplifies the interface to the library. In many cases, it
is desirable to use the same cryptographic policies across all of the
streams in a session, but to use a distinct key for each stream. A
`srtp_crypto_policy_t` structure can be initialized by using either the
`srtp_crypto_policy_set_rtp_default()` or `srtp_crypto_policy_set_rtcp_default()`
functions, which set a crypto policy structure to the default policies
for RTP and RTCP protection, respectively.
--------------------------------------------------------------------------------
## Secure RTP Background
In this section we review SRTP and introduce some terms that are used
in libSRTP. An RTP session is defined by a pair of destination
transport addresses, that is, a network address plus a pair of UDP
ports for RTP and RTCP. RTCP, the RTP control protocol, is used to
coordinate between the participants in an RTP session, e.g. to provide
feedback from receivers to senders. An *SRTP session* is
similarly defined; it is just an RTP session for which the SRTP
profile is being used. An SRTP session consists of the traffic sent
to the SRTP or SRTCP destination transport addresses. Each
participant in a session is identified by a synchronization source
(SSRC) identifier. Some participants may not send any SRTP traffic;
they are called receivers, even though they send out SRTCP traffic,
such as receiver reports.
RTP allows multiple sources to send RTP and RTCP traffic during the
same session. The synchronization source identifier (SSRC) is used to
distinguish these sources. In libSRTP, we call the SRTP and SRTCP
traffic from a particular source a *stream*. Each stream has its own
SSRC, sequence number, rollover counter, and other data. A particular
choice of options, cryptographic mechanisms, and keys is called a
*policy*. Each stream within a session can have a distinct policy
applied to it. A session policy is a collection of stream policies.
A single policy can be used for all of the streams in a given session,
though the case in which a single *key* is shared across multiple
streams requires care. When key sharing is used, the SSRC values that
identify the streams **must** be distinct. This requirement can be
enforced by using the convention that each SRTP and SRTCP key is used
for encryption by only a single sender. In other words, the key is
shared only across streams that originate from a particular device (of
course, other SRTP participants will need to use the key for
decryption). libSRTP supports this enforcement by detecting the case
in which a key is used for both inbound and outbound data.
--------------------------------------------------------------------------------
## Supported Features
This library supports all of the mandatory-to-implement features of
SRTP (as defined in [RFC 3711](https://tools.ietf.org/html/rfc3711)). Some of these
features can be selected (or de-selected) at run time by setting an
appropriate policy; this is done using the structure `srtp_policy_t`.
Some other behaviors of the protocol can be adapted by defining an
approriate event handler for the exceptional events; see the SRTPevents
section in the generated documentation.
Some options that are described in the SRTP specification are not
supported. This includes
- key derivation rates other than zero,
- the cipher F8,
- the use of the packet index to select between master keys.
The user should be aware that it is possible to misuse this libary,
and that the result may be that the security level it provides is
inadequate. If you are implementing a feature using this library, you
will want to read the Security Considerations section of [RFC 3711](https://tools.ietf.org/html/rfc3711#section-9).
In addition, it is important that you read and understand the
terms outlined in the [License and Disclaimer](#license-and-disclaimer) section.
--------------------------------------------------------------------------------
## Implementation Notes
* The `srtp_protect()` function assumes that the buffer holding the
rtp packet has enough storage allocated that the authentication
tag can be written to the end of that packet. If this assumption
is not valid, memory corruption will ensue.
* Automated tests for the crypto functions are provided through
the `cipher_type_self_test()` and `auth_type_self_test()` functions.
These functions should be used to test each port of this code
to a new platform.
* Replay protection is contained in the crypto engine, and
tests for it are provided.
* This implementation provides calls to initialize, protect, and
unprotect RTP packets, and makes as few as possible assumptions
about how these functions will be called. For example, the
caller is not expected to provide packets in order (though if
they're called more than 65k out of sequence, synchronization
will be lost).
* The sequence number in the rtp packet is used as the low 16 bits
of the sender's local packet index. Note that RTP will start its
sequence number in a random place, and the SRTP layer just jumps
forward to that number at its first invocation. An earlier
version of this library used initial sequence numbers that are
less than 32,768; this trick is no longer required as the
`rdbx_estimate_index(...)` function has been made smarter.
* The replay window for (S)RTCP is hardcoded to 128 bits in length.
--------------------------------------------------------------------------------
# Installing and Building libSRTP
To install libSRTP, download the latest release of the distribution
from [https://github.com/cisco/libsrtp/releases](https://github.com/cisco/libsrtp/releases).
You probably want to get the most recent release. Unpack the distribution and
extract the source files; the directory into which the source files
will go is named `libsrtp-A-B-C` where `A` is the version number, `B` is the
major release number and `C` is the minor release number.
libSRTP uses the GNU `autoconf` and `make` utilities (BSD make will not work; if
both versions of make are on your platform, you can invoke GNU make as
`gmake`.). In the `libsrtp` directory, run the configure script and then
make:
~~~.txt
./configure [ options ]
make
~~~
The configure script accepts the following options:
Option | Description
-------------------------------|--------------------
\-\-help \-h | Display help
\-\-enable-debug-logging | Enable debug logging in all modules
\-\-enable-log-stdout | Enable logging to stdout
\-\-enable-openssl | Enable OpenSSL crypto engine
\-\-enable-openssl-kdf | Enable OpenSSL KDF algorithm
\-\-with-log-file | Use file for logging
\-\-with-openssl-dir | Location of OpenSSL installation
By default there is no log output, logging can be enabled to be output to stdout
or a given file using the configure options.
This package has been tested on the following platforms: Mac OS X
(powerpc-apple-darwin1.4), Cygwin (i686-pc-cygwin), Solaris
(sparc-sun-solaris2.6), RedHat Linux 7.1 and 9 (i686-pc-linux), and
OpenBSD (sparc-unknown-openbsd2.7).
--------------------------------------------------------------------------------
## Changing Build Configuration
To build the `./configure` script mentioned above, libSRTP relies on the
[automake](https://www.gnu.org/software/automake/) toolchain. Since
`./configure` is built from `configure.in` by automake, if you make changes in
how `./configure` works (e.g., to add a new library dependency), you will need
to rebuild `./configure` and commit the updated version. In addition to
automake itself, you will need to have the `pkgconfig` tools installed as well.
For example, on macOS:
```
brew install automake pkgconfig
# Edit configure.in
autoremake -ivf
```
--------------------------------------------------------------------------------
## Using Visual Studio
On Windows one can use Visual Studio via CMake. CMake can be downloaded here:
https://cmake.org/ . To create Visual Studio build files, for example run the
following commands:
```
# Create build subdirectory
mkdir build
cd build
# Make project files
cmake .. -G "Visual Studio 15 2017"
# Or for 64 bit project files
cmake .. -G "Visual Studio 15 2017 Win64"
```
--------------------------------------------------------------------------------
## Using Meson
On all platforms including Windows, one can build using [Meson](https://mesonbuild.org).
Steps to download Meson are here: https://mesonbuild.com/Getting-meson.html
To build with Meson, you can do something like:
```
# Setup the build subdirectory
meson setup --prefix=/path/to/prefix builddir
# Build the project
meson compile -C builddir
# Run tests
meson test -C builddir
# Optionally, install
meson install -C builddir
```
To build with Visual Studio, run the above commands from inside a Visual Studio
command prompt, or run `vcvarsall.bat` with the appropriate arguments inside
a Command Prompt.
Note that you can also replace the above commands with the appropriate `ninja`
targets: `ninja -C build`, `ninja -C build test`, `ninja -C build install`.
--------------------------------------------------------------------------------
# Applications
Several test drivers and a simple and portable srtp application are
included in the `test/` subdirectory.
Test driver | Function tested
--------- | -------
kernel_driver | crypto kernel (ciphers, auth funcs, rng)
srtp_driver | srtp in-memory tests (does not use the network)
rdbx_driver | rdbx (extended replay database)
roc_driver | extended sequence number functions
replay_driver | replay database
cipher_driver | ciphers
auth_driver | hash functions
The app `rtpw` is a simple rtp application which reads words from
`/usr/dict/words` and then sends them out one at a time using [s]rtp.
Manual srtp keying uses the -k option; automated key management
using gdoi will be added later.
usage:
~~~.txt
rtpw [[-d ]* [-k|b [-a][-e ][-g]] [-s | -r] dest_ip dest_port] | [-l]
~~~
Either the -s (sender) or -r (receiver) option must be chosen. The
values `dest_ip`, `dest_port` are the IP address and UDP port to which
the dictionary will be sent, respectively.
The options are:
Option | Description
--------- | -------
-s | (S)RTP sender - causes app to send words
-r | (S)RTP receive - causes app to receive words
-k | use SRTP master key , where the key is a hexadecimal (without the leading "0x")
-b | same as -k but with base64 encoded key
-e | encrypt/decrypt (for data confidentiality) (requires use of -k option as well) (use 128, 192, or 256 for keysize)
-g | use AES-GCM mode (must be used with -e)
-a | message authentication (requires use of -k option as well)
-l | list the available debug modules
-d | turn on debugging for module
In order to get random 30-byte values for use as key/salt pairs , you
can use the following bash function to format the output of
`/dev/random` (where that device is available).
~~~.txt
function randhex() {
cat /dev/random | od --read-bytes=32 --width=32 -x | awk '{ print $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 }'
}
~~~
An example of an SRTP session using two rtpw programs follows:
~~~.txt
set k=c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451
[sh1]$ test/rtpw -s -k $k -e 128 -a 0.0.0.0 9999
Security services: confidentiality message authentication
set master key/salt to C1EEC3717DA76195BB878578790AF71C/4EE9F859E197A414A78D5ABC7451
setting SSRC to 2078917053
sending word: A
sending word: a
sending word: aa
sending word: aal
...
[sh2]$ test/rtpw -r -k $k -e 128 -a 0.0.0.0 9999
security services: confidentiality message authentication
set master key/salt to C1EEC3717DA76195BB878578790AF71C/4EE9F859E197A414A78D5ABC7451
19 octets received from SSRC 2078917053 word: A
19 octets received from SSRC 2078917053 word: a
20 octets received from SSRC 2078917053 word: aa
21 octets received from SSRC 2078917053 word: aal
...
~~~
--------------------------------------------------------------------------------
## Example Code
This section provides a simple example of how to use libSRTP. The
example code lacks error checking, but is functional. Here we assume
that the value ssrc is already set to describe the SSRC of the stream
that we are sending, and that the functions `get_rtp_packet()` and
`send_srtp_packet()` are available to us. The former puts an RTP packet
into the buffer and returns the number of octets written to that
buffer. The latter sends the RTP packet in the buffer, given the
length as its second argument.
~~~.c
srtp_t session;
srtp_policy_t policy;
// Set key to predetermined value
uint8_t key[30] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D};
// initialize libSRTP
srtp_init();
// default policy values
memset(&policy, 0x0, sizeof(srtp_policy_t));
// set policy to describe a policy for an SRTP stream
srtp_crypto_policy_set_rtp_default(&policy.rtp);
srtp_crypto_policy_set_rtcp_default(&policy.rtcp);
policy.ssrc = ssrc;
policy.key = key;
policy.next = NULL;
// allocate and initialize the SRTP session
srtp_create(&session, &policy);
// main loop: get rtp packets, send srtp packets
while (1) {
char rtp_buffer[2048];
unsigned len;
len = get_rtp_packet(rtp_buffer);
srtp_protect(session, rtp_buffer, &len);
send_srtp_packet(rtp_buffer, len);
}
~~~
--------------------------------------------------------------------------------
# Credits
The original implementation and documentation of libSRTP was written
by David McGrew of Cisco Systems, Inc. in order to promote the use,
understanding, and interoperability of Secure RTP. Michael Jerris
contributed support for building under MSVC. Andris Pavenis
contributed many important fixes. Brian West contributed changes to
enable dynamic linking. Yves Shumann reported documentation bugs.
Randell Jesup contributed a working SRTCP implementation and other
fixes. Steve Underwood contributed x86_64 portability changes. We also give
thanks to Fredrik Thulin, Brian Weis, Mark Baugher, Jeff Chan, Bill
Simon, Douglas Smith, Bill May, Richard Preistley, Joe Tardo and
others for contributions, comments, and corrections.
This reference material, when applicable, in this documenation was generated
using the doxygen utility for automatic documentation of source code.
Copyright 2001-2005 by David A. McGrew, Cisco Systems, Inc.
--------------------------------------------------------------------------------
# References
SRTP and ICM References
September, 2005
Secure RTP is defined in [RFC 3711](https://tools.ietf.org/html/rfc3711).
The counter mode definition is in [Section 4.1.1](https://tools.ietf.org/html/rfc3711#section-4.1.1).
SHA-1 is defined in [FIPS PUB 180-4](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf).
HMAC is defined in [RFC 2104](https://tools.ietf.org/html/rfc2104)
and HMAC-SHA1 test vectors are available
in [RFC 2202](https://tools.ietf.org/html/rfc2202#section-3).
AES-GCM usage in SRTP is defined in [RFC 7714](https://tools.ietf.org/html/rfc7714)
---
### Libs/Srtp/CMakeLists (libs/srtp/CMakeLists.txt)
cmake_minimum_required(VERSION 3.12)
project(libsrtp2 VERSION 2.4.0 LANGUAGES C)
set(PACKAGE_VERSION ${CMAKE_PROJECT_VERSION})
set(PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_VERSION}")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(TestBigEndian)
include(CheckIncludeFile)
include(CheckFunctionExists)
include(CheckTypeSize)
include(CheckCSourceCompiles)
test_big_endian(WORDS_BIGENDIAN)
if (NOT APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
set (HAVE_X86 TRUE)
else ()
set (HAVE_X86 FALSE)
endif ()
check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
check_include_file(byteswap.h HAVE_BYTESWAP_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_include_file(machine/types.h HAVE_MACHINE_TYPES_H)
check_include_file(netinet/in.h HAVE_NETINET_IN_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_include_file(sys/int_types.h HAVE_SYS_INT_TYPES_H)
check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(windows.h HAVE_WINDOWS_H)
check_include_file(winsock2.h HAVE_WINSOCK2_H)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(inet_aton HAVE_INET_ATON)
check_function_exists(usleep HAVE_USLEEP)
check_type_size(uint8_t UINT8_T)
check_type_size(uint16_t UINT16_T)
check_type_size(uint32_t UINT32_T)
check_type_size(uint64_t UINT64_T)
check_type_size(int32_t INT32_T)
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
check_c_source_compiles("inline void func(); void func() { } int main() { func(); return 0; }" HAVE_INLINE)
if(NOT HAVE_INLINE)
check_c_source_compiles("__inline void func(); void func() { } int main() { func(); return 0; }" HAVE___INLINE)
endif()
set(ENABLE_DEBUG_LOGGING OFF CACHE BOOL "Enable debug logging in all modules")
set(ERR_REPORTING_STDOUT OFF CACHE BOOL "Enable logging to stdout")
set(ERR_REPORTING_FILE "" CACHE FILEPATH "Use file for logging")
set(ENABLE_OPENSSL OFF CACHE BOOL "Enable OpenSSL crypto engine")
set(ENABLE_MBEDTLS OFF CACHE BOOL "Enable MbedTLS crypto engine")
set(ENABLE_NSS OFF CACHE BOOL "Enable NSS crypto engine")
set(TEST_APPS ON CACHE BOOL "Build test applications")
set(BUILD_WITH_SANITIZERS OFF CACHE BOOL "Adds sanitizer flags to compiler")
option(BUILD_SHARED_LIBS "Build shared library" OFF)
if(ENABLE_OPENSSL OR ENABLE_MBEDTLS OR ENABLE_NSS)
set(USE_EXTERNAL_CRYPTO TRUE)
else()
set(USE_EXTERNAL_CRYPTO FALSE)
endif()
if(ENABLE_OPENSSL)
if(ENABLE_NSS OR ENABLE_MBEDTLS)
message(FATAL_ERROR "ssl conflict. can not enable openssl and mbedtls or nss simultaneously.")
endif()
find_package(OpenSSL REQUIRED)
set(OPENSSL ${ENABLE_OPENSSL} CACHE BOOL INTERNAL)
set(GCM ${ENABLE_OPENSSL} CACHE BOOL INTERNAL)
endif()
if(ENABLE_MBEDTLS)
if(ENABLE_OPENSSL OR ENABLE_NSS)
message(FATAL_ERROR "ssl conflict. can not enable mbedtls and openssl or nss simultaneously.")
endif()
find_package(MbedTLS REQUIRED)
set(MBEDTLS ${ENABLE_MBEDTLS} CACHE BOOL INTERNAL)
set(GCM ${ENABLE_MBEDTLS} CACHE BOOL INTERNAL)
endif()
if(ENABLE_NSS)
if(ENABLE_OPENSSL OR ENABLE_MBEDTLS)
message(FATAL_ERROR "ssl conflict. can not enable nss and openssl or mbedtls simultaneously.")
endif()
find_package(NSS REQUIRED)
set(NSS ${ENABLE_NSS} CACHE BOOL INTERNAL)
set(GCM ${ENABLE_NSS} CACHE BOOL INTERNAL)
endif()
set(CONFIG_FILE_DIR ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CONFIG_FILE_DIR})
configure_file(config_in_cmake.h ${CONFIG_FILE_DIR}/config.h)
add_definitions(-DHAVE_CONFIG_H)
if(BUILD_WITH_SANITIZERS AND NOT WIN32)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SANITIZERS address,undefined)
else()
set(SANITIZERS leak,address,undefined)
endif()
message(STATUS "Using sanitizers: ${SANITIZERS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZERS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZERS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZERS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZERS}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=${SANITIZERS}")
endif()
set(SOURCES_C
srtp/srtp.c
)
set(CIPHERS_SOURCES_C
crypto/cipher/cipher.c
crypto/cipher/cipher_test_cases.c
crypto/cipher/cipher_test_cases.h
crypto/cipher/null_cipher.c
)
if(ENABLE_OPENSSL)
list(APPEND CIPHERS_SOURCES_C
crypto/cipher/aes_icm_ossl.c
crypto/cipher/aes_gcm_ossl.c
)
elseif(ENABLE_MBEDTLS)
list(APPEND CIPHERS_SOURCES_C
crypto/cipher/aes_icm_mbedtls.c
crypto/cipher/aes_gcm_mbedtls.c
)
elseif(ENABLE_NSS)
list(APPEND CIPHERS_SOURCES_C
crypto/cipher/aes_icm_nss.c
crypto/cipher/aes_gcm_nss.c
)
else()
list(APPEND CIPHERS_SOURCES_C
crypto/cipher/aes.c
crypto/cipher/aes_icm.c
)
endif()
set(HASHES_SOURCES_C
crypto/hash/auth.c
crypto/hash/auth_test_cases.c
crypto/hash/auth_test_cases.h
crypto/hash/null_auth.c
)
if(ENABLE_OPENSSL)
list(APPEND HASHES_SOURCES_C
crypto/hash/hmac_ossl.c
)
elseif(ENABLE_MBEDTLS)
list(APPEND HASHES_SOURCES_C
crypto/hash/hmac_mbedtls.c
)
elseif(ENABLE_NSS)
list(APPEND HASHES_SOURCES_C
crypto/hash/hmac_nss.c
)
else()
list(APPEND HASHES_SOURCES_C
crypto/hash/hmac.c
crypto/hash/sha1.c
)
endif()
set(KERNEL_SOURCES_C
crypto/kernel/alloc.c
crypto/kernel/crypto_kernel.c
crypto/kernel/err.c
crypto/kernel/key.c
)
set(MATH_SOURCES_C
crypto/math/datatypes.c
)
set(REPLAY_SOURCES_C
crypto/replay/rdb.c
crypto/replay/rdbx.c
)
set(SOURCES_H
crypto/include/aes.h
crypto/include/aes_icm.h
crypto/include/alloc.h
crypto/include/auth.h
crypto/include/cipher.h
crypto/include/cipher_types.h
crypto/include/crypto_kernel.h
crypto/include/crypto_types.h
crypto/include/datatypes.h
crypto/include/err.h
crypto/include/hmac.h
crypto/include/integers.h
crypto/include/key.h
crypto/include/null_auth.h
crypto/include/null_cipher.h
crypto/include/rdb.h
crypto/include/rdbx.h
crypto/include/sha1.h
include/srtp.h
include/srtp_priv.h
${CONFIG_FILE_DIR}/config.h
)
if(BUILD_SHARED_LIBS AND WIN32)
list(APPEND SOURCES_C
srtp.def
)
endif()
source_group("src" FILES ${SOURCES_C})
source_group("src\\Ciphers" FILES ${CIPHERS_SOURCES_C})
source_group("src\\Hashes" FILES ${HASHES_SOURCES_C})
source_group("src\\Kernel" FILES ${KERNEL_SOURCES_C})
source_group("src\\Math" FILES ${MATH_SOURCES_C})
source_group("src\\Replay" FILES ${REPLAY_SOURCES_C})
source_group("include" FILES ${SOURCES_H})
add_library(srtp2
${SOURCES_C}
${CIPHERS_SOURCES_C}
${HASHES_SOURCES_C}
${KERNEL_SOURCES_C}
${MATH_SOURCES_C}
${REPLAY_SOURCES_C}
${SOURCES_H}
)
set_target_properties(srtp2 PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
target_include_directories(srtp2 PUBLIC crypto/include include)
if(ENABLE_OPENSSL)
target_include_directories(srtp2 PRIVATE ${OPENSSL_INCLUDE_DIR})
target_link_libraries(srtp2 OpenSSL::Crypto)
elseif(ENABLE_MBEDTLS)
target_include_directories(srtp2 PRIVATE ${MBEDTLS_INCLUDE_DIRS})
target_link_libraries(srtp2 ${MBEDTLS_LIBRARIES})
elseif(ENABLE_NSS)
target_include_directories(srtp2 PRIVATE ${NSS_INCLUDE_DIRS})
target_link_libraries(srtp2 ${NSS_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(srtp2 ws2_32)
target_compile_definitions(srtp2 PUBLIC _CRT_SECURE_NO_WARNINGS)
endif()
install(TARGETS srtp2 DESTINATION lib)
install(FILES include/srtp.h crypto/include/auth.h
crypto/include/cipher.h
crypto/include/crypto_types.h
DESTINATION include/srtp2)
if(TEST_APPS)
enable_testing()
if(NOT (BUILD_SHARED_LIBS AND WIN32))
if(NOT USE_EXTERNAL_CRYPTO)
add_executable(aes_calc crypto/test/aes_calc.c test/getopt_s.c test/util.c)
target_include_directories(aes_calc PRIVATE test)
target_link_libraries(aes_calc srtp2)
add_test(aes_calc_128 aes_calc 000102030405060708090a0b0c0d0e0f
00112233445566778899aabbccddeeff
69c4e0d86a7b0430d8cdb78070b4c55a)
add_test(aes_calc_256 aes_calc 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
00112233445566778899aabbccddeeff
8ea2b7ca516745bfeafc49904b496089)
add_executable(sha1_driver crypto/test/sha1_driver.c test/util.c)
target_include_directories(sha1_driver PRIVATE test)
target_link_libraries(sha1_driver srtp2)
add_test(sha1_driver sha1_driver -v)
endif()
add_executable(datatypes_driver crypto/test/datatypes_driver.c test/util.c)
target_include_directories(datatypes_driver PRIVATE test)
target_link_libraries(datatypes_driver srtp2)
add_test(datatypes_driver datatypes_driver -v)
add_executable(cipher_driver crypto/test/cipher_driver.c test/getopt_s.c)
target_include_directories(cipher_driver PRIVATE test)
target_link_libraries(cipher_driver srtp2)
add_test(cipher_driver cipher_driver -v)
add_executable(kernel_driver crypto/test/kernel_driver.c test/getopt_s.c)
target_include_directories(kernel_driver PRIVATE test)
target_link_libraries(kernel_driver srtp2)
add_test(kernel_driver kernel_driver -v)
add_executable(rdbx_driver test/rdbx_driver.c test/getopt_s.c test/ut_sim.c)
target_include_directories(rdbx_driver PRIVATE test)
target_link_libraries(rdbx_driver srtp2)
add_test(rdbx_driver rdbx_driver -v)
add_executable(replay_driver test/replay_driver.c test/ut_sim.c)
target_include_directories(replay_driver PRIVATE test)
target_link_libraries(replay_driver srtp2)
add_test(replay_driver replay_driver -v)
add_executable(roc_driver test/roc_driver.c test/ut_sim.c)
target_include_directories(roc_driver PRIVATE test)
target_link_libraries(roc_driver srtp2)
add_test(roc_driver roc_driver -v)
endif()
add_executable(srtp_driver test/srtp_driver.c
test/util.c test/getopt_s.c)
target_link_libraries(srtp_driver srtp2)
add_test(srtp_driver srtp_driver -v)
if(NOT (BUILD_SHARED_LIBS AND WIN32))
add_executable(test_srtp test/test_srtp.c)
if(ENABLE_OPENSSL)
target_include_directories(test_srtp PRIVATE ${OPENSSL_INCLUDE_DIR})
elseif(ENABLE_MBEDTLS)
target_include_directories(test_srtp PRIVATE ${MBEDTLS_INCLUDE_DIRS})
elseif(ENABLE_NSS)
target_include_directories(test_srtp PRIVATE ${NSS_INCLUDE_DIRS})
endif()
target_link_libraries(test_srtp srtp2)
add_test(test_srtp test_srtp)
endif()
find_program(BASH_PROGRAM bash)
if(BASH_PROGRAM AND NOT WIN32)
add_executable(rtpw test/rtpw.c test/rtp.c test/util.c test/getopt_s.c)
target_link_libraries(rtpw srtp2)
add_test(NAME rtpw_test
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/rtpw_test.sh -w ${CMAKE_CURRENT_SOURCE_DIR}/test/words.txt
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
if(GCM)
add_test(NAME rtpw_test_gcm
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test/rtpw_test_gcm.sh -w ${CMAKE_CURRENT_SOURCE_DIR}/test/words.txt
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
endif()
endif()
---
### Libs/Srtp/Meson Options (libs/srtp/meson_options.txt)
option('debug-logging', type : 'boolean', value : false,
description : 'Enable debug logging in all modules')
option('log-stdout', type : 'boolean', value : false,
description : 'Redirect logging to stdout')
option('log-file', type : 'string', value : '',
description : 'Write logging output into this file')
option('crypto-library', type: 'combo', choices : ['none', 'openssl', 'nss'], value : 'none',
description : 'What external crypto library to leverage, if any (OpenSSL or NSS)')
option('crypto-library-kdf', type : 'feature', value : 'auto',
description : 'Use the external crypto library for Key Derivation Function support')
option('fuzzer', type : 'feature', value : 'disabled',
description : 'Build libsrtp2 fuzzer (requires build with clang)')
option('tests', type : 'feature', value : 'auto', yield : true,
description : 'Build test applications')
option('pcap-tests', type : 'feature', value : 'auto',
description : 'Build test application that require libpcap')
option('doc', type : 'feature', value : 'auto', yield : true,
description : 'Generate API documentation with doxygen')
---
### Libs/Srtp/.Travis.Yml (libs/srtp/.travis.yml)
dist: xenial
language: c
env:
global:
- secure: "QD09MuUxftXRXtz7ZrB7S0NV/3O9yVhjvIlCSbXN8B87rNSDC8wxMThKMT7iZewnqGk53m+Up19PiMw5ERlHose5tm2cmY1FO/l+c9oAyWZaAL+4XNXryq6zI5F5FX5I61NbfqV3xcnfLTI2QIJF6WqDojNxhPjTbNzQGxIDuqw="
matrix:
include:
# linux build
- os: linux
env:
- TEST="linux (gcc)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure
- make
- make runtest
- make runtest-valgrind
- make distclean
- mkdir build && cd build
- cmake -DBUILD_WITH_SANITIZERS=TRUE ..
- make
- CTEST_OUTPUT_ON_FAILURE=1 make test
- cd ..
- CC=gcc-6 meson setup --werror builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with openssl
- os: linux
env:
- TEST="linux openssl (gcc)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- make runtest-valgrind
- make distclean
- mkdir build && cd build
- cmake -DENABLE_OPENSSL=ON -DBUILD_WITH_SANITIZERS=TRUE ..
- make
- CTEST_OUTPUT_ON_FAILURE=1 make test
- cd ..
- mkdir build_shared && cd build_shared
- cmake -DENABLE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON ..
- make
- make test
- cd ..
- meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with openssl and clang
- os: linux
env:
- TEST="linux openssl (clang)"
addons:
apt:
packages:
- clang
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=clang EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- CC=clang meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with nss
- os: linux
env:
- TEST="linux nss (gcc / valgrind)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- valgrind
- libnss3-dev
install:
- pyenv global 3.7.1
- pip3 install meson ninja
script:
- CC=gcc-6 EXTRA_CFLAGS=-Werror ./configure --enable-nss
- make
- make runtest
- make runtest-valgrind
- mkdir build && cd build
- cmake -DENABLE_NSS=ON -DBUILD_WITH_SANITIZERS=TRUE ..
- make
- CTEST_OUTPUT_ON_FAILURE=1 make test
- cd ..
- CC=gcc-6 meson setup --werror -Dcrypto-library=nss builddir
- meson compile -C builddir
- meson test -v -C builddir
# linux build with mbedtls
- os: linux
env:
- TEST="linux mbedtls (gcc)"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- libmbedtls-dev
script:
- mkdir build && cd build
- cmake -DENABLE_MBEDTLS=ON -DBUILD_WITH_SANITIZERS=TRUE ..
- make
- CTEST_OUTPUT_ON_FAILURE=1 make test
- cd ..
# default osx build
- os: osx
env:
- TEST="osx"
before_install:
- pip3 install meson ninja
script:
- EXTRA_CFLAGS=-Werror ./configure
- make
- make runtest
- make distclean
- mkdir build && cd build
- cmake ..
- make
- make test
- cd ..
- meson setup --werror builddir
- meson compile -C builddir
- meson test -v -C builddir
# osx build with openssl
- os: osx
osx_image: xcode11.2
env:
- TEST="osx openssl"
before_install:
- pip3 install meson ninja
- brew install openssl@1.1
script:
- PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-openssl
- make
- make runtest
- make distclean
- mkdir build && cd build
- cmake -DOPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1) -DENABLE_OPENSSL=ON ..
- make
- make test
- cd ..
- PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig meson setup --werror -Dcrypto-library=openssl builddir
- meson compile -C builddir
- meson test -v -C builddir
# osx build with nss
- os: osx
osx_image: xcode11.2
env:
- TEST="osx nss"
before_install:
- pip3 install meson ninja
script:
- PKG_CONFIG_PATH=$(brew --prefix nss)/lib/pkgconfig EXTRA_CFLAGS=-Werror ./configure --enable-nss
- make
- make runtest
- PKG_CONFIG_PATH=$(brew --prefix nss)/lib/pkgconfig meson setup --werror -Dcrypto-library=nss builddir
- meson compile -C builddir
- meson test -v -C builddir
# osx build for Apple Silicon
- os: osx
osx_image: xcode12u
env:
- TEST="osx Apple Silicon"
script:
- mkdir build && cd build
- cmake "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" ..
- make
- lipo -info srtp_driver
- make test
# code format check
- os: linux
env:
- TEST="clang-format"
addons:
apt:
packages:
- clang-format-3.9
script:
- CLANG_FORMAT=clang-format-3.9 ./format.sh -d
# big-endian
- os: linux
env:
- TEST="big-endian"
services:
- docker
addons:
apt:
packages:
- qemu-user-static
- qemu-system-mips
before_install:
- sudo docker run --volume $(pwd):/src --workdir /src --name mipsX --tty --detach ubuntu:16.04 tail
- sudo docker exec --tty mipsX apt-get update
- sudo docker exec --tty mipsX apt-get install build-essential -y
- sudo docker exec --tty mipsX apt-get install qemu-user-static qemu-system-mips gcc-mips-linux-gnu python3-pip -y
- sudo docker exec --tty mipsX pip3 install meson==0.56.2 ninja
script:
- sudo docker exec --tty mipsX bash -c 'EXTRA_CFLAGS=-static CC=mips-linux-gnu-gcc ./configure --host=mips-linux-gnu'
- sudo docker exec --tty mipsX make
- file test/srtp_driver
- make runtest
- |
cat > mips-cross-file.txt < uwp-amd64-cross-file.txt < uwp-arm64-cross-file.txt < android-cross-file.txt < ios-cross-file.txt <. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
---
### Libs/Xmlrpc C/Src/Test/Http Req Simple (libs/xmlrpc-c/src/test/http-req-simple.txt)
POST /cgi-bin/sample-cgi.cgi 1.0
Host: localhost
Content-Type: text/xml
Content-Length: 141
system.listMethods
---
### Libs/Xmlrpc C/Tools/Binmode Rpc Kit/Binmode Rpc Rfc (libs/xmlrpc-c/tools/binmode-rpc-kit/binmode-rpc-rfc.txt)
This is a draft, and subject to change. Please do not implement it
yet. Thank you!
Examples can be found at the bottom of the file.
Thank you for your feedback!
Eric Kidd
eric.kidd@pobox.com
30 January 2001
The Binmode RPC Protocol
========================
Binmode RPC is an ultra-lightweight RPC protocol designed for 100%
compatibility with XML-RPC . It emphasizes
simplicity, dynamically-typed data, and extreme ease of implementation.
Two XML-RPC implementations that support 'binmode-rpc' may negotiate away
the XML part of XML-RPC, and replace it with a simple binary protocol.
Design goals:
* The complete specification should fit in a 350-line text file. :-)
* The protocol should be easy to implement.
* The protocol should provide a high degree of compression.
* The protocol should be very fast--faster than zlib compression.
* The protocol must be implementable in portable ANSI C, with no
'./configure' checks.
* The protocol must not contain any options, variant encodings
or similar hair. If you want DCE/RPC, you know where to find it.
* All protocol operations must be performed at the byte level
(except for UTF-8 encoding and decoding).
* The protocol must be semi-readable in a hex dump or Emacs buffer.
* The protocol must efficiently encode boxcarred calls that are
implemented using 'system.multicall'.
* The protocol must support an efficient encoding for
frequently-repeated string values.
* The protocol must never be sent to clients or servers which
don't support it.
* There must be a way for clients and servers to active the protocol
if both ends of the connection support it.
The X-XML-RPC-Extensions Header
-------------------------------
(First, we'll need a mechanism for unobtrusively announcing the presence of
non-standard capabilities.)
An XML-RPC implementation MAY advertise additional, non-standard
capabilities using the 'X-XML-RPC-Extensions' header.
Rationale: The 'X-XML-RPC-Extensions' header should be available to CGI
scripts in the environment variable HTTP_X_XML_RPC_EXTENSIONS.
If present, this header MUST contain a comma-separated list of
keywords. Parameter information MAY be included, if desired, in the
standard fashion used by HTTP 1.1 'Accept-Encoding' headers.
X-XML-RPC-Extensions: binmode-rpc
X-XML-RPC-Extensions: binmode-rpc, x-telepathic-transport
X-XML-RPC-Extensions: binmode-rpc,x-telepathic-transport
X-XML-RPC-Extensions: binmode-rpc, x-telepathic-transport;speed=low
If a client sends the X-XML-RPC-Extensions header in a request, the server
MAY use any of the specified extensions in its response.
Rationale: No client may be sent non-standard data without first having
advertised the ability to accept it.
If the server includes the X-XML-RPC-Extensions header in a response, the
client MAY use any of the specified extensions in further requests to that
URL. The client MUST NOT assume that the same extensions are available for
any other URL on the same server.
Rationale: No server may be sent non-standard data without first having
advertised the ability to accept it. Furthermore, this permission is
URL-specific, since different XML-RPC implementations may be located at
different URLs on a single server.
The client SHOULD NOT cache extension information about a particular server
for an excessive length of time (typically beyond a single program
invocation). If the client does cache this information indefinitely, it
SHOULD be able to cope if an extension is disabled.
Rationale: The XML-RPC implementation used on the server may be changed by
the administrator.
The 'binmode-rpc' Extension
-----------------------
A client or server which sends the 'binmode-rpc' extension MUST accept
message bodies of type 'application/x-binmode-rpc' in addition to the
regular 'text/xml'.
All servers which accept the binmode-rpc extension MUST also support
standard XML-RPC, as described by .
The 'application/x-binmode-rpc' Format
--------------------------------------
All documents of the type 'application/x-binmode-rpc' MUST begin with the
following byte sequence (represented here as a C string):
'binmode-rpc:'
This MUST be followed by a Call or a Response, encoded as described below:
Call := 'C' String Array
A Call consists of a single octet with the ASCII value 'C', followed by a
String containing the method name and an Array containing the parameters.
Response := 'R' (Value|Fault)
A Response MUST contain either a Value or a Fault.
Fault := 'F' Struct
A Fault contains a regular Struct (with members as specified by the the
XML-RPC specification).
Trailing data at the end of an 'application/x-binmode-rpc' document MUST be
ignored.
Byte-Order of Integers
----------------------
(The following integer types don't correspond directly to XML-RPC
integers--instead, they'll be used to *build* more complicated types.)
SignedLSB := a four-octet, signed, twos'-complement integer,
least-significant byte (LSB) first
UnsignedLSB := a four-octet, unsigned integer, LSB first
Raw integer data is encoded in little-endian format.
Rationale: A fixed, mandatory byte ordering is easier to implement than
approaches which allow multiple byte orderings, and little-endian CPUs
outnumber big-endian CPUs at the time of writing.
Values
------
Value := (Integer|Boolean|Double|DateTimeISO8601Binary|Array|Struct|
String|Other)
Integer := 'I' SignedLSB
Boolean := ('t'|'f')
Double := 'D' SizeOctet AsciiChar...
DateTimeISO8601 := '8' SizeOctet AsciiChar...
These two types are encoded with an unsigned size octet followed by the
specified number of ASCII characters. The values are encoded in the fashion
described by the XML-RPC specification.
Rationale: In both these cases, we're punting. Binary floating point
formats are highly non-portable, and cannot be easily manipulated by most
programming languages. XML-RPC values lack timezone
information, and are therefore difficult to convert to a binary format.
Binary := 'B' UnsignedLSB Octet...
This corresponds to the XML-RPC type, but without any encoding.
The UnsignedLSB specifies the number of octets of data.
Array := 'A' UnsignedLSB Value...
The UnsignedLSB specifies the number of values in the array.
Struct := 'S' UnsignedLSB (String,Value)...
The UnsignedLSB specifies the number of String,Value pairs in the struct.
The strings are keys; the values may be of any type.
Other := 'O' String Binary
Future XML-RPC types (if any) may be sent a String containing the type name
and a Binary block (as above) containing type-specific data.
Implementations MUST NOT encode any of the standard types using this
construct. Implementations MAY signal an error if data of type Other is
encountered.
Rationale: This is allowed to cause an error because most applications
won't understand the contents anyway. But if new types are added, dumb
gateways will be able to manipulate them in encapsulated format (if they so
desire).
Strings
-------
String := (RegularString|RecordedString|RecalledString)
We have three types of strings.
RegularString := 'U' StringData
StringData := UnsignedLSB Utf8Octet...
Strings are encoded in UTF-8 format. The UnsignedLSB specifies the number
of UTF-8 octets. Implementations SHOULD raise an error if they encounter
invalid UTF-8 data (e.g., ISO Latin 1 characters).
Rationale: Technically speaking, XML-RPC is limited to plain ASCII
characters, and may not contain 8-bit or 16-bit characters in any coding
system. But since XML-RPC is based on XML, adding Unicode is a trivial
enhancement to the basic protocol, and *somebody* will make it sooner or
later. When that day arrives, we want to be able to encode Unicode
characters.
Implements MUST encode UTF-8 characters using the minimum number of octets.
Implementations SHOULD raise an error if they encounter any UTF-8
characters encoded using more than the minimum number of octets.
Rationale: Overlong UTF-8 encodings are sometimes used to bypass string
validation in security code. They serve no legitimate purpose, either. So
to improve the overall security of the Universe, we work hard to discourage
them.
UTF-8 & Unicode FAQ: http://www.cl.cam.ac.uk/~mgk25/unicode.html
RecordedString := '>' CodebookPosition StringData
RecalledString := '<' CodebookPosition
CodebookPosition := UnsignedOctet
The 'binmode' format supports a 256-entry "codebook" of strings. At the
start of a data stream, the codebook is empty. When the decoder
encounters a RecordedString, it MUST store it into the specified codebook
position (and then proceed to decode it as a regular string).
When the decoder encounters a RecalledString, it MUST look it up in the
specified codebook position. If that codebook position has been set, the
implementation MUST use the string value found in the codebook. If the
position has not been set, the implementation MUST stop decoding and raise
an error. It is legal to change a codebook position once it has been set;
the most recent value applies.
A RecordedString or a RecalledString may be used anywhere a RegularString
may be used.
Rationale: XML-RPC data tends to contain large numbers of identical
strings. (These are typically the names of members or the names of
methods in a multicall.) To get any kind of reasonable data compression,
it's necessary to have some way of compressing these values. The codebook
mechanism is relatively simple and uncomplicated.
Implementations MAY choose not to use this feature when encoding data, but
MUST understand it when decoding data.
Rationale: On the decoding end of things, this feature is trivial to
implement, and must be present for the sake of interoperability. On the
encoding end of things, however, making effective use of this feature is
slightly trickier, so implementations are allowed (but not encouraged) to
omit it.
Compliance
----------
Implementations MUST implement all features of this protocol correctly,
particularly on the decoding end. In the case of this protocol, a 95% correct
implementation is 100% broken. Yes, this statement is redundant. ;-)
Examples
--------
Non-ASCII octets are specified as in C strings. Continued lines are
indicated by a trailing '\'; these should be joined together as one
sequence of bytes.
binmode-rpc:CU\003\0\0\0addA\002\0\0\0I\002\0\0\0I\002\0\0\0
binmode-rpc:RI\004\0\0\0
binmode-rpc:RFS\002\0\0\0 \
U\011\0\0\0faultCodeI\001\0\0\0 \
U\013\0\0\0faultStringU\021\0\0\0An error occurred
binmode-rpc:RA\006\0\0\0 \
>\000\003\0\0\0foo \
>\001\003\0\0\0bar \
<\000 \
>\000\003\0\0\0baz \
<\000 \
<\001
(This deserializes to ['foo', 'bar', 'foo', 'baz', 'baz', 'bar'].)
binmode-rpc:RU\042\0\0\0Copyright \302\251 1995 J. Random Hacker
(This is based on an example in the Unicode/UTF-8 FAQ (see above).)
binmode-rpc:RA\010\0\0\0 \
I\006\0\0\0 \
tf \
D\0042.75 \
8\02119980717T14:08:55 \
U\003\0\0\0foo \
B\003\0\0\0abc \
S\002\0\0\0U\003\0\0\0runt
Counter-Examples
----------------
The following specimens are illegal, and SHOULD be rejected by a compliant
implementation. Please test your code.
* A different format name:
binmode-rpc2:RI\004\0\0\0
* A built-in type incorrectly encoded using 'O':
binmode-rpc:ROU\006\0\0\0stringB\003\0\0\0xyz
* A recall of an unrecorded string:
binmode-rpc:R<\002
* ISO Latin 1 data in a string. (UTF-8 required!)
binmode-rpc:RU\041\0\0\0Copyright \251 1995 J. Random Hacker
* UTF-8 character encoded with too many octets (based on an example in the
Unicode/UTF-8 FAQ):
binmode-rpc:RU\041\0\0\0Bad linefeed: \300\212 (too many bytes)
A compliant implementation MUST NOT send any of these sequences.
---
### Libs/Xmlrpc C/Windows/ReadMeOld (libs/xmlrpc-c/Windows/ReadMeOld.txt)
Current information is in ReadMeWin32.txt.
What follows is previous contents of that file.
Markus Hoffrogge:
Compilation for WIN32 is possible now again for version 1.6.10 - non
CPP parts only. Project files have been tested under VicualStudio
6.0. Build project all - this will build all other projects. CPP
code is not compiled and adopted right now.
This release excludes the option to compile an "http.sys" version of
an XML-RPC server. If you do wish to build in the http.sys server, set
the MUST_BUILD_HTTP_SYS_SERVER to 1 in the transport_config_win32.h
and/or the transport_config.h file. Successful conpilation requires
installation of the Microsoft Platform SDK for Windows XP SP2 (or
later) to get the latest header and link libraries required to support
this functionality. After installation, be sure to properly register
the directories as documented in the Platform SDK help file topic
"Installing the Platform SDK with Visual Studio". Download the
Platform SDK from:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
To create the three headers required for Win32 WinInet compilation,
run the ConfigureWin32.bat found in the Windows directory. If you
wish to alter the transports that are built to include curl or libwww,
adjust the preprocessor definitions at the top of the
transport_config_win32.h and/or the transport_config.h files. See the
file UsingCURLinWin32.txt for more information on using the curl
transport.
To compile, open the xmlrpc.dsw file in Visual Studio 6 or greater.
The project will convert and work fine in Visual Studio 2003 as well -
other versions of Visual Studio were not tested.
NOTE: If you get an error while opening or converting the project
files, it is likely due to using WinRar or similar to decompress the
distribution tarball. You can use WinZip or another utility to
correctly decompress the .tgz file.
Suggested testing for evaluation of the library involves a few
projects. Here is a quick getting started guide:
1) Set the Active Project to query_meerkat and build it in release or
debug modes. The dependent projects will be built automatically.
In the project settings dialog, add the argument for what you wish
to query meerkat for - "Windows" is a good query. Run the project.
This will query the meerkat server for articles related to windows
and output the results to the console.
2) Set the Active Project to xmlrpc_sample_add_server and build it in
release or debug modes. The dependent projects will be built
automatically. In the project settings dialog, add the argument
for the port to 8080. This will run the server sample which adds
two numbers and returns a result. You should run this from a
command prompt instead of through Visual Studio so you may run the
sample client as well.
3) Set the Active Project to xmlrpc_sample_add_sync_client or
xmlrpc_sample_add_async_client and build it in release or debug
modes. The dependent projects will be built automatically. This
will run the client sample which submits two numbers to be added to
the server application as described above and displays the result.
Note that the client example comes in the sync and async varieties.
Steven Bone
July 27, 2005
sbone@pobox.com
WIN32 CHANGES
Changes from the 1.02 release for Win32:
1) Option to easily disable the http.sys server for those who do not
need it or wish to download the Platform SDK.
Changes from the 1.01 -> 1.02 release for Win32:
1) Project files for gennmtab, xmlparse, and xmltok updated to include the
path to the xmlrpc_config.h file.
2) Bugfix for WinInet authentication.
3) Supports xmlrpc_xportparms, xmlrpc_wininet_xportparms added
*potential breaking change* - now by default we fail on invalid
SSL certs, use the xmlrpc_wininet_xportparms option to enable old
behavior.
4) Added project file for xmlrpc_sample_auth_client
5) Added project and src for a http.sys based xmlrpc-c server. See comments
in the source files. This supports Windows XP SP2 and Windows Server
2003 and allows other http.sys based applications to bind to the same
port. In Server 2003, IIS uses http.sys and thus the XML-RPC server
can be run on the standard port 80 along with IIS. The sample also
supports https and basic authentication. It tested OK with
http://validator.xmlrpc.com/ Note that the Platform SDK headers and
link libraries for Windows XP SP2 or newer are required to compile
xmlrpc-c for this module. If you are not using this server, it is
safe to exclude the xmlrpc_server_w32httpsys.c file from the xmlrpc
project and these dependencies will not be required. You can get the
latest platform SDK at
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
Be sure after installation to choose the program to "register the PSDK
directories with Visual Studio" so the newer headers are found.
6) Better support for libcurl. Updated project files,
transport_config_win32.h, added documentation UsingCURLinWin32.txt.
Changes from the 1.00 -> 1.01 release for Win32:
1) Project files now reflect static linking for the expat XML library.
2) Example projects were created/updated to keep them in sync with the
distribution. The project files were moved into the Windows
directory
3) Projects for the rpc and cpp tests were created. The
xmlrpc_win32_config.h defines the directory for the test files relative
to the output directory
4) Major refactoring of the Wininet Transport.
---
### Libs/Xmlrpc C/Windows/ReadMeWin32 (libs/xmlrpc-c/Windows/ReadMeWin32.txt)
Build Instructions For XML-RPC For C/C++ On Windows
---------------------------------------------------
-------------------------------------------------------------------------
These instructions are for static link libraries, using Microsoft Visual
Studio 7 and later. There are project files to create DLLs, using
Visual Studio 2008 or later, in the 'dll' subdirectory. People maintain
those project files separately from the rest of the build system, so it's
not uncommon for something to work with one but not the other.
-------------------------------------------------------------------------
1. Run the batch file ConfigureWin32.bat, found in the Windows
directory. This will copy four(4) headers to the appropriate folders.
2. Load xmlrpc.dsw in MSVC[7,8] or later, and build the Release or Debug
configurations. DLL configurations are not included, and may not compile.
This build requires that you have a Microsoft SDK, or Plaform SDK
installed, since among other things, it uses , and
HTTPAPI.LIB, from the SDK.
Once built, the rpctest.exe, in the bin folder, should run with no errors,
and the xmlrpc_sample_add_server.exe, using port 8080, and
xmlrpc_sample_add_sync_client.exe should communicate ... proving 7+5 = 12 ;=))
Have fun.
PS: Several other batch files are included in the Windows folder ...
delsln.bat - to delete all the MSVC7 and 8 solution file.
diffcfg.bat - compare the headers in windows with the version used in
the compile. Requires diff.exe to be in the path.
updcfg.bat - copy the 3 manually maintained configuration files back
to the Windows folder (for distribution).
cleawin32.bat - deletes the headers used in the compile. That is does the
opposite of ConfigureWin32.bat.
cleanall.bat - to remove ALL the binary files created. Requires an xdelete
program which will recursively delete an entire folder.
There is some historical information in ReadMeOld.txt, which used to be
the contents of this file. Some of it is still valid.
Developing XML-RPC For C/C++ for Windows
----------------------------------------
If you fix or enhance something in the Windows build system, please send
your updates to the Xmlrpc-c maintainer to be included in future releases
so others don't have to repeat your work.
Output of a Subversion 'diff' is usually the best way to send updates,
but you can also send complete files or just a description of the
change if that is easier.
For the project files, we distribute only MSVC6-compatible DSP and DSW
files (which are, of course, usable as input to later versions of MSVC
as well). That means if you need to modify something in the project
files and you are not using MSVC6, you must edit the project files
manually as text files. Modifying them via the IDE would simply
generate new files in a format that cannot be used with older MSVC.
---
### Libs/Xmlrpc C/Windows/UsingProxyDSP (libs/xmlrpc-c/Windows/UsingProxyDSP.txt)
Using xmlrpc_cpp_proxy.dsp
While not included in the main xmlrpc.dsw file, this
xmlrpc_cpp_proxy.dsp, if added as a project to the xmlrpc solution,
will build bin\xmlrpc_cpp_proxy.exe and xmlrpc_cpp_proxyD.exe, for
testing using the default WinINET transport.
After you have loaded the xmlrpc_cpp_proxy.dsp, which adds an
xmlrpc_cpp_proxy project, it is necessary to ADD a dependance on
the xmlrpc library, to complete the link.
To do this in say MSVC8, select the xmlrpc_cpp_proxy project, and right
mouse click, and in the context menu, select 'Project Dependancies...'.
And in the Project Dependancies dialog, check the xmlrpc proejct,
then [Ok] ...
To test your xmlrpc_cpp_proxy[D].exe -
1. In a console start the server, like -
bin/xmlrpc_sample_add_serverD 8080
Note, since this server opens a socket, you may have to enable it on some
anti-virus software that detects the socket being established, and
'Unblock' it in the Windows Security Alert system dialog that appears.
You can later remove this program from the Firewall exceptions, through
Control Panel -> Windows Firewall, selecting the 'Exceptions' tab, where
you can also disable this 'blocking' notification, but not recommended.
The server should start, and report -
Running XML-RPC server...
2. In another console run the cpp proxy client, with say -
bin>xmlrpc_cpp_proxyD http://localhost:8080/RPC2 null null
The client should connect to the server, and output a 'null' header,
and implementation file. If this functions, for a bigger example, try -
bin>xmlrpc_cpp_proxyD http://localhost:8080/RPC2 system systemProxy
and you should see a better example of a class header, and the
implementation code ...
20 December, 2007
EOF
---
### Scripts/Packaging/README (scripts/packaging/README.md)
# Installing FreeSWITCH using FSGET
## Prerequisites
### Dependencies
Make sure you have `cURL` binary installed or use any other downloader.
To install curl type
```
apt update && apt install -y curl
```
### Authentication required
A `SignalWire Personal Access Token` (PAT) or an `API Token` (for enterprise customers) is required to access FreeSWITCH install packages.
[HOWTO Create a SignalWire Personal Access Token](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/how-to-create-a-personal-access-token/how-to-create-a-personal-access-token)
[Upgrade to FreeSWITCH Advantage](https://signalwire.com/products/freeswitch-enterprise)
## Configuring FreeSWITCH Debian repository
```
curl -sSL https://freeswitch.org/fsget | bash -s [release|prerelease] [install]
```
Notice that `fsget` accepts arguments:
- `` (Required)
- `[release|prerelease]` (Optional) - `release` by default, `prerelease` is what you see in the `master` branch
- `[install]` (Optional) - If missing it will not install FreeSWITCH automatically after configuring the repository
`FreeSWITCH Community` or `FreeSWITCH Enterprise` version is installed based on the token provided.
Enterprise customers may install `FreeSWITCH Community` versions by using a `SignalWire Personal Access Token` instead of an `API Token`.
## Installing FreeSWITCH
If not installed already type
```
apt-get install -y freeswitch-meta-all
```
Enjoy using FreeSWITCH!
---
### Src/CMakeLists (src/CMakeLists.txt)
#FREESWITCH CMAKE file
#Shane Burrell 2009 (supjigator)
cmake_minimum_required(VERSION 2.6)
INCLUDE_DIRECTORIES(include/ ../libs/libresample/include/ ../libs/srtp/crypto/include/ ../libs/srtp/include/)
SET ( freeswitch_la_SRCS
switch_apr.c
switch_buffer.c
switch_caller.c
switch_channel.c
switch_console.c
switch_core_media_bug.c
switch_core_timer.c
switch_core_asr.c
switch_core_event_hook.c
switch_core_speech.c
switch_core_memory.c
switch_core_codec.c
switch_core_file.c
switch_core_hash.c
switch_core_sqldb.c
switch_core_session.c
switch_core_directory.c
switch_core_state_machine.c
switch_core_io.c
switch_core_rwlock.c
switch_core_port_allocator.c
switch_core.c
switch_scheduler.c
switch_core_db.c
switch_dso.c
switch_loadable_module.c
switch_utils.c
switch_event.c
switch_resample.c
switch_regex.c
switch_rtp.c
switch_ivr_bridge.c
switch_ivr_originate.c
switch_ivr_async.c
switch_ivr_play_say.c
switch_ivr_menu.c
switch_ivr.c
switch_stun.c
switch_log.c
switch_xml.c
switch_config.c
switch_time.c
switch_cpp.cpp
g711.c
switch_pcm.c
../libs/libteletone/src/libteletone_detect.c
../libs/libteletone/src/libteletone_generate.c
include/switch_am_config.h
include/switch.h
include/switch_apr.h
include/switch_buffer.h
include/switch_caller.h
include/switch_channel.h
include/switch_console.h
include/switch_core_event_hook.h
include/switch_scheduler.h
include/switch_core.h
include/switch_core_db.h
include/switch_config.h
include/switch_event.h
include/switch_frame.h
include/switch_ivr.h
include/switch_dso.h
include/switch_loadable_module.h
include/switch_module_interfaces.h
include/switch_platform.h
include/switch_resample.h
include/switch_regex.h
include/switch_types.h
include/switch_utils.h
include/switch_rtp.h
include/switch_stun.h
include/switch_log.h
include/switch_xml.h
include/switch_cpp.h
../libs/libteletone/src/libteletone_detect.h
../libs/libteletone/src/libteletone_generate.h
../libs/libteletone/src/libteletone.h
include/switch_odbc.h
)
ADD_LIBRARY(freeswitch_la ${freeswitch_la_SRCS})
---
### Src/Mod/Applications/Mod Avmd/Scripts/Test (src/mod/applications/mod_avmd/scripts/test.txt)
#author Piotr Gregor
#date 27th Dec 2019
Test dialplan
=============
Test machine
============
CPU is 8-core Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz.
Test results
===========
Obtained from output of top (running in multiple core mode, so max value of CPU for this case of 8-core CPU is 800%).
Running command
./avmd_originate_multiple.pl avmd1 piotr X
then Freeswitch starts two legs for each call (AND I configured avmd to start on both of them).
then Freeswitch's command "show calls" is showing 2*X calls, so if I run ./avmd_originate_multiple.pl avmd1 piotr 10
then if I do "show calls" in cli it displays "20 total", as it counts "-a" and "-b" loopback legs.
So for test extension "avmd2" where avmd_start app is executed Freeswitch starts two legs for each call and avmd is running on inbound.
This table uses X as calls (so if you did "show calls" in cli you would actually see twice as the number in top row).
ext/#calls 10 50 100 150 200
avmd1 10% 26 50 63 78
avmd2 103 257 382 510 760(GUI lagging)
Results are values shown as %CPU from "top" command (here that would be 63.3%):
Obtained from output of top (running in multiple core mode, so max value of CPU for this case of 8-core CPU is 800%).
top -p `pidof freeswitch`
top - 02:26:45 up 13 days, 13:48, 1 user, load average: 0.62, 0.39, 0.34
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 7.9 us, 0.6 sy, 0.0 ni, 89.8 id, 0.0 wa, 0.0 hi, 1.7 si, 0.0 st
MiB Mem : 24034.2 total, 4879.0 free, 11671.8 used, 7483.4 buff/cache
MiB Swap: 24502.0 total, 24502.0 free, 0.0 used. 11040.5 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8765 root -2 -10 4370088 115872 20780 S 63.3 0.5 1:42.73 freeswitch
Test script (for up to date version see avmd_originate_multiple.pl)
===========
#!/usr/bin/perl -w
#brief Make multiple calls. This script can be used to check CPU usage on calls running avmd (see test.txt).
#author Piotr Gregor
#date 15 Sept 2016 02:44 PM
#changed 27th Dec 2019
use strict;
use warnings;
require ESL;
use POSIX;
use Time::HiRes;
my $host = "127.0.0.1";
my $port = "8021";
my $pass = "ClueCon";
my $extension_base = "sofia/internal/1000\@192.168.1.1";
my $playback = 'local_stream://moh';
my $context = 'default';
#Example:
#my $endpoint = "originate {originator_codec=PCMA,origination_uuid=%s}sofia/gateway/box_b/840534002 \&park()";
#my $endpoint = "originate {originator_codec=PCMA,origination_uuid=%s}sofia/gateway/%s/%s \&park()";
my $endpoint;
my $gateway;
my $dest;
my $callerid;
my $thread_n;
my $idx = 0;
if ($#ARGV + 1 eq 3) {
$dest = $ARGV[0];
$callerid = $ARGV[1];
$thread_n = $ARGV[2];
print "Dialing [" .$thread_n ."] calls simultaneously to[" .$dest ."] as [" .$callerid ."]\n";
} else {
die "Please specify destination number, caller id and number of calls to make\n";
}
my $con = new ESL::ESLconnection($host, $port, $pass);
if (!$con) {
die "Unable to establish connection to $host:$port\n";
}
if ($con->connected()) {
print "OK, Connected.\n";
} else {
die "Connection failure.\n";
}
while($con->connected() && ($idx < $thread_n)) {
call_once($dest, $callerid, $idx);
$idx++;
Time::HiRes::sleep(0.11); # avoid switch_core_session.c:2265 Throttle Error! 33, switch_time.c:1227 Over Session Rate of 30!
}
print "Disconnected.\n\n";
sub call_once {
my ($dest, $callerid, $idx) = @_;
my $originate_string =
'originate ' .
'{ignore_early_media=true,' .
'originator_codec=PCMA,' .
'origination_uuid=%s,' .
'originate_timeout=60,' .
'origination_caller_id_number=' . $callerid . ',' .
'origination_caller_id_name=' . $callerid . '}';
if(defined($endpoint)) {
$originate_string = '';
$originate_string .= $endpoint;
} else {
$originate_string .= 'loopback/' . $dest . '/' . $context;
$originate_string .= ' ' . '&playback(' . $playback . ')';
}
my $uuid = $con->api('create_uuid')->getBody();
my ($time_epoch, $time_hires) = Time::HiRes::gettimeofday();
printf("[%s]\tCalling with uuid [%s] [%s]... [%s]\n", $idx + 1, $uuid, POSIX::strftime('%Y-%m-%d %H:%M:%S', localtime($time_epoch)), $originate_string);
$con->bgapi(sprintf($originate_string, $uuid));
$con->api('uuid_setvar ' . $uuid .' execute_on_answer avmd_start');
}
CPU info
=========
peter@photon:/usr/local/freeswitch/conf/dialplan$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.008
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 799.969
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 1
cpu cores : 4
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 799.992
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 2
cpu cores : 4
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.021
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.038
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 0
cpu cores : 4
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.241
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 1
cpu cores : 4
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.199
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 2
cpu cores : 4
apicid : 5
initial apicid : 5
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 60
model name : Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
stepping : 3
microcode : 0x19
cpu MHz : 800.031
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm cpuid_fault invpcid_single pti tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 7999.38
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:
---
### Src/Mod/Applications/Mod Expr/Readme (src/mod/applications/mod_expr/readme.txt)
ExprEval - A C/C++ based expression evaluation library
Written by: Brian Allen Vanderburg II
Licensed under the ExprEval License
------------------------------------------------------
ExprEval is a mostly a C based expression evaluation
library. The only C++ part is the C++ Wrapper which
encapsulates the complexity of the library usage.
ExprEval supports the parsing of multiple expressions
in a single expression string. Each sub-expression
must end with a semicolon. It also supports the use
of variables, constants, and functions. Functions
can take multiple arguments. These arguments can
also be expressions.
ExprEval is very fast. It first parses the expression
string into a tree of actions to take. After it has
been parsed, an expression can be evaluated many times
over an over.
Functions, variables, and constants are stored in
their own seperate lists. This makes is where the
lists can be shared among multiple expression objects.
A function list can add all the functions needed, and
then be added to each expression object, instead of
added each needed function to each object. The same
goes for constant lists. Variable lists make it where
one expression can depend on a variable set in another.
Saturday, July 1, 2006
----------------------
Version 2.6
* Added a new value list function 'exprValListGetNext' that can be used to
enumerate the items in a value list. Any of the items not needed (name,
value, or address) can be NULL. For example:
char *name;
EXPRTYPE val;
void *cookie;
cookie = exprValListGetNext(vlist, &name, &value, NULL, NULL);
while(cookie)
{
/* Do something with name and value */
cookie = exprValListGetNext(vlist, &name, &value, NULL, cookie);
}
You must make sure not to actually edit the returned name, because it is a
pointer into the value list to the name. This can also be used to have one
value list store globals. Global variables can be added to a value list, then
additional lists can be created, and before any variables are added
or the expression is parsed, the global list can be enumerated for name and
address and the exprValListAddAddress can be used to add them. This way,
expressions can have their own private list, but some variables may be shared
on each expression through the global list. This is useful especially if the
globals are not known at compile time, but can be adjusted by the user.
For example:
exprValList *globals;
exprValList *v1;
exprValList *v2;
char *name;
EXPRTYPE *addr;
void *cookie;
exprValListCreate(&globals);
/* Add variables to the list, perhaps read from a user file or something */
exprValListCreate(&v1);
cookie = exprValListGetNext(globals, &name, NULL, &addr, NULL);
while(cookie)
{
exprValListAddAddress(v1, name, addr);
cookie = exprValListGetNext(globals, &name, NULL, &addr, cookie);
}
Friday, June 30, 2006
---------------------
Version 2.5
* Added a new value list function 'exprValListAddAddress'. This function adds
a named value to the list, but uses the addresss of a stack variable. The
stack variable is then used to set/get the value instead of the internal list
value. You must ensure that the stack variable exists as long as it is used
by the expression. This can permit, for example, a value name to be shared
with two different value lists like such:
EXPRTYPE global_value;
exprValListAddAddress(vlist, "global", &global_value);
exprValListAddAddress(vlist2, "global", &global_value);
Like this, the value can be directly accessed by the application, and each
value list will share it. This can also be used to replace code from this:
EXPRTYPE *a;
exprValListAdd(vlist, "var", 0.0);
exprValListGetAddress(vlist, "var", &a);
To look like this:
EXPRTYPE a;
exprValListAddAddress(vlist, "var", &a);
* Added a value list function exprValListSet to set the value of a variable
(using the slow search method). This is because the add functions now return
and error if the item (function/value) already exists instead of setting the
value of the item. You can still use the fast direct access method.
* Changed internal lists for function and value lists from binary trees to
linked lists.
Thursday, May 4, 2006
---------------------
Version 2.0
* All internal functions are evaluated directly in the exprEvalNode call.
This gives some speed increase.
* Removed parameter and reference count macros as well as functin creation
macro. Parameter and reference count information can be set when adding
a function solver.
* Removed exprMsgFuncType, since it is unused by the library.
* Changed much of the internal names from one-letter variable names to
more meaningful names.
Thursday, December 1, 2005
--------------------------
Version 1.8
* Added support for the ^ operator to raise to a power.
The pow function can still be used.
* Moved basic math code (add,subtract,multiply,divide,negate,exponent)
and multiple expression support from function solvers to the exprEvalNode
function.
Tuesday, November 22, 2005
--------------------------
I still haven't been keeping up with history much.
* Removed < and > as comments. Instead use # as a
comment to the end of the line
* Added function exprGetErrorPosition to get start and
end position of parse error.
Monday, May 3, 2004: Version 1.0
---------------------------------
This is a pretty bad time to start the history part since
ExprEval is pretty much up and running and very operational.
* Added macro EXPR_MAJORVERSION
* Added macro EXPR_MINORVERSION
* Added function exprGetVersion
* Added macro to make declaring functions easy:
EXPR_FUNCTIONSOLVER(func_name)
* Added support for passing variable references to functions
with the ampersand. Example: minmax(1,2,3,&min,&max)
* Added macros for reference support:
EXPR_REQUIREREFCOUNT
EXPR_REQUIREREFCOUNTMIN
EXPR_REQUIREREFCOUNTMAX
EXPR_REQUIREREFCOUNTRANGE
* Added feature to disable assigning to a variable with the
same name as a constant.
* Added feature to enable applications to change the value of
a constant while the expression can not. You must add
any constants to the constant list BEFORE you parse the
expression.
---
### Src/Mod/Applications/Mod Expr/License (src/mod/applications/mod_expr/license.txt)
ExprEval - Expression Evaluation Library
Version 2.0
Copyright (C) 2004 Brian Allen Vanderburg II
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
---
### Src/Mod/Applications/Mod Httapi/Docs/Mod Httapi Doc (src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt)
HT-TAPI Hyper-Text Telephony API and http file format plugin
This module provides an HTTP based Telephony API using a standard FreeSWITCH application interface as well as a cached http file format interface.
The file format plugin can be used like this:
This syntax is valid anywhere a filename parameter is requested in FreeSWITCH.
The application is called like this:
The target url is expected to be a CGI returning text/xml using the documentation below.
The format is roughly as described below (We could use a DTD maybe).
someval
someval
<...>
The profile name must be chosen to bind to a preset series of settings and permissions to use as a basis for the client session.
It's chosen from the specified params or from the channel variable using the keyname 'httapi_profile' and if not specified will default to 'default'
Any params specified in the initial data of the application encased in brackets {} will be parsed into the initial params similar to originate.
These params remain set until the call ends and are supplied as form elements on each hit to the HTTP server.
If the permissions allow, a tag is parsed from the resulting document and set into this data set and will be mirrored back on subsequqent http posts.
Also if the permissions allow a tag is parsed the same way setting channel variables.
The tag is required and contains one or more of the supported command tags that generally manipulate the call behaviour.
The application will continue to do the task in the work section until an error is encoutered or when an action from the work tag warrants it.
If the session exits the httapi app without hanging up it can do other tasks and make another call to httapi and the session data will remain preserved.
EXAMPLE:
~\d+#
BINDINGS
Several of the work tags that indicate they support bindings can contain one of more bind tags that function with similar fashion to bind_digit_action
*EXPR*
ATTRS:
action : a specific url to go to next if the binding is dialed
strip : a character to strip from in the result such as #
WORK TAGS:
*ACTIONS*
*EXPR*
: Plays a file and optionally collects input.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
asr-engine : ASR engine to use
asr-grammar : ASR grammar to use
*EXPR*
: Plays a vm name and optionally collects input.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
*EXPR*
: Records a file, optionally collects input and posts the file back to the target url.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
*EXPR*
: Waits for input for a specific amount of time.
ATTRS:
milliseconds : Number of milliseconds to pause
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
*EXPR*
: Read Text to Speech with optional input.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
engine : tts engine to use.
voice : tts voice to use.
*EXPR*
: Use the FS say engine to iterate sounds to similate a human speaker.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
language : language
type : type (fs param)
method : method (fs param)
gender : gender (fs param)
*DATA*
: Execute a FreeSWITCH app.
ATTRS:
application : The app to run
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
data : Alternate source for app data
*DATA* : The app data
DATA
: Send a SMS message.
ATTRS:
to : The dest number
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
*DATA* : The message data
*DATA*
: Place an outbound call or transfer.
ATTRS:
context : Dialplan context.
dialplan : Dialplan dialplan.
caller-id-name : Caller ID Name.
caller-id-number : Caller ID Number.
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
*DATA* : Number to dial or originate string
: begin recording the call. The file will be posted when the call ends.
ATTRS:
limit : Timeout in seconds.
name : Name to use for input values.
action : URL action to use.
temp-action : Change url to submit to. just for the next loop.
: Start a conference call.
ATTRS:
profile : Conference profile to use.
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
: Answer the call
ATTRS:
is-conference : true|false (set the conference flag for RFC4579 stuff.
: Establish media on the call without answering.
: Indicate ringing to an unaswered channel.
: Hangup the call
ATTRS:
cause : Hangup cause
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
: Exit the httapi application and continue in the dialplan.
: Write a log line to fs_cli, console, logs, etc.
ATTRS:
level : The log level to use.
clean : If true do not print log prefix.
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
: Just continue (no-op)
ATTRS:
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
: Get a Channel variable (depends on permissions)
ATTRS:
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
permanent : Add as a permanent param or just once.
: Call the voicemail app without requiring "execute" permissions
ATTRS:
action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
check : true to check (omit to leave)
auth-only : authenticate only and move on
profile : profile name to use (omit for "default")
domain : domain to use (omit for global domain variable)
id : id to use (omit to prompt for id)
CONFIGURATION:
:
debug : false Print debug data
file-cache-ttl : 300 How long to wait before checking the server to see if audio file has changed.
Whichever is smaller that or the max-age returned by the server (if present).
abs-file-cache-ttl : 0 Force the cache time no matter what anything else says.
file-not-found-expires : 300 How long to still preserve cached audio files that are not found by the server.
: CREATE NEW PROFILE TO REFERENCE BY NAME
gateway-url : "" Initial URL to connect to.
gateway-credentials : "" HTTP credentials.
auth-scheme : basic auth scheme to use. [basic|digest|NTLM|GSS-NEGOTIATE|any]
disable-100-continue : true Disable the 100 continue feature.
method : "" METHOD name to send.
timeout : 0 Timeout waiting for response.
connect-timeout : 0 Timeout to create connection. Use default value 0 to switch to the
default built-in connection timeout - 300 seconds.
enable-cacert-check : false Check CA/CERT.
ssl-cert-path : "" path to file.
ssl-key-path : "" path to file.
ssl-key-password : "" password to use.
ssl-version : "" ssl version
ssl-cacert-file : "" CA/CERT file.
enable-ssl-verifyhost : "" Verify ssl host.
cookie-file : "" Path to file to use for cookie.
enable-post-var : "" Specify specifc param names ok to send.
bind-local : "" Interface to bind to.
default-profile : default Profile to use when not specified.
user-agent : mod_httapi/1.0 User Agent header value.
: * = default
*set-params : tag can be parsed for session params.
set-vars : tag can be parsed to set channel vars.
extended-data : Extended data is sent like full channel event data.
execute-apps : tag is enabled to execute apps.
expand-vars : Allow expansion of FS ${variables}. (this opens up all FSAPI calls)
*dial : tag is enabled allowing outbound dialing.
dial-set-context : context attribute is permitted.
dial-set-dialplan : dialplan attribute is permitted.
dial-set-cid-name : cid_name attribute is permitted.
dial-set-cid-number : cid_number attribute is permitted.
dial-full-originate : full originate syntax is permitted instead of just a number.
*conference : tag is enabled allowing creation of conferences.
conference-set-profile : attribure is permitted.
all : all permissions are set
none : no permissions are set
---
### Src/Mod/Applications/Mod Osp/Docs/Mod Osp (src/mod/applications/mod_osp/docs/mod_osp.txt)
FreeSWITCH Open Settlement Protocol (OSP) module
1 Introduction
FreeSWITCH OSP module provides OSP based call authentication, authorization, routing lookup and call detail record (CDR) collection services using standard FreeSWITCH application interface and state handlers.
2 Configuration Parameters
The OSP module can be configured by OSP module global parameters and OSP provider profile parameters in osp.conf.xml.
2.1 Global Parameters
FreeSWITCH OSP module global configuration parameters can be set using the following format:
Global parameter names and values can be:
- debug-info: Flag to show OSP module debug information. The default is "disabled".
- log-level: At which log level to show OSP module debug information. The default is "info".
- crypto-hardware: If to use hardware for OpenSSL. The default is "disabled".
- sip: Used SIP module and profile. The default is "sofia" and "external".
- h323: Used H.323 module and profile. The default is "h323" and "external". This option has not been implemented.
- iax: Used IAX2 module and profile. The default is "iax" and "external". This option has not been implemented.
- skype: Used Skype module and profile. The default is "skypopen" and "external". This option has not been implemented.
- default-protocol: The VoIP protocol for destinations with unknown/undefined protocol. The default is "sip".
2.2 OSP Provider Parameters
FreeSWITCH OSP module OSP provider configuration parameters can be set using the following format:
OSP provider parameter names ane values cab be:
- profile: OSP provider profile name.
- service-point-url: OSP service point URL. This parameter must be defined. Up to 8 URLs are allowed.
- device-ip: FreeSWITCH IP for OSP module. This parameter must be defined.
- ssl-lifetime: SSL lifetime. The default is 300 in seconds.
- http-max-connections: HTTP max connections. The default is 20.
- http-persistence: HTTP persistence. The default is 60 in seconds.
- http-retry-delay: HTTP retry delay. The default is 0 in seconds.
- http-retry-limit: HTTP retry times. The default is 2.
- http-timeout: HTTP timeout. The default is 10000 in ms.
- work-mode: OSP module work mode (direct and indirect). The default is "direct".
- service-type: OSP service type (voice, npquery and cnamquery (this option has not been implemented)). The default is "voice".
- max-destinations: Max destinations OSP server will return. It is up to 12. The default is 12.
3 OSP Applications
The OSP applications are called in dial plan like this:
and
*PROFILE* is an OSP service provider profile name configured in osp.conf.xml. If data attribute is not provided or its value is empty, profile name "default" is used.
3.1 OSPLookup Application
osplookup application does OSP authorization request and gets first supported destination for inbound calls. It exports a set of channel variables for FreeSWITCH dial plan logic.
osplookup application accepts two sets of channel variables that are used to pass additional inbound call information and outbound control parameters to OSP module. It also exports a set of channel variables for outbound channels and FreeSWITCH dial plan logic.
3.1.1 Inbound Call Information
- osp_source_device: Actual source device IP address channel variable. It is only for FreeSWITH OSP module running in indirect mode.
- osp_source_nid: Source device network ID channel variable.
- osp_custom_info_N: Up to 8 custom info channel variables. N is the index starting from 1.
3.1.2 Outbound Control Parameters
- osp_networkid_userparam: The URI user parameter name that is used to present destination network ID. For example, sip:callednumber;networkid=dnid@host.
- osp_networkid_uriparam: The URI parameter name that is used to present destination network ID. For example, sip:callednumber@host;networkid=dnid.
- osp_outstring_userparam: The URI user parameter string. For example, sip:callednumber;outstring@host.
- osp_outstring_uriparam: The URI parameter string. For example, sip:callednumber@host;outstring.
- osp_user_phone: Flag to add "user=phone" URI parameter. The default is "disabled".
- osp_outbound_proxy: Outbound proxy IP address channel variable.
3.1.3 Exported Parameters
- osp_profile_name: Used OSP provider profile name. It will be used by ospnext application and OSP module state handlers.
- osp_transaction_handle: OSP transaction handle. It will be used by ospnext application and OSP module state handlers.
- osp_transaction_id: OSP transaction ID. It will be used by ospnext application and OSP module state handlers for log purpose.
- osp_lookup_status: osplookup application status. It will be used by FreeSWITCH dial plan logic. 0 for no error.
- osp_route_total: Total number of destinations from OSP servers. It will be used by ospnext application and OSP module state handlers.
- osp_route_count: Destination index starting from 1. It will be used by ospnext application and OSP module state handlers.
- osp_auto_route: Bridge route string. It will be used by bridge application.
- osp_termiation_cause: Destination termination cause. It will be used by ospnext application and OSP module state handlers.
3.2 OSPNext Application
ospnext application gets next supported destination for inbound calls. It exports a set of channel variables for FreeSWITCH dial plan logic.
ospnext application accepts a set of channel variables exported by osplookup application to pass OSP call transaction information to OSP module. It also exports a set of channel variables for outbound channels and FreeSWITCH dial plan logic.
3.2.1 Transaction Parameters
- osp_profile_name: Used OSP provider profile name.
- osp_transaction_handle: OSP transaction handle.
- osp_transaction_id: OSP transaction ID. It is for log purpose.
- osp_route_total: Total number of destinations from OSP servers.
- osp_route_count: destination index starting from 1.
- osp_termiation_cause: Destination termination cause.
3.2.2 Exported Parameters
- osp_next_status: ospnext application status. It will be used by FreeSWITCH dial plan logic. 0 for no error.
- osp_route_count: Destination index starting from 1. It will be used by ospnext application and OSP module state handlers.
- osp_termiation_cause: Destination termination cause. It will be used by ospnext application and OSP module state handlers.
- osp_auto_route: Bridge route string. It will be used by bridge application.
4 State Handler
OSP module state handler reports usage of calls.
OSP module state handler accepts a set of channel variables exported by osplookup and/or ospnext applications to pass OSP call transaction information to OSP module.
4.1 Transaction Parameters
- osp_profile_name: Used OSP provider profile name.
- osp_transaction_handle: OSP transaction handle.
- osp_transaction_id: OSP transaction ID. It is for log purpose.
- osp_route_total: Total number of destinations from OSP servers.
- osp_route_count: destination index starting from 1.
- osp_termiation_cause: Destination termination cause.
5 Appendix
5.1 Sample Configuration
5.2 Sample Dialplan
---
### Src/Mod/Endpoints/Mod H323/Changes (src/mod/endpoints/mod_h323/changes.txt)
fix memory leaks, thanks Sharath from packetizer forum.
fix stale calls then fax send/recv in some circumstance
remove SWITCH_RTP_FLAG_AUTO_CNG - works incorrectly.
moves the switch_rtp_request_port() call from the contructor to FSH323Connection::CreateRealTimeLogicalChannel() - fix
rtp port leak. tnx to Peter Olsson.
fix log printing
fix small interoperability issues if remote endpoint send progress twice
make sure dtmfinband gets initialized
make gk-identifier and gk-interface settings optional (documentation sayed that about gk-identifier already)
fix race condition on destroying signaling thread in h323 library
Adds an extra switch_rtp_destroy or switch_rtp_release_port when a session ends
- to make sure the port is returned to FS. thx to Peter Olsson.
fix issues with Progress message type if pre_answer enabled
fix crashes on FSH323Connection calls in on_hangup routine in different threads.
move PTrace level set to FSH323EndPoint::Initialise
partially apply patch from from Peter Olsson, Remove UnLock() when TryLock() failed and DEBUG_RTP_PACKETS directive.
apply changes from mod_h323-patch.diff by Peter Olsson.
some t.38 and lockinng improvements.
replace ptrace with switch_log_printf.
initial t.38 support.
remake logical channel opening.
add missing param name in example config.
add dtmfinband conf parameter.
add endpoint-name conf parameter represents endpoint name.
fix GK registration retrying in case of registration reject.
fix double DTMF hadling for examle in case dtmf-relay h245-signal h245-alphanumeric on cisco dial-peer.
fix crash on module unloading.
add PI handling in Call Proceeding.
add PI handling in alerting.
fix slow start handling
move faststart to callproceeding due to some broken hardware not anderstand
correclty faststart in progress.
fix rtp timer initialisation.
implement alerting-indication option and channel variable.
implement progress-indication option and channel variable.
fix short DTMF warnings.
remove SWITCH_RTP_FLAG_AUTOADJ because its not work correctly and not do anything reliable in our cases.
fix faststart in progress handling
fixxxxes
remove trys to implement non standard codecs.
implement jitter-size value option.
implement gk register retry timer.
implement h245insetup enable/disable option.
implement h245tunneling enable/disable option.
implement faststart enable/disable option.
fix release handling from h323 leg.
fix misstype in codec conversion.
fix rtp issue causes choppy sound.
fix progress ind handling on outbound calls.
fix crash on log line, btw not understand why.
implement dtmf transfer.
fix codec name conversion a bit.
fix crash on inbound fast start connection.
initial release.
---
### Src/Mod/Endpoints/Mod H323/Compiling (src/mod/endpoints/mod_h323/compiling.txt)
To compile this module use latest ptlib/h323plis combinations listed at http://www.gnugk.org/compiling-gnugk.html
---
### Src/Mod/Endpoints/Mod Rtmp/Libamf/CMakeLists (src/mod/endpoints/mod_rtmp/libamf/CMakeLists.txt)
cmake_minimum_required(VERSION 2.6)
project(libamf C)
# generic variables
set(PACKAGE "libamf")
set(PACKAGE_NAME ${PACKAGE})
set(PACKAGE_BUGREPORT "libamf@sf.net")
set(PACKAGE_VERSION "0.1.0")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
#platform tests
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckTypeSize)
include(TestBigEndian)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)
check_include_file(inttypes.h HAVE_INTTYPES_H)
check_type_size("double" SIZEOF_DOUBLE)
check_type_size("float" SIZEOF_FLOAT)
check_type_size("long double" SIZEOF_LONG_DOUBLE)
if(WIN32)
set(int16_t 1)
set(int32_t 1)
set(int64_t 1)
set(int8_t 1)
set(uint16_t 1)
set(uint32_t 1)
set(uint64_t 1)
set(uint8_t 1)
endif(WIN32)
test_big_endian(IS_BIGENDIAN)
if(IS_BIGENDIAN)
set(WORDS_BIGENDIAN 1)
endif(IS_BIGENDIAN)
# configuration file
configure_file(amf-cmake.h.in ${CMAKE_BINARY_DIR}/amf.h)
include_directories(${CMAKE_BINARY_DIR})
install(
FILES ${CMAKE_BINARY_DIR}/amf.h
DESTINATION include/amf
)
# Visual C++ specific configuration
if(MSVC)
# use static library
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
# C runtime deprecation in Visual C++ 2005 and later
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif(MSVC)
add_subdirectory(src)
# tests
enable_testing()
add_subdirectory(tests)
---
### Src/Mod/Endpoints/Mod Rtmp/Libamf/Src/CMakeLists (src/mod/endpoints/mod_rtmp/libamf/src/CMakeLists.txt)
set(libamf_src
amf0.c
amf0.h
hash.c
hash.h
io.c
io.h
ptrarray.c
ptrarray.h
types.c
types.h
${CMAKE_BINARY_DIR}/amf.h
)
add_library(amf ${libamf_src})
install(TARGETS amf
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
)
install(
FILES amf0.h amf3.h
DESTINATION include/amf
)
---
### Src/Mod/Endpoints/Mod Rtmp/Libamf/Tests/CMakeLists (src/mod/endpoints/mod_rtmp/libamf/tests/CMakeLists.txt)
include_directories(${CMAKE_SOURCE_DIR}/src)
add_executable(amf0_demo amf0_demo.c)
add_dependencies(amf0_demo amf)
---
### Src/Mod/Languages/Mod Python3/README (src/mod/languages/mod_python3/README.md)
## WARNING: new default module is mod_python3
`freeswitch-mod-python` debian package is NOT going to be installed by default.
`freeswitch-mod-python3` will be installed instead.
You should remove `freeswitch-mod-python3` package and install `freeswitch-mod-python` manually if you want.
---
### Support D/Gdb/README (support-d/gdb/README.md)
`gdb` scripts
-----------
Originally from: https://github.com/facebook/folly/tree/593b6e76881042031b7f21d898c8e0874ea79fe0/folly/experimental/gdb
This directory contains a collection of `gdb` scripts that we have found helpful.
These scripts use the [gdb extension Python API](https://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Python).
### How to run the scripts
To run the scripts, fire up `gdb` and load a script with `source -v`. Example:
```lang=bash
$ gdb -p 123456
(gdb) source -v ./folly/experimental/gdb/deadlock.py
Type "deadlock" to detect deadlocks.
# At this point, any new commands defined in `deadlock.py` are available.
(gdb) deadlock
Found deadlock!
...
```
### What does each script do?
#### `deadlock.py` - Detect deadlocks
Consider the following program that always deadlocks:
```lang=cpp
void deadlock3() {
std::mutex m1, m2, m3;
folly::Baton<> b1, b2, b3;
auto t1 = std::thread([&m1, &m2, &b1, &b2] {
std::lock_guard g1(m1);
b1.post();
b2.wait();
std::lock_guard g2(m2);
});
auto t2 = std::thread([&m3, &m2, &b3, &b2] {
std::lock_guard g2(m2);
b2.post();
b3.wait();
std::lock_guard g3(m3);
});
auto t3 = std::thread([&m3, &m1, &b3, &b1] {
std::lock_guard g3(m3);
b3.post();
b1.wait();
std::lock_guard g1(m1);
});
t1.join();
t2.join();
t3.join();
}
```
The `deadlock.py` script introduces a new `deadlock` command that can help
us identify the threads and mutexes involved with the deadlock.
```lang=bash
$ gdb -p 2174496
(gdb) source -v ./folly/experimental/gdb/deadlock.py
Type "deadlock" to detect deadlocks.
(gdb) deadlock
Found deadlock!
Thread 2 (LWP 2174497) is waiting on mutex (0x00007ffcff42a4c0) held by Thread 3 (LWP 2174498)
Thread 3 (LWP 2174498) is waiting on mutex (0x00007ffcff42a4f0) held by Thread 4 (LWP 2174499)
Thread 4 (LWP 2174499) is waiting on mutex (0x00007ffcff42a490) held by Thread 2 (LWP 2174497)
```
NOTE: This script only works on Linux and requires debug symbols to be installed
for the `pthread` library.
---
### .Github/ISSUE TEMPLATE/Bug Report (.github/ISSUE_TEMPLATE/bug_report.md)
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Using this example configuration...
2. Dial into conference using verto
3. Play my_problem_file.mp4 into conference
4. FreeSWITCH crashes
**Expected behavior**
A clear and concise description of what you expected to happen.
**Package version or git hash**
- Version [e.g. 1.10.4]
**Trace logs**
Provide freeswitch logs w/ DEBUG and UUID logging enabled
**backtrace from core file**
If applicable, provide the full backtrace from the core file.
```
(gdb) set pagination off
(gdb) set logging file /tmp/backtrace.log
(gdb) set logging on
Copying output to /tmp/backtrace.log.
(gdb) bt
(gdb) bt full
(gdb) info threads
(gdb) thread apply all bt
(gdb) thread apply all bt full
(gdb) set logging off
Done logging to /tmp/backtrace.log.
(gdb) quit
```
---
### .Github/ISSUE TEMPLATE/Feature Request (.github/ISSUE_TEMPLATE/feature_request.md)
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
**Package version or git hash**
- Version of FreeSWITCH [e.g. 1.10.4]
---
### .Github/Workflows/Build.Yml (.github/workflows/build.yml)
name: Build and Distribute
on:
pull_request:
push:
branches:
- master
- v1.10
- v1.11
paths:
- "**"
workflow_dispatch:
inputs:
freeswitch_ref:
description: "FreeSWITCH repository ref"
required: true
default: master
type: string
release:
description: "FreeSWITCH release type"
type: choice
required: true
default: unstable
options:
- release
- unstable
publish:
description: "Publish build data"
required: true
default: false
type: boolean
concurrency:
group: ${{ github.head_ref || github.ref }}
jobs:
preconfig:
name: "Preconfig"
runs-on: ubuntu-latest
outputs:
deb: ${{ steps.deb.outputs.excludes }}
release: ${{ steps.release.outputs.release }}
steps:
- name: Generate Matrix excludes for DEB
id: deb
run: |
JSON="[]"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
JSON=$(jq -n '[
{
"version": "bookworm",
"platform": {
"name": "arm64v8"
}
},
{
"version": "bullseye",
"platform": {
"name": "arm32v7"
}
}
]')
fi
echo "excludes=$(echo $JSON | jq -c .)" | tee -a $GITHUB_OUTPUT
- name: Get release type based on branch
id: release
run: |
if [[ '${{ github.event_name }}' == 'pull_request' ]]; then
if [[ '${{ github.base_ref }}' == 'v1.10' || '${{ github.base_ref }}' == 'v1.11' ]]; then
echo 'release=release' | tee -a $GITHUB_OUTPUT
else
echo 'release=unstable' | tee -a $GITHUB_OUTPUT
fi
elif [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then
echo 'release=${{ inputs.release }}' | tee -a $GITHUB_OUTPUT
elif [[ '${{ github.ref }}' == 'refs/heads/v1.10' || '${{ github.ref }}' == 'refs/heads/v1.11' ]]; then
echo 'release=release' | tee -a $GITHUB_OUTPUT
else
echo 'release=unstable' | tee -a $GITHUB_OUTPUT
fi
get-nonce:
name: "Get Nonce for token"
runs-on: freeswitch-repo-auth-client
outputs:
nonce: ${{ steps.get-nonce.outputs.nonce }}
steps:
- name: Get Nonce
id: get-nonce
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
with:
mode: nonce
issue-token:
name: "Issue temporary token"
runs-on: ubuntu-latest
needs: get-nonce
env:
NONCE: ${{ needs.get-nonce.outputs.nonce }}
outputs:
token: ${{ steps.issue-token.outputs.token }}
steps:
- name: Mask Token
run: echo "::add-mask::$NONCE"
- name: Issue Token
id: issue-token
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
env:
NONCE: ${{ needs.get-nonce.outputs.nonce }}
with:
mode: issue
deb-public:
name: "DEB-PUBLIC"
permissions:
id-token: write
contents: read
needs:
- preconfig
- issue-token
uses: signalwire/actions-template/.github/workflows/cicd-docker-build-and-distribute.yml@main
strategy:
# max-parallel: 1
fail-fast: false
matrix:
os:
- debian
version:
- trixie
- bookworm
- bullseye
platform:
- name: amd64
runner: ubuntu-latest
- name: arm32v7
runner: ubuntu-24.04-arm
- name: arm64v8
runner: ubuntu-24.04-arm
release:
- ${{ needs.preconfig.outputs.release }}
exclude: ${{ fromJson(needs.preconfig.outputs.deb) }}
with:
RUNNER: ${{ matrix.platform.runner }}
REF: ${{ inputs.freeswitch_ref }}
ARTIFACTS_PATTERN: '.*\.(deb|dsc|changes|tar.bz2|tar.gz|tar.lzma|tar.xz)$'
DOCKERFILE: .github/docker/${{ matrix.os }}/${{ matrix.version }}/${{ matrix.platform.name }}/public.${{ matrix.release }}.Dockerfile
MAINTAINER: "Andrey Volk "
META_FILE_PATH_PREFIX: /var/www/freeswitch/public/${{ matrix.release }}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}
PLATFORM: ${{ matrix.platform.name }}
REPO_DOMAIN: "freeswitch.signalwire.com"
TARGET_ARTIFACT_NAME: ${{ matrix.os }}-${{ matrix.version }}-${{ matrix.platform.name }}-public-${{ matrix.release }}-artifact
UPLOAD_BUILD_ARTIFACTS: >-
${{
(
github.event_name == 'push' &&
github.repository == 'signalwire/freeswitch' &&
contains(fromJSON('["master", "v1.10", "v1.11"]'), github.ref_name)
) ||
(github.event_name == 'workflow_dispatch' && inputs.publish)
}}
secrets:
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
HOSTNAME: ${{ secrets.HOSTNAME }}
PROXY_URL: ${{ secrets.PROXY_URL }}
USERNAME: ${{ secrets.USERNAME }}
TELEPORT_TOKEN: ${{ secrets.TELEPORT_TOKEN }}
REPO_USERNAME: "SWUSERNAME"
REPO_PASSWORD: ${{ needs.issue-token.outputs.token }}
revoke-token:
name: "Revoke temporary token"
runs-on: ubuntu-latest
# if: always()
needs:
- issue-token
- deb-public
steps:
- name: Revoke Token
id: revoke-token
uses: signalwire/actions-template/.github/actions/repo-auth-client@main
env:
TOKEN: ${{ needs.issue-token.outputs.token }}
with:
mode: revoke
meta:
name: "Publish build data to meta-repo"
if: >-
${{
github.event_name == 'push' &&
github.repository == 'signalwire/freeswitch' &&
contains(fromJSON('["master", "v1.10", "v1.11"]'), github.ref_name)
}}
needs:
- deb-public
permissions:
id-token: write
contents: read
uses: signalwire/actions-template/.github/workflows/meta-repo-content.yml@main
with:
META_CONTENT: "/var/www/freeswitch/public/{release,unstable}/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}"
META_REPO: signalwire/bamboo_gha_trigger
META_REPO_BRANCH: trigger/freeswitch/${{ github.ref_name }}
secrets:
GH_BOT_DEPLOY_TOKEN: ${{ secrets.PAT }}
---
### .Github/Workflows/Ci.Yml (.github/workflows/ci.yml)
name: CI
on:
push:
branches:
- master
- v1.10
- v1.11
pull_request:
types:
- opened
- synchronize
workflow_dispatch:
inputs:
freeswitch_ref:
description: 'FreeSWITCH repository ref'
required: false
type: string
sofia-sip_ref:
description: 'Sofia-Sip repository ref'
required: false
type: string
dind:
description: 'Run tests using Docker-in-Docker'
required: false
type: boolean
default: false
env:
CI_BASE_STATIC_IMAGE: signalwire/freeswitch-public-ci-base:bookworm-amd64
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
DOCKER_BUILD_RECORD_UPLOAD: false
jobs:
unit-tests-pre-config:
if: ${{ !inputs.dind }}
name: "Unit-tests pre-config"
runs-on: ubuntu-latest
env:
TOTAL_GROUPS: 2
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
container-image: ${{ steps.set-vars.outputs.container-image }}
working-directory: ${{ steps.set-vars.outputs.working-directory }}
tests-only: ${{ steps.set-vars.outputs.tests-only }}
steps:
- id: set-matrix
shell: bash
run: |
MATRIX=$(jq -c -n --argjson groups "${{ env.TOTAL_GROUPS }}" \
'{
include: [range(1; $groups + 1) | {group: ., total: $groups}]
}')
echo "matrix=$MATRIX" | tee -a $GITHUB_OUTPUT
- id: set-vars
shell: bash
run: |
echo "tests-only=false" >> $GITHUB_OUTPUT
echo "working-directory=freeswitch/tests/unit" >> $GITHUB_OUTPUT
echo "container-image=$CI_BASE_STATIC_IMAGE" >> $GITHUB_OUTPUT
unit-tests:
if: ${{ !inputs.dind }}
name: "Unit-tests (group ${{ matrix.group }})"
needs:
- unit-tests-pre-config
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.unit-tests-pre-config.outputs.matrix) }}
uses: ./.github/workflows/unit-test.yml
with:
total-groups: ${{ matrix.total }}
current-group: ${{ matrix.group }}
container-image: ${{ needs.unit-tests-pre-config.outputs.container-image }}
working-directory: ${{ needs.unit-tests-pre-config.outputs.working-directory }}
tests-only: ${{ fromJson(needs.unit-tests-pre-config.outputs.tests-only) }}
secrets: inherit
validate-unit-tests:
if: ${{ always() && !inputs.dind }}
name: "Validate Unit-tests"
needs: unit-tests
runs-on: ubuntu-latest
steps:
- name: Check unit tests status
run: |
if [ "${{ needs.unit-tests.result }}" != "success" ]; then
exit 1
fi
unit-tests-dind:
if: ${{ inputs.dind }}
name: "Unit-tests D-in-D"
uses: ./.github/workflows/unit-test-dind.yml
with:
freeswitch_ref: ${{ inputs.freeswitch_ref }}
sofia-sip_ref: ${{ inputs.sofia-sip_ref }}
secrets: inherit
scan-build:
name: "Scan Build"
uses: ./.github/workflows/scan-build.yml
secrets: inherit
---
### .Github/Workflows/Macos.Yml (.github/workflows/macos.yml)
name: MacOS Build
on:
workflow_dispatch:
push:
branches:
- master
- v1.10
- v1.11
pull_request:
branches:
- master
- v1.10
- v1.11
jobs:
build:
name: Build MacOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
brew update
brew upgrade --formula || true
# Remove pinned cmake version (https://github.com/actions/runner-images/blob/macos-15-arm64/20250825.2246/images/macos/scripts/build/install-common-utils.sh#L19)
brew uninstall --ignore-dependencies cmake || true
# brew install libtiff openssl@3
brew install \
autoconf \
automake \
curl \
ffmpeg@7 \
gnu-sed \
jpeg \
ldns \
libpq@18 \
libsndfile \
libtool \
lua \
opus \
ossp-uuid \
pcre2 \
pkgconf \
sofia-sip \
speex \
speexdsp \
sqlite \
yasm \
&& \
brew list --pinned | awk '{system("brew unpin " $1)}' && \
brew install --adopt \
signalwire/homebrew-signalwire/libks2 \
signalwire/homebrew-signalwire/signalwire-c2 \
signalwire/homebrew-signalwire/spandsp \
&& \
brew link --force --overwrite \
ffmpeg@7 \
libpq@18
- name: Bootstrap FreeSWITCH
run: ./bootstrap.sh -j
# - name: Disable modules
# run: |
# gsed -i \
# -e '/mod_pgsql/s/^/#/g' \
# modules.conf
- name: Configure build
run: |
mkdir -p OUT && \
./configure \
--enable-shared \
--enable-static \
--exec_prefix=${{ github.workspace }}/OUT \
--prefix=${{ github.workspace }}/OUT
- name: Build
run: |
make
- name: Install to local folder
run: |
make install
# - name: Debug - List all files
# run: |
# find . -type f | sort
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: freeswitch-macos-build
path: |
OUT/
---
### .Github/Workflows/Scan Build.Yml (.github/workflows/scan-build.yml)
name: Scan build (Static Analysis)
on:
workflow_call:
inputs:
freeswitch_ref:
description: 'FreeSWITCH repository ref'
required: false
type: string
sofia-sip_ref:
description: 'Sofia-Sip repository ref'
required: false
type: string
jobs:
scan-build:
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-ci-base:bookworm-amd64
options: --privileged
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout Sofia-Sip
if: inputs.sofia-sip_ref == ''
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
path: sofia-sip
- name: Checkout Sofia-Sip (via ref)
if: inputs.sofia-sip_ref != ''
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
ref: ${{ inputs.sofia-sip_ref }}
path: sofia-sip
- name: Checkout FreeSWITCH (via ref)
if: inputs.freeswitch_ref != ''
uses: actions/checkout@v4
with:
ref: ${{ inputs.freeswitch_ref }}
path: freeswitch
- name: Checkout FreeSWITCH
if: inputs.freeswitch_ref == ''
uses: actions/checkout@v4
with:
path: freeswitch
- name: Configure, Build and Install Sofia-Sip
shell: bash
working-directory: freeswitch
run: |
DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre2-dev libsphinxbase-dev libpocketsphinx-dev libnode-dev
./ci.sh -t scan-build -a configure -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
./ci.sh -t scan-build -a build -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
./ci.sh -t scan-build -a install -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
- name: Configure FreeSWITCH
shell: bash
working-directory: freeswitch
run: |
./ci.sh -t scan-build -a configure -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
- name: Run scan-build analysis
shell: bash
working-directory: freeswitch
run: |
./ci.sh -t scan-build -a build -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
- name: Check analysis results
if: always()
shell: bash
working-directory: freeswitch
run: |
./ci.sh -t scan-build -a validate -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
- name: Upload Scan-Build logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: scan-build-logs
path: freeswitch/scan-build
if-no-files-found: ignore
compression-level: 9
- name: Notify run tests result to slack
if: |
failure() &&
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10' || github.ref == 'refs/heads/v1.11')
uses: signalwire/actions-template/.github/actions/slack@main
with:
CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }}
MESSAGE: Scan-Build ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Static analysis failed.
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
---
### .Github/Workflows/Tarball.Yml (.github/workflows/tarball.yml)
name: Release generic source archives
on:
push:
branches:
- 'v1.10'
- 'v1.11'
workflow_dispatch:
inputs:
ref:
description: 'Branch, tag, or SHA to build tarball from'
required: true
type: string
jobs:
source:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
path: 'code'
ref: ${{ inputs.ref || github.ref }}
- name: Checkout reusable actions
uses: actions/checkout@v6
with:
repository: signalwire/actions-template
ref: main
fetch-depth: 1
path: actions
sparse-checkout: |
.github/actions/teleport/action.yml
sparse-checkout-cone-mode: false
- name: Install dependencies
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update && sudo apt-get install -y \
devscripts \
libtool \
libtool-bin \
zip \
tar \
gzip \
bzip2 \
xz-utils
- name: Run source tarball script
shell: bash
working-directory: ./code
run: ./scripts/ci/src_tarball.sh
- name: Generate checksums
shell: bash
working-directory: ./code/../src_dist
run: |
find . \( -iname '*.tar.bz2' -o -iname '*.tar.gz' -o -iname '*.tar.xz' -o -iname '*.zip' \) | while read file; do
echo $(md5sum $(basename $file)) > $file.md5
echo $(sha1sum $(basename $file)) > $file.sha1
echo $(sha256sum $(basename $file)) > $file.sha256
done
- name: Pack source archives directory
shell: bash
run: tar -czvf source_archives.tar.gz -C ./code/../src_dist .
- name: List contents
shell: bash
run: |
tar -tvzf source_archives.tar.gz
- name: Upload source tarball to remote host
if: github.event_name != 'workflow_dispatch'
uses: ./actions/.github/actions/teleport
with:
EXEC_COMMANDS_PRE: 'mkdir -p /var/www/freeswitch/public/release/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
FILES: 'source_archives.tar.gz'
FILES_FOLDER: '/var/www/freeswitch/public/release/${{ github.ref_name }}/${{ github.run_id }}-${{ github.run_number }}'
env:
HOSTNAME: ${{ secrets.HOSTNAME }}
PROXY_URL: ${{ secrets.PROXY_URL }}
TOKEN: ${{ secrets.TELEPORT_TOKEN }}
USERNAME: ${{ secrets.USERNAME }}
- name: Upload source tarball as artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: source_archives
path: source_archives.tar.gz
---
### .Github/Workflows/Unit Test Dind.Yml (.github/workflows/unit-test-dind.yml)
name: Unit-tests D-in-D
on:
workflow_call:
inputs:
freeswitch_ref:
description: 'FreeSWITCH repository ref'
required: false
type: string
sofia-sip_ref:
description: 'Sofia-Sip repository ref'
required: false
type: string
env:
MAX_CONTAINERS: 8
NUM_CPU_PER_CONTAINER: 1
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
DOCKER_BUILD_RECORD_UPLOAD: false
jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: signalwire/freeswitch-public-ci-base:bookworm-amd64
options: --privileged
env:
DEBIAN_FRONTEND: noninteractive
ASAN_OPTIONS: log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
steps:
- name: Checkout Sofia-Sip (via ref)
if: inputs.sofia-sip_ref != ''
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
ref: ${{ inputs.sofia-sip_ref }}
path: sofia-sip
- name: Checkout Sofia-Sip
if: inputs.sofia-sip_ref == ''
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
path: sofia-sip
- name: Checkout FreeSWITCH (via ref)
if: inputs.freeswitch_ref != ''
uses: actions/checkout@v4
with:
ref: ${{ inputs.freeswitch_ref }}
path: freeswitch
- name: Checkout FreeSWITCH
if: inputs.freeswitch_ref == ''
uses: actions/checkout@v4
with:
path: freeswitch
- name: Run Unit-Test containers and collect artifacts
id: unit_tests
shell: bash
run: |
echo "logs_path=${GITHUB_WORKSPACE}/freeswitch/tests/unit/logs" >> $GITHUB_OUTPUT
"${GITHUB_WORKSPACE}/freeswitch/tests/unit/run-tests-docker.sh" \
--base-image signalwire/freeswitch-public-ci-base:bookworm-amd64 \
--cpus ${{ env.NUM_CPU_PER_CONTAINER }} \
--image-tag ci.local \
--max-containers ${{ env.MAX_CONTAINERS }} \
--output-dir "${GITHUB_WORKSPACE}/freeswitch/tests/unit/logs" \
--sofia-sip-path "${GITHUB_WORKSPACE}/sofia-sip" \
--freeswitch-path "${GITHUB_WORKSPACE}/freeswitch"
test -d "/cores" && ls -lah /cores
cd "${GITHUB_WORKSPACE}/freeswitch/tests/unit/" && \
./collect-test-logs.sh --dir logs --print
- name: Upload Unit-Test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ github.sha }}-${{ github.run_number }}
path: ${{ steps.unit_tests.outputs.logs_path }}
if-no-files-found: ignore
compression-level: 9
- name: Notify run tests result to slack
if: |
failure() &&
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10' || github.ref == 'refs/heads/v1.11')
uses: signalwire/actions-template/.github/actions/slack@main
with:
CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }}
MESSAGE: Unit-Tests ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Some tests are failing.
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
---
### .Github/Workflows/Unit Test.Yml (.github/workflows/unit-test.yml)
name: Unit tests
on:
workflow_call:
inputs:
total-groups:
description: 'Total number of test groups'
required: true
type: number
default: 1
current-group:
description: 'Current test group number'
required: true
type: number
default: 1
freeswitch_ref:
description: 'FreeSWITCH repository ref'
required: false
type: string
sofia-sip_ref:
description: 'Sofia-Sip repository ref'
required: false
type: string
container-image:
description: 'Container image to use for running tests'
required: false
type: string
default: 'signalwire/freeswitch-public-ci-base:bookworm-amd64'
working-directory:
description: 'Working directory for running tests'
required: false
type: string
default: 'freeswitch/tests/unit'
tests-only:
description: 'Run only tests, skip other tasks'
required: false
type: boolean
default: false
jobs:
unit-test:
runs-on: ubuntu-latest
container:
image: ${{ inputs.container-image }}
options: --privileged
env:
DEBIAN_FRONTEND: noninteractive
ASAN_OPTIONS: log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0
steps:
- name: Override core_pattern
shell: bash
run: |
echo '/cores/core.%s.%E.%e.%p.%t' > /proc/sys/kernel/core_pattern
cat /proc/sys/kernel/core_pattern
- name: Checkout Sofia-Sip (via ref)
if: ${{ !inputs.tests-only && inputs.sofia-sip_ref != '' }}
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
ref: ${{ inputs.sofia-sip_ref }}
path: sofia-sip
- name: Checkout Sofia-Sip
if: ${{ !inputs.tests-only && inputs.sofia-sip_ref == '' }}
uses: actions/checkout@v4
with:
repository: freeswitch/sofia-sip
path: sofia-sip
- name: Checkout FreeSWITCH (via ref)
if: ${{ !inputs.tests-only && inputs.freeswitch_ref != '' }}
uses: actions/checkout@v4
with:
ref: ${{ inputs.freeswitch_ref }}
path: freeswitch
- name: Checkout FreeSWITCH
if: ${{ !inputs.tests-only && inputs.freeswitch_ref == '' }}
uses: actions/checkout@v4
with:
path: freeswitch
- name: Configure, Build and Install Sofia-Sip
if: ${{ !inputs.tests-only }}
shell: bash
working-directory: freeswitch
run: |
DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre2-dev libsphinxbase-dev libpocketsphinx-dev
./ci.sh -t unit-test -a configure -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
./ci.sh -t unit-test -a build -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
./ci.sh -t unit-test -a install -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip"
- name: Configure, Build and Install FreeSWITCH
if: ${{ !inputs.tests-only }}
shell: bash
working-directory: freeswitch
run: |
./ci.sh -t unit-test -a configure -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
./ci.sh -t unit-test -a build -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
./ci.sh -t unit-test -a install -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch"
- name: Run unit tests
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
./run-tests.sh ${{ inputs.total-groups }} ${{ inputs.current-group }} --output-dir logs || exit 1
- name: Run libesl tests
if: ${{ inputs.current-group == 1 }}
shell: bash
working-directory: ${{ inputs.working-directory }}/../../libs/esl
run: |
make check
- name: Collect unit test logs
if: always()
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
test -d "/cores" && ls -lah /cores
./collect-test-logs.sh --dir logs --print
- name: Upload Unit-Test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ github.sha }}-${{ github.run_number }}-${{ inputs.current-group }}-of-${{ inputs.total-groups }}
path: ${{ inputs.working-directory }}/logs
if-no-files-found: ignore
compression-level: 9
- name: Notify run tests result to slack
if: |
failure() &&
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10' || github.ref == 'refs/heads/v1.11')
uses: signalwire/actions-template/.github/actions/slack@main
with:
CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }}
MESSAGE: Unit-Tests ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Some tests are failing.
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
---
### .Github/Workflows/Windows.Yml (.github/workflows/windows.yml)
name: Windows
on:
pull_request:
types: [opened, synchronize]
push:
branches: [master, release]
jobs:
x64:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build
run: msbuild Freeswitch.2017.sln -t:build -verbosity:minimal -property:Configuration=Release -property:Platform=x64
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: MSI Package
path: D:\a\freeswitch\freeswitch\x64\*.msi
if: contains(github.event.pull_request.title, ':upload-artifacts') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10' || github.ref == 'refs/heads/v1.11'
---