All Projects → havfo → Skype-Kamailio-PSTN-gateway

havfo / Skype-Kamailio-PSTN-gateway

Licence: other
Skype for Business/Lync PSTN gateway

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Skype-Kamailio-PSTN-gateway

pyfreebilling
Routing and rating VoIP application for service providers - API based - AGPL v3 - Based on kamailio
Stars: ✭ 75 (+257.14%)
Mutual labels:  sip, kamailio
kamailioexamples
configurations for voip solution architectures and usecases involving SIP servers
Stars: ✭ 59 (+180.95%)
Mutual labels:  sip, kamailio
ominicontacto
The Open Source Contact Center Solution (mirror of https://gitlab.com/omnileads/ominicontacto)
Stars: ✭ 24 (+14.29%)
Mutual labels:  kamailio, rtpengine
sip3-captain-ce
SIP3 Captain (Community Edition)
Stars: ✭ 73 (+247.62%)
Mutual labels:  sip
VAG.Node
GB28181 PS流转发网关服务<Node 版>,以GB28181对接的方式将摄像机/硬盘录像机 的PS流(H264/H265)打包推送到RTMP服务器。
Stars: ✭ 48 (+128.57%)
Mutual labels:  sip
AmiClient
Modern .NET Standard client for accessing the Asterisk AMI protocol using async/await and Reactive Extensions (Rx)
Stars: ✭ 30 (+42.86%)
Mutual labels:  sip
SfBAutomatedLab
SfBAutomatedLab deploys Skype for Business labs using PowerShell and AutomatedLab. You just need the topology file and 2 lines of code.
Stars: ✭ 14 (-33.33%)
Mutual labels:  skype
app
studio link - app - mirror repo only -> issues now https://gitlab.com/studio.link/app
Stars: ✭ 56 (+166.67%)
Mutual labels:  sip
BotBuilder-Watson
A Microsoft Bot Framework & IBM Watson bot
Stars: ✭ 19 (-9.52%)
Mutual labels:  skype
astlinux
AstLinux is a "Network Appliance for Communications" x86_64 Linux distribution
Stars: ✭ 23 (+9.52%)
Mutual labels:  sip
go-sip
A Go (golang) library to interface with SIP (Session Initiation Protocol) as defined in RFC 3261.
Stars: ✭ 100 (+376.19%)
Mutual labels:  sip
WireBug
WireBug is a toolset for Voice-over-IP penetration testing
Stars: ✭ 142 (+576.19%)
Mutual labels:  sip
docker open5gs
Docker files to run open5gs + IMS + eNB + gNB + NR-UE in a docker
Stars: ✭ 98 (+366.67%)
Mutual labels:  kamailio
mumsi
SIP to Mumble gateway/bridge using PJSUA stack.
Stars: ✭ 33 (+57.14%)
Mutual labels:  sip
skype-bot-php
PHP CLI/Library for the Skype Bot API
Stars: ✭ 64 (+204.76%)
Mutual labels:  skype
qSIP
VoIP/SIP client (softphone)
Stars: ✭ 20 (-4.76%)
Mutual labels:  sip
Katari
Katari - Python Session Initiated Protocol Framework
Stars: ✭ 29 (+38.1%)
Mutual labels:  sip
react-native-sip
SIP module for React Native
Stars: ✭ 37 (+76.19%)
Mutual labels:  sip
DaProfiler
DaProfiler allows you to create a profile on your target based in France only. The particularity of this program is its ability to find the e-mail addresses your target.
Stars: ✭ 58 (+176.19%)
Mutual labels:  skype
sip3-twig-ce
SIP3 Twig (Community Edition)
Stars: ✭ 56 (+166.67%)
Mutual labels:  sip

Skype for Business/Lync PSTN gateway with Kamailio

How to setup Kamailio + RTPEngine to enable PSTN calling from Skype for Business/Lync. This configuration currently only supports SIP over TCP and unencrypted RTP. It is able to handle multiple domains from multiple mediation servers.

This setup is for Debian 9 Stretch.

Architecture

This setup handles the green boxes in the diagram only.

Skype for Business - PSTN architecture

Get configuration files

All files needed to setup all components on Debian 9 Stretch.

git clone https://github.com/havfo/Skype-Kamailio-PSTN-gateway.git
cd Skype-Kamailio-PSTN-gateway
find . -type f -print0 | xargs -0 sed -i 's/XXXX-XXXX/PUT-FQDN-OF-YOUR-SIP-SERVER-HERE/g'
find . -type f -print0 | xargs -0 sed -i 's/XXX-XXX/PUT-IP-OF-YOUR-SIP-SERVER-HERE/g'

Install RTPEngine

This will do the RTP handling.

The easiest way of installing is to get it from Sipwise repository:

echo 'deb http://deb.sipwise.com/spce/mr7.1.1/ stretch main' > /etc/apt/sources.list.d/sipwise.list
echo 'deb-src http://deb.sipwise.com/spce/mr7.1.1/ stretch main' >> /etc/apt/sources.list.d/sipwise.list
apt-get update
apt-get install -y --allow-unauthenticated ngcp-keyring
apt-get update
apt-get install -y ngcp-rtpengine

After you have successfully installed RTPEngine, copy the configuration from this repository.

cd Skype-Kamailio-PSTN-gateway
cp etc/default/ngcp-rtpengine-daemon /etc/default/
cp etc/rtpengine/rtpengine.conf /etc/rtpengine/
/etc/init.d/ngcp-rtpengine-daemon restart

Install IPTables firewall (optional)

RTPEngine handles the chain for itself, but make sure to not block the RTP-ports it is using. Take a look in iptables.sh for details, and apply it by doing the following. This will persist after reboot. You can run the iptables.sh script at any time after it is set up.

cd Skype-Kamailio-PSTN-gateway
chmod +x iptables.sh
cp etc/network/if-up.d/iptables /etc/network/if-up.d/
chmod +x /etc/network/if-up.d/iptables
touch /etc/iptables/firewall.conf
touch /etc/iptables/firewall6.conf
./iptables.sh

Install Kamailio

apt-get install kamailio kamailio-mysql-modules kamailio-tls-modules mysql-server
cd Skype-Kamailio-PSTN-gateway
cp etc/kamailio/* /etc/kamailio/
kamdbctl create

Select yes (Y) to all options.

/etc/init.d/kamailio restart

Setup domain and number handling in Kamailio

Insert the kamailio.sql into mysql using something like:

mysql -u root -p < kamailio.sql

Take a look in kamailio.sql for examples of numbers/domains/mediation servers/proxies.

To add a mediation server:

  1. INSERT the mediation server into address table with grp field set to something in the range 300 -> 399
    • Note: If you have a Skype for Business site/pool with several mediation servers, add them with the same grp field
  2. INSERT the number series belonging to the mediation server (pool/site) into carrierroute table with rewrite_host set to the skype-sip-domain the number series belongs to
  3. INSERT the mediation server into dispatcher table with setid field set to same number chosen for the grp field in the address table
  4. INSERT the SIP domain of the number series into domain_lookup table with groupid field set to same number chosen for the grp field in the address table

By default, outbound calls from Skype for Business are dispatched to dispatcher group 200. Take a look in kamailio.sql for examples on adding a proxy.

Skype for Business configuration

  1. Configure PSTN GW in topology builder using TCP and port 5065
  2. Configure trunk in Skype for Business/Lync Control Panel > Voice Routing > Trunk Configuration
    • Change "Encryption support level:" to Disabled
    • Change "Refer support:" to None
    • Make sure "Enable media bypass" is unchecked
    • Make sure "Centralized media processing" is checked
    • Make sure "Enable RTP latching" is unchecked
    • Make sure "Enable forward call history" is checked
    • Make sure "Enable forward P-Asserted-Identity data" is checked
    • Make sure "Enable outbound routing failover timer" is checked
  3. Configure voice route in Skype for Business/Lync Control Panel > Voice Routing > Voice Policy/Route/PSTN Usage
    • The voice route supports all types of forwarding/delegation/park and so on

Testing

Call in/out to/from a Skype for Business user and make sure you use full E164 number format in your dial-plans.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].