diff --git a/docs/Install.windows b/docs/Install.windows index 38a871d5..4eec5a37 100644 --- a/docs/Install.windows +++ b/docs/Install.windows @@ -1,203 +1,203 @@ SIP SIMPLE SDK installation on Microsoft Windows ------------------------------------------------ -Note: This document is work in progress. - Home page: http://sipsimpleclient.org This document describes the installation procedure on Microsoft Windows operating systems. Supported versions are Windows XP or higher. Step 1. Prerequisites --------------------- The building process is designed to work with the MSYS2 environment and the MinGW-w64 compiler toolchain. Other approaches might work but they are not tested nor supported. MSYS2: MSYS2 is a minimal Unix-like environment for Windows. It includes a port of the 'pacman' package manager (ported from Arch Linux) and a pretty extensive collection of packages which can be easily installed. It contains packages for the MinGW-w64 toolchain, for 32 and 64 bit architectures. MinGW-w64: MinGW is a minimal compilation toolchain for Windows. It contains GCC and allows for compilation of native applications for Windows. The original MinGW project (available at http://mingw.org, henceforth referred to as 'MinGW32') didn't support 64 bit Windows so the MinGW-w64 project was created. It contains support for both 32 and 64 bit architectures and generally it's better maintained than MinGW32. Step 1.1. Installing MSYS2 and MinGW-w64 ---------------------------------------- The following instructions will guide you through the installation of a MSYS2 and MinGW-w64. * Go to http://msys2.github.io and download the MSYS2 installer * Run it and install it on C:\msys2 (or any other path, but note it has to be ASCII only and with no spaces! The no spaces restriction also applies to the paths of the packages that will be built during the installation) * Upgrade the system packages by following the instructions from: http://msys2.github.io Launch MSYS MINGW64 * Install the compiler toolchain and assorted tools: pacman -S mingw-w64-x86_64-toolchain Step 1.2. Installing Python-PIP ------------------------------- The Python binaries that are available for download on Python's official website are compiled with Visual Studio, and if we use MinGW to compile libraries which are then used by Python modules we are at risk because the resulting application would load 2 different C runtimes. So you should remove python3 if it is installed in Windows. * Install pip/setuptools: pacman -S mingw-w64-x86_64-python3-pip Step 2. Install dependencies ---------------------------- See Dependencies.txt for detailed description of the required libraries and their minimum version number. * Install required dependencies with pacman: pacman -S mingw-w64-x86_64-gnutls mingw-w64-x86_64-python3-lxml \ mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-sqlite3 msys2-w32api-headers \ mingw-w64-x86_64-gmp mingw-w64-x86_64-mpc mingw-w64-x86_64-mpfr * Install the Python package dependencies: pip3 install cython==0.29.37 dnspython twisted python-dateutil greenlet Step 2.1. Install python3-application, python3-gnults and python3-otr --------------------------------------------------------------------- * Install git: pacman -S git * Install python3-application pip3 install git+https://github.com/AGProjects/python3-application.git * Install python3-gnutls: pacman -S mingw-w64-x86_64-python-pyopenssl pip install git+https://github.com/AGProjects/python3-gnutls.git --no-build-isolation * Install cryptography: pacman -S --overwrite '*' mingw-w64-x86_64-python-setuptools-rust patch wget https://mirror.msys2.org/mingw/sources/mingw-w64-python-cryptography-38.0.4-1.src.tar.zst Extract this and cd into the dir: tar --zstd -xvf ./mingw-w64-python-cryptography-38.0.4-1.src.tar.zst cd mingw-w64-python-cryptography makepkg-mingw -cfiL --nocheck --nosign * Install gmpy2: pacman -S mingw-w64-x86_64-python-gmpy2 * Install python3-otr: pip install git+https://github.com/AGProjects/python3-otr.git --no-build-isolation Step 2.2. Build and install some extra packages ----------------------------------------------- mingw-w64-intsafe-headers * Get the package code: darcs get http://devel.ag-projects.com/repositories/windows/mingw-w64-intsafe-headers * Enter the directory and build+install the package: cd mingw-w64-intsafe-headers && makepkg-mingw -cfiL --nocheck --nosign * Install will probably fail, so install with pacman -S --overwrite '*' ./mingw-w64-intsafe-headers-1.1.0-1-any.pkg.tar.zst mingw-w64-dshow-baseclasses * Get the package code: darcs get http://devel.ag-projects.com/repositories/windows/mingw-w64-dshow-baseclasses * Enter the directory and build+install the package: cd mingw-w64-dshow-baseclasses && makepkg-mingw -cfiL --nocheck --nosign Step 3. Install SIP SIMPLE client SDK ------------------------------------- The SDK consists of four parts: 1. python-eventlib 2. XCAP library 3. MSRP library 4. SIP SIMPLE library itself Make sure that the path where you download the software below does not contain any space in its name. # Eventlib git clone https://github.com/AGProjects/python3-eventlib.git cd python3-eventlib Eventlib needs to be patched: diff --git a/eventlib/green/socket.py b/eventlib/green/socket.py index 7a4623b..0455e2e 100644 --- a/eventlib/green/socket.py +++ b/eventlib/green/socket.py @@ -1,5 +1,5 @@ import socket as __socket -from socket import (__all__, error, AF_INET, AF_UNIX, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR, getdefaulttimeout, gethostname, getnameinfo, getservbyname, herror, htonl, SOCK_DGRAM, timeout, gaierror, SOCK_RAW, setdefaulttimeout, getservbyport, gethostbyaddr, ntohl, htons, ntohs, getfqdn, SOCK_RDM, SOCK_SEQPACKET) +from socket import (__all__, error, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_REUSEADDR, getdefaulttimeout, gethostname, getnameinfo, getservbyname, herror, htonl, SOCK_DGRAM, timeout, gaierror, SOCK_RAW, setdefaulttimeout, getservbyport, gethostbyaddr, ntohl, htons, ntohs, getfqdn, SOCK_RDM, SOCK_SEQPACKET) from eventlib.api import get_hub from eventlib.greenio import GreenSocket as socket pip install . cd .. # XCAP library git clone https://github.com/AGProjects/python3-xcaplib.git cd python3-xcaplib + Gevent does not work yet. So we need to patch xcaplib: diff --git a/xcaplib/client.py b/xcaplib/client.py index 6b489cb..3f904ca 100644 --- a/xcaplib/client.py +++ b/xcaplib/client.py @@ -1,8 +1,8 @@ -import gevent -from gevent import monkey +#import gevent +#from gevent import monkey -monkey.patch_socket() -monkey.patch_ssl() +#monkey.patch_socket() +#monkey.patch_ssl() from xcaplib import __version__ from xcaplib.httpclient import HTTPClient pip install . cd .. # MSRP library pip install git+https://github.com/AGProjects/python3-msrplib.git --no-build-isolation # SIPSimple SDK git clone https://github.com/AGProjects/python3-sipsimple.git pacman -S msys/make cd python3-sipsimple ./get_dependencies.sh - Gevent does not work yet. So we need to patch xcap: + + Gevent does not work yet, we skip it for the time being by patching xcap: patch -p1 < ./deps/patches/windows/001_disable_gevent.patch - pip install . --no-build-isolation + pip install . --no-build-isolation diff --git a/TODO b/docs/TODO similarity index 90% rename from TODO rename to docs/TODO index 28897477..7e70d738 100644 --- a/TODO +++ b/docs/TODO @@ -1,86 +1,78 @@ TODO ---- + - Remove use of gevent that doesnot work on Windows - Use individual TCP/TLS transport per SIP account - - Use individual TLS settings per account (CA, list, certificate and verify server) - After ICE neg is completed we must send re-INVITE with the chosen RTP candidates - Cannot retry a Call Transfer if it failed (invitation._transfer_usage is not reset) - Modify Invitation/Request/Subscription to reset transport on request_uri - Application.py subscribes to notifications but doesn't remove them when it stops - Send notifications when local/remote party becomes focus SIPSessionLocalPartyIsFocus, SIPSessionRemotePartyIsFocus -Migrate from eventlib to gevent -------------------------------- - - * http://sdiehl.github.io/gevent-tutorial/ - * https://blog.gevent.org/2010/02/27/why-gevent/ - * http://groups.google.com/group/gevent/browse_thread/thread/7fca7230db0509f6 - - -TODO Python version 2 ---------------------- +TODO Python 2 +------------- - If the SIP account password is changed on the server, then the client modifies some contact, xcap PUT will keep failing with 401 even after the password is reverted on the server. This will only be fixed by deactivating/reactivating the account or restarting the application. - Warning header takes a code (300-399) a hostname (not user agent) and a message. Class allows any code (100-999) and we use engine.user_agent for the hostname where we use this header in session.py - 202 is deprecated (see https://tools.ietf.org/html/rfc6665#page-43) - After ICE negotiation completed we do not save state and later re-INVITEs can fail, we must send re-INVITE or UPDATE with chosen candidate + Allow resume of failed file transfers (a=file-range SDP attribute) + combine account.uri and account.contact into account.uri.aor and account.uri.contact. This will also remove the confusion between account.contact and account.contact_manager + change settings so they store changes in a thread local container which is made public (accessible for all threads) when save is called. This will make changes be atomic inside a thread (everything from attribute changes up to the save operation is contained in the thread and will not mix with changes done in parallel from other threads). + there is a race condition that can prevent an account to start if it is created while the start method of SIPApplication runs and it passed the point where it called AccountManager.start. A quick workaround is to never create an account before SIPApplicationDidStart is posted + SIPApplication.start attempts to be restartable in case of errors, but there are cases where it may enter into a state where it will raise exceptions perpetually, even if the condition that led to the exception was fixed. - allow deleting transport on SIPURI - End a session while in accepting state (requires session serialization) - Model file transfer after desktop sharing (use handlers on termination) have internal/external handlers (notifications based or file bridges) - Use an ordered dict for keeping accounts in the AccountManager ?!? see http://code.activestate.com/recipes/576693/ - have higher level notifications on conference events - Notification from SIPApplication when a transport is added/removed to the engine. - SIPApplication should provide a list of supported transports that need to be used instead of the ones from settings because not everything enabled in settings may actually be available at runtime on the engine - Build contacts on above notification instead of building them on the fly - Ability to start stream deactivated / on-hold - VideoStream(direction='sendrecv') like MSRP? - Review stream API, s/deactivate/shutdown/ ? - Open the camera at its native framerate