├── docs ├── source │ ├── _static │ │ └── placeholder │ ├── _templates │ │ └── placeholder │ ├── dev │ │ ├── external_links │ │ │ ├── CONTRIBUTING.md │ │ │ └── CONTRIBUTORS.md │ │ ├── shared.rst │ │ ├── database.rst │ │ ├── settings.rst │ │ ├── dsiprouter.rst │ │ ├── sysloginit.rst │ │ ├── index.rst │ │ └── modules.rst │ ├── user │ │ ├── images │ │ │ ├── DID_test.csv │ │ │ ├── add_trunk.png │ │ │ ├── dialplan.png │ │ │ ├── dsip_v51.png │ │ │ ├── 11d_dialplan.png │ │ │ ├── add_a_domain.png │ │ │ ├── add_endpoint.png │ │ │ ├── config_pic.png │ │ │ ├── dSIP_PBX_Add.png │ │ │ ├── sip_settings.png │ │ │ ├── skyetel_logo.jpg │ │ │ ├── skyetel_logo.png │ │ │ ├── add_new_domain.png │ │ │ ├── carrier_groups.png │ │ │ ├── chansip_zoiper.png │ │ │ ├── dSIP_dashboard.png │ │ │ ├── list_of_domain.png │ │ │ ├── outbound_proxy.png │ │ │ ├── reload_button.png │ │ │ ├── sipchan_added.png │ │ │ ├── zoiper_example.png │ │ │ ├── IP_authenication.png │ │ │ ├── add_carrier_group.png │ │ │ ├── add_new_domain3.png │ │ │ ├── add_new_domain522.png │ │ │ ├── assign_template.png │ │ │ ├── carrier_editing.png │ │ │ ├── chansip_incoming.png │ │ │ ├── chansip_outgoing.png │ │ │ ├── dSIP_IN_DID_Map.png │ │ │ ├── dial_plan_chansip.png │ │ │ ├── dsiprouter-pbxs.jpg │ │ │ ├── fusionpbx_hosting.png │ │ │ ├── list_of_domains1.png │ │ │ ├── register_string.png │ │ │ ├── sipchan_general.png │ │ │ ├── sipchan_outbound.png │ │ │ ├── upgrade_available.png │ │ │ ├── upgrading-log-01.png │ │ │ ├── upgrading-log-02.png │ │ │ ├── username_password.png │ │ │ ├── zoiper_screenshot.png │ │ │ ├── apply_config_button.png │ │ │ ├── carrier_group_list.png │ │ │ ├── chansip_dial_wizard.png │ │ │ ├── dSIP_Global_Out_Add.png │ │ │ ├── dSIP_IN_DID_Reload.png │ │ │ ├── dSIP_IN_Import_DID.png │ │ │ ├── dSIP_IN_Manual_Add.png │ │ │ ├── direct-routing-sbcs.png │ │ │ ├── dsiprouter-pbx-auth.jpg │ │ │ ├── freepbx-pt-add-pbx.png │ │ │ ├── fusionpbx_hosting1.png │ │ │ ├── fusionpbx_hosting2.png │ │ │ ├── new_carrier_details.png │ │ │ ├── provisioning_server.png │ │ │ ├── upgrade_up_to_date.png │ │ │ ├── add_new_domain_dev522.png │ │ │ ├── chansip_dial_pattern.png │ │ │ ├── dSIP_PBX_ADD_New_PBX.png │ │ │ ├── dsiprouter-teleblock.jpg │ │ │ ├── freepbx-pt-add-domain.png │ │ │ ├── fusionpbx_integration.png │ │ │ ├── sip_trunking_fusionpbx.png │ │ │ ├── sip_trunking_ip_auth.png │ │ │ ├── stir_shaken_settings.png │ │ │ ├── add_new_carrier_details.png │ │ │ ├── fusionpbx_domain_support.png │ │ │ ├── outbound_routes_chansip.png │ │ │ ├── sip_trunking_fusionpbx_2.png │ │ │ ├── sip_trunking_fusionpbx_3.png │ │ │ ├── sip_trunking_fusionpbx_4.png │ │ │ ├── dsiprouter-inboundmapping.jpg │ │ │ ├── dsiprouter-outboundrouting.jpg │ │ │ ├── dsiprouter_outboundrouting.jpg │ │ │ ├── freepbx-pt-setup-softphone.png │ │ │ ├── fusionpbx_global_dialplan.png │ │ │ ├── outbound-routes_fusionpbx.png │ │ │ ├── outbound-routes_fusionpbx_2.png │ │ │ ├── features │ │ │ │ └── pbx_domain │ │ │ │ │ ├── PBX_modal.png │ │ │ │ │ ├── PBX_modal_ip.png │ │ │ │ │ ├── PBX_modal_uac.png │ │ │ │ │ └── PBX_subcriber_update.png │ │ │ ├── sip_trunking_credentials_auth.png │ │ │ ├── sip_trunking_freepbx_pjsip_1.png │ │ │ ├── sip_trunking_freepbx_pjsip_2.png │ │ │ ├── dSIP_Global_Out_Add_Outbound_Route.png │ │ │ ├── dsiprouter-fusionpbx_domain_support.jpg │ │ │ └── device_provisioning_http__domain_filter.png │ │ ├── carrier_editing.png │ │ ├── username_password.png │ │ ├── configuring.rst │ │ ├── upgrade_0.621_to_0.63.rst │ │ ├── global_outbound_routes.rst │ │ ├── resources.rst │ │ ├── pbxs_and_endpoints.rst │ │ ├── supported_configurations.rst │ │ ├── domains.rst │ │ ├── api.rst │ │ └── inbound_did_mapping.rst │ ├── routes │ │ ├── details.rst │ │ ├── index.rst │ │ └── summary.rst │ └── index.rst ├── .DS_Store ├── dsiprouter_300px.png ├── requirements.in └── Makefile ├── gui ├── modules │ ├── api │ │ ├── auth │ │ │ ├── __init__.py │ │ │ └── ldap │ │ │ │ └── __init__.py │ │ ├── mediaserver │ │ │ └── plugin │ │ │ │ └── fusionpbx │ │ ├── carriergroups │ │ │ └── plugin │ │ │ │ └── twilio │ │ │ │ └── carrier_plugintype_version.py │ │ ├── kamailio │ │ │ └── errors.py │ │ ├── sample_api.py │ │ ├── api.sql │ │ └── cron_functions.py │ ├── domain │ │ ├── __init__.py │ │ └── install.sh │ ├── fusionpbx │ │ ├── html │ │ │ └── images │ │ │ │ └── placeholder.txt │ │ ├── dsiprouter.nginx.tpl │ │ ├── dsiprouter.nginx │ │ ├── dsiprouter-provisioner.conf │ │ └── dsiprouter-provisioner.tpl │ ├── certificates │ │ └── certificates.sql │ ├── cdr │ │ └── cron_functions.py │ ├── frauddetection │ │ ├── install.sh │ │ └── fraud.py │ ├── upgrade │ │ └── __init__.py │ ├── dnid_enrichment │ │ └── dnid_enrichment.sql │ └── flowroute │ │ └── __init__.py ├── static │ ├── favicon.ico │ ├── fonts │ │ ├── icomoon.eot │ │ ├── icomoon.ttf │ │ ├── icomoon.woff │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── images │ │ ├── login-splash.jpg │ │ ├── dopensource_logo.png │ │ └── dsiprouter_x50px.png │ ├── template │ │ └── DID_example.csv │ ├── css │ │ ├── dashboard.css │ │ ├── cdrs.css │ │ ├── certificates.css │ │ ├── msteams.css │ │ ├── highlight │ │ │ ├── codepen-embed.css │ │ │ ├── github-gist.css │ │ │ ├── darcula.css │ │ │ ├── monokai-sublime.css │ │ │ ├── googlecode.css │ │ │ ├── LICENSE │ │ │ ├── idea.css │ │ │ ├── github.css │ │ │ └── default.css │ │ └── bootstrap-toggle.min.css │ └── js │ │ ├── npm.js │ │ ├── teleblock.js │ │ ├── stirshaken.js │ │ ├── dashboard.js │ │ ├── transnexus.js │ │ └── highlight │ │ └── LICENSE ├── dsiprouter_ut.py ├── requirements.txt ├── templates │ ├── login_layout.html │ ├── util.jinja2.html │ └── license_required.html ├── util │ └── persistence.py ├── sysloginit.py └── dsiprouter_cron.py ├── .DS_Store ├── HA ├── consul │ ├── server.hcl │ ├── consul.hcl │ ├── consul.fc │ └── consul.service └── pacemaker │ └── DO │ └── assign-ip ├── resources ├── syslog │ ├── consul.conf │ ├── kamailio.conf │ ├── rtpengine.conf │ └── dsiprouter.conf ├── terraform │ └── do │ │ ├── .gitignore │ │ ├── terraform.tfvars.sample │ │ └── variables.tf ├── git │ ├── gitattributes │ ├── commit-msg │ ├── gitconfig │ ├── merge-changelog.sh │ └── gitwrapper.sh ├── upgrade │ ├── v0.72 │ │ ├── settings.json │ │ └── scripts │ │ │ └── bootstrap.sh │ ├── v0.721 │ │ ├── settings.json │ │ └── scripts │ │ │ └── bootstrap.sh │ ├── v0.74 │ │ └── settings.json │ ├── v0.76 │ │ └── settings.json │ ├── v0.77 │ │ ├── settings.json │ │ └── clear_defaults.sql │ ├── v0.78 │ │ ├── settings.json │ │ ├── dsip-fwd-old.sql │ │ └── dsip-fwd-new.sql │ ├── v0.73 │ │ ├── settings.json │ │ └── scripts │ │ │ └── bootstrap.sh │ └── v0.75 │ │ ├── settings.json │ │ ├── clear_defaults.sql │ │ ├── pre_import_data.sql │ │ ├── migrate_data.sql │ │ └── scripts │ │ └── bootstrap.sh ├── logrotate │ ├── kamailio │ ├── consul │ ├── dsiprouter │ └── rtpengine ├── apt │ ├── debian │ │ ├── 10 │ │ │ └── official-releases.list │ │ ├── 11 │ │ │ └── official-releases.list │ │ └── 12 │ │ │ └── official-releases.list │ └── ubuntu │ │ ├── 20.04 │ │ └── official-releases.list │ │ ├── 22.04 │ │ └── official-releases.list │ │ └── 24.04 │ │ └── official-releases.list └── mysql │ └── asterisk-realtime-setup.sql ├── kamailio ├── defaults │ ├── dr_rules.csv │ ├── dr_rules.sql │ ├── dispatcher.sql │ ├── dr_gw_lists.sql │ ├── address.sql │ ├── subscribers.sql │ ├── uacreg.sql │ ├── dsip_cdrinfo.sql │ ├── dsip_maintmode.sql │ ├── dsip_notification.sql │ ├── dr_gw_lists.csv │ ├── dsip_lcr.sql │ ├── dsip_call_settings.sql │ ├── dsip_forwarding.sql │ └── dr_gateways.sql ├── systemd │ ├── kamailio.conf │ ├── kamailio-v1.service │ └── kamailio-v2.service └── modules │ └── dsiprouter │ ├── Makefile │ ├── mod_funcs.h │ └── README.md ├── mysql └── systemd │ ├── override.conf │ ├── dummy.service │ └── override.sh ├── dnsmasq ├── configs │ ├── systemdnetworkd │ │ ├── docker.network │ │ ├── wait-override.conf │ │ ├── dsiprouter.network │ │ ├── override.conf │ │ └── networkd-pre.sh │ ├── networkmanager │ │ ├── wait-override.conf │ │ └── dsiprouter.conf │ ├── resolvconf_def │ ├── systemdresolved │ │ └── dsiprouter.conf │ ├── ifupdown │ │ ├── override.conf │ │ ├── networking-pre.sh │ │ └── default.conf │ └── resolv.conf ├── systemd │ ├── dnsmasq-v2.service │ ├── dnsmasq-v3.service │ └── dnsmasq-v1.service ├── rhel │ └── install.sh ├── rocky │ └── install.sh └── almalinux │ └── install.sh ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug-report.md └── PULL_REQUEST_TEMPLATE │ └── default.md ├── rtpengine ├── configs │ ├── default.conf │ └── rtpengine.conf ├── systemd │ ├── dummy.service │ ├── rtpengine-v1.service │ ├── rtpengine-v3.service │ └── rtpengine-v2.service └── deb-mr11.5.1.11.patch ├── testing ├── 1.sh ├── 0.sh ├── 20.sh ├── 3.sh ├── 4.sh ├── 5.sh ├── 2.sh ├── 14.sh.dev ├── 15.sh.dev ├── 16.sh ├── 21.sh ├── sql │ ├── v0.60+ent │ │ └── grants.sql │ └── v0.523+ent │ │ └── grants.sql ├── 13.sh.dev ├── 9.sh.dev ├── 12.sh.dev ├── 8.sh ├── 6.sh ├── payload.json ├── INVITE.sip ├── 17.sh ├── 18.sh └── README.md ├── nginx ├── systemd │ ├── nginx-watcher.path │ ├── nginx-watcher-v1.service │ ├── nginx-watcher-v2.service │ ├── nginx-stop.sh │ ├── nginx-v1.service │ └── nginx-v2.service ├── selinux │ └── centos.te └── configs │ ├── dsiprouter.conf │ └── nginx.conf ├── cloud ├── cloud-init │ ├── configs │ │ ├── AWS.cfg │ │ ├── AZURE.cfg │ │ ├── VULTR.cfg │ │ ├── GCE.cfg │ │ └── DO.cfg │ └── templates │ │ ├── hosts.amzn.tmpl │ │ ├── hosts.rhel.tmpl │ │ ├── hosts.almalinux.tmpl │ │ ├── hosts.centos.tmpl │ │ ├── hosts.debian.tmpl │ │ ├── hosts.rocky.tmpl │ │ └── hosts.ubuntu.tmpl └── find_hosts_tmpl.sh ├── docker ├── dsiprouter │ ├── wait-for-dsiprouter-mysql.sh │ └── dockerfile └── mysql │ └── dockerfile ├── .gitignore ├── dsiprouter ├── sudoers.d │ └── 99-dsiprouter ├── pbkdf2.sh └── systemd │ ├── dsiprouter-v1.service │ └── dsiprouter-v2.service ├── CONTRIBUTORS.md ├── Jenkinsfile ├── Jenkinsfile.common ├── .readthedocs.yml └── docker-compose.yml /docs/source/_static/placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gui/modules/api/auth/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gui/modules/domain/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/source/_templates/placeholder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gui/modules/api/auth/ldap/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gui/modules/api/mediaserver/plugin/fusionpbx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gui/modules/fusionpbx/html/images/placeholder.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/source/dev/external_links/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../../../../CONTRIBUTING.md -------------------------------------------------------------------------------- /docs/source/dev/external_links/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ../../../../CONTRIBUTORS.md -------------------------------------------------------------------------------- /gui/modules/api/carriergroups/plugin/twilio/carrier_plugintype_version.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/.DS_Store -------------------------------------------------------------------------------- /HA/consul/server.hcl: -------------------------------------------------------------------------------- 1 | server = true 2 | bootstrap_expect = ${NUM_NODES} 3 | ui = true -------------------------------------------------------------------------------- /resources/syslog/consul.conf: -------------------------------------------------------------------------------- 1 | local3.* /var/log/consul.log 2 | & stop 3 | -------------------------------------------------------------------------------- /resources/syslog/kamailio.conf: -------------------------------------------------------------------------------- 1 | local0.* /var/log/kamailio.log 2 | & stop 3 | -------------------------------------------------------------------------------- /docs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/.DS_Store -------------------------------------------------------------------------------- /docs/source/user/images/DID_test.csv: -------------------------------------------------------------------------------- 1 | 13134860409 2 | 13134860410 3 | 13134860411 4 | -------------------------------------------------------------------------------- /kamailio/defaults/dr_rules.csv: -------------------------------------------------------------------------------- 1 | 1;FLT_OUTBOUND;;;;;#2;name:Default Outbound Route 2 | -------------------------------------------------------------------------------- /resources/syslog/rtpengine.conf: -------------------------------------------------------------------------------- 1 | local1.* /var/log/rtpengine.log 2 | & stop 3 | -------------------------------------------------------------------------------- /gui/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/favicon.ico -------------------------------------------------------------------------------- /mysql/systemd/override.conf: -------------------------------------------------------------------------------- 1 | [Install] 2 | Alias= 3 | Alias=mysql.service 4 | Alias=mysqld.service 5 | -------------------------------------------------------------------------------- /dnsmasq/configs/systemdnetworkd/docker.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=docker* 3 | 4 | [Link] 5 | Unmanaged=yes -------------------------------------------------------------------------------- /docs/dsiprouter_300px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/dsiprouter_300px.png -------------------------------------------------------------------------------- /dnsmasq/configs/networkmanager/wait-override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | Environment= 3 | Environment=NM_ONLINE_TIMEOUT=30 -------------------------------------------------------------------------------- /dnsmasq/configs/resolvconf_def: -------------------------------------------------------------------------------- 1 | REPORT_ABSENT_SYMLINK=no 2 | TRUNCATE_NAMESERVER_LIST_AFTER_LOOPBACK_ADDRESS=yes -------------------------------------------------------------------------------- /gui/static/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/icomoon.eot -------------------------------------------------------------------------------- /gui/static/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/icomoon.ttf -------------------------------------------------------------------------------- /gui/static/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/icomoon.woff -------------------------------------------------------------------------------- /dnsmasq/configs/systemdnetworkd/wait-override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStart=/lib/systemd/systemd-networkd-wait-online --timeout=30 -------------------------------------------------------------------------------- /gui/static/images/login-splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/images/login-splash.jpg -------------------------------------------------------------------------------- /dnsmasq/configs/systemdnetworkd/dsiprouter.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=* 3 | 4 | [Network] 5 | DHCP=yes 6 | 7 | [DHCP] 8 | UseDNS=true -------------------------------------------------------------------------------- /docs/source/user/carrier_editing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/carrier_editing.png -------------------------------------------------------------------------------- /docs/source/user/images/add_trunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_trunk.png -------------------------------------------------------------------------------- /docs/source/user/images/dialplan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dialplan.png -------------------------------------------------------------------------------- /docs/source/user/images/dsip_v51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsip_v51.png -------------------------------------------------------------------------------- /resources/terraform/do/.gitignore: -------------------------------------------------------------------------------- 1 | .terraform 2 | .terraform* 3 | terraform.tfvars 4 | terraform.tfstate 5 | terraform.tfstate.backup -------------------------------------------------------------------------------- /docs/source/user/images/11d_dialplan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/11d_dialplan.png -------------------------------------------------------------------------------- /docs/source/user/images/add_a_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_a_domain.png -------------------------------------------------------------------------------- /docs/source/user/images/add_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_endpoint.png -------------------------------------------------------------------------------- /docs/source/user/images/config_pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/config_pic.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_PBX_Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_PBX_Add.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_settings.png -------------------------------------------------------------------------------- /docs/source/user/images/skyetel_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/skyetel_logo.jpg -------------------------------------------------------------------------------- /docs/source/user/images/skyetel_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/skyetel_logo.png -------------------------------------------------------------------------------- /docs/source/user/username_password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/username_password.png -------------------------------------------------------------------------------- /gui/static/images/dopensource_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/images/dopensource_logo.png -------------------------------------------------------------------------------- /gui/static/images/dsiprouter_x50px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/images/dsiprouter_x50px.png -------------------------------------------------------------------------------- /docs/source/user/images/add_new_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_new_domain.png -------------------------------------------------------------------------------- /docs/source/user/images/carrier_groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/carrier_groups.png -------------------------------------------------------------------------------- /docs/source/user/images/chansip_zoiper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/chansip_zoiper.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_dashboard.png -------------------------------------------------------------------------------- /docs/source/user/images/list_of_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/list_of_domain.png -------------------------------------------------------------------------------- /docs/source/user/images/outbound_proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/outbound_proxy.png -------------------------------------------------------------------------------- /docs/source/user/images/reload_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/reload_button.png -------------------------------------------------------------------------------- /docs/source/user/images/sipchan_added.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sipchan_added.png -------------------------------------------------------------------------------- /docs/source/user/images/zoiper_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/zoiper_example.png -------------------------------------------------------------------------------- /docs/source/user/images/IP_authenication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/IP_authenication.png -------------------------------------------------------------------------------- /docs/source/user/images/add_carrier_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_carrier_group.png -------------------------------------------------------------------------------- /docs/source/user/images/add_new_domain3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_new_domain3.png -------------------------------------------------------------------------------- /docs/source/user/images/add_new_domain522.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_new_domain522.png -------------------------------------------------------------------------------- /docs/source/user/images/assign_template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/assign_template.png -------------------------------------------------------------------------------- /docs/source/user/images/carrier_editing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/carrier_editing.png -------------------------------------------------------------------------------- /docs/source/user/images/chansip_incoming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/chansip_incoming.png -------------------------------------------------------------------------------- /docs/source/user/images/chansip_outgoing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/chansip_outgoing.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_IN_DID_Map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_IN_DID_Map.png -------------------------------------------------------------------------------- /docs/source/user/images/dial_plan_chansip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dial_plan_chansip.png -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-pbxs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-pbxs.jpg -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_hosting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_hosting.png -------------------------------------------------------------------------------- /docs/source/user/images/list_of_domains1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/list_of_domains1.png -------------------------------------------------------------------------------- /docs/source/user/images/register_string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/register_string.png -------------------------------------------------------------------------------- /docs/source/user/images/sipchan_general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sipchan_general.png -------------------------------------------------------------------------------- /docs/source/user/images/sipchan_outbound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sipchan_outbound.png -------------------------------------------------------------------------------- /docs/source/user/images/upgrade_available.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/upgrade_available.png -------------------------------------------------------------------------------- /docs/source/user/images/upgrading-log-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/upgrading-log-01.png -------------------------------------------------------------------------------- /docs/source/user/images/upgrading-log-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/upgrading-log-02.png -------------------------------------------------------------------------------- /docs/source/user/images/username_password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/username_password.png -------------------------------------------------------------------------------- /docs/source/user/images/zoiper_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/zoiper_screenshot.png -------------------------------------------------------------------------------- /gui/static/template/DID_example.csv: -------------------------------------------------------------------------------- 1 | DID,EndpointGroupID,Name 2 | 13134860409,52,Inbound1 3 | 13134860410,53,Inbound2 4 | 13134860411,34,Inbound3 5 | -------------------------------------------------------------------------------- /dnsmasq/configs/systemdnetworkd/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=NetworkManager.service 3 | 4 | [Service] 5 | ExecStartPre=!/usr/lib/systemd/networkd-pre -------------------------------------------------------------------------------- /docs/source/user/images/apply_config_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/apply_config_button.png -------------------------------------------------------------------------------- /docs/source/user/images/carrier_group_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/carrier_group_list.png -------------------------------------------------------------------------------- /docs/source/user/images/chansip_dial_wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/chansip_dial_wizard.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_Global_Out_Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_Global_Out_Add.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_IN_DID_Reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_IN_DID_Reload.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_IN_Import_DID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_IN_Import_DID.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_IN_Manual_Add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_IN_Manual_Add.png -------------------------------------------------------------------------------- /docs/source/user/images/direct-routing-sbcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/direct-routing-sbcs.png -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-pbx-auth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-pbx-auth.jpg -------------------------------------------------------------------------------- /docs/source/user/images/freepbx-pt-add-pbx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/freepbx-pt-add-pbx.png -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_hosting1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_hosting1.png -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_hosting2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_hosting2.png -------------------------------------------------------------------------------- /docs/source/user/images/new_carrier_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/new_carrier_details.png -------------------------------------------------------------------------------- /docs/source/user/images/provisioning_server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/provisioning_server.png -------------------------------------------------------------------------------- /docs/source/user/images/upgrade_up_to_date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/upgrade_up_to_date.png -------------------------------------------------------------------------------- /resources/git/gitattributes: -------------------------------------------------------------------------------- 1 | CHANGELOG.md merge=merge-changelog 2 | CONTRIBUTORS.md merge=merge-contributors 3 | *requirements.txt merge=merge-requirements -------------------------------------------------------------------------------- /docs/source/user/images/add_new_domain_dev522.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_new_domain_dev522.png -------------------------------------------------------------------------------- /docs/source/user/images/chansip_dial_pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/chansip_dial_pattern.png -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_PBX_ADD_New_PBX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_PBX_ADD_New_PBX.png -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-teleblock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-teleblock.jpg -------------------------------------------------------------------------------- /docs/source/user/images/freepbx-pt-add-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/freepbx-pt-add-domain.png -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_integration.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_fusionpbx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_fusionpbx.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_ip_auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_ip_auth.png -------------------------------------------------------------------------------- /docs/source/user/images/stir_shaken_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/stir_shaken_settings.png -------------------------------------------------------------------------------- /gui/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /gui/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /gui/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/source/routes/details.rst: -------------------------------------------------------------------------------- 1 | Route Details 2 | ============= 3 | 4 | .. autoflask:: dsiprouter:app 5 | :undoc-static: 6 | :include-empty-docstring: 7 | -------------------------------------------------------------------------------- /docs/source/user/images/add_new_carrier_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/add_new_carrier_details.png -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_domain_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_domain_support.png -------------------------------------------------------------------------------- /docs/source/user/images/outbound_routes_chansip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/outbound_routes_chansip.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_fusionpbx_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_fusionpbx_2.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_fusionpbx_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_fusionpbx_3.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_fusionpbx_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_fusionpbx_4.png -------------------------------------------------------------------------------- /gui/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/gui/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-inboundmapping.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-inboundmapping.jpg -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-outboundrouting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-outboundrouting.jpg -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter_outboundrouting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter_outboundrouting.jpg -------------------------------------------------------------------------------- /docs/source/user/images/freepbx-pt-setup-softphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/freepbx-pt-setup-softphone.png -------------------------------------------------------------------------------- /docs/source/user/images/fusionpbx_global_dialplan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/fusionpbx_global_dialplan.png -------------------------------------------------------------------------------- /docs/source/user/images/outbound-routes_fusionpbx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/outbound-routes_fusionpbx.png -------------------------------------------------------------------------------- /docs/source/user/images/outbound-routes_fusionpbx_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/outbound-routes_fusionpbx_2.png -------------------------------------------------------------------------------- /dnsmasq/configs/systemdresolved/dsiprouter.conf: -------------------------------------------------------------------------------- 1 | [Resolve] 2 | MulticastDNS=no 3 | LLMNR=no 4 | Cache=no 5 | CacheFromLocalhost=no 6 | DNSStubListener=no 7 | ReadEtcHosts=no -------------------------------------------------------------------------------- /docs/source/dev/shared.rst: -------------------------------------------------------------------------------- 1 | shared 2 | ====== 3 | 4 | .. automodule:: shared 5 | :members: 6 | :undoc-members: 7 | :private-members: 8 | :special-members: 9 | -------------------------------------------------------------------------------- /docs/source/user/images/features/pbx_domain/PBX_modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/features/pbx_domain/PBX_modal.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_credentials_auth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_credentials_auth.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_freepbx_pjsip_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_freepbx_pjsip_1.png -------------------------------------------------------------------------------- /docs/source/user/images/sip_trunking_freepbx_pjsip_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/sip_trunking_freepbx_pjsip_2.png -------------------------------------------------------------------------------- /kamailio/defaults/dr_rules.sql: -------------------------------------------------------------------------------- 1 | -- update dr_rules schema to fit our storage requirements 2 | ALTER TABLE dr_rules 3 | MODIFY description varchar(255) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /docs/source/dev/database.rst: -------------------------------------------------------------------------------- 1 | database 2 | ======== 3 | 4 | .. automodule:: database 5 | :members: 6 | :undoc-members: 7 | :private-members: 8 | :special-members: 9 | -------------------------------------------------------------------------------- /docs/source/dev/settings.rst: -------------------------------------------------------------------------------- 1 | settings 2 | ======== 3 | 4 | .. automodule:: settings 5 | :members: 6 | :undoc-members: 7 | :private-members: 8 | :special-members: 9 | -------------------------------------------------------------------------------- /docs/source/user/images/features/pbx_domain/PBX_modal_ip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/features/pbx_domain/PBX_modal_ip.png -------------------------------------------------------------------------------- /kamailio/defaults/dispatcher.sql: -------------------------------------------------------------------------------- 1 | -- update dispatcher schema to fit our storage requirements 2 | ALTER TABLE dispatcher 3 | MODIFY description varchar(255) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /docs/source/user/images/dSIP_Global_Out_Add_Outbound_Route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dSIP_Global_Out_Add_Outbound_Route.png -------------------------------------------------------------------------------- /docs/source/user/images/features/pbx_domain/PBX_modal_uac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/features/pbx_domain/PBX_modal_uac.png -------------------------------------------------------------------------------- /kamailio/defaults/dr_gw_lists.sql: -------------------------------------------------------------------------------- 1 | -- update dr_gw_lists schema to fit our storage requirements 2 | ALTER TABLE dr_gw_lists 3 | MODIFY description varchar(255) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /docs/source/dev/dsiprouter.rst: -------------------------------------------------------------------------------- 1 | dsiprouter 2 | ========== 3 | 4 | .. automodule:: dsiprouter 5 | :members: 6 | :undoc-members: 7 | :private-members: 8 | :special-members: 9 | -------------------------------------------------------------------------------- /docs/source/dev/sysloginit.rst: -------------------------------------------------------------------------------- 1 | sysloginit 2 | ========== 3 | 4 | .. automodule:: sysloginit 5 | :members: 6 | :undoc-members: 7 | :private-members: 8 | :special-members: 9 | -------------------------------------------------------------------------------- /docs/source/user/images/dsiprouter-fusionpbx_domain_support.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/dsiprouter-fusionpbx_domain_support.jpg -------------------------------------------------------------------------------- /docs/source/user/images/device_provisioning_http__domain_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/device_provisioning_http__domain_filter.png -------------------------------------------------------------------------------- /kamailio/defaults/address.sql: -------------------------------------------------------------------------------- 1 | -- update address schema 2 | ALTER TABLE address 3 | MODIFY COLUMN `ip_addr` VARCHAR(253) NOT NULL, 4 | MODIFY COLUMN `tag` VARCHAR(255) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /resources/upgrade/v0.72/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.72", 3 | "depends": "0.70", 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } -------------------------------------------------------------------------------- /docs/requirements.in: -------------------------------------------------------------------------------- 1 | docutils<0.17,>=0.12 2 | myst-parser 3 | recommonmark 4 | requests 5 | sphinx 6 | sphinxcontrib-httpdomain 7 | sphinx-rtd-theme 8 | piccolo_theme 9 | UltraDict 10 | -------------------------------------------------------------------------------- /docs/source/user/images/features/pbx_domain/PBX_subcriber_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dOpensource/dsiprouter/HEAD/docs/source/user/images/features/pbx_domain/PBX_subcriber_update.png -------------------------------------------------------------------------------- /resources/git/commit-msg: -------------------------------------------------------------------------------- 1 | %s 2 | 3 | Commit: %h 4 | Tree: %t 5 | Author: %an 6 | Email: %ae 7 | Date: %aD 8 | 9 | %b 10 | 11 | %N 12 | 13 | -------------------------------------------------------------------------------- /resources/upgrade/v0.721/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.721", 3 | "depends": "0.70", 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /resources/upgrade/v0.74/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.74", 3 | "depends": ["0.73"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /resources/upgrade/v0.76/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.76", 3 | "depends": ["0.75"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /resources/upgrade/v0.77/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.77", 3 | "depends": ["0.76"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /resources/upgrade/v0.78/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.78", 3 | "depends": ["0.77"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /kamailio/defaults/subscribers.sql: -------------------------------------------------------------------------------- 1 | -- update schema for subscribers table 2 | ALTER TABLE subscriber 3 | ADD email_address varchar(128) NOT NULL DEFAULT '', 4 | ADD rpid varchar(128) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /resources/upgrade/v0.73/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.73", 3 | "depends": ["0.72", "0.721"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /kamailio/systemd/kamailio.conf: -------------------------------------------------------------------------------- 1 | RUN_KAMAILIO=yes 2 | USER=kamailio 3 | GROUP=kamailio 4 | SHM_MEMORY=512 5 | PKG_MEMORY=64 6 | PIDFILE=/run/kamailio/kamailio.pid 7 | CFGFILE=/etc/kamailio/kamailio.cfg 8 | #DUMP_CORE=yes -------------------------------------------------------------------------------- /rtpengine/configs/default.conf: -------------------------------------------------------------------------------- 1 | CONFIG_FILE=/etc/rtpengine/rtpengine.conf 2 | CONFIG_SECTION=rtpengine 3 | PID_FILE=/run/rtpengine/rtpengine.pid 4 | MANAGE_IPTABLES=yes 5 | SET_USER=rtpengine 6 | SET_GROUP=rtpengine 7 | -------------------------------------------------------------------------------- /testing/1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="Mysql Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet mariadb; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /gui/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | .dashboard-metric { 2 | font-size: 80px; 3 | text-align: center; 4 | } 5 | 6 | .dashboard-metric-label { 7 | font-size: 35px; 8 | text-align: center; 9 | color: #ddd; 10 | } 11 | -------------------------------------------------------------------------------- /resources/syslog/dsiprouter.conf: -------------------------------------------------------------------------------- 1 | $EscapeControlCharactersOnReceive off 2 | $Escape8BitCharactersOnReceive off 3 | $template dsipFormat,"%rawmsg:6:$:%\n" 4 | local2.* /var/log/dsiprouter.log;dsipFormat 5 | & stop 6 | -------------------------------------------------------------------------------- /resources/upgrade/v0.75/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.75", 3 | "depends": ["0.72", "0.721", "0.73", "0.74"], 4 | "install_location": "/opt/dsiprouter", 5 | "dsiprouter": [ 6 | "migrate.sh" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /testing/0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="Syslog Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet rsyslog; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /testing/20.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="DNSmasq Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet dnsmasq; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /testing/3.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="Kamailio Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet kamailio; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /resources/upgrade/v0.75/clear_defaults.sql: -------------------------------------------------------------------------------- 1 | SET FOREIGN_KEY_CHECKS=0; 2 | TRUNCATE TABLE `address`; 3 | TRUNCATE TABLE `dr_gateways`; 4 | TRUNCATE TABLE `dr_gw_lists`; 5 | TRUNCATE TABLE `dr_rules`; 6 | SET FOREIGN_KEY_CHECKS=1; -------------------------------------------------------------------------------- /resources/upgrade/v0.77/clear_defaults.sql: -------------------------------------------------------------------------------- 1 | SET FOREIGN_KEY_CHECKS=0; 2 | TRUNCATE TABLE `address`; 3 | TRUNCATE TABLE `dr_gateways`; 4 | TRUNCATE TABLE `dr_gw_lists`; 5 | TRUNCATE TABLE `dr_rules`; 6 | SET FOREIGN_KEY_CHECKS=1; -------------------------------------------------------------------------------- /testing/4.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="dSIPRouter Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet dsiprouter; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /testing/5.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="RTPEngine Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet rtpengine; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /testing/2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="dsip-init Service Started" 6 | 7 | # Is service started 8 | systemctl is-active --quiet dsip-init; ret=$? 9 | 10 | process_result "$test" $ret 11 | -------------------------------------------------------------------------------- /mysql/systemd/dummy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MySQL Dummy Service 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/true 7 | RemainAfterExit=true 8 | TimeoutSec=0 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /nginx/systemd/nginx-watcher.path: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Nginx Service Reloader 3 | PartOf=nginx.service 4 | 5 | [Path] 6 | Unit=nginx-watcher.service 7 | PathChanged=/etc/dsiprouter/certs/ 8 | 9 | [Install] 10 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /rtpengine/systemd/dummy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=RTPEngine Dummy Service 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/bin/true 7 | RemainAfterExit=true 8 | TimeoutSec=0 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /nginx/systemd/nginx-watcher-v1.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Nginx Service Reloader 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/usr/sbin/nginx -s reload 7 | StartLimitInterval=5 8 | StartLimitBurst=3 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /resources/terraform/do/terraform.tfvars.sample: -------------------------------------------------------------------------------- 1 | pvt_key_path="/Users/mackhendricks/.ssh/dopensource-training" 2 | dns_domain="dsiprouter.net" 3 | dns_hostname="training" 4 | number_of_environments=1 5 | pub_key_name="dopensource-training" 6 | additional_commands="echo" -------------------------------------------------------------------------------- /nginx/systemd/nginx-watcher-v2.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Nginx Service Reloader 3 | StartLimitIntervalSec=5 4 | StartLimitBurst=3 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStart=/usr/sbin/nginx -s reload 9 | 10 | [Install] 11 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /docs/source/user/configuring.rst: -------------------------------------------------------------------------------- 1 | dSIPRouter GUI Intro 2 | ==================== 3 | 4 | .. toctree:: 5 | :maxdepth: 3 6 | 7 | carrier_groups.rst 8 | pbxs_and_endpoints.rst 9 | domains.rst 10 | inbound_did_mapping.rst 11 | global_outbound_routes.rst 12 | 13 | -------------------------------------------------------------------------------- /gui/static/css/cdrs.css: -------------------------------------------------------------------------------- 1 | #downloadCDR, #refreshCDR { 2 | left: .25em; 3 | cursor: pointer; 4 | } 5 | 6 | #cdrs_wrapper > div.btn-group, #cdrs_wrapper > div.btn-group-vertical { 7 | position: absolute; 8 | display: -ms-inline-flexbox; 9 | display: inline-flex; 10 | vertical-align: middle; 11 | } 12 | -------------------------------------------------------------------------------- /resources/logrotate/kamailio: -------------------------------------------------------------------------------- 1 | /var/log/kamailio*.log { 2 | daily 3 | missingok 4 | rotate 5 5 | compress 6 | delaycompress 7 | create 640 root root 8 | sharedscripts 9 | postrotate 10 | systemctl kill -s HUP --kill-who=main rsyslog 2>/dev/null || true 11 | endscript 12 | } 13 | -------------------------------------------------------------------------------- /kamailio/defaults/uacreg.sql: -------------------------------------------------------------------------------- 1 | -- update uacreg schema 2 | ALTER TABLE uacreg 3 | MODIFY COLUMN `l_domain` VARCHAR(253) NOT NULL DEFAULT '', 4 | MODIFY COLUMN `r_domain` VARCHAR(253) NOT NULL DEFAULT '', 5 | MODIFY COLUMN `realm` varchar(253) NOT NULL DEFAULT '', 6 | MODIFY COLUMN `auth_proxy` varchar(16000) NOT NULL DEFAULT ''; -------------------------------------------------------------------------------- /resources/logrotate/consul: -------------------------------------------------------------------------------- 1 | /var/log/consul*.log { 2 | daily 3 | missingok 4 | rotate 5 5 | compress 6 | delaycompress 7 | create 640 root root 8 | sharedscripts 9 | copytruncate 10 | postrotate 11 | systemctl kill -s HUP --kill-who=main rsyslog 2>/dev/null || true 12 | endscript 13 | } 14 | -------------------------------------------------------------------------------- /resources/logrotate/dsiprouter: -------------------------------------------------------------------------------- 1 | /var/log/dsiprouter*.log { 2 | daily 3 | missingok 4 | rotate 5 5 | compress 6 | delaycompress 7 | create 640 root root 8 | sharedscripts 9 | copytruncate 10 | postrotate 11 | systemctl kill -s HUP --kill-who=main rsyslog 2>/dev/null || true 12 | endscript 13 | } 14 | -------------------------------------------------------------------------------- /resources/logrotate/rtpengine: -------------------------------------------------------------------------------- 1 | /var/log/rtpengine*.log { 2 | daily 3 | missingok 4 | rotate 5 5 | compress 6 | delaycompress 7 | create 640 root root 8 | sharedscripts 9 | copytruncate 10 | postrotate 11 | systemctl kill -s HUP --kill-who=main rsyslog 2>/dev/null || true 12 | endscript 13 | } 14 | -------------------------------------------------------------------------------- /resources/upgrade/v0.78/dsip-fwd-old.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS dsip_prefix_mapping; 2 | DROP VIEW IF EXISTS dsip_prefix_mapping; 3 | CREATE VIEW dsip_prefix_mapping AS 4 | SELECT 5 | prefix, 6 | CAST(ruleid AS char) AS ruleid, 7 | CAST(priority AS char) AS priority, 8 | '0' AS key_type, 9 | '0' AS value_type 10 | FROM dr_rules; -------------------------------------------------------------------------------- /gui/modules/certificates/certificates.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_certificates`; 2 | CREATE TABLE IF NOT EXISTS `dsip_certificates` ( 3 | `id` INT NOT NULL AUTO_INCREMENT, 4 | `domain` VARCHAR(128) NULL, 5 | `type` VARCHAR(45) NULL, 6 | `email` VARCHAR(128) NULL, 7 | `cert` BLOB NULL, 8 | `key` BLOB NULL, 9 | PRIMARY KEY (`id`) 10 | ); 11 | -------------------------------------------------------------------------------- /dnsmasq/configs/ifupdown/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=systemd-networkd.service 3 | 4 | [Service] 5 | EnvironmentFile=-/run/network/ifupdown.conf 6 | ExecStartPre=/usr/lib/ifupdown/networking-pre 7 | #ExecStartPre=/bin/bash -c '[ ! -e /run/network/ifclean ] && { ifdown -f -a --read-environment -X lo; touch /run/network/restart-hotplug /run/network/ifclean; true; } || true' -------------------------------------------------------------------------------- /kamailio/modules/dsiprouter/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Usrloc module Makefile 3 | # 4 | # WARNING: do not run this directly, it should be run by the master Makefile 5 | 6 | include ../../Makefile.defs 7 | auto_gen= 8 | NAME=dsiprouter.so 9 | LIBS=-lssl -lcrypto 10 | 11 | SERLIBPATH=../../lib 12 | SER_LIBS+=$(SERLIBPATH)/srdb2/srdb2 13 | include ../../Makefile.modules 14 | -------------------------------------------------------------------------------- /cloud/cloud-init/configs/AWS.cfg: -------------------------------------------------------------------------------- 1 | datasource_list: [ Ec2, NoCloud, None ] 2 | disable_root: true 3 | ssh_pwauth: false 4 | ssh_deletekeys: true 5 | ssh_genkeytypes: [rsa, dsa, ecdsa, ed25519] 6 | allow_public_ssh_keys: true 7 | ssh_quiet_keygen: true 8 | manage_etc_hosts: true 9 | manage_resolv_conf: false 10 | preserve_hostname: false 11 | apt_preserve_sources_list: true 12 | -------------------------------------------------------------------------------- /docker/dsiprouter/wait-for-dsiprouter-mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # wait-for-dsiprouter-mysql.sh 3 | 4 | set -e 5 | 6 | host="$1" 7 | shift 8 | cmd="$@" 9 | 10 | until python ./gui/dsiprouter.py runserver; do 11 | >&2 echo "dSIPRouter MySQL is unavailable - can't start - sleeping" 12 | sleep 1 13 | done 14 | 15 | >&2 echo "dSIPRouter MySQL is up - started dSIPRouter" 16 | -------------------------------------------------------------------------------- /resources/upgrade/v0.78/dsip-fwd-new.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS dsip_prefix_mapping; 2 | DROP VIEW IF EXISTS dsip_prefix_mapping; 3 | CREATE VIEW dsip_prefix_mapping AS 4 | SELECT 5 | prefix, 6 | CAST(ruleid AS char) AS ruleid, 7 | CAST(priority AS char) AS priority, 8 | '0' AS key_type, 9 | '0' AS value_type 10 | FROM dr_rules 11 | WHERE groupid='9000'; -------------------------------------------------------------------------------- /cloud/cloud-init/configs/AZURE.cfg: -------------------------------------------------------------------------------- 1 | datasource_list: [ Azure, NoCloud, None ] 2 | disable_root: true 3 | ssh_pwauth: false 4 | ssh_deletekeys: true 5 | ssh_genkeytypes: [rsa, dsa, ecdsa, ed25519] 6 | allow_public_ssh_keys: true 7 | ssh_quiet_keygen: true 8 | manage_etc_hosts: true 9 | manage_resolv_conf: false 10 | preserve_hostname: false 11 | apt_preserve_sources_list: true 12 | -------------------------------------------------------------------------------- /cloud/cloud-init/configs/VULTR.cfg: -------------------------------------------------------------------------------- 1 | datasource_list: [ Vultr, NoCloud, None ] 2 | disable_root: true 3 | ssh_pwauth: false 4 | ssh_deletekeys: true 5 | ssh_genkeytypes: [rsa, dsa, ecdsa, ed25519] 6 | allow_public_ssh_keys: true 7 | ssh_quiet_keygen: true 8 | manage_etc_hosts: true 9 | manage_resolv_conf: false 10 | preserve_hostname: false 11 | apt_preserve_sources_list: true 12 | -------------------------------------------------------------------------------- /resources/upgrade/v0.75/pre_import_data.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `dsip_calllimit` ( 2 | `gwgroupid` varchar(64) NOT NULL, 3 | `limit` varchar(64) NOT NULL DEFAULT '0', 4 | `status` tinyint(1) NOT NULL DEFAULT 1, 5 | `key_type` varchar(64) NOT NULL DEFAULT '0', 6 | `value_type` varchar(64) NOT NULL DEFAULT '0', 7 | PRIMARY KEY (`gwgroupid`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: dSIPRouter Community Slack 4 | url: https://dsiproutercommunity.slack.com/ 5 | about: Community hangout where questions can be asked and answered. 6 | - name: dOpenSource Official Support 7 | url: https://dopensource.com/shop/ 8 | about: Official support and addons can be purchased here. 9 | -------------------------------------------------------------------------------- /cloud/cloud-init/configs/GCE.cfg: -------------------------------------------------------------------------------- 1 | datasource_list: datasource_list: [ GCE, NoCloud, None ] 2 | disable_root: true 3 | ssh_pwauth: false 4 | ssh_deletekeys: true 5 | ssh_genkeytypes: [rsa, dsa, ecdsa, ed25519] 6 | allow_public_ssh_keys: true 7 | ssh_quiet_keygen: true 8 | manage_etc_hosts: true 9 | manage_resolv_conf: false 10 | preserve_hostname: false 11 | apt_preserve_sources_list: true 12 | -------------------------------------------------------------------------------- /cloud/cloud-init/configs/DO.cfg: -------------------------------------------------------------------------------- 1 | datasource_list: [ ConfigDrive, DigitalOcean, NoCloud, None ] 2 | disable_root: false 3 | ssh_pwauth: false 4 | ssh_deletekeys: true 5 | ssh_genkeytypes: [rsa, dsa, ecdsa, ed25519] 6 | allow_public_ssh_keys: true 7 | ssh_quiet_keygen: true 8 | manage_etc_hosts: true 9 | manage_resolv_conf: false 10 | preserve_hostname: false 11 | apt_preserve_sources_list: true 12 | -------------------------------------------------------------------------------- /HA/consul/consul.hcl: -------------------------------------------------------------------------------- 1 | datacenter = "${CLUSTER_NAME}" 2 | data_dir = "/opt/consul" 3 | node_name = "NODE_NAME" 4 | log_level = "INFO" 5 | bind_addr = "0.0.0.0" 6 | client_addr = "0.0.0.0" 7 | advertise_addr = "EXTERNAL_IP_ADDR" 8 | enable_syslog = true 9 | syslog_facility = "LOCAL3" 10 | encrypt = "${KEY_CIPHER_TEXT_B64}" 11 | retry_join = ${RETRY_JOIN} 12 | performance = { 13 | raft_multiplier = 1 14 | } -------------------------------------------------------------------------------- /docker/mysql/dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile 2 | FROM python:3.6-stretch 3 | 4 | MAINTAINER Mack Hendricks 5 | 6 | COPY ../../ /opt/dsiprouter/ 7 | WORKDIR /opt/dsiprouter 8 | RUN pip install -r ./gui/requirements.txt 9 | ENV DBSERVER '' 10 | ENV DBPORT '3306' 11 | ENV DBUSER '' 12 | ENV DBPASS '' 13 | ENV DBNAME '' 14 | 15 | EXPOSE 5000:5000 16 | 17 | CMD ["python", "./gui/dsiprouter.py"] 18 | -------------------------------------------------------------------------------- /nginx/selinux/centos.te: -------------------------------------------------------------------------------- 1 | module dsiprouter 1.0; 2 | 3 | require { 4 | type unconfined_t; 5 | type unconfined_service_t; 6 | type var_run_t; 7 | type httpd_t; 8 | class sock_file write; 9 | class unix_stream_socket connectto; 10 | } 11 | 12 | allow httpd_t unconfined_t:unix_stream_socket connectto; 13 | allow httpd_t unconfined_service_t:unix_stream_socket connectto; 14 | allow httpd_t var_run_t:sock_file write; 15 | -------------------------------------------------------------------------------- /docker/dsiprouter/dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile 2 | FROM python:3.6-stretch 3 | 4 | MAINTAINER Mack Hendricks 5 | 6 | COPY ./ /opt/dsiprouter/ 7 | WORKDIR /opt/dsiprouter 8 | RUN pip install -r ./gui/requirements.txt 9 | ENV DBSERVER '' 10 | ENV DBPORT '3306' 11 | ENV DBUSER '' 12 | ENV DBPASS '' 13 | ENV DBNAME '' 14 | 15 | EXPOSE 5000:5000 16 | 17 | CMD ["python", "./gui/dsiprouter.py", "runserver"] 18 | -------------------------------------------------------------------------------- /resources/git/gitconfig: -------------------------------------------------------------------------------- 1 | [merge "merge-changelog"] 2 | name = A custom merge driver used to resolve CHANGELOG.md conflicts 3 | driver = _merge-changelog %O %A %B %L %P 4 | [merge "merge-contributors"] 5 | name = A custom merge driver used to resolve CONTRIBUTORS.md conflicts 6 | driver = true 7 | [merge "merge-requirements"] 8 | name = A custom merge driver used to resolve requirements.txt conflicts 9 | driver = true -------------------------------------------------------------------------------- /docs/source/routes/index.rst: -------------------------------------------------------------------------------- 1 | GUI/API Routes 2 | ============== 3 | 4 | The GUI and API make several routes accessible for usage. 5 | A summary and description of each route are provided below. 6 | 7 | Summary Table 8 | ------------- 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | summary.rst 14 | 15 | Detailed Descriptions 16 | --------------------- 17 | 18 | .. toctree:: 19 | :maxdepth: 2 20 | 21 | details.rst 22 | -------------------------------------------------------------------------------- /gui/static/css/certificates.css: -------------------------------------------------------------------------------- 1 | .loader { 2 | border: 16px solid #f3f3f3; /* Light grey */ 3 | border-top: 16px solid #3498db; /* Blue */ 4 | border-radius: 50%; 5 | width: 120px; 6 | height: 120px; 7 | position: relative; 8 | display: none; 9 | z-index: 10; 10 | animation: spin 2s linear infinite; 11 | } 12 | 13 | @keyframes spin { 14 | 0% { transform: rotate(0deg); } 15 | 100% { transform: rotate(360deg); } 16 | } 17 | -------------------------------------------------------------------------------- /gui/dsiprouter_ut.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from modules.domain.domain_service import * 3 | 4 | class TestUnit(unittest.TestCase): 5 | 6 | def setUp(self): 7 | pass 8 | 9 | def test_add_static_domain(self): 10 | self.assertTrue(addDomain('xyc.com')) 11 | 12 | def test_getDomains(self): 13 | res = getDomains() 14 | assert res is not None 15 | 16 | if __name__ == '__main__': 17 | unittest.main() 18 | -------------------------------------------------------------------------------- /gui/modules/api/kamailio/errors.py: -------------------------------------------------------------------------------- 1 | class KamailioError(Exception): 2 | """ 3 | There was an error communicating with Kamailio 4 | """ 5 | 6 | def __init__(self, *args, **kwargs): 7 | super().__init__(*args, **kwargs) 8 | 9 | 10 | class NoDispatcherSets(KamailioError): 11 | """ 12 | No dispatcher sets exist but the module is loaded 13 | """ 14 | 15 | def __init__(self, *args, **kwargs): 16 | super().__init__(*args, **kwargs) -------------------------------------------------------------------------------- /resources/upgrade/v0.72/scripts/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export BOOTSTRAPPING_UPGRADE=1 4 | export DSIP_PROJECT_DIR='/tmp/dsiprouter' 5 | TAG_NAME='v0.72-rel' 6 | REPO_URL='https://github.com/dOpensource/dsiprouter.git' 7 | rm -f /etc/dsiprouter/.requirementsinstalled 8 | rm -rf "$DSIP_PROJECT_DIR" 2>/dev/null 9 | git clone --depth 1 -c advice.detachedHead=false -b "$TAG_NAME" "$REPO_URL" "$DSIP_PROJECT_DIR" 10 | ${DSIP_PROJECT_DIR}/dsiprouter.sh upgrade -rel v0.72 11 | -------------------------------------------------------------------------------- /resources/upgrade/v0.721/scripts/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export BOOTSTRAPPING_UPGRADE=1 4 | export DSIP_PROJECT_DIR='/tmp/dsiprouter' 5 | TAG_NAME='v0.721-rel' 6 | REPO_URL='https://github.com/dOpensource/dsiprouter.git' 7 | rm -f /etc/dsiprouter/.requirementsinstalled 8 | rm -rf "$DSIP_PROJECT_DIR" 2>/dev/null 9 | git clone --depth 1 -c advice.detachedHead=false -b "$TAG_NAME" "$REPO_URL" "$DSIP_PROJECT_DIR" 10 | ${DSIP_PROJECT_DIR}/dsiprouter.sh upgrade -rel v0.721 11 | -------------------------------------------------------------------------------- /testing/14.sh.dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | . include/common 5 | 6 | unitname="Domain Auth" 7 | 8 | # static settings 9 | username="smoketest" 10 | host="localhost" 11 | port="5060" 12 | 13 | # TODO: add some domain entries 14 | 15 | # TODO: send invite with domain auth 16 | # we should be using a template INVITE and replacing values with sed 17 | #sipsak -f INVITE.sip -s sip:$username@$host:$port -H $host -vvv >/dev/null 18 | 19 | process_result "$unitname" $ret 20 | -------------------------------------------------------------------------------- /testing/15.sh.dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | . include/common 5 | 6 | unitname="Flowroute DID Sync Module" 7 | 8 | # static settings 9 | username="smoketest" 10 | host="localhost" 11 | port="5060" 12 | 13 | # TODO: create some DID's using flowroute's API (not ours) 14 | 15 | # TODO: test flowroute module's python functions (verify we get data we sent to flowroute) 16 | 17 | # TODO: check DB and see if those DID's were synced 18 | 19 | process_result "$unitname" $ret 20 | -------------------------------------------------------------------------------- /resources/upgrade/v0.73/scripts/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export BOOTSTRAPPING_UPGRADE=1 4 | export BOOTSTRAP_DIR='/tmp/dsiprouter' 5 | TAG_NAME='v0.73-rel' 6 | REPO_URL='https://github.com/dOpensource/dsiprouter.git' 7 | [[ -e "$BOOTSTRAP_DIR" ]] && rm -rf "$BOOTSTRAP_DIR" 8 | git clone --depth 1 -c advice.detachedHead=false -b "$TAG_NAME" "$REPO_URL" "$BOOTSTRAP_DIR" 9 | ${BOOTSTRAP_DIR}/dsiprouter.sh upgrade -rel v0.73 10 | RET=$? 11 | rm -rf ${BOOTSTRAP_DIR} 12 | exit $RET 13 | -------------------------------------------------------------------------------- /docs/source/user/upgrade_0.621_to_0.63.rst: -------------------------------------------------------------------------------- 1 | In this section we will show you how to upgrade from 0.621 to 0.63. This is the first release 2 | to contain our new upgrade approach. 3 | 4 | The following steps will upgrade your Kamailio configuration from 0.621 to 0.63. 5 | 6 | .. code-block:: bash 7 | 8 | cd /opt/dsiprouter 9 | git stash 10 | git checkout v0.63 11 | dsiprouter upgrade -rel 0.63 12 | 13 | You should now be able to login to dSIPRouter and see that the new release has been applied. 14 | -------------------------------------------------------------------------------- /mysql/systemd/override.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DSIP_PROJECT_DIR=${DSIP_PROJECT_DIR:-/opt/dsiprouter} 4 | 5 | # alias mariadb.service to mysql.service and mysqld.service using systemd drop-in replacements 6 | # allowing us to use same service name (mysql.service) across platforms 7 | mkdir -p /etc/systemd/system/mariadb.service.d 8 | cp -f ${DSIP_PROJECT_DIR}/mysql/systemd/override.conf /etc/systemd/system/mariadb.service.d/override.conf 9 | chmod 644 /etc/systemd/system/mariadb.service.d/override.conf 10 | -------------------------------------------------------------------------------- /testing/16.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | unitname="JSONRPC Access to Kamailio" 6 | 7 | # static settings 8 | project_dir=/opt/dsiprouter 9 | source_ip="127.0.0.1" 10 | sip_port="5060" 11 | rpc_proto="http" 12 | host="localhost" 13 | 14 | # Send a bunch of of requests to the server 15 | curl -s -X GET --connect-timeout 3 -d '{"jsonrpc": "2.0", "method": "core.psx", "id": 1}' "${rpc_proto}://${host}:${sip_port}/api/kamailio" > /dev/null 16 | ret=$? 17 | 18 | process_result "$unitname" $ret -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dSIPRouter Project Specific Ignored Files 2 | .idea 3 | /resources/terraform/do/*.tfstate 4 | /resources/terraform/do/*.backup 5 | /resources/terraform/do/.terraform 6 | /resources/terraform/do/*.hcl 7 | /resources/terraform/do/terraform.tfvars 8 | */__pycache__/ 9 | venv/ 10 | # TODO: these following files could be generated elsewhere 11 | # adding them to python path where needed to cleanup project dir 12 | docs/build/ 13 | gui/modules/fusionpbx/certs/cert.key 14 | gui/modules/fusionpbx/certs/cert_combined.crt -------------------------------------------------------------------------------- /testing/21.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | test="DNS Resolver Test" 6 | 7 | validateResolver() { 8 | # can localhost be resolved 9 | nslookup localhost 2>&1 >/dev/null || return 1 10 | 11 | # can DMQ domain local.cluster be resolved 12 | nslookup local.cluster 2>&1 >/dev/null || return 1 13 | 14 | # can an external host be resolved 15 | nslookup www.google.com 2>&1 >/dev/null || return 1 16 | 17 | return 0 18 | } 19 | 20 | validateResolver; ret=$? 21 | 22 | process_result "$test" $ret 23 | -------------------------------------------------------------------------------- /testing/sql/v0.60+ent/grants.sql: -------------------------------------------------------------------------------- 1 | GRANT USAGE ON *.* TO 'kamailio'@'localhost' IDENTIFIED BY PASSWORD '*2870144497941F902294EDABA260A0A4A15078E4'; 2 | GRANT ALL PRIVILEGES ON `kamailio`.* TO 'kamailio'@'localhost'; 3 | GRANT USAGE ON *.* TO 'kamailioro'@'localhost' IDENTIFIED BY PASSWORD '*CF29822D11D49E1965F110105EACFBE9202F1A31'; 4 | GRANT SELECT ON `kamailio`.* TO 'kamailioro'@'localhost'; 5 | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED VIA unix_socket WITH GRANT OPTION; 6 | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION; 7 | -------------------------------------------------------------------------------- /gui/static/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js'); 3 | require('../../js/alert.js'); 4 | require('../../js/button.js'); 5 | require('../../js/carousel.js'); 6 | require('../../js/collapse.js'); 7 | require('../../js/dropdown.js'); 8 | require('../../js/modal.js'); 9 | require('../../js/tooltip.js'); 10 | require('../../js/popover.js'); 11 | require('../../js/scrollspy.js'); 12 | require('../../js/tab.js'); 13 | require('../../js/affix.js'); -------------------------------------------------------------------------------- /testing/13.sh.dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | . include/common 5 | 6 | unitname="FusionPBX Sync Module" 7 | 8 | # static settings 9 | username="smoketest" 10 | host="localhost" 11 | port="5060" 12 | 13 | # TODO: check that cron entry exists 14 | 15 | # TODO: check that nginx server is running and accepts requests 16 | 17 | # TODO: test fusionpbx db syncing 18 | # - create new local db 19 | # - add some date 20 | # - add pbx to kamailio db w/ fusionpbx enabled 21 | # - check that db tables synced 22 | 23 | process_result "$unitname" $ret 24 | -------------------------------------------------------------------------------- /dnsmasq/configs/resolv.conf: -------------------------------------------------------------------------------- 1 | # DNS servers are being managed by dSIPRouter dynamically, DO NOT CHANGE THIS FILE 2 | # 3 | # The DNSmasq stub resolver will handle lookups in the following order: 4 | # 1. entries from /etc/hosts 5 | # 2. the system provided DNS servers (via DHCP) 6 | # 7 | # To change the upstream DNS servers DNSmasq forwards to update resolv-file in 8 | # /etc/dnsmasq.conf to your resolve file of choice. 9 | # For more information on configuring DNSmasq refer to dnsmasq(8) manpage. 10 | # 11 | nameserver 127.0.0.1 12 | 13 | #####DSIP_CONFIG_START 14 | #####DSIP_CONFIG_END -------------------------------------------------------------------------------- /testing/9.sh.dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | . include/common 5 | 6 | unitname="Call Detail Records" 7 | 8 | # settings 9 | username="smoketest" 10 | host="localhost" 11 | port="5060" 12 | 13 | # TODO: send invite to generate CDR's 14 | # we should be using a template INVITE and replacing values with sed 15 | #sipsak -f INVITE.sip -s sip:$username@$host:$port -H $host -vvv >/dev/null 16 | 17 | # check acc table 18 | mysql kamailio -sN -e "select * from acc;" 19 | 20 | # check cdrs table 21 | mysql kamailio -sN -e "select * from cdrs;" 22 | 23 | process_result "$unitname" $ret 24 | -------------------------------------------------------------------------------- /dsiprouter/sudoers.d/99-dsiprouter: -------------------------------------------------------------------------------- 1 | Cmnd_Alias DSIP_UPGRADE_CMDS = /usr/bin/dsiprouter upgrade, /usr/bin/dsiprouter upgrade * 2 | Cmnd_Alias DSIP_RESTART_CMDS = /usr/bin/dsiprouter restart, /usr/bin/dsiprouter restart * 3 | Cmnd_Alias DSIP_BACKUP_CMDS = /usr/bin/dsiprouter backup, /usr/bin/dsiprouter backup * 4 | Cmnd_Alias DSIP_RESTORE_CMDS = /usr/bin/dsiprouter restore, /usr/bin/dsiprouter restore * 5 | dsiprouter ALL=(ALL) NOPASSWD:SETENV: DSIP_UPGRADE_CMDS 6 | dsiprouter ALL=(ALL) NOPASSWD: DSIP_RESTART_CMDS 7 | dsiprouter ALL=(ALL) NOPASSWD: DSIP_BACKUP_CMDS 8 | dsiprouter ALL=(ALL) NOPASSWD: DSIP_RESTORE_CMDS -------------------------------------------------------------------------------- /gui/requirements.txt: -------------------------------------------------------------------------------- 1 | UltraDict 2 | acme 3 | ansi2html 4 | bjoern 5 | bson 6 | cron_descriptor 7 | cryptography 8 | dnspython 9 | docker 10 | docutils<0.17,>=0.12 11 | Flask~=2.2.0 12 | Flask_WTF 13 | itsdangerous==2.0.1 14 | Jinja2==3.1.3 15 | josepy 16 | myst-parser 17 | mysqlclient 18 | pem 19 | psycopg2 20 | psycopg2_binary 21 | pycryptodome 22 | pygtail 23 | PyMySQL 24 | pyOpenSSL 25 | python-ldap==3.4.4 26 | python_crontab 27 | pytz 28 | recommonmark 29 | requests 30 | sphinx 31 | sphinxcontrib-httpdomain 32 | sphinx-rtd-theme 33 | piccolo_theme 34 | SQLAlchemy~=2.0 35 | twilio 36 | Werkzeug~=2.0 37 | -------------------------------------------------------------------------------- /kamailio/defaults/dsip_cdrinfo.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_cdrinfo`; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE `dsip_cdrinfo` ( 5 | `gwgroupid` int(11) NOT NULL, 6 | `email` varchar(255) NOT NULL DEFAULT '', 7 | `send_interval` varchar(255) NOT NULL DEFAULT '* * 1 * *', 8 | `last_sent` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 9 | PRIMARY KEY (`gwgroupid`) 10 | ) ENGINE = InnoDB 11 | DEFAULT CHARSET = utf8; 12 | /*!40101 SET character_set_client = @saved_cs_client */; 13 | -------------------------------------------------------------------------------- /kamailio/defaults/dsip_maintmode.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_maintmode`; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE `dsip_maintmode` ( 5 | `ipaddr` varchar(64) NOT NULL DEFAULT '', 6 | `key_type` varchar(64) NOT NULL DEFAULT '0', 7 | `gwid` varchar(64) NOT NULL DEFAULT '', 8 | `value_type` varchar(64) NOT NULL DEFAULT '0', 9 | `status` TINYINT NOT NULL DEFAULT '1', 10 | PRIMARY KEY (`ipaddr`) 11 | ) ENGINE = InnoDB 12 | DEFAULT CHARSET = utf8; 13 | /*!40101 SET character_set_client = @saved_cs_client */; 14 | -------------------------------------------------------------------------------- /kamailio/defaults/dsip_notification.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_notification`; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE `dsip_notification` ( 5 | `gwgroupid` int(11) NOT NULL, 6 | `type` int(11) NOT NULL, 7 | `method` int(11) DEFAULT NULL, 8 | `value` varchar(255) DEFAULT NULL, 9 | `createdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 10 | PRIMARY KEY (`gwgroupid`,`type`) 11 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 12 | /*!40101 SET character_set_client = @saved_cs_client */; 13 | 14 | -------------------------------------------------------------------------------- /gui/modules/api/sample_api.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | from modules.api.api_functions import api_security 3 | 4 | 5 | new_api = Blueprint('new_api','__name__') 6 | 7 | # Sample route. Replace new_api and new_entity with the name of the api 8 | # and the name of the entity that it will manipulate 9 | @new_api.route('/api/v1/new_api/new_entity') 10 | @api_security 11 | def getEntity(): 12 | result = "{ \ 13 | domain_id: 1012 \ 14 | name: AprilandMackCo, \ 15 | enabled: true, \ 16 | description: 'April and Mack Co', \ 17 | config_id: 64 \ 18 | }" 19 | return result 20 | -------------------------------------------------------------------------------- /gui/static/js/teleblock.js: -------------------------------------------------------------------------------- 1 | ;(function (window, document) { 2 | 'use strict'; 3 | 4 | $(document).ready(function() { 5 | /* listener for teleblock toggle */ 6 | $('#toggleTeleblock').change(function () { 7 | if ($(this).is(":checked") || $(this).prop("checked")) { 8 | $('#teleblockOptions').removeClass("hidden"); 9 | $(this).val("1"); 10 | $(this).bootstrapToggle('on'); 11 | } 12 | else { 13 | $('#teleblockOptions').addClass("hidden"); 14 | $(this).val("0"); 15 | $(this).bootstrapToggle('off'); 16 | } 17 | }); 18 | }); 19 | 20 | })(window, document); 21 | -------------------------------------------------------------------------------- /rtpengine/configs/rtpengine.conf: -------------------------------------------------------------------------------- 1 | [rtpengine] 2 | table = 0 3 | no-fallback = false 4 | interface = 127.0.0.1 5 | listen-ng = 127.0.0.1:7722 6 | port-min = 10000 7 | port-max = 20000 8 | #num-threads = 8 9 | timeout = 60 10 | silent-timeout = 3600 11 | offer-timeout = 300 12 | #final-timeout = 7200 13 | #tos = 184 14 | #control-tos = 184 15 | #delete-delay = 30 16 | #final-timeout = 10800 17 | #homer = 123.234.345.456:9060 18 | #homer-protocol = udp 19 | #homer-id = 1 20 | #sip-source = false 21 | #dtls-passive = false 22 | log-level = 4 23 | log-stderr = false 24 | log-facility = local1 25 | log-facility-cdr = local1 26 | log-facility-rtcp = local1 27 | -------------------------------------------------------------------------------- /testing/12.sh.dev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | . include/common 5 | 6 | unitname="dSIP Custom Routing" 7 | 8 | # static settings 9 | username="smoketest" 10 | host="localhost" 11 | port="5060" 12 | 13 | # TODO: add custom routes to db 14 | # - locality prefix matching 15 | # - custom kamailio route matching 16 | # mysql -e 'insert into custom_routing ...' 17 | # mysql -e 'insert into dr_rules ...' 18 | 19 | # TODO: send invite to test routes 20 | # we should be using a template INVITE and replacing values with sed 21 | #sipsak -f INVITE.sip -s sip:$username@$host:$port -H $host -vvv >/dev/null 22 | 23 | process_result "$unitname" $ret 24 | -------------------------------------------------------------------------------- /HA/consul/consul.fc: -------------------------------------------------------------------------------- 1 | /usr/local/bin/consul -- gen_context(system_u:object_r:consul_exec_t,s0) 2 | /usr/lib/systemd/system/consul.service -- gen_context(system_u:object_r:consul_unit_file_t,s0) 3 | /etc/systemd/system/consul.service -- gen_context(system_u:object_r:consul_unit_file_t,s0) 4 | /var/lib/consul(/.*)? -- gen_context(system_u:object_r:consul_var_lib_t,s0) 5 | /var/run/consul.pid -- gen_context(system_u:object_r:consul_var_run_t,s0) 6 | /var/run/user/consul(/.*)? -- gen_context(system_u:object_r:consul_tmp_t,s0) 7 | /var/cache/consul(/.*)? -- gen_context(system_u:object_r:consul_cache_t,s0) 8 | /etc/consul.d(/.*)? -- gen_context(system_u:object_r:consul_etc_t,s0) -------------------------------------------------------------------------------- /dnsmasq/systemd/dnsmasq-v2.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=dnsmasq - A lightweight DHCP and caching DNS server 3 | Requires=basic.target network.target 4 | After=network.target network-online.target basic.target 5 | Before=multi-user.target 6 | DefaultDependencies=no 7 | 8 | [Service] 9 | Type=simple 10 | PIDFile=/run/dnsmasq/dnsmasq.pid 11 | Environment='RUN_DIR=/run/dnsmasq' 12 | # make sure everything is setup correctly before starting 13 | ExecStartPre=!-/usr/bin/dsiprouter chown -dnsmasq 14 | ExecStartPre=/usr/sbin/dnsmasq --test 15 | ExecStart=/usr/sbin/dnsmasq -k 16 | ExecReload=/bin/kill -HUP $MAINPID 17 | 18 | [Install] 19 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /kamailio/modules/dsiprouter/mod_funcs.h: -------------------------------------------------------------------------------- 1 | #ifndef DSIPROUTER_LICENSING_MOD_FUNCS_H 2 | #define DSIPROUTER_LICENSING_MOD_FUNCS_H 3 | 4 | #include 5 | #include 6 | 7 | char *readFile(char *path); 8 | char **strsplit(char *str, const char delims[], size_t *len); 9 | unsigned char *b64decode(char *b64message, size_t *out_length); 10 | RSA *createRSA(unsigned char *key, int public); 11 | int verifyRSA(const unsigned char *msg, size_t msglen, unsigned char *sig, size_t siglen, unsigned char *pubkey); 12 | int validate_license(char *license_file, char *signature_file, char *uuid_file); 13 | 14 | #endif //DSIPROUTER_LICENSING_MOD_FUNCS_H 15 | -------------------------------------------------------------------------------- /kamailio/defaults/dr_gw_lists.csv: -------------------------------------------------------------------------------- 1 | 1;1,2,3,4,5,6,7,8;name:Twilio NA Inbound CarrierGroup,type:8,lb:1 2 | 2;9,10,11,12,13,14,15,16,17,18,19;name:Skyetel CarrierGroup,type:8,lb:2 3 | 3;21,23;name:Flowroute CarrierGroup,type:8,lb:3 4 | 4;24,25,26,27,28,29;name:Voxbone CarrierGroup,type:8,lb:4 5 | 5;30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45;name:VoIP Innovations Inbound CarrierGroup,type:8,lb:5 6 | 6;46,47,48,49;name:VoIP Innovations Outbound Conversational CarrierGroup,type:8,lb:6 7 | 7;50;name:Thinq CarrierGroup,type:8,lb:7 8 | 8;51;name:Voxtelesys CarrierGroup,type:8,lb:8 9 | 9;52;name:Les.net CarrierGroup,type:8,lb:9 10 | 10;53,54,55;name:ThinkTel CarrierGroup,type:8,lb:10 11 | -------------------------------------------------------------------------------- /dnsmasq/systemd/dnsmasq-v3.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=dnsmasq - A lightweight DHCP and caching DNS server 3 | Requires=basic.target network.target 4 | After=network.target network-online.target basic.target 5 | Before=multi-user.target 6 | DefaultDependencies=no 7 | 8 | [Service] 9 | Type=simple 10 | PermissionsStartOnly=true 11 | PIDFile=/run/dnsmasq/dnsmasq.pid 12 | Environment='RUN_DIR=/run/dnsmasq' 13 | # make sure everything is setup correctly before starting 14 | ExecStartPre=/usr/bin/dsiprouter chown -dnsmasq 15 | ExecStartPre=/usr/sbin/dnsmasq --test 16 | ExecStart=/usr/sbin/dnsmasq -k 17 | ExecReload=/bin/kill -HUP $MAINPID 18 | 19 | [Install] 20 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /gui/static/css/msteams.css: -------------------------------------------------------------------------------- 1 | /* The Configuration Panel */ 2 | .configurationpanel { 3 | height:auto; /* Specify a height */ 4 | width: 0; /* 0 width - change this with JavaScript */ 5 | /*position: fixed; Stay in place */ 6 | z-index: 1; /* Stay on top */ 7 | /*top: 0; 8 | left: 0; */ 9 | background-color: #111; /* Black*/ 10 | overflow-x: hidden; /* Disable horizontal scroll */ 11 | padding-top: 60px; /* Place content 60px from the top */ 12 | transition: 0.5s; /* 0.5 second transition effect to slide in the sidepanel */ 13 | } 14 | 15 | .tooltip-inner{ 16 | font-size: 10px; 17 | border:1px solid #e74c3c; 18 | background-color: red; 19 | height:100%; 20 | } 21 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | ## Thank you to all contributors for your hard work 2 | 3 | ### Contributors 4 | 5 | - Asiel Lara 6 | - chelseatcarter 7 | - Dan 8 | - Dan Ryan 9 | - Dean Forester 10 | - demonspork 11 | - dependabot[bot] 12 | - dopensource 13 | - hailthemelody 14 | - James Peru Mmbono 15 | - jornsby 16 | - littleguga 17 | - Mack 18 | - Mack Hendicks 19 | - Mack hendricks 20 | - Mack Hendricks 21 | - matmurdock 22 | - Mat Murdock 23 | - Maurice Rogers 24 | - mhendricks 25 | - Micah Quinn 26 | - ncannon01 27 | - Nicole 28 | - Omari S. King 29 | - reqlez 30 | - richard 31 | - Richard 32 | - Richard Bolaji 33 | - RichSosa28 34 | - root 35 | - TheGolg 36 | - TuxPowered 37 | - Tyler Moore 38 | - VOICE1 39 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | dSIPRouter Docs 2 | =============== 3 | 4 | There are 3 main sections of documentation: 5 | 6 | 1. User Documentation 7 | 2. Developer Documentation 8 | 3. Routes Documentation (API/GUI routes) 9 | 10 | Use the table of contents on your left to navigate between sections. 11 | 12 | 13 | Indices and tables 14 | ------------------ 15 | 16 | * :ref:`genindex` 17 | * :ref:`modindex` 18 | * :ref:`search` 19 | 20 | .. toctree:: 21 | :caption: Table of Contents 22 | :name: mastertoc 23 | :titlesonly: 24 | :glob: 25 | :hidden: 26 | 27 | User Documentation 28 | Developer Documentation 29 | Routes Documentation 30 | -------------------------------------------------------------------------------- /kamailio/defaults/dsip_lcr.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_lcr`; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE `dsip_lcr` ( 5 | `pattern` varchar(64) NOT NULL DEFAULT '', 6 | `key_type` varchar(64) NOT NULL DEFAULT '0', 7 | `dr_groupid` varchar(64) NOT NULL DEFAULT '', 8 | `value_type` varchar(64) NOT NULL DEFAULT '0', 9 | `cost` decimal(3,2) NOT NULL DEFAULT '0.0', 10 | `from_prefix` varchar(64) NOT NULL DEFAULT '', 11 | `expires` int(11) NOT NULL DEFAULT '0', 12 | PRIMARY KEY (`pattern`) 13 | ) ENGINE = InnoDB 14 | DEFAULT CHARSET = utf8; 15 | /*!40101 SET character_set_client = @saved_cs_client */; 16 | -------------------------------------------------------------------------------- /gui/templates/login_layout.html: -------------------------------------------------------------------------------- 1 | {% from 'util.jinja2.html' import link_tag, script_tag, tracked_link %} 2 | 3 | 4 | 5 | 6 | 7 | dSIPRouter {% block title %}{% endblock %} 8 | 9 | {{ link_tag('bootstrap') }} 10 | {{ link_tag('main') }} 11 | 12 | {% block custom_css %} 13 | {% endblock %} 14 | 15 | 16 | 17 | 18 | 19 |
20 | {% block body %} 21 | {% endblock %} 22 |
23 | 24 | {{ script_tag('jquery') }} 25 | 26 | {% block custom_js %} 27 | {% endblock %} 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /gui/modules/fusionpbx/dsiprouter.nginx.tpl: -------------------------------------------------------------------------------- 1 | upstream fusionpbx { 2 | ##SERVERLIST## 3 | } 4 | 5 | 6 | server { 7 | listen 80; 8 | listen 443 ssl; 9 | 10 | ssl_certificate /etc/ssl/certs/cert_combined.crt; 11 | ssl_certificate_key /etc/ssl/certs/cert.key; 12 | 13 | location /provision/ { 14 | proxy_pass https://fusionpbx; 15 | proxy_redirect off; 16 | proxy_next_upstream error timeout http_404 http_403 http_500 http_502 http_503 http_504 non_idempotent; 17 | } 18 | 19 | location / { 20 | 21 | error_page 404 /404.html; 22 | 23 | } 24 | 25 | location /images/ { 26 | 27 | alias /etc/nginx/html/images/; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /resources/upgrade/v0.75/migrate_data.sql: -------------------------------------------------------------------------------- 1 | UPDATE `dr_gateways` SET `attrs` = IF( 2 | (CHAR_LENGTH(attrs) - CHAR_LENGTH(REPLACE(attrs, ',', ''))) = 2, 3 | CONCAT(SUBSTRING_INDEX(`attrs`, ',', 3), ',proxy,proxy'), 4 | CONCAT(SUBSTRING_INDEX(`attrs`, ',', 2), ',,proxy,proxy') 5 | ); 6 | 7 | UPDATE `dispatcher` SET `attrs` = IF( 8 | `attrs` REGEXP 'weight=([0-9]+)', CONCAT('signalling=proxy;media=proxy;rweight=', 9 | CAST((REGEXP_REPLACE(`attrs`, '.*weight=([0-9]+).*', '\\1') / 100) AS CHAR)), 10 | 'signalling=proxy;media=proxy;rweight=0' 11 | ); 12 | 13 | INSERT INTO `dsip_call_settings` (`gwgroupid`, `limit`) 14 | SELECT CAST(`gwgroupid` AS UNSIGNED), CAST(`limit` AS UNSIGNED) 15 | FROM `dsip_calllimit`; 16 | DROP TABLE `dsip_calllimit`; -------------------------------------------------------------------------------- /testing/8.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | unitname="DoS and SIP Security - Block Unknown IP" 6 | 7 | # settings 8 | source_ip="127.0.0.10" 9 | username="smoketest" 10 | host="localhost" 11 | 12 | # Send a bunch of of requests to the server 13 | sipsak -F -d -k $source_ip -e 500 -s sip:$username@$host >/dev/null 14 | 15 | sleep 1 16 | # Check the ipban htable to see if the ipaddress is being blocked after sending a 17 | # bunch of SIP requests 18 | kamcmd htable.dump ipban | grep -q "$source_ip" 19 | ret=$? 20 | 21 | # Clean up, remove the entry 22 | kamcmd htable.delete ipban $source_ip 23 | 24 | # TODO: Add a test to validate that the Server user agent is no longer sent 25 | 26 | process_result "$unitname" $ret 27 | -------------------------------------------------------------------------------- /dnsmasq/configs/systemdnetworkd/networkd-pre.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /run/systemd/network/ 4 | rm -f /run/systemd/network/00-nm_managed-*.network 2>/dev/null 5 | 6 | # check whether nmcli reports that network manager is managing the interface 7 | # ref: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/libnmc-base/nm-client-utils.c?ref_type=heads#L288 8 | # blacklist those managed interfaces from being managed by systemd-networkd 9 | for IFACE in $(nmcli -t -m tabular device status | awk -F ':' '$3 !~ /unmanaged|[^ ]+ \(externally\)/ {print $1}'); do 10 | cat <"/run/systemd/network/00-nm_managed-$IFACE.network" 11 | [Match] 12 | Name=$IFACE 13 | 14 | [Link] 15 | Unmanaged=yes 16 | EOF 17 | done 18 | 19 | exit 0 -------------------------------------------------------------------------------- /nginx/systemd/nginx-stop.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | TIMEOUT=5 4 | MAINPID="$1" 5 | PIDFILE="$2" 6 | 7 | if [[ -z "$(ps -p $MAINPID -o pid= 2>/dev/null)" ]]; then 8 | rm -f ${PIDFILE} 2>/dev/null 9 | exit 0 10 | fi 11 | 12 | kill -s SIGSTOP $MAINPID 13 | for (( ROUND=0; ROUND<$TIMEOUT; ROUND++ )); do 14 | if [[ -z "$(ps -p $MAINPID -o pid= 2>/dev/null)" ]]; then 15 | rm -f ${PIDFILE} 2>/dev/null 16 | exit 0 17 | fi 18 | sleep 1 19 | done 20 | 21 | kill -s SIGQUIT $MAINPID 22 | for (( ROUND=0; ROUND<$TIMEOUT; ROUND++ )); do 23 | if [[ -z "$(ps -p $MAINPID -o pid= 2>/dev/null)" ]]; then 24 | rm -f ${PIDFILE} 2>/dev/null 25 | exit 0 26 | fi 27 | sleep 1 28 | done 29 | 30 | exit 1 31 | 32 | -------------------------------------------------------------------------------- /testing/6.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | unitname="PBX and Endpoint Registration" 6 | 7 | 8 | # settings 9 | username="smoketest" 10 | password="90dsip2432x" 11 | domain="sip.dsiprouter.org" 12 | host="localhost" 13 | port="5060" 14 | 15 | # Create a new user 16 | mysql kamailio -e "insert into subscriber values (null,'$username','$host','$password','','','','');" 17 | 18 | 19 | # Register User 20 | sipsak -U -C sip:$username@$domain -s sip:$username@$host:$port -u $username -a $password -H $host -i -vvv >/dev/null 21 | ret=$? 22 | 23 | # Clean up 24 | # Delete user 25 | mysql kamailio -e "delete from subscriber where username='$username' and password='$password';" 26 | 27 | 28 | process_result "$unitname" $ret 29 | 30 | 31 | -------------------------------------------------------------------------------- /gui/modules/fusionpbx/dsiprouter.nginx: -------------------------------------------------------------------------------- 1 | upstream fusionpbx { 2 | server fusionpbx5.dsiprouter.net:443; 3 | 4 | } 5 | 6 | 7 | server { 8 | listen 80; 9 | listen 443 ssl; 10 | 11 | ssl_certificate /etc/ssl/certs/cert_combined.crt; 12 | ssl_certificate_key /etc/ssl/certs/cert.key; 13 | 14 | location /provision/ { 15 | proxy_pass https://fusionpbx; 16 | proxy_redirect off; 17 | proxy_next_upstream error timeout http_404 http_403 http_500 http_502 http_503 http_504 non_idempotent; 18 | } 19 | 20 | location / { 21 | 22 | error_page 404 /404.html; 23 | 24 | } 25 | 26 | location /images/ { 27 | 28 | alias /etc/nginx/html/images/; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /HA/consul/consul.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description="HashiCorp Consul Service Mesh" 3 | Documentation=https://www.consul.io/ 4 | Requires=network-online.target 5 | After=network-online.target 6 | ConditionFileNotEmpty=/etc/consul.d/consul.hcl 7 | 8 | [Service] 9 | User=consul 10 | Group=consul 11 | PIDFile=/var/run/consul/consul.pid 12 | ExecStartPre=[ -f "/var/run/consul/consul.pid" ] && /bin/rm -f /var/run/consul/consul.pid 13 | ExecStartPre=/usr/local/bin/consul validate /etc/consul.d 14 | ExecStart=/usr/local/bin/consul agent -pid-file /var/run/consul/consul.pid -enable-local-script-checks -config-dir=/etc/consul.d 15 | ExecReload=/usr/local/bin/consul reload 16 | KillMode=process 17 | Restart=on-failure 18 | LimitNOFILE=65536 19 | 20 | [Install] 21 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /gui/modules/api/api.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_endpoint_lease`; 2 | CREATE TABLE `dsip_endpoint_lease` ( 3 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 4 | `gwid` int(10) unsigned NOT NULL, 5 | `sid` int(10) unsigned NOT NULL, 6 | `expiration` datetime NOT NULL, 7 | PRIMARY KEY (`id`) 8 | ); 9 | 10 | 11 | 12 | DROP TABLE IF EXISTS `dsip_user`; 13 | CREATE TABLE `dsip_user` ( 14 | `id` INT NOT NULL auto_increment unique, 15 | `firstname` VARCHAR(255) NOT NULL, 16 | `lastname` VARCHAR(255) NULL, 17 | `username` VARCHAR(255) NOT NULL unique, 18 | `password` VARCHAR(255) NOT NULL, 19 | `roles` VARCHAR(255) NULL, 20 | `domains` VARCHAR(255) NULL, 21 | `token` VARCHAR(255) NULL, 22 | `token_expiration` DATETIME NULL, 23 | PRIMARY KEY (`id`)); 24 | -------------------------------------------------------------------------------- /gui/static/js/stirshaken.js: -------------------------------------------------------------------------------- 1 | ;(function (window, document) { 2 | 'use strict'; 3 | 4 | $(document).ready(function() { 5 | var toggle = $('#toggleStirShaken'); 6 | 7 | function updateToggle() { 8 | if (toggle.is(":checked") || toggle.prop("checked")) { 9 | $('#stirShakenOptions').removeClass("hidden"); 10 | $(this).val("1"); 11 | $(this).bootstrapToggle('on'); 12 | } 13 | else { 14 | $('#stirShakenOptions').addClass("hidden"); 15 | $(this).val("0"); 16 | $(this).bootstrapToggle('off'); 17 | } 18 | } 19 | 20 | /* update toggle on page load */ 21 | updateToggle(); 22 | /* listener for toggle changes */ 23 | toggle.change(updateToggle); 24 | }); 25 | 26 | })(window, document); 27 | -------------------------------------------------------------------------------- /resources/terraform/do/variables.tf: -------------------------------------------------------------------------------- 1 | variable "pvt_key_path" { 2 | type=string 3 | } 4 | 5 | variable "pub_key_name" { 6 | type=string 7 | } 8 | 9 | variable "dns_domain" { 10 | type=string 11 | default="" 12 | } 13 | 14 | variable "dns_hostname" { 15 | type=string 16 | default="demo" 17 | } 18 | 19 | variable "branch" { 20 | type=string 21 | default="master" 22 | } 23 | 24 | variable "pull_request" { 25 | type=string 26 | default="" 27 | } 28 | 29 | variable "region" { 30 | type=string 31 | default="tor1" 32 | } 33 | 34 | variable "image" { 35 | type=string 36 | default="debian-12-x64" 37 | } 38 | 39 | variable "image_size" { 40 | type=string 41 | default="2gb" 42 | } 43 | 44 | variable "additional_commands" { 45 | type=string 46 | default="echo" 47 | } 48 | -------------------------------------------------------------------------------- /testing/sql/v0.523+ent/grants.sql: -------------------------------------------------------------------------------- 1 | -- Grants dumped for users: kamailio,kamailioro 2 | GRANT USAGE ON *.* TO 'kamailio'@'%' IDENTIFIED BY PASSWORD '*2870144497941F902294EDABA260A0A4A15078E4'; 3 | GRANT ALL PRIVILEGES ON `kamailio`.* TO 'kamailio'@'%'; 4 | GRANT USAGE ON *.* TO 'kamailio'@'localhost' IDENTIFIED BY PASSWORD '*2870144497941F902294EDABA260A0A4A15078E4'; 5 | GRANT ALL PRIVILEGES ON `kamailio`.* TO 'kamailio'@'localhost'; 6 | GRANT USAGE ON *.* TO 'kamailioro'@'%' IDENTIFIED BY PASSWORD '*CF29822D11D49E1965F110105EACFBE9202F1A31'; 7 | GRANT SELECT ON `kamailio`.* TO 'kamailioro'@'%'; 8 | GRANT USAGE ON *.* TO 'kamailioro'@'localhost' IDENTIFIED BY PASSWORD '*CF29822D11D49E1965F110105EACFBE9202F1A31'; 9 | GRANT SELECT ON `kamailio`.* TO 'kamailioro'@'localhost'; 10 | FLUSH PRIVILEGES; 11 | -------------------------------------------------------------------------------- /docs/source/routes/summary.rst: -------------------------------------------------------------------------------- 1 | Route Summary 2 | ============= 3 | 4 | .. raw:: html 5 | 6 | 7 | 8 | .. raw:: html 9 | 10 | 20 | 21 | .. qrefflask:: dsiprouter:app 22 | :undoc-static: 23 | :autoquickref: 24 | -------------------------------------------------------------------------------- /rtpengine/deb-mr11.5.1.11.patch: -------------------------------------------------------------------------------- 1 | Subject: [PATCH] change defaults config path 2 | --- 3 | Index: debian/ngcp-rtpengine-iptables-setup 4 | IDEA additional info: 5 | Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP 6 | <+>UTF-8 7 | =================================================================== 8 | diff --git a/debian/ngcp-rtpengine-iptables-setup b/debian/ngcp-rtpengine-iptables-setup 9 | --- a/debian/ngcp-rtpengine-iptables-setup (revision a6631401498937d0c03e63931e601c40fcbfa2e7) 10 | +++ b/debian/ngcp-rtpengine-iptables-setup (date 1717809128862) 11 | @@ -4,7 +4,7 @@ 12 | MODNAME=xt_RTPENGINE 13 | MANAGE_IPTABLES=yes 14 | 15 | -DEFAULTS=/etc/default/ngcp-rtpengine-daemon 16 | +DEFAULTS=/etc/default/rtpengine.conf 17 | 18 | # Load startup options if available 19 | if [ -f "$DEFAULTS" ]; then 20 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | parameters { 3 | password (name: 'DIGITALOCEAN_TOKEN') 4 | } 5 | environment { 6 | TF_WORKSPACE = 'dev' //Sets the Terraform Workspace 7 | TF_IN_AUTOMATION = 'true' 8 | DIGITALOCEAN_TOKEN = "${params.DIGITALOCEAN_TOKEND}" 9 | } 10 | stages { 11 | stage('Terraform Init') { 12 | steps { 13 | sh "${env.TERRAFORM_HOME}/terraform init -input=false" 14 | } 15 | } 16 | stage('Terraform Plan') { 17 | steps { 18 | sh "${env.TERRAFORM_HOME}/terraform plan -out=tfplan -input=false -var-file='dev.tfvars'" 19 | } 20 | } 21 | stage('Terraform Apply') { 22 | steps { 23 | input 'Apply Plan' 24 | sh "${env.TERRAFORM_HOME}/terraform apply -input=false tfplan" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/source/user/global_outbound_routes.rst: -------------------------------------------------------------------------------- 1 | 2 | .. _global_outbound_routes: 3 | 4 | Global Outbound Routes 5 | ^^^^^^^^^^^^^^^^^^^^^^^^ 6 | 7 | 8 | 9 | 1) Go to the Dashboard screen. 10 | 11 | 12 | 13 | .. image:: images//dSIP_dashboard.png 14 | :align: center 15 | 16 | 17 | 18 | 2) Click on Global Outbound Routes. 19 | 20 | 21 | 22 | 3) Click on the green Add button. 23 | 24 | 25 | 26 | .. image:: images//dSIP_Global_Out_Add.png 27 | :align: center 28 | 29 | 30 | 31 | 4) 32 | a) Enter in the Outbound Route information. 33 | b) Click on the green Add button. 34 | 35 | .. image:: images//dSIP_Global_Out_Add_Outbound_Route.png 36 | :align: center 37 | 38 | 39 | 5) Click on the blue Reload Kamailio button in order for the changes to be updated. 40 | 41 | -------------------------------------------------------------------------------- /docs/source/user/resources.rst: -------------------------------------------------------------------------------- 1 | Extra Resources 2 | =============== 3 | 4 | Uploading CSVs 5 | -------------- 6 | 7 | `CSV Example `_ 8 | 9 | Proxy FusionPBX UI 10 | ------------------ 11 | 12 | Add the following stanza before "location /images/" stanza to proxy the FusionPBX UI thru dSIPRouter. Once the following text 13 | is added to /opt/dsiprouter/gui/modules/fusionpbx/dsiprouter.nginx.tpl you will be able to access the FusionPBX GUI via: 14 | https://dSIPRouter_IP/ or https://dSIPRouter_IP:: 15 | 16 | location / { 17 | proxy_pass https://fusionpbx; 18 | proxy_redirect off; 19 | proxy_next_upstream error timeout http_404 http_403 http_500 http_502 http_503 http_504 non_idempotent; 20 | } 21 | -------------------------------------------------------------------------------- /gui/modules/cdr/cron_functions.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from shared import debugException 3 | from database import startSession, DummySession, dSIPCDRInfo 4 | from modules.api.api_routes import generateCDRS 5 | 6 | def sendCdrReport(gwgroupid): 7 | db = DummySession() 8 | 9 | try: 10 | db = startSession() 11 | 12 | now = datetime.now() 13 | cdr_info = db.query(dSIPCDRInfo).filter(dSIPCDRInfo.gwgroupid == gwgroupid).first() 14 | generateCDRS(gwgroupid=gwgroupid, report_type='csv', send_email=True, dtfilter=cdr_info.last_sent, run_standalone=True) 15 | cdr_info.last_sent = now 16 | db.commit() 17 | 18 | except Exception as ex: 19 | debugException(ex) 20 | db.rollback() 21 | db.flush() 22 | finally: 23 | db.close() 24 | -------------------------------------------------------------------------------- /testing/payload.json: -------------------------------------------------------------------------------- 1 | { "name": "Endpoint1", 2 | "calllimit": "0", 3 | "auth": { "type":"ip", 4 | "user":"mack10", 5 | "pass":"1234", 6 | "domain":"sip.dsiprouter.org" 7 | }, 8 | "endpoints": [ 9 | {"hostname":"142.131.313.1","description":"Endpoint1","maintmode":0}, 10 | {"hostname":"143.131.344.2","description":"Endpoint2","maintmode":1} 11 | ], 12 | "strip": 0, 13 | "prefix": "", 14 | "notifications": { 15 | "overmaxcalllimit": "mack.hendricks@gmail.com", 16 | "endpointfailure": "mack.hendricks@gmail.com" 17 | }, 18 | 19 | "fusionpbx": { 20 | "enabled": 1, 21 | "dbhost": "13.13.24.22", 22 | "dbuser": "fusiopbx", 23 | "dbpass": "1234" 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /resources/apt/debian/11/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from debian 11 (bullseye) release 3 | #------------------------------------------------------------------- 4 | deb https://deb.debian.org/debian/ bullseye main contrib non-free 5 | #deb-src https://deb.debian.org/debian/ bullseye main contrib non-free 6 | 7 | deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free 8 | #deb-src https://deb.debian.org/debian/ bullseye-updates main contrib non-free 9 | 10 | deb https://deb.debian.org/debian/ bullseye-backports main 11 | #deb-src https://deb.debian.org/debian/ bullseye-backports main 12 | 13 | deb https://deb.debian.org/debian-security/ bullseye-security main 14 | #deb-src https://deb.debian.org/debian-security/ bullseye-security main 15 | -------------------------------------------------------------------------------- /resources/apt/debian/12/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from debian 12 (bookworm) release 3 | #------------------------------------------------------------------- 4 | deb https://deb.debian.org/debian/ bookworm main contrib non-free 5 | #deb-src https://deb.debian.org/debian/ bookworm main contrib non-free 6 | 7 | deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free 8 | #deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free 9 | 10 | deb https://deb.debian.org/debian/ bookworm-backports main 11 | #deb-src https://deb.debian.org/debian/ bookworm-backports main 12 | 13 | deb https://deb.debian.org/debian-security/ bookworm-security main 14 | #deb-src https://deb.debian.org/debian-security/ bookworm-security main 15 | -------------------------------------------------------------------------------- /dnsmasq/configs/networkmanager/dsiprouter.conf: -------------------------------------------------------------------------------- 1 | # dSIPRouter does not utilize the NetworkManager dnsmasq plugin. 2 | # Instead DNSmasq is managed as a separate service that pulls DNS servers 3 | # from the upstream DNS provider (NetworkManager/dhclient/systemd-resolved). 4 | # Currently the only plugin utilized by dSIPRouter is the keyfile plugin. 5 | # The ifupdown plugin should not be loaded here as it is loaded via the 6 | # systemd service files with interfaces conditionally managed.. 7 | # Note: the "no-auto-default" setting tells network manager not to automatically 8 | # create profiles for connected ethernet devices, only allowing explicit profiles. 9 | # Ref: https://people.freedesktop.org/~lkundrak/nm-docs/NetworkManager.conf.html 10 | [main] 11 | dns=none 12 | no-auto-default=* 13 | plugins=keyfile 14 | 15 | [keyfile] 16 | unmanaged-devices=interface-name:docker* -------------------------------------------------------------------------------- /docs/source/dev/index.rst: -------------------------------------------------------------------------------- 1 | Developer Hub 2 | ============= 3 | 4 | Python Modules 5 | -------------- 6 | 7 | The dSIPRouter project at its core is a WSGI Flask application that serves HTTP content. 8 | This section makes the core modules easier to explore for developers. 9 | 10 | .. toctree:: 11 | :titlesonly: 12 | 13 | database 14 | dsiprouter 15 | modules 16 | settings 17 | shared 18 | sysloginit 19 | util 20 | 21 | .. TODO: changelog uses github-flavored markdown comments and is not parsed correctly by myst-parser 22 | 23 | Contibuting Guidelines 24 | ---------------------- 25 | 26 | .. toctree:: 27 | 28 | external_links/CONTRIBUTING.md 29 | 30 | Credits 31 | ------- 32 | 33 | .. toctree:: 34 | :titlesonly: 35 | 36 | external_links/CONTRIBUTORS.md 37 | -------------------------------------------------------------------------------- /gui/modules/frauddetection/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Debug this script if in debug mode 4 | (( $DEBUG == 1 )) && set -x 5 | 6 | # ENABLED=1 --> install, ENABLED=0 --> do nothing, ENABLED=-1 uninstall 7 | ENABLED=0 8 | 9 | # Import dsip_lib utility / shared functions if not already 10 | if [[ "$DSIP_LIB_IMPORTED" != "1" ]]; then 11 | . ${DSIP_PROJECT_DIR}/dsiprouter/dsip_lib.sh 12 | fi 13 | 14 | function installSQL { 15 | echo "" 16 | } 17 | 18 | function install { 19 | installSQL 20 | printdbg "Fraud Detection module installed" 21 | } 22 | 23 | function uninstall { 24 | printdbg "Fraud Detection module uninstalled" 25 | } 26 | 27 | function main { 28 | if [[ ${ENABLED} -eq 1 ]]; then 29 | install && exit 0 || exit 1 30 | elif [[ ${ENABLED} -eq -1 ]]; then 31 | uninstall && exit 0 || exit 1 32 | else 33 | exit 0 34 | fi 35 | } 36 | 37 | main 38 | -------------------------------------------------------------------------------- /Jenkinsfile.common: -------------------------------------------------------------------------------- 1 | gitlabBuilds(builds: ['build', 'test', 'artifacts']) { 2 | 3 | stage('build') { gitlabCommitStatus(name: 'build') { 4 | sh "./gradlew --no-daemon clean build" 5 | }} 6 | 7 | stage('test') { gitlabCommitStatus(name: 'test') { 8 | sh "./gradlew --no-daemon check" 9 | }} 10 | 11 | stage('artifacts') { gitlabCommitStatus(name: 'artifacts') { 12 | archiveArtifacts artifacts: '**/build/libs/*.jar', fingerprint: true, onlyIfSuccessful: true 13 | step([$class: 'JavadocArchiver', javadocDir: 'thrifty-compiler/build/docs/javadoc/', keepAll: false]) 14 | step([$class: 'JavadocArchiver', javadocDir: 'thrifty-schema/build/docs/javadoc/', keepAll: false]) 15 | step([$class: 'JavadocArchiver', javadocDir: 'thrifty-java-codegen/build/docs/javadoc/', keepAll: false]) 16 | step([$class: 'JavadocArchiver', javadocDir: 'thrifty-runtime/build/docs/javadoc/', keepAll: false]) 17 | }} 18 | } 19 | -------------------------------------------------------------------------------- /gui/util/persistence.py: -------------------------------------------------------------------------------- 1 | import json, os 2 | 3 | 4 | # TODO: not thread/process safe, move to shared memory manager 5 | 6 | 7 | def getPersistentState(): 8 | if not os.path.exists('/run/dsiprouter/state.json'): 9 | return {} 10 | 11 | with open('/run/dsiprouter/state.json', 'r') as f: 12 | return json.load(f) 13 | 14 | def setPersistentState(state): 15 | with open('/run/dsiprouter/state.json', 'w') as f: 16 | json.dump(state, f) 17 | 18 | def updatePersistentState(updates): 19 | if not os.path.exists('/run/dsiprouter/state.json'): 20 | with open('/run/dsiprouter/state.json', 'w') as f: 21 | json.dump(updates, f) 22 | return updates 23 | 24 | with open('/run/dsiprouter/state.json', 'r+') as f: 25 | state = json.load(f) 26 | state.update(updates) 27 | f.seek(0) 28 | f.truncate(0) 29 | json.dump(state, f) 30 | return state -------------------------------------------------------------------------------- /gui/static/js/dashboard.js: -------------------------------------------------------------------------------- 1 | ;(function(window, document) { 2 | 'use strict'; 3 | 4 | function getKamailioStats(elem) { 5 | $.ajax({ 6 | type: "GET", 7 | url: "/api/v1/kamailio/stats", 8 | dataType: "json", 9 | success: function(response, text_status, xhr) { 10 | var stats = response.data[0]; 11 | // set defaults if bad response 12 | stats.current = stats.current !== undefined ? stats.current : 0; 13 | stats.waiting = stats.waiting !== undefined ? stats.waiting : 0; 14 | stats.total = stats.total !== undefined ? stats.total : 0; 15 | $("#dashboard_current_calls").text(stats.current); 16 | $("#dashboard_calls_inqueue").text(stats.waiting); 17 | $("#dashboard_total_calls_processed").text(stats.total); 18 | } 19 | }); 20 | } 21 | 22 | $(document).ready(function() { 23 | getKamailioStats(); 24 | }); 25 | 26 | })(window, document); 27 | -------------------------------------------------------------------------------- /nginx/systemd/nginx-v1.service: -------------------------------------------------------------------------------- 1 | # ExecStop sends SIGQUIT to the main process 2 | # If, after 3s nginx is still running, sends SIGTERM to main process 3 | # If, after 6s nginx is still running, sends SIGKILL to all processes 4 | [Unit] 5 | Description=A high performance web server and a reverse proxy server 6 | Documentation=man:nginx(8) 7 | Requires=basic.target network.target 8 | Wants=nginx-watcher.path 9 | After=network.target network-online.target basic.target nss-lookup.target remote-fs.target 10 | DefaultDependencies=no 11 | 12 | [Service] 13 | Type=forking 14 | Environment='RUNDIR=/run/nginx' 15 | PIDFile=/run/nginx/nginx.pid 16 | ExecStartPre=/usr/bin/dsiprouter chown -certs -nginx 17 | ExecStartPre=/usr/sbin/nginx -t 18 | ExecStart=/usr/sbin/nginx 19 | ExecReload=/usr/sbin/nginx -s reload 20 | ExecStop=/bin/kill -s SIGQUIT ${MAINPID} 21 | TimeoutStopSec=3 22 | KillMode=mixed 23 | Restart=on-failure 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | -------------------------------------------------------------------------------- /nginx/systemd/nginx-v2.service: -------------------------------------------------------------------------------- 1 | # ExecStop sends SIGQUIT to the main process 2 | # If, after 3s nginx is still running, sends SIGTERM to main process 3 | # If, after 6s nginx is still running, sends SIGKILL to all processes 4 | [Unit] 5 | Description=A high performance web server and a reverse proxy server 6 | Documentation=man:nginx(8) 7 | Requires=basic.target network.target 8 | Wants=nginx-watcher.path 9 | After=network.target network-online.target basic.target nss-lookup.target remote-fs.target 10 | DefaultDependencies=no 11 | 12 | [Service] 13 | Type=forking 14 | Environment='RUNDIR=/run/nginx' 15 | PIDFile=/run/nginx/nginx.pid 16 | ExecStartPre=!-/usr/bin/dsiprouter chown -certs -nginx 17 | ExecStartPre=/usr/sbin/nginx -t 18 | ExecStart=/usr/sbin/nginx 19 | ExecReload=/usr/sbin/nginx -s reload 20 | ExecStop=/bin/kill -s SIGQUIT ${MAINPID} 21 | TimeoutStopSec=3 22 | KillMode=mixed 23 | Restart=on-failure 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the OS, Python version and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.8" 13 | # You can also specify other tool versions: 14 | # nodejs: "20" 15 | # rust: "1.70" 16 | # golang: "1.20" 17 | 18 | # Build documentation in the docs/ directory with Sphinx 19 | sphinx: 20 | configuration: docs/source/user/conf.py 21 | 22 | # Build documentation with MkDocs 23 | #mkdocs: 24 | # configuration: mkdocs.yml 25 | 26 | # Optionally build your docs in additional formats such as PDF 27 | formats: 28 | - pdf 29 | 30 | # Optional but recommended, declare the Python requirements 31 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 32 | python: 33 | install: 34 | - requirements: docs/requirements.txt -------------------------------------------------------------------------------- /kamailio/defaults/dsip_call_settings.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `dsip_call_settings`; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE `dsip_call_settings` ( 5 | `gwgroupid` INT UNSIGNED NOT NULL, 6 | `limit` INT UNSIGNED DEFAULT NULL, 7 | `timeout` INT UNSIGNED DEFAULT NULL, 8 | PRIMARY KEY (`gwgroupid`) 9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 10 | /*!40101 SET character_set_client = @saved_cs_client */; 11 | 12 | DROP TABLE IF EXISTS `dsip_call_settings_h`; 13 | DROP VIEW IF EXISTS `dsip_call_settings_h`; 14 | /*!40101 SET @saved_cs_client = @@character_set_client */; 15 | /*!40101 SET character_set_client = utf8 */; 16 | CREATE VIEW `dsip_call_settings_h` AS 17 | SELECT 18 | CAST(gwgroupid AS char) AS gwgroupid, 19 | CAST(`limit` AS char) AS `limit`, 20 | CAST(timeout AS char) AS timeout 21 | FROM dsip_call_settings; 22 | /*!40101 SET character_set_client = @saved_cs_client */; -------------------------------------------------------------------------------- /kamailio/systemd/kamailio-v1.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kamailio - the Open Source SIP Server 3 | Requires=basic.target network.target 4 | After=network.target network-online.target systemd-journald.socket basic.target 5 | After=rsyslog.service dnsmasq.service mariadb.service rtpengine.service 6 | Wants=mariadb.service 7 | DefaultDependencies=no 8 | 9 | [Service] 10 | Type=forking 11 | User=kamailio 12 | Group=kamailio 13 | PermissionsStartOnly=true 14 | Environment='RUNDIR=/run/kamailio' 15 | EnvironmentFile=/etc/default/kamailio.conf 16 | # PIDFile requires a full absolute path 17 | PIDFile=/run/kamailio/kamailio.pid 18 | # Exec* requires a full absolute path 19 | ExecStartPre=/usr/bin/dsiprouter chown -certs -kamailio 20 | ExecStart=/usr/sbin/kamailio -P $PIDFILE -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY --atexit=no 21 | Restart=on-failure 22 | # necessary for chown of control files e.g. for jsonrpcs and ctl modules 23 | AmbientCapabilities=CAP_CHOWN 24 | 25 | [Install] 26 | WantedBy=multi-user.target 27 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = /opt/dsiprouter/venv/bin/python -m sphinx 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | .PHONY: help Makefile html pdf 11 | 12 | # Put it first so that "make" without argument is like "make help". 13 | help: 14 | @$(SPHINXBUILD) -M help $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)" 15 | 16 | # Make all available formats 17 | all: html pdf 18 | 19 | # Make building pdf with rinoh easier to run 20 | pdf: 21 | @$(SPHINXBUILD) -b rinoh $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/pdf" 22 | 23 | # Make building html 24 | html: 25 | $(SPHINXBUILD) -b html $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html" 26 | 27 | # Catch-all target: route all unknown targets to Sphinx using the new 28 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 29 | %: Makefile 30 | @$(SPHINXBUILD) -M $@ $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)" $(O) -------------------------------------------------------------------------------- /testing/INVITE.sip: -------------------------------------------------------------------------------- 1 | INVITE sip:5554443333@localhost;transport=UDP SIP/2.0 2 | Via: SIP/2.0/UDP 10.0.0.140:43017;branch=z9hG4bK-d8754z-71c87a1a39321e30-1---d8754z- 3 | Max-Forwards: 70 4 | Contact: 5 | To: 6 | From: ;tag=cbe80728 7 | Call-ID: YWI1Mjk1OTBmZWEzY2EyYTg4OGFlYjQ5NzhhMWE0Y2I. 8 | CSeq: 1 INVITE 9 | Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE 10 | Content-Type: application/sdp 11 | Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri 12 | User-Agent: Z 3.3.21937 r21903 13 | Allow-Events: presence, kpml 14 | Content-Length: 282 15 | 16 | v=0 17 | o=Z 0 0 IN IP4 10.0.0.140 18 | s=Z 19 | c=IN IP4 10.0.0.140 20 | t=0 0 21 | m=audio 8000 RTP/AVP 18 3 110 8 0 98 101 22 | a=rtpmap:18 G729/8000 23 | a=fmtp:18 annexb=no 24 | a=rtpmap:110 speex/8000 25 | a=rtpmap:98 iLBC/8000 26 | a=fmtp:98 mode=20 27 | a=rtpmap:101 telephone-event/8000 28 | -------------------------------------------------------------------------------- /gui/modules/upgrade/__init__.py: -------------------------------------------------------------------------------- 1 | import re, requests 2 | 3 | import settings 4 | 5 | 6 | class UpdateUtils(): 7 | @staticmethod 8 | def get_repo_version_list(): 9 | headers = { 10 | 'Accept': 'application/vnd.github+json' 11 | } 12 | params = { 13 | "per_page": 100 14 | } 15 | r = requests.get(settings.GIT_RELEASE_URL, params=params, headers=headers) 16 | return r.json() 17 | 18 | @staticmethod 19 | def get_latest_version(): 20 | latest = { 21 | 'tag_name': '', 22 | 'ver_num': 0 23 | } 24 | for rel in UpdateUtils.get_repo_version_list(): 25 | tag_name = rel['tag_name'] 26 | ver_num = float(re.sub(r'^v([0-9]+\.[0-9]+).*?$', r'\1', tag_name, flags=re.MULTILINE)) 27 | if ver_num > latest['ver_num']: 28 | latest = { 29 | 'tag_name': tag_name, 30 | 'ver_num': ver_num 31 | } 32 | return latest 33 | -------------------------------------------------------------------------------- /resources/upgrade/v0.75/scripts/bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd /opt/dsiprouter 4 | . dsiprouter/dsip_lib.sh 5 | LC_CHECK=$(decryptConfigAttrib 'DSIP_CORE_LICENSE' /etc/dsiprouter/gui/settings.py | dd if=/dev/stdin of=/dev/stdout bs=1 count=32 2>/dev/null) 6 | (( ${#LC_CHECK} == 32 )) || { 7 | echo "a core licene is required to use the auto upgrade feature" 8 | echo "without a license the upgrade will fail" 9 | echo "you can purchase a license here: https://dopensource.com/product/dsiprouter-core/" 10 | exit 1 11 | } 12 | 13 | export BOOTSTRAPPING_UPGRADE=1 14 | export BOOTSTRAP_DIR='/tmp/dsiprouter' 15 | TAG_NAME='v0.75-rel' 16 | REPO_URL='https://github.com/dOpensource/dsiprouter.git' 17 | [[ -e "$BOOTSTRAP_DIR" ]] && rm -rf "$BOOTSTRAP_DIR" 18 | 19 | git clone --depth 1 -c advice.detachedHead=false -b "$TAG_NAME" "$REPO_URL" "$BOOTSTRAP_DIR" && 20 | mkdir -p /opt/dsiprouter/resources/upgrade/v0.75/ && 21 | cp -rf /tmp/dsiprouter/resources/upgrade/v0.75/. /opt/dsiprouter/resources/upgrade/v0.75/ && 22 | dsiprouter upgrade -rel v0.75 -------------------------------------------------------------------------------- /gui/modules/api/cron_functions.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from shared import debugException 3 | from database import startSession, DummySession, Subscribers, dSIPLeases, Gateways 4 | 5 | def cleanupLeases(): 6 | db = DummySession() 7 | 8 | try: 9 | db = startSession() 10 | 11 | Leases = db.query(dSIPLeases).filter(datetime.now() >= dSIPLeases.expiration).all() 12 | for Lease in Leases: 13 | # Remove the entry in the Subscribers table 14 | db.query(Subscribers).filter(Subscribers.id == Lease.sid).delete(synchronize_session=False) 15 | 16 | # Remove the entry in the Gateway table 17 | db.query(Gateways).filter(Gateways.gwid == Lease.gwid).delete(synchronize_session=False) 18 | 19 | # Remove the entry in the Lease table 20 | db.delete(Lease) 21 | 22 | db.commit() 23 | 24 | except Exception as ex: 25 | debugException(ex) 26 | db.rollback() 27 | db.flush() 28 | finally: 29 | db.close() 30 | -------------------------------------------------------------------------------- /resources/git/merge-changelog.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Summary: Merge driver for CHANGELOG conflicts 3 | # Author: DevOpSec 4 | # Usage: Copy gitconfig to /.git/config and gitattributes to /.gitattributes 5 | # 6 | # $1 == %O - temporary file name for the merge base (origin) 7 | # $2 == %A - temporary file name for our version (ours) 8 | # $3 == %B - temporary file name for the other branches version (theirs) 9 | # $4 == %L - conflict marker length 10 | # $5 == %P - the original path quoted for the shell 11 | # 12 | 13 | # TODO: make more elegant solution; such as diffing & merging then rewriting changelog 14 | # possible example (if no other conflicts update changelog): 15 | # 16 | #PROJECT_ROOT="$(git rev-parse --show-toplevel)" 17 | # 18 | #CONFLICTS=$(git diff --cached --name-only -S '<<<<<<') 19 | #if ! echo "$CONFLICTS" | grep -q -v 'CHANGELOG.md'; then 20 | # ${PROJECT_ROOT}/.git/hooks/post-commit 21 | #fi 22 | 23 | # For now just keep our version of CHANGELOG.md and update on next commit 24 | exit 0 25 | -------------------------------------------------------------------------------- /gui/templates/util.jinja2.html: -------------------------------------------------------------------------------- 1 | {%- macro link_tag(location) -%} 2 | 3 | {%- endmacro -%} 4 | 5 | {%- macro script_tag(location) -%} 6 | 7 | {%- endmacro -%} 8 | 9 | {%- macro tracked_link(title, url) -%} 10 | {{ title }} 11 | {%- endmacro -%} 12 | 13 | {%- macro img_tag(location, alt="", style="width:auto; height:auto;") -%} 14 | {{ alt }} 15 | {%- endmacro -%} 16 | 17 | {%- macro modal(id, label='', hidden="true", content="") -%} 18 | 25 | {%- endmacro %} 26 | 27 | -------------------------------------------------------------------------------- /gui/modules/dnid_enrichment/dnid_enrichment.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS dsip_dnid_enrich_lnp; 2 | /*!40101 SET @saved_cs_client = @@character_set_client */; 3 | /*!40101 SET character_set_client = utf8 */; 4 | CREATE TABLE dsip_dnid_enrich_lnp ( 5 | id int(10) unsigned NOT NULL AUTO_INCREMENT, 6 | dnid varchar(64) NOT NULL, 7 | country_code varchar(64) NOT NULL DEFAULT '', 8 | routing_number varchar(64) NOT NULL DEFAULT '', 9 | description varchar(128) NOT NULL DEFAULT '', 10 | PRIMARY KEY (id) 11 | ) ENGINE = InnoDB 12 | DEFAULT CHARSET = utf8; 13 | /*!40101 SET character_set_client = @saved_cs_client */; 14 | 15 | DROP TABLE IF EXISTS dsip_dnid_lnp_mapping; 16 | DROP VIEW IF EXISTS dsip_dnid_lnp_mapping; 17 | /*!40101 SET @saved_cs_client = @@character_set_client */; 18 | /*!40101 SET character_set_client = utf8 */; 19 | CREATE VIEW dsip_dnid_lnp_mapping AS 20 | SELECT dnid, CONCAT(country_code, routing_number) AS prefix, '0' AS key_type, '0' AS value_type 21 | FROM dsip_dnid_enrich_lnp; 22 | /*!40101 SET character_set_client = @saved_cs_client */; 23 | -------------------------------------------------------------------------------- /testing/17.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | unitname="Domain Pass-Thru using FreePBX" 6 | 7 | # static settings 8 | username="1001" 9 | password="1RSk8l6VGKUsl0zzUFYmIwsAIFT9qARM4vGoVB0pf88=" 10 | domain="smoketest.com" 11 | host="localhost" 12 | port="5060" 13 | externalip=$(getExternalIP) 14 | internalip=$(ip route get 8.8.8.8 | awk 'NR == 1 {print $7}') 15 | 16 | $(addPBX) 17 | $(addDomain) 18 | 19 | #Reload Kamailio Modules 20 | kamcmd domain.reload 21 | kamcmd drouting.reload 22 | 23 | # Register User 24 | # Try external ip 25 | sipsak -U -C sip:$username@home.com --from sip:$username@$domain -u $username -a $password -p $externalip:$port -s sip:$username@$domain -i -vvv >/dev/null 26 | ret=$? 27 | # Try internal ip if it fails 28 | if [ "$ret" != "0" ]; then 29 | sipsak -U -C sip:$username@home.com --from sip:$username@$domain -u $username -a $password -p $internalip:$port -s sip:$username@$domain -i -vvv >/dev/null 30 | ret=$? 31 | fi 32 | 33 | #Clean Up 34 | deletePBX 35 | deleteDomain 36 | 37 | process_result "$unitname" $ret 38 | -------------------------------------------------------------------------------- /rtpengine/systemd/rtpengine-v1.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=RTPEngine proxy for RTP and other media streams 3 | Requires=basic.target network.target 4 | After=network.target network-online.target systemd-journald.socket basic.target 5 | After=iptables.service redis.service rsyslog.service 6 | # iptables.service is required only if the RTPEngine uses its kernel module. 7 | # redis.service is required if the Redis server is working on the same machine along with the RTPEngine 8 | DefaultDependencies=no 9 | 10 | [Service] 11 | Type=simple 12 | PermissionsStartOnly=true 13 | Environment='CFGFILE=/etc/default/rtpengine.conf' 14 | Environment='RUNDIR=/run/rtpengine' 15 | # PIDFile requires an absolute path 16 | PIDFile=/run/rtpengine/rtpengine.pid 17 | # ExecStart* requires an absolute path for the program 18 | ExecStartPre=/usr/bin/dsiprouter chown -rtpengine 19 | ExecStartPre=/usr/sbin/rtpengine-start-pre $CFGFILE 20 | ExecStart=/usr/bin/rtpengine -f $OPTIONS 21 | ExecStopPost=/usr/sbin/rtpengine-stop-post $CFGFILE 22 | Restart=on-failure 23 | 24 | [Install] 25 | WantedBy=multi-user.target 26 | -------------------------------------------------------------------------------- /dnsmasq/configs/ifupdown/networking-pre.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mkdir -p /run/network/ 4 | rm -f /run/network/ifupdown.conf 2>/dev/null 5 | 6 | # check whether nmcli reports that network manager is managing the interface 7 | # ref: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/libnmc-base/nm-client-utils.c?ref_type=heads#L288 8 | NM_IFACES=$(nmcli -t -m tabular device status | awk -F ':' '$3 !~ /unmanaged|[^ ]+ \(externally\)/ {print $1}') 9 | # check whether networkctl reports that systemd-networkd is manaing the interface 10 | # ref: https://github.com/systemd/systemd/blob/e603a438a7918a2fcc35d7683fd755d3837b7024/src/network/networkd-link.c#L2918 11 | SN_IFACES=$(networkctl list --json=short | jq -r -e '.Interfaces[] | select(.AdministrativeState!="unmanaged").Name') 12 | # blacklist those managed interfaces from being managed by ifupdown 13 | EXCLUSIONS='' 14 | for IFACE in $NM_IFACES $SN_IFACES; do 15 | EXCLUSIONS="$EXCLUSIONS $IFACE ${IFACE}:*" 16 | done 17 | 18 | [ -n "$EXCLUSIONS" ] && echo "EXCLUDE_INTERFACES='$EXCLUSIONS'" >/run/network/ifupdown.conf 19 | 20 | exit 0 -------------------------------------------------------------------------------- /HA/pacemaker/DO/assign-ip: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # derived from http://do.co/ocf-floatip 4 | 5 | api_base='https://api.digitalocean.com/v2' 6 | 7 | 8 | usage() { 9 | echo "$0 " 10 | echo '' 11 | echo 'Your DigitialOcean API token must be in the "DO_TOKEN" environmental variable.' 12 | } 13 | 14 | main() { 15 | local floating_ip="$1" 16 | 17 | droplet_id=$(curl -s http://169.254.169.254/metadata/v1/id) 18 | 19 | resp=$( 20 | curl -s \ 21 | -H "Authorization: Bearer $DO_TOKEN" \ 22 | -H 'Content-type: application/json' \ 23 | -d '{"type": "assign", "droplet_id": '$droplet_id'}' \ 24 | "${api_base}/floating_ips/${floating_ip}/actions" 25 | ) 26 | msg=$(jq -e -r '.message' <<<"$resp") && { 27 | echo "$(jq -r '.id' <<<"$resp"): $msg" 28 | return 1 29 | } 30 | echo "Moving IP address: $(jq -r '.action.status' <<<"$resp")" 31 | return 0 32 | } 33 | 34 | if [[ -z "$DO_TOKEN" ]] || (( $# != 1 )); then 35 | usage 36 | exit 1 37 | fi 38 | 39 | main "$@" 40 | exit $? 41 | 42 | -------------------------------------------------------------------------------- /kamailio/systemd/kamailio-v2.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Kamailio - the Open Source SIP Server 3 | Requires=basic.target network.target 4 | After=network.target network-online.target systemd-journald.socket basic.target 5 | After=rsyslog.service dnsmasq.service mariadb.service rtpengine.service 6 | Wants=mariadb.service 7 | DefaultDependencies=no 8 | 9 | [Service] 10 | Type=forking 11 | User=kamailio 12 | Group=kamailio 13 | Environment='RUNDIR=/run/kamailio' 14 | EnvironmentFile=/etc/default/kamailio.conf 15 | EnvironmentFile=-/etc/default/kamailio.d/*.conf 16 | # PIDFile requires a full absolute path 17 | PIDFile=/run/kamailio/kamailio.pid 18 | # Exec* requires a full absolute path 19 | ExecStartPre=!-/usr/bin/dsiprouter chown -certs -kamailio 20 | ExecStart=/usr/sbin/kamailio -P $PIDFILE -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY --atexit=no 21 | Restart=on-failure 22 | # /run/kamailio in tmpfs 23 | RuntimeDirectory=kamailio 24 | RuntimeDirectoryMode=0770 25 | # necessary for chown of control files e.g. for jsonrpcs and ctl modules 26 | AmbientCapabilities=CAP_CHOWN 27 | 28 | [Install] 29 | WantedBy=multi-user.target 30 | -------------------------------------------------------------------------------- /gui/static/css/highlight/codepen-embed.css: -------------------------------------------------------------------------------- 1 | /* 2 | codepen.io Embed Theme 3 | Author: Justin Perry 4 | Original theme - https://github.com/chriskempson/tomorrow-theme 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #222; 12 | color: #fff; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #777; 18 | } 19 | 20 | .hljs-variable, 21 | .hljs-template-variable, 22 | .hljs-tag, 23 | .hljs-regexp, 24 | .hljs-meta, 25 | .hljs-number, 26 | .hljs-built_in, 27 | .hljs-builtin-name, 28 | .hljs-literal, 29 | .hljs-params, 30 | .hljs-symbol, 31 | .hljs-bullet, 32 | .hljs-link, 33 | .hljs-deletion { 34 | color: #ab875d; 35 | } 36 | 37 | .hljs-section, 38 | .hljs-title, 39 | .hljs-name, 40 | .hljs-selector-id, 41 | .hljs-selector-class, 42 | .hljs-type, 43 | .hljs-attribute { 44 | color: #9b869b; 45 | } 46 | 47 | .hljs-string, 48 | .hljs-keyword, 49 | .hljs-selector-tag, 50 | .hljs-addition { 51 | color: #8f9c6c; 52 | } 53 | 54 | .hljs-emphasis { 55 | font-style: italic; 56 | } 57 | 58 | .hljs-strong { 59 | font-weight: bold; 60 | } 61 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.amzn.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | # The following lines are desirable for IPv4 capable hosts 16 | 127.0.0.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost.localdomain localhost 18 | 127.0.0.1 localhost4.localdomain4 localhost4 19 | 20 | # The following lines are desirable for IPv6 capable hosts 21 | ::1 {{fqdn}} {{hostname}} 22 | ::1 localhost.localdomain localhost 23 | ::1 localhost6.localdomain6 localhost6 24 | 25 | #####DSIP_CONFIG_START 26 | #####DSIP_CONFIG_END 27 | 28 | #####PACEMAKER_CONFIG_START 29 | #####PACEMAKER_CONFIG_END 30 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.rhel.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | # The following lines are desirable for IPv4 capable hosts 16 | 127.0.0.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost.localdomain localhost 18 | 127.0.0.1 localhost4.localdomain4 localhost4 19 | 20 | # The following lines are desirable for IPv6 capable hosts 21 | ::1 {{fqdn}} {{hostname}} 22 | ::1 localhost.localdomain localhost 23 | ::1 localhost6.localdomain6 localhost6 24 | 25 | #####DSIP_CONFIG_START 26 | #####DSIP_CONFIG_END 27 | 28 | #####PACEMAKER_CONFIG_START 29 | #####PACEMAKER_CONFIG_END 30 | -------------------------------------------------------------------------------- /gui/modules/fusionpbx/dsiprouter-provisioner.conf: -------------------------------------------------------------------------------- 1 | upstream fusionpbx { 2 | server fusionpbx5.dsiprouter.net:443; 3 | 4 | } 5 | 6 | 7 | # handle the https requests 8 | server { 9 | # by default we listen on all interfaces 10 | listen 80; 11 | listen [::]:80; 12 | server_name _; 13 | 14 | #ssl_certificate /etc/dsiprouter/certs/dsiprouter-cert.pem; 15 | #ssl_certificate_key /etc/dsiprouter/certs/dsiprouter-key.pem; 16 | 17 | location /provision/ { 18 | proxy_pass http://fusionpbx; 19 | proxy_redirect off; 20 | proxy_set_header Host $host; 21 | proxy_next_upstream error timeout http_404 http_403 http_500 http_502 http_503 http_504 non_idempotent; 22 | } 23 | 24 | location / { 25 | 26 | error_page 404 /404.html; 27 | 28 | } 29 | 30 | location /images/ { 31 | alias /etc/nginx/html/images/; 32 | } 33 | 34 | # enable the access log for debugging 35 | # it doesn't log data between nginx and the upstream FusionPBX servers 36 | # it only logs data between the phone and nginx 37 | #access_log /var/log/nginx/dsiprouter-provisioner-access.log; 38 | } 39 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.almalinux.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | # The following lines are desirable for IPv4 capable hosts 16 | 127.0.0.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost.localdomain localhost 18 | 127.0.0.1 localhost4.localdomain4 localhost4 19 | 20 | # The following lines are desirable for IPv6 capable hosts 21 | ::1 {{fqdn}} {{hostname}} 22 | ::1 localhost.localdomain localhost 23 | ::1 localhost6.localdomain6 localhost6 24 | 25 | #####DSIP_CONFIG_START 26 | #####DSIP_CONFIG_END 27 | 28 | #####PACEMAKER_CONFIG_START 29 | #####PACEMAKER_CONFIG_END 30 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.centos.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | # The following lines are desirable for IPv4 capable hosts 16 | 127.0.0.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost.localdomain localhost 18 | 127.0.0.1 localhost4.localdomain4 localhost4 19 | 20 | # The following lines are desirable for IPv6 capable hosts 21 | ::1 {{fqdn}} {{hostname}} 22 | ::1 localhost.localdomain localhost 23 | ::1 localhost6.localdomain6 localhost6 24 | 25 | #####DSIP_CONFIG_START 26 | #####DSIP_CONFIG_END 27 | 28 | #####PACEMAKER_CONFIG_START 29 | #####PACEMAKER_CONFIG_END 30 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.debian.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file (/etc/cloud/templates/hosts.debian.tmpl) is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | {# The value '{{hostname}}' will be replaced with the local-hostname -#} 16 | 127.0.1.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost 18 | 19 | # The following lines are desirable for IPv6 capable hosts 20 | ::1 ip6-localhost ip6-loopback 21 | fe00::0 ip6-localnet 22 | ff00::0 ip6-mcastprefix 23 | ff02::1 ip6-allnodes 24 | ff02::2 ip6-allrouters 25 | ff02::3 ip6-allhosts 26 | 27 | #####DSIP_CONFIG_START 28 | #####DSIP_CONFIG_END 29 | 30 | #####PACEMAKER_CONFIG_START 31 | #####PACEMAKER_CONFIG_END 32 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.rocky.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | # The following lines are desirable for IPv4 capable hosts 16 | 127.0.0.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost.localdomain localhost 18 | 127.0.0.1 localhost4.localdomain4 localhost4 19 | 20 | # The following lines are desirable for IPv6 capable hosts 21 | ::1 {{fqdn}} {{hostname}} 22 | ::1 localhost.localdomain localhost 23 | ::1 localhost6.localdomain6 localhost6 24 | 25 | #####DSIP_CONFIG_START 26 | #####DSIP_CONFIG_END 27 | 28 | #####PACEMAKER_CONFIG_START 29 | #####PACEMAKER_CONFIG_END 30 | -------------------------------------------------------------------------------- /cloud/cloud-init/templates/hosts.ubuntu.tmpl: -------------------------------------------------------------------------------- 1 | ## template:jinja 2 | {# 3 | This file (/etc/cloud/templates/hosts.debian.tmpl) is only utilized 4 | if enabled in cloud-config. Specifically, in order to enable it 5 | you need to add the following to config: 6 | manage_etc_hosts: True 7 | -#} 8 | # Your system has configured 'manage_etc_hosts' as True. 9 | # As a result, if you wish for changes to this file to persist 10 | # then you will need to either 11 | # a.) make changes to the master file in /etc/cloud/templates/hosts.debian.tmpl 12 | # b.) change or remove the value of 'manage_etc_hosts' in 13 | # /etc/cloud/cloud.cfg or cloud-config from user-data 14 | # 15 | {# The value '{{hostname}}' will be replaced with the local-hostname -#} 16 | 127.0.1.1 {{fqdn}} {{hostname}} 17 | 127.0.0.1 localhost 18 | 19 | # The following lines are desirable for IPv6 capable hosts 20 | ::1 ip6-localhost ip6-loopback 21 | fe00::0 ip6-localnet 22 | ff00::0 ip6-mcastprefix 23 | ff02::1 ip6-allnodes 24 | ff02::2 ip6-allrouters 25 | ff02::3 ip6-allhosts 26 | 27 | #####DSIP_CONFIG_START 28 | #####DSIP_CONFIG_END 29 | 30 | #####PACEMAKER_CONFIG_START 31 | #####PACEMAKER_CONFIG_END 32 | -------------------------------------------------------------------------------- /dnsmasq/configs/ifupdown/default.conf: -------------------------------------------------------------------------------- 1 | # Configuration for networking init script being run during 2 | # the boot sequence 3 | 4 | # Set to 'no' to skip interfaces configuration on boot 5 | #CONFIGURE_INTERFACES=yes 6 | 7 | # Don't configure these interfaces. Shell wildcards supported/ 8 | #EXCLUDE_INTERFACES= 9 | 10 | # Set to 'yes' to enable additional verbosity 11 | #VERBOSE=no 12 | 13 | # Method to wait for the network to become online, 14 | # for services that depend on a working network: 15 | # - ifup: wait for ifup to have configured an interface. 16 | # - route: wait for a route to a given address to appear. 17 | # - ping/ping6: wait for a host to respond to ping packets. 18 | # - none: don't wait. 19 | #WAIT_ONLINE_METHOD=ifup 20 | 21 | # Which interface to wait for. 22 | # If none given, wait for all auto interfaces, or if there are none, 23 | # wait for at least one hotplug interface. 24 | #WAIT_ONLINE_IFACE= 25 | 26 | # Which address to wait for for route, ping and ping6 methods. 27 | # If none is given for route, it waits for a default gateway. 28 | #WAIT_ONLINE_ADDRESS= 29 | 30 | # Timeout in seconds for waiting for the network to come online. 31 | WAIT_ONLINE_TIMEOUT=30 -------------------------------------------------------------------------------- /gui/modules/fusionpbx/dsiprouter-provisioner.tpl: -------------------------------------------------------------------------------- 1 | upstream fusionpbx { 2 | ##SERVERLIST## 3 | } 4 | 5 | 6 | # handle the https requests 7 | server { 8 | # by default we listen on all interfaces 9 | listen 443 ssl http2 so_keepalive=on; 10 | listen [::]:443 ssl http2 so_keepalive=on; 11 | server_name _; 12 | 13 | ssl_certificate /etc/dsiprouter/certs/dsiprouter-cert.pem; 14 | ssl_certificate_key /etc/dsiprouter/certs/dsiprouter-key.pem; 15 | 16 | location ~^(\/app\/provision\/|\/provision\/) { 17 | proxy_pass https://fusionpbx; 18 | proxy_redirect off; 19 | proxy_set_header Host $host; 20 | proxy_next_upstream error timeout http_404 http_403 http_500 http_502 http_503 http_504 non_idempotent; 21 | } 22 | 23 | location / { 24 | 25 | error_page 404 /404.html; 26 | 27 | } 28 | 29 | location /images/ { 30 | alias /etc/nginx/html/images/; 31 | } 32 | 33 | # enable the access log for debugging 34 | # it doesn't log data between nginx and the upstream FusionPBX servers 35 | # it only logs data between the phone and nginx 36 | #access_log /var/log/nginx/dsiprouter-provisioner-access.log; 37 | } 38 | -------------------------------------------------------------------------------- /gui/static/js/transnexus.js: -------------------------------------------------------------------------------- 1 | ;(function (window, document) { 2 | 'use strict'; 3 | 4 | function updateToggle(toggle_node, settings_node) { 5 | if (toggle_node.is(":checked") || toggle_node.prop("checked")) { 6 | settings_node.removeClass("hidden"); 7 | toggle_node.val("1"); 8 | toggle_node.bootstrapToggle('on'); 9 | } 10 | else { 11 | settings_node.addClass("hidden"); 12 | toggle_node.val("0"); 13 | toggle_node.bootstrapToggle('off'); 14 | } 15 | } 16 | 17 | $(document).ready(function() { 18 | var auth_toggle = $('#toggle_auth_settings'); 19 | var auth_settings = $('#authservice_settings'); 20 | var verify_toggle = $('#toggle_verify_settings'); 21 | var verify_settings = $('#verifyservice_settings'); 22 | 23 | /* update toggle on page load */ 24 | updateToggle(auth_toggle, auth_settings); 25 | updateToggle(verify_toggle, verify_settings); 26 | /* listener for toggle changes */ 27 | auth_toggle.change(function() { 28 | updateToggle(auth_toggle, auth_settings); 29 | }); 30 | verify_toggle.change(function() { 31 | updateToggle(verify_toggle, verify_settings); 32 | }); 33 | }); 34 | 35 | })(window, document); 36 | -------------------------------------------------------------------------------- /kamailio/modules/dsiprouter/README.md: -------------------------------------------------------------------------------- 1 | ## Instructions 2 | 3 | ### assumptions 4 | 5 | - You have dSIPRouter and Kamailio installed 6 | 7 | 8 | ### clone your kamailio version's branch: 9 | 10 | ``` 11 | KAM_VERSIONL=$(kamailio -v 2>/dev/null | grep '^version:' | awk '{print $3}' | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]/\1/') 12 | rm -rf /tmp/kamailio 2>/dev/null 13 | git clone --depth 1 -c advice.detachedHead=false -b ${KAM_VERSION} https://github.com/kamailio/kamailio.git /tmp/kamailio 14 | ``` 15 | 16 | ### copy to src dir and compile: 17 | 18 | ``` 19 | DSIP_PROJECT_DIR=/opt/dsiprouter 20 | cp -rf ${DSIP_PROJECT_DIR}/kamailio/modules/dsiprouter/ /tmp/kamailio/src/modules/ 21 | cd /tmp/kamailio/src/modules/dsiprouter 22 | make 23 | ``` 24 | 25 | ### copy to deployment location: 26 | 27 | ``` 28 | MPATH=$(grep mpath /etc/kamailio/kamailio.cfg | awk 'NR==2' | awk '{print $3}') 29 | cp /tmp/kamailio/src/modules/dsiprouter/*.so $MPATH 30 | ``` 31 | 32 | ### load module in kamailio (/etc/kamailio/kamailio.cfg): 33 | 34 | ``` 35 | loadmodule "dsiprouter.so" 36 | ``` 37 | 38 | ### restart kamailio 39 | 40 | ``` 41 | systemctl restart kamailio 42 | ``` 43 | 44 | ## Notes 45 | 46 | - Anytime Kamailio is upgraded (even patch releases) you must recompile this module. 47 | -------------------------------------------------------------------------------- /resources/apt/ubuntu/20.04/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from ubuntu 20.04 (focal) release 3 | #------------------------------------------------------------------- 4 | deb https://nyc.mirrors.clouvider.net/ubuntu/ focal main restricted universe multiverse 5 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ focal main restricted universe multiverse 6 | 7 | deb https://nyc.mirrors.clouvider.net/ubuntu/ focal-security main restricted universe multiverse 8 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ focal-security main restricted universe multiverse 9 | 10 | deb https://nyc.mirrors.clouvider.net/ubuntu/ focal-updates main restricted universe multiverse 11 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ focal-updates main restricted universe multiverse 12 | 13 | deb https://nyc.mirrors.clouvider.net/ubuntu/ focal-backports main restricted universe multiverse 14 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ focal-backports main restricted universe multiverse 15 | 16 | #deb https://nyc.mirrors.clouvider.net/ubuntu/ focal-proposed main restricted universe multiverse 17 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ focal-proposed main restricted universe multiverse 18 | -------------------------------------------------------------------------------- /resources/apt/ubuntu/22.04/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from ubuntu 22.04 (jammy) release 3 | #------------------------------------------------------------------- 4 | deb https://nyc.mirrors.clouvider.net/ubuntu/ jammy main restricted universe multiverse 5 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ jammy main restricted universe multiverse 6 | 7 | deb https://nyc.mirrors.clouvider.net/ubuntu/ jammy-security main restricted universe multiverse 8 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ jammy-security main restricted universe multiverse 9 | 10 | deb https://nyc.mirrors.clouvider.net/ubuntu/ jammy-updates main restricted universe multiverse 11 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ jammy-updates main restricted universe multiverse 12 | 13 | deb https://nyc.mirrors.clouvider.net/ubuntu/ jammy-backports main restricted universe multiverse 14 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ jammy-backports main restricted universe multiverse 15 | 16 | #deb https://nyc.mirrors.clouvider.net/ubuntu/ jammy-proposed main restricted universe multiverse 17 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ jammy-proposed main restricted universe multiverse 18 | -------------------------------------------------------------------------------- /resources/apt/ubuntu/24.04/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from ubuntu 24.04 (noble) release 3 | #------------------------------------------------------------------- 4 | deb https://nyc.mirrors.clouvider.net/ubuntu/ noble main restricted universe multiverse 5 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ noble main restricted universe multiverse 6 | 7 | deb https://nyc.mirrors.clouvider.net/ubuntu/ noble-security main restricted universe multiverse 8 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ noble-security main restricted universe multiverse 9 | 10 | deb https://nyc.mirrors.clouvider.net/ubuntu/ noble-updates main restricted universe multiverse 11 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ noble-updates main restricted universe multiverse 12 | 13 | deb https://nyc.mirrors.clouvider.net/ubuntu/ noble-backports main restricted universe multiverse 14 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ noble-backports main restricted universe multiverse 15 | 16 | #deb https://nyc.mirrors.clouvider.net/ubuntu/ noble-proposed main restricted universe multiverse 17 | #deb-src https://nyc.mirrors.clouvider.net/ubuntu/ noble-proposed main restricted universe multiverse 18 | -------------------------------------------------------------------------------- /testing/18.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | . include/common 4 | 5 | unitname="DoS and SIP Security - Doesn't Block Known Carrier IP(s)" 6 | 7 | # settings 8 | source_ip="127.0.0.11" 9 | username="smoketest" 10 | host="localhost" 11 | 12 | # Add Carrier IP to address table 13 | mysql kamailio -e "insert into address values (null,8,'$source_ip',32,0,'name:Smoke Test Carrier,gwgroup:0');" 14 | 15 | # Reload the address table 16 | kamcmd permissions.addressReload >/dev/null 17 | 18 | # Send a bunch of of requests to the server 19 | sipsak -F -d -k $source_ip -e 500 -s sip:$username@$host >/dev/null 20 | 21 | sleep 1 22 | # Check the ipban htable to see if the ipaddress is being blocked after sending a 23 | # bunch of SIP requests 24 | # Using '!' to negate the return code. I want return code of 1 to negate to a 0 if the source_ip is not found in the ipban table 25 | ! kamcmd htable.dump ipban | grep -q "$source_ip" 26 | ret=$? 27 | 28 | # Clean up, remove the entry 29 | kamcmd htable.delete ipban $source_ip 30 | 31 | # TODO: Add a test to validate that the Server user agent is no longer sento 32 | 33 | # Remove IP from Carrier table 34 | mysql kamailio -e "DELETE FROM address WHERE tag LIKE '%name:Smoke Test Carrier%';" 35 | 36 | process_result "$unitname" $ret 37 | -------------------------------------------------------------------------------- /gui/static/css/highlight/github-gist.css: -------------------------------------------------------------------------------- 1 | /** 2 | * GitHub Gist Theme 3 | * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro 4 | */ 5 | 6 | .hljs { 7 | display: block; 8 | background: white; 9 | padding: 0.5em; 10 | color: #333333; 11 | overflow-x: auto; 12 | } 13 | 14 | .hljs-comment, 15 | .hljs-meta { 16 | color: #969896; 17 | } 18 | 19 | .hljs-string, 20 | .hljs-variable, 21 | .hljs-template-variable, 22 | .hljs-strong, 23 | .hljs-emphasis, 24 | .hljs-quote { 25 | color: #df5000; 26 | } 27 | 28 | .hljs-keyword, 29 | .hljs-selector-tag, 30 | .hljs-type { 31 | color: #a71d5d; 32 | } 33 | 34 | .hljs-literal, 35 | .hljs-symbol, 36 | .hljs-bullet, 37 | .hljs-attribute { 38 | color: #0086b3; 39 | } 40 | 41 | .hljs-section, 42 | .hljs-name { 43 | color: #63a35c; 44 | } 45 | 46 | .hljs-tag { 47 | color: #333333; 48 | } 49 | 50 | .hljs-title, 51 | .hljs-attr, 52 | .hljs-selector-id, 53 | .hljs-selector-class, 54 | .hljs-selector-attr, 55 | .hljs-selector-pseudo { 56 | color: #795da3; 57 | } 58 | 59 | .hljs-addition { 60 | color: #55a532; 61 | background-color: #eaffea; 62 | } 63 | 64 | .hljs-deletion { 65 | color: #bd2c00; 66 | background-color: #ffecec; 67 | } 68 | 69 | .hljs-link { 70 | text-decoration: underline; 71 | } 72 | -------------------------------------------------------------------------------- /gui/static/css/highlight/darcula.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Darcula color scheme from the JetBrains family of IDEs 4 | 5 | */ 6 | 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | background: #2b2b2b; 13 | } 14 | 15 | .hljs { 16 | color: #bababa; 17 | } 18 | 19 | .hljs-strong, 20 | .hljs-emphasis { 21 | color: #a8a8a2; 22 | } 23 | 24 | .hljs-bullet, 25 | .hljs-quote, 26 | .hljs-link, 27 | .hljs-number, 28 | .hljs-regexp, 29 | .hljs-literal { 30 | color: #6896ba; 31 | } 32 | 33 | .hljs-code, 34 | .hljs-selector-class { 35 | color: #a6e22e; 36 | } 37 | 38 | .hljs-emphasis { 39 | font-style: italic; 40 | } 41 | 42 | .hljs-keyword, 43 | .hljs-selector-tag, 44 | .hljs-section, 45 | .hljs-attribute, 46 | .hljs-name, 47 | .hljs-variable { 48 | color: #cb7832; 49 | } 50 | 51 | .hljs-params { 52 | color: #b9b9b9; 53 | } 54 | 55 | .hljs-string { 56 | color: #6a8759; 57 | } 58 | 59 | .hljs-subst, 60 | .hljs-type, 61 | .hljs-built_in, 62 | .hljs-builtin-name, 63 | .hljs-symbol, 64 | .hljs-selector-id, 65 | .hljs-selector-attr, 66 | .hljs-selector-pseudo, 67 | .hljs-template-tag, 68 | .hljs-template-variable, 69 | .hljs-addition { 70 | color: #e0c46c; 71 | } 72 | 73 | .hljs-comment, 74 | .hljs-deletion, 75 | .hljs-meta { 76 | color: #7f7f7f; 77 | } 78 | -------------------------------------------------------------------------------- /dnsmasq/systemd/dnsmasq-v1.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=dnsmasq - A lightweight DHCP and caching DNS server 3 | Requires=basic.target network.target 4 | After=network.target network-online.target basic.target 5 | Wants=nss-lookup.target 6 | Before=nss-lookup.target 7 | DefaultDependencies=no 8 | 9 | [Service] 10 | Type=forking 11 | PIDFile=/run/dnsmasq/dnsmasq.pid 12 | Environment='RUN_DIR=/run/dnsmasq' 13 | Environment='IGNORE_RESOLVCONF=yes' 14 | # make sure everything is setup correctly before starting 15 | ExecStartPre=!-/usr/bin/dsiprouter chown -dnsmasq 16 | ExecStartPre=/usr/sbin/dnsmasq --test 17 | # We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a 18 | # wrapper picking up extra configuration files and then execs dnsmasq 19 | # itself, when called with the "systemd-exec" function. 20 | ExecStart=/etc/init.d/dnsmasq systemd-exec 21 | # The systemd-*-resolvconf functions configure (and deconfigure) 22 | # resolvconf to work with the dnsmasq DNS server. They're called like 23 | # this to get correct error handling (ie don't start-resolvconf if the 24 | # dnsmasq daemon fails to start. 25 | ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf 26 | ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf 27 | ExecReload=/bin/kill -HUP $MAINPID 28 | 29 | [Install] 30 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | dsiprouter: 4 | build: 5 | context: . 6 | dockerfile: docker/dsiprouter/dockerfile 7 | image: dopensource/dsiprouter 8 | volumes: 9 | - .:/opt/dsiprouter 10 | ports: 11 | - "5000:5000" 12 | environment: 13 | - ENV=PROD 14 | - DSIP_USER=admin 15 | - DSIP_PASS=admin 16 | - DSIP_DEBUG=True 17 | - KAM_DB_HOST=dsiprouter-mysql 18 | - KAM_DB_TYPE=mysql 19 | - KAM_DB_PORT=3306 20 | - KAM_DB_NAME=kamailio 21 | - KAM_DB_USER=kamailio 22 | - KAM_DB_PASS=kamailiorw 23 | depends_on: 24 | - dsiprouter-mysql 25 | command: ["./docker/dsiprouter/wait-for-dsiprouter-mysql.sh","dsiprouter-mysql","python","dsiprouter.py","runserver"] 26 | 27 | dsiprouter-mysql: 28 | image: mysql:5.7 29 | volumes: 30 | - /tmp/dbdata:/var/lib/mysql 31 | - ./testing/sql/v0.60+ent:/docker-entrypoint-initdb.d/ 32 | ports: 33 | - "3306:3306" 34 | environment: 35 | - MYSQL_ALLOW_EMPTY_PASSWORD=yes 36 | - MYSQL_USER=kamailio 37 | - MYSQL_PASSWORD=kamailiorw 38 | - MYSQL_DATABASE=kamailio 39 | healthcheck: 40 | test: mysql --user=root -e "select * from kamailio.dr_gateways" 41 | timeout: 45s 42 | retries: 5 43 | 44 | -------------------------------------------------------------------------------- /resources/git/gitwrapper.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # git wrapper: should be sourced by a login script 3 | 4 | # extends git command functionality 5 | __gitwrapper() { 6 | local ARGS=() COMMIT_FLAG=0 REMOTE_NAME="" 7 | 8 | while (( $# > 0 )); do 9 | case "$1" in 10 | commit) 11 | ARGS+=("$1") 12 | COMMIT_FLAG=1 13 | shift 14 | ;; 15 | --remote=*) 16 | if (( ${COMMIT_FLAG} == 1 )); then 17 | REMOTE_NAME=$(printf '%s' "$1" | cut -d '=' -f 2-) 18 | else 19 | ARGS+=("$1") 20 | fi 21 | shift 22 | ;; 23 | *) 24 | ARGS+=("$1") 25 | shift 26 | ;; 27 | esac 28 | done 29 | 30 | # if default remote used we have to lookup the remote name 31 | if [[ "${REMOTE_NAME}" == "." ]]; then 32 | REMOTE_NAME=$(git config --get checkout.defaultremote) 33 | fi 34 | # if using default and not set then use origin 35 | REMOTE_NAME=${REMOTE_NAME:-origin} 36 | 37 | export REMOTE_NAME 38 | command git "${ARGS[@]}" 39 | unset REMOTE_NAME 40 | } 41 | 42 | # Shadows git cmd 43 | git() { 44 | __gitwrapper "$@" 45 | } 46 | -------------------------------------------------------------------------------- /cloud/find_hosts_tmpl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Summary: find the correct hosts template for the current environment 4 | # 5 | 6 | case "$(cloud-init query distro)" in 7 | alpine) 8 | echo '/etc/cloud/templates/hosts.alpine.tmpl' 9 | ;; 10 | arch) 11 | echo '/etc/cloud/templates/hosts.arch.tmpl' 12 | ;; 13 | debian|ubuntu) 14 | echo '/etc/cloud/templates/hosts.debian.tmpl' 15 | ;; 16 | freebsd|dragonfly) 17 | echo '/etc/cloud/templates/hosts.freebsd.tmpl' 18 | ;; 19 | gentoo|cos) 20 | echo '/etc/cloud/templates/hosts.gentoo.tmpl' 21 | ;; 22 | netbsd) 23 | echo '/etc/cloud/templates/hosts.netbsd.tmpl' 24 | ;; 25 | openbsd) 26 | echo '/etc/cloud/templates/hosts.openbsd.tmpl' 27 | ;; 28 | almalinux|amazon|centos|cloudlinux|eurolinux|fedora|mariner|miraclelinux|openmandriva|photon|rhel|rocky|virtuozzo) 29 | echo '/etc/cloud/templates/hosts.redhat.tmpl' 30 | ;; 31 | opensuse|opensuse-leap|opensuse-microos|opensuse-tumbleweed|sle_hpc|sle-micro|sles|suse) 32 | echo '/etc/cloud/templates/hosts.suse.tmpl' 33 | ;; 34 | openeuler) 35 | echo '/etc/cloud/templates/hosts.openeuler.tmpl' 36 | ;; 37 | OpenCloudOS|TencentOS) 38 | echo '/etc/cloud/templates/hosts.OpenCloudOS.tmpl' 39 | ;; 40 | *) 41 | echo '/etc/cloud/templates/hosts.tmpl' 42 | ;; 43 | esac 44 | -------------------------------------------------------------------------------- /rtpengine/systemd/rtpengine-v3.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=RTPEngine proxy for RTP and other media streams 3 | Requires=basic.target network.target 4 | After=network.target network-online.target systemd-journald.socket basic.target 5 | After=iptables.service redis.service rsyslog.service 6 | # iptables.service is required only if the RTPEngine uses its kernel module. 7 | # redis.service is required if the Redis server is working on the same machine along with the RTPEngine 8 | DefaultDependencies=no 9 | 10 | [Service] 11 | Type=forking 12 | EnvironmentFile=/etc/default/rtpengine.conf 13 | User=rtpengine 14 | Group=rtpengine 15 | # runtime only directory /run/rtpengine 16 | RuntimeDirectory=rtpengine 17 | RuntimeDirectoryMode=0770 18 | # PIDFile requires an absolute path 19 | PIDFile=/run/rtpengine/rtpengine.pid 20 | # process capabilities 21 | AmbientCapabilities=CAP_NET_ADMIN CAP_SYS_NICE 22 | CapabilityBoundingSet=CAP_NET_ADMIN CAP_SYS_NICE 23 | # ExecStart* requires an absolute path for the program 24 | ExecStartPre=!-/usr/bin/dsiprouter chown -rtpengine 25 | ExecStartPre=+/usr/sbin/ngcp-rtpengine-iptables-setup start 26 | ExecStart=/usr/bin/rtpengine --config-file=${CONFIG_FILE} --pidfile=${PID_FILE} 27 | ExecStopPost=+/usr/sbin/ngcp-rtpengine-iptables-setup stop 28 | Restart=on-failure 29 | 30 | [Install] 31 | WantedBy=multi-user.target 32 | -------------------------------------------------------------------------------- /rtpengine/systemd/rtpengine-v2.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=RTPEngine proxy for RTP and other media streams 3 | Requires=basic.target network.target 4 | After=network.target network-online.target systemd-journald.socket basic.target 5 | After=iptables.service redis.service rsyslog.service 6 | # iptables.service is required only if the RTPEngine uses its kernel module. 7 | # redis.service is required if the Redis server is working on the same machine along with the RTPEngine 8 | DefaultDependencies=no 9 | 10 | [Service] 11 | Type=forking 12 | PermissionsStartOnly=true 13 | EnvironmentFile=/etc/default/rtpengine.conf 14 | User=rtpengine 15 | Group=rtpengine 16 | # runtime only directory /run/rtpengine 17 | RuntimeDirectory=rtpengine 18 | RuntimeDirectoryMode=0770 19 | # PIDFile requires an absolute path 20 | PIDFile=/run/rtpengine/rtpengine.pid 21 | # process capabilities 22 | AmbientCapabilities=CAP_NET_ADMIN CAP_SYS_NICE 23 | CapabilityBoundingSet=CAP_NET_ADMIN CAP_SYS_NICE 24 | # ExecStart* requires an absolute path for the program 25 | ExecStartPre=/usr/bin/dsiprouter chown -rtpengine 26 | ExecStartPre=/usr/sbin/ngcp-rtpengine-iptables-setup start 27 | ExecStart=/usr/bin/rtpengine --config-file=${CONFIG_FILE} --pidfile=${PID_FILE} 28 | ExecStopPost=/usr/sbin/ngcp-rtpengine-iptables-setup stop 29 | Restart=on-failure 30 | 31 | [Install] 32 | WantedBy=multi-user.target 33 | -------------------------------------------------------------------------------- /nginx/configs/dsiprouter.conf: -------------------------------------------------------------------------------- 1 | # setup the dsiprouter server group (using unix sockets) 2 | # if multiple instances are running they can be configured here 3 | upstream dsiprouter { 4 | server unix:DSIP_UNIX_SOCK; 5 | } 6 | 7 | # handle the https requests 8 | server { 9 | # by default we listen on all interfaces 10 | listen DSIP_PORT ssl http2 so_keepalive=on; 11 | listen [::]:DSIP_PORT ssl http2 so_keepalive=on; 12 | server_name _; 13 | 14 | ssl_certificate DSIP_SSL_CERT; 15 | ssl_certificate_key DSIP_SSL_KEY; 16 | 17 | # reverse proxy for dsiprouter 18 | location / { 19 | proxy_pass http://dsiprouter; 20 | proxy_http_version 1.1; 21 | proxy_cache_bypass $http_upgrade; 22 | proxy_set_header Upgrade $http_upgrade; 23 | proxy_set_header Connection "upgrade"; 24 | proxy_set_header Host $host; 25 | proxy_set_header X-Real-IP $remote_addr; 26 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 27 | proxy_set_header X-Forwarded-Proto $scheme; 28 | proxy_set_header X-Forwarded-Host $host; 29 | proxy_set_header X-Forwarded-Port $server_port; 30 | } 31 | 32 | location /stirshaken_certs { 33 | alias /etc/dsiprouter/certs/stirshaken; 34 | } 35 | 36 | 37 | # redirect http to https 38 | error_page 497 https://$host:DSIP_PORT$request_uri; 39 | } -------------------------------------------------------------------------------- /testing/README.md: -------------------------------------------------------------------------------- 1 | # Testing dSIPRouter 2 | 3 | This directory contains a number of scripts that contains Unit Test for testing dSIPRouter 4 | functionality. 5 | 6 | ## Execute all Unit Tests 7 | 8 | ``` 9 | make all 10 | ``` 11 | 12 | ## Execute a Single Unit Tests 13 | 14 | ``` 15 | make run UNIT=1.sh 16 | ``` 17 | 18 | ## List of Unit Tests 19 | 20 | Contains the Unittest number and a description of what the tests validates 21 | 22 | | Unittest Number | Test Description | 23 | |:-------------------------:|:----------------------------------------:| 24 | |0|syslog is started| 25 | |1|mysql is started| 26 | |2|dsip-init is started| 27 | |3|kamailio is started| 28 | |4|dsiprouter is started| 29 | |5|rtpengine is started| 30 | |6|PBX and Endpoint Registration| 31 | |7|SIP INVITE with Username/Password Auth| 32 | |8|DoS and SIP Security - Block Unknown IP| 33 | |9|CDR data is stored on SIP INVITE **(dev)**| 34 | |10|AWS instance deployment requirements satisfied| 35 | |11|dSIPRouter GUI login| 36 | |12|dSIP Custom Routing| 37 | |13|FusionPBX Sync Module| 38 | |14|Domain Auth| 39 | |15|Flowroute DID Sync Module| 40 | |16|Sending JSONRPC Commands to Kamailio| 41 | |17|Domain Pass-Thru using FreePBX| 42 | |18|DoS and SIP Security - Doesn't Block Known Carrier IP(s)| 43 | |19|dSIPRouter API| 44 | |20|DNSmasq is started| 45 | |21|DNS Resolver Test| 46 | **More to come 47 | -------------------------------------------------------------------------------- /gui/static/css/highlight/monokai-sublime.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #23241f; 12 | } 13 | 14 | .hljs, 15 | .hljs-tag, 16 | .hljs-subst { 17 | color: #f8f8f2; 18 | } 19 | 20 | .hljs-strong, 21 | .hljs-emphasis { 22 | color: #a8a8a2; 23 | } 24 | 25 | .hljs-bullet, 26 | .hljs-quote, 27 | .hljs-number, 28 | .hljs-regexp, 29 | .hljs-literal, 30 | .hljs-link { 31 | color: #ae81ff; 32 | } 33 | 34 | .hljs-code, 35 | .hljs-title, 36 | .hljs-section, 37 | .hljs-selector-class { 38 | color: #a6e22e; 39 | } 40 | 41 | .hljs-strong { 42 | font-weight: bold; 43 | } 44 | 45 | .hljs-emphasis { 46 | font-style: italic; 47 | } 48 | 49 | .hljs-keyword, 50 | .hljs-selector-tag, 51 | .hljs-name, 52 | .hljs-attr { 53 | color: #f92672; 54 | } 55 | 56 | .hljs-symbol, 57 | .hljs-attribute { 58 | color: #66d9ef; 59 | } 60 | 61 | .hljs-params, 62 | .hljs-class .hljs-title { 63 | color: #f8f8f2; 64 | } 65 | 66 | .hljs-string, 67 | .hljs-type, 68 | .hljs-built_in, 69 | .hljs-builtin-name, 70 | .hljs-selector-id, 71 | .hljs-selector-attr, 72 | .hljs-selector-pseudo, 73 | .hljs-addition, 74 | .hljs-variable, 75 | .hljs-template-variable { 76 | color: #e6db74; 77 | } 78 | 79 | .hljs-comment, 80 | .hljs-deletion, 81 | .hljs-meta { 82 | color: #75715e; 83 | } 84 | -------------------------------------------------------------------------------- /gui/sysloginit.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import settings 3 | from logging.handlers import SysLogHandler 4 | from copy import copy 5 | 6 | def initSyslogLogger(): 7 | """ 8 | Configure syslog loggers 9 | :return: syslog log handler 10 | """ 11 | # close any zombie handlers for root logger 12 | for handler in copy(logging.getLogger().handlers): 13 | logging.getLogger().removeHandler(handler) 14 | handler.close() 15 | 16 | # create our own custom formatter and handler for syslog 17 | log_formatter = logging.Formatter('[%(asctime)s] [%(process)d->%(thread)d] [%(levelname)s]: %(message)s', 18 | datefmt='%Y-%m-%d %H:%M:%S') 19 | log_handler = logging.handlers.SysLogHandler(address="/dev/log", facility=settings.DSIP_LOG_FACILITY) 20 | log_handler.setLevel(settings.DSIP_LOG_LEVEL) 21 | log_handler.setFormatter(log_formatter) 22 | 23 | # set log handler for our dsiprouter app 24 | logging.getLogger().setLevel(settings.DSIP_LOG_LEVEL) 25 | logging.getLogger().addHandler(log_handler) 26 | 27 | # redirect stderr and stdout to syslog 28 | # if not settings.DEBUG: 29 | # sys.stderr = StreamLogger(level=logging.WARNING) 30 | # sys.stdout = StreamLogger(level=logging.DEBUG) 31 | 32 | return log_handler 33 | 34 | # import this file to setup logging 35 | # syslog handler created globally 36 | # syslog_handler = initSyslogLogger() 37 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/default.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Include a summary of the changes and the related issue. 4 | Include relevant motivation and context. 5 | List any dependencies that are required for this change. 6 | 7 | ## Type of change 8 | 9 | Please delete options that are not relevant. 10 | 11 | - [ ] Bug fix (non-breaking change which fixes an issue) 12 | - [ ] New feature (non-breaking change which adds functionality) 13 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 14 | - [ ] This change requires a documentation update 15 | 16 | ## How Has This Been Tested? 17 | 18 | Describe the tests that you ran to verify your changes. 19 | Provide instructions that we can use to reproduce your results. 20 | List any relevant details for your test configuration. 21 | 22 | - [ ] Test Script Committed 23 | - [ ] Instructions Provided Below 24 | 25 | **Test Configuration**: 26 | * Hardware: 27 | * OS/Distro: 28 | * Software: 29 | 30 | ## Checklist: 31 | 32 | - [ ] My code follows the Contributing guidelines of this project 33 | - [ ] This PR is not a duplicate of another open PR? 34 | - [ ] I have performed a self-review of my code 35 | - [ ] I have made corresponding changes to the documentation 36 | - [ ] I have added tests that prove my fix is effective or that my feature works 37 | - [ ] New and existing unit tests pass locally with my changes 38 | - [ ] My code passes integration testing on a live system 39 | -------------------------------------------------------------------------------- /gui/static/css/highlight/googlecode.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Google Code style (c) Aahan Krish 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: white; 12 | color: black; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #800; 18 | } 19 | 20 | .hljs-keyword, 21 | .hljs-selector-tag, 22 | .hljs-section, 23 | .hljs-title, 24 | .hljs-name { 25 | color: #008; 26 | } 27 | 28 | .hljs-variable, 29 | .hljs-template-variable { 30 | color: #660; 31 | } 32 | 33 | .hljs-string, 34 | .hljs-selector-attr, 35 | .hljs-selector-pseudo, 36 | .hljs-regexp { 37 | color: #080; 38 | } 39 | 40 | .hljs-literal, 41 | .hljs-symbol, 42 | .hljs-bullet, 43 | .hljs-meta, 44 | .hljs-number, 45 | .hljs-link { 46 | color: #066; 47 | } 48 | 49 | .hljs-title, 50 | .hljs-doctag, 51 | .hljs-type, 52 | .hljs-attr, 53 | .hljs-built_in, 54 | .hljs-builtin-name, 55 | .hljs-params { 56 | color: #606; 57 | } 58 | 59 | .hljs-attribute, 60 | .hljs-subst { 61 | color: #000; 62 | } 63 | 64 | .hljs-formula { 65 | background-color: #eee; 66 | font-style: italic; 67 | } 68 | 69 | .hljs-selector-id, 70 | .hljs-selector-class { 71 | color: #9B703F 72 | } 73 | 74 | .hljs-addition { 75 | background-color: #baeeba; 76 | } 77 | 78 | .hljs-deletion { 79 | background-color: #ffc8bd; 80 | } 81 | 82 | .hljs-doctag, 83 | .hljs-strong { 84 | font-weight: bold; 85 | } 86 | 87 | .hljs-emphasis { 88 | font-style: italic; 89 | } 90 | -------------------------------------------------------------------------------- /gui/templates/license_required.html: -------------------------------------------------------------------------------- 1 | {% extends 'fullwidth_layout.html' %} 2 | 3 | {% block title %}License Required{% endblock %} 4 | 5 | {% block custom_css %} 6 | {% endblock %} 7 | 8 | {% block body %} 9 | 10 | {% set dopensource_url = 'https://dopensource.com' %} 11 | {% set dsiprouter_licenses_url = dopensource_url + "/product-category/dsiprouter/" %} 12 | 13 |
14 |
15 |

Acesss Denied: License Required

16 |
17 | 18 | {% if msg is not none %} 19 |
20 |

Detailed Information: {{ msg }}

21 |
22 | {% endif %} 23 | 24 |
25 | 26 |
27 |

A license is required to access this resource.

28 |

You can purchase licenses at dopensource.com.

29 |

Once purchased, activate the license key using the dSIPRouter license manager.

30 |
31 |
32 | 33 | {% endblock %} 34 | 35 | {% block custom_js %} 36 | 46 | {% endblock %} 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report unexpected program behavior to help us improve 4 | title: "[BUG] Your Issue Name Here" 5 | labels: bug, needs validation 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | Add any applicable logs as well; such as an `dsiprouter.log`, or `kamailio.log`, etc... 26 | 27 | **Server Info:** 28 | - OS: *output from* `uname -a` 29 | - Distro: *output from* `cat /etc/os-release` 30 | - dSIPRouter Version: *output from* `dsiprouter version` 31 | *If not on a release version include the branch name and last commit id* 32 | - Kamailio Version: *output from* `kamailio -v` 33 | - RTPengine Version: *output from* `rtpengine -v` 34 | - Python Package Versions: *if applicable, include output from* `/opt/dsiprouter/venv/bin/python -m pip freeze` 35 | 36 | **Client Info:** 37 | - Device: *e.g. Polycom VVX 350, Lenovo Thinkpad X1, ..* 38 | - OS: *e.g. Windows 11, Ubuntu 22.04, ..* 39 | - Client Software: *e.g. Mozilla Firefox 103.0, Zoiper 5.5.13, ..* 40 | 41 | **Additional context** 42 | Add any other context about the problem here. 43 | -------------------------------------------------------------------------------- /dsiprouter/pbkdf2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Inspired By: https://gist.github.com/grondilu/abe50de34f6c838dbc9388fe797ea4e4 4 | # Credit to: https://github.com/stayradiated/pbkdf2-sha512 5 | # Copyright (c) 2014, JP Richardson Copyright (c) 2010-2011 Intalio Pte, All Rights Reserved 6 | # Original Author: Lucien Grondin, 2022 7 | 8 | declare hash_name="$1" key_str="$2" salt_str="$3" 9 | declare -ai key salt u t block1 dk 10 | declare -i hLen="$(openssl dgst "-$hash_name" -binary <<<"foo" |wc -c)" 11 | declare -i iterations=$4 dkLen=${5:-hLen} 12 | declare -i i j k l=$(( (dkLen+hLen-1)/hLen )) 13 | 14 | for ((i=0; i<${#key_str}; i++)); do 15 | printf -v "key[$i]" "%d" "'${key_str:i:1}" 16 | done 17 | 18 | for ((i=0; i<${#salt_str}; i++)); do 19 | printf -v "salt[$i]" "%d" "'${salt_str:i:1}" 20 | done 21 | 22 | block1=(${salt[@]} 0 0 0 0) 23 | 24 | step() { 25 | printf '%02x' "$@" | 26 | xxd -p -r | 27 | openssl dgst -"$hash_name" -hmac "$key_str" -binary | 28 | xxd -p -c 1 | 29 | sed 's/^/0x/' 30 | } 31 | 32 | for ((i=1;i<=l;i++)); do 33 | for k in {0..3}; do 34 | block1[${#salt[@]}+$k]=$((i >> (8*(3-k)) & 0xff)) 35 | done 36 | 37 | u=($(step "${block1[@]}")) 38 | t=(${u[@]}) 39 | for ((j=1; j [] 7 | # supported modules: 8 | # api 9 | # cdr 10 | # fusionpbx 11 | # supported commands: 12 | # api - cleanleases 13 | # - synclicenses 14 | # cdr - sendreport 15 | # fusionpbx - sync 16 | # 17 | 18 | import sys 19 | 20 | 21 | if __name__ == '__main__': 22 | args = sys.argv[1:] 23 | if len(args) < 2: 24 | sys.exit(1) 25 | mod = args.pop(0) 26 | cmd = args.pop(0) 27 | 28 | if mod == 'api': 29 | if cmd == 'cleanleases': 30 | from modules.api.cron_functions import cleanupLeases 31 | cleanupLeases() 32 | sys.exit(0) 33 | elif cmd == 'synclicenses': 34 | from modules.api.licensemanager.functions import syncLicensesToGlobalState 35 | syncLicensesToGlobalState() 36 | sys.exit(0) 37 | 38 | elif mod == 'cdr': 39 | if cmd == 'sendreport' and len(args) > 0: 40 | from modules.cdr.cron_functions import sendCdrReport 41 | gwgroupid = args[0] 42 | sendCdrReport(gwgroupid) 43 | sys.exit(0) 44 | 45 | elif mod == 'fusionpbx': 46 | if cmd == 'sync': 47 | from modules.fusionpbx.fusionpbx_sync_functions import run_sync 48 | import settings 49 | run_sync(settings) 50 | sys.exit(0) 51 | 52 | sys.exit(1) 53 | -------------------------------------------------------------------------------- /gui/static/css/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /gui/static/js/highlight/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /dsiprouter/systemd/dsiprouter-v2.service: -------------------------------------------------------------------------------- 1 | # Utilzing Type=simple while main process is still single threaded 2 | # Main process is managed via signals from systemd (stop/reload data/etc..) 3 | # When stopping the service a SIGTERM is sent immediately, to the main process 4 | # If, after 3s dsiprouter is still running, sends SIGKILL to all process 5 | # 6 | # The following are updated dynamically on install and should not be changed here: 7 | # Environment=DSIP_PROJECT_DIR 8 | # Environment=DSIP_RUN_DIR 9 | # Environment=DSIP_SYSTEM_CONFIG_DIR 10 | [Unit] 11 | Description=dSIPRouter Service 12 | DefaultDependencies=no 13 | Requires=basic.target network.target 14 | After=network.target network-online.target systemd-journald.socket basic.target 15 | After=rsyslog.service mariadb.service nginx.service kamailio.service 16 | Wants=nginx.service mariadb.service kamailio.service 17 | StartLimitIntervalSec=30 18 | StartLimitBurst=3 19 | 20 | [Service] 21 | Type=simple 22 | User=dsiprouter 23 | Group=dsiprouter 24 | Environment='DSIP_PROJECT_DIR=/opt/dsiprouter' 25 | Environment='DSIP_RUN_DIR=/run/dsiprouter' 26 | Environment='DSIP_SYSTEM_CONFIG_DIR=/etc/dsiprouter' 27 | EnvironmentFile=-/etc/defaults/dsiprouter.conf 28 | EnvironmentFile=-/etc/defaults/dsiprouter.d/*.conf 29 | # PIDFile requires an absolute path 30 | PIDFile=/run/dsiprouter/dsiprouter.pid 31 | # ExecStart* requires an absolute path for the program 32 | ExecStartPre=!-/usr/bin/dsiprouter chown -dsiprouter 33 | ExecStart=/usr/bin/dsiprouter exec 34 | TimeoutStopSec=3 35 | KillMode=mixed 36 | Restart=on-failure 37 | 38 | [Install] 39 | WantedBy=multi-user.target 40 | -------------------------------------------------------------------------------- /docs/source/user/pbxs_and_endpoints.rst: -------------------------------------------------------------------------------- 1 | PBX(s) and Endpoints 2 | ====================== 3 | 4 | 5 | 6 | Allows you to define a PBX or Endpoint that will send or receive calls from dSIPRouter. The PBX or Endpoint can use IP 7 | authentication or a username/password can be defined. 8 | 9 | 10 | 11 | To add an Endpoint Group: 12 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 13 | 14 | 1) Click on Endpoints Groups. 15 | 16 | 17 | 18 | 2) Click on the green Add button. 19 | 20 | .. image:: images//dSIP_PBX_Add.png 21 | :align: center 22 | 23 | 3) Configure the Endpoint Group 24 | 25 | The Endpoint Tab is where you specify the endpoints that will be signaling 26 | with dSIPRouter. The weight field allows you to define how much SIP traffic 27 | is distributed to a particular endpoint. If you don't specify a weight for an endpoint 28 | the system will automatically generate a weight. If you are using FusionPBX Domain 29 | Auth then Register and INVITE requests will be distributed to the endpoints based 30 | upon the weights. You will also have the option to route Inbound calls to the 31 | endpoints based on the weights by selecting the name of the Endpoint Group with 32 | an LB concatenated to the name. For example, if the name of the Endpoint Group is 33 | **PBXCluster** then you would select **PBXCluster LB** from the Inbound Mapping 34 | Endpoint Group drop down. 35 | 36 | b) Click the green Add button. 37 | 38 | .. image:: images//dSIP_PBX_ADD_New_PBX.png 39 | :align: center 40 | 41 | 42 | 43 | 4) Click on the Reload Kamailio button in order for the changes to be updated. 44 | -------------------------------------------------------------------------------- /gui/modules/flowroute/__init__.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import settings 3 | 4 | # TODO: automate route setup and ip auth config in flowroute 5 | 6 | class Numbers(): 7 | """ 8 | Contains methods for accessing the flowroute Numbers api 9 | """ 10 | 11 | def __init__(self): 12 | self.auth = (settings.FLOWROUTE_ACCESS_KEY, settings.FLOWROUTE_SECRET_KEY) 13 | self.api_url = settings.FLOWROUTE_API_ROOT_URL + "/numbers" 14 | 15 | def __del__(self): 16 | self.auth = None 17 | self.api_url = None 18 | 19 | def getNumbers(self, starts_with=None, contains=None, ends_with=None, limit=1000000, offset=None): 20 | """ 21 | Get flowroute DID's associated with accnt 22 | 23 | .. seealso:: `flowroute list numbers `_ 24 | :param starts_with: match numbers starting with.. 25 | :param contains: match numbers containing.. 26 | :param ends_with: match numbers ending with.. 27 | :param limit: limit of matched numbers 28 | :param offset: offsets list of numbers returned 29 | :return: list(*str) 30 | """ 31 | payload = { 32 | 'starts_with': starts_with, 33 | 'contains': contains, 34 | 'ends_with': ends_with, 35 | 'limit': limit, 36 | 'offset': offset 37 | } 38 | resp = requests.get(self.api_url, auth=self.auth, params=payload) 39 | resp.raise_for_status() 40 | return [num['attributes']['value'] for num in resp.json()['data']] 41 | -------------------------------------------------------------------------------- /resources/apt/debian/10/official-releases.list: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------- 2 | # packages from debian 10 (buster) release 3 | #------------------------------------------------------------------- 4 | deb https://deb.debian.org/debian/ buster main contrib non-free 5 | #deb-src https://deb.debian.org/debian/ buster main contrib non-free 6 | 7 | deb https://deb.debian.org/debian/ buster-updates main contrib non-free 8 | #deb-src https://deb.debian.org/debian/ buster-updates main contrib non-free 9 | 10 | deb https://deb.debian.org/debian/ buster-backports main contrib non-free 11 | #deb-src https://deb.debian.org/debian/ buster-backports main contrib non-free 12 | 13 | deb https://deb.debian.org/debian-security/ buster/updates main 14 | #deb-src https://deb.debian.org/debian-security/ buster/updates main 15 | 16 | #------------------------------------------------------------------- 17 | # packages from debian 11 (bullseye) release 18 | #------------------------------------------------------------------- 19 | deb https://deb.debian.org/debian/ bullseye main contrib non-free 20 | #deb-src https://deb.debian.org/debian/ bullseye main contrib non-free 21 | 22 | deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free 23 | #deb-src https://deb.debian.org/debian/ bullseye-updates main contrib non-free 24 | 25 | deb https://deb.debian.org/debian/ bullseye-backports main 26 | #deb-src https://deb.debian.org/debian/ bullseye-backports main 27 | 28 | deb https://deb.debian.org/debian-security/ bullseye-security main 29 | #deb-src https://deb.debian.org/debian-security/ bullseye-security main 30 | -------------------------------------------------------------------------------- /gui/static/css/highlight/idea.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Intellij Idea-like styling (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #000; 12 | background: #fff; 13 | } 14 | 15 | .hljs-subst, 16 | .hljs-title { 17 | font-weight: normal; 18 | color: #000; 19 | } 20 | 21 | .hljs-comment, 22 | .hljs-quote { 23 | color: #808080; 24 | font-style: italic; 25 | } 26 | 27 | .hljs-meta { 28 | color: #808000; 29 | } 30 | 31 | .hljs-tag { 32 | background: #efefef; 33 | } 34 | 35 | .hljs-section, 36 | .hljs-name, 37 | .hljs-literal, 38 | .hljs-keyword, 39 | .hljs-selector-tag, 40 | .hljs-type, 41 | .hljs-selector-id, 42 | .hljs-selector-class { 43 | font-weight: bold; 44 | color: #000080; 45 | } 46 | 47 | .hljs-attribute, 48 | .hljs-number, 49 | .hljs-regexp, 50 | .hljs-link { 51 | font-weight: bold; 52 | color: #0000ff; 53 | } 54 | 55 | .hljs-number, 56 | .hljs-regexp, 57 | .hljs-link { 58 | font-weight: normal; 59 | } 60 | 61 | .hljs-string { 62 | color: #008000; 63 | font-weight: bold; 64 | } 65 | 66 | .hljs-symbol, 67 | .hljs-bullet, 68 | .hljs-formula { 69 | color: #000; 70 | background: #d0eded; 71 | font-style: italic; 72 | } 73 | 74 | .hljs-doctag { 75 | text-decoration: underline; 76 | } 77 | 78 | .hljs-variable, 79 | .hljs-template-variable { 80 | color: #660e7a; 81 | } 82 | 83 | .hljs-addition { 84 | background: #baeeba; 85 | } 86 | 87 | .hljs-deletion { 88 | background: #ffc8bd; 89 | } 90 | 91 | .hljs-emphasis { 92 | font-style: italic; 93 | } 94 | 95 | .hljs-strong { 96 | font-weight: bold; 97 | } 98 | -------------------------------------------------------------------------------- /gui/modules/frauddetection/fraud.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from pyspark.sql import SQLContext 3 | from pyspark.sql import SparkSession 4 | from pyspark.ml.linalg import DenseVector 5 | from pyspark.sql import functions as F 6 | import pyspark.sql.types as T 7 | 8 | spark = SparkSession \ 9 | .builder \ 10 | .appName("Python Spark SQL basic example") \ 11 | .config("spark.driver.extraClassPath", "/usr/share/java/mysql-connector-java.jar") \ 12 | .config("spark.executor.extraClassPath", "/usr/share/java/mysql-connector-java.jar") \ 13 | .config("spark.pyspark.python","/usr/bin/python3.6") \ 14 | .getOrCreate() 15 | 16 | sc = spark.sparkContext 17 | 18 | sqlContext = SQLContext(sc) 19 | 20 | url = "jdbc:mysql://localhost:3306/kamailio?user=kamailio;password=kamailiorw" 21 | 22 | df = sqlContext \ 23 | .read \ 24 | .format("jdbc") \ 25 | .option("url", url) \ 26 | .option("dbtable", "cdrs") \ 27 | .option("user","kamailio") \ 28 | .option("password", "kamailiorw") \ 29 | .load() 30 | 31 | df.printSchema() 32 | 33 | df1 = df.select("fraud","src_username","dst_username","call_start_time") 34 | 35 | df1.show() 36 | 37 | def removeTechPrefix(col): 38 | techprefix,dst_username = col.split("*") 39 | return dst_username 40 | 41 | my_udf = F.UserDefinedFunction(removeTechPrefix, T.StringType()) 42 | 43 | df2=df1.withColumn("dst_username",my_udf(df1.dst_username)) 44 | df2=df2.withColumn("call_start_time",F.hour(df2.call_start_time)) 45 | 46 | df2.show() 47 | 48 | input_data = df2.rdd.map(lambda x: (x[0],DenseVector(x[1:]))) 49 | 50 | df3 = spark.createDataFrame(input_data, ["label", "features"]) 51 | 52 | df3.show() 53 | -------------------------------------------------------------------------------- /docs/source/user/supported_configurations.rst: -------------------------------------------------------------------------------- 1 | .. _supported_configurations 2 | 3 | Supported Configurations 4 | ======================== 5 | 6 | Pass Thru to PBX Authentication Supported Configurations 7 | -------------------------------------------------------- 8 | 9 | ================ ================= =========== ================= ================ ========================================================= 10 | PBX Distribution PBX Version Driver Type Registration Test Ext to Ext Test Notes 11 | ================ ================= =========== ================= ================ ========================================================= 12 | FreePBX Asterisk 13.22.0 chan_sip Pass Pass see :ref:`enabling-the-path-header-for-asterisk-chan_sip` 13 | FreePBX Asterisk 13.22.0 chan_pjsip Pass Not Tested suppport_path needs to be enabled 14 | FusionPBX FreeSWITCH 1.6 Sofia Pass Pass 15 | ================ ================= =========== ================= ================ ========================================================= 16 | 17 | .. _enabling-the-path-header-for-asterisk-chan_sip: 18 | 19 | Enabling the Path Header for Asterisk chan_sip 20 | ---------------------------------------------- 21 | 22 | 1. Login into the FreePBX Admin GUI 23 | 2. Click Settings -> Asterisk SIP Settings 24 | 3. Click Chan SIP Settings 25 | 4. Find the "Other SIP Settings" field 26 | 5. Add the following field and click "Add Field" 27 | 28 | supportpath = yes 29 | 30 | 6. Click Submit 31 | 7. Click the red "Apply" settings button at the very top of the page 32 | -------------------------------------------------------------------------------- /gui/static/css/bootstrap-toggle.min.css: -------------------------------------------------------------------------------- 1 | /*! ======================================================================== 2 | * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 3 | * http://www.bootstraptoggle.com 4 | * ======================================================================== 5 | * Copyright 2014 Min Hur, The New York Times Company 6 | * Licensed under MIT 7 | * ======================================================================== */ 8 | .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} 9 | .toggle{position:relative;overflow:hidden} 10 | .toggle input[type=checkbox]{display:none} 11 | .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} 12 | .toggle.off .toggle-group{left:-100%} 13 | .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} 14 | .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} 15 | .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} 16 | .toggle.btn{min-width:59px;min-height:34px} 17 | .toggle-on.btn{padding-right:24px} 18 | .toggle-off.btn{padding-left:24px} 19 | .toggle.btn-lg{min-width:79px;min-height:45px} 20 | .toggle-on.btn-lg{padding-right:31px} 21 | .toggle-off.btn-lg{padding-left:31px} 22 | .toggle-handle.btn-lg{width:40px} 23 | .toggle.btn-sm{min-width:50px;min-height:30px} 24 | .toggle-on.btn-sm{padding-right:20px} 25 | .toggle-off.btn-sm{padding-left:20px} 26 | .toggle.btn-xs{min-width:35px;min-height:22px} 27 | .toggle-on.btn-xs{padding-right:12px} 28 | .toggle-off.btn-xs{padding-left:12px} -------------------------------------------------------------------------------- /gui/static/css/highlight/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #998; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-subst { 24 | color: #333; 25 | font-weight: bold; 26 | } 27 | 28 | .hljs-number, 29 | .hljs-literal, 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-tag .hljs-attr { 33 | color: #008080; 34 | } 35 | 36 | .hljs-string, 37 | .hljs-doctag { 38 | color: #d14; 39 | } 40 | 41 | .hljs-title, 42 | .hljs-section, 43 | .hljs-selector-id { 44 | color: #900; 45 | font-weight: bold; 46 | } 47 | 48 | .hljs-subst { 49 | font-weight: normal; 50 | } 51 | 52 | .hljs-type, 53 | .hljs-class .hljs-title { 54 | color: #458; 55 | font-weight: bold; 56 | } 57 | 58 | .hljs-tag, 59 | .hljs-name, 60 | .hljs-attribute { 61 | color: #000080; 62 | font-weight: normal; 63 | } 64 | 65 | .hljs-regexp, 66 | .hljs-link { 67 | color: #009926; 68 | } 69 | 70 | .hljs-symbol, 71 | .hljs-bullet { 72 | color: #990073; 73 | } 74 | 75 | .hljs-built_in, 76 | .hljs-builtin-name { 77 | color: #0086b3; 78 | } 79 | 80 | .hljs-meta { 81 | color: #999; 82 | font-weight: bold; 83 | } 84 | 85 | .hljs-deletion { 86 | background: #fdd; 87 | } 88 | 89 | .hljs-addition { 90 | background: #dfd; 91 | } 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /kamailio/defaults/dsip_forwarding.sql: -------------------------------------------------------------------------------- 1 | -- dr_ruleid refers to owning inbound rule 2 | DROP TABLE IF EXISTS dsip_hardfwd; 3 | /*!40101 SET @saved_cs_client = @@character_set_client */; 4 | /*!40101 SET character_set_client = utf8 */; 5 | CREATE TABLE dsip_hardfwd ( 6 | dr_ruleid varchar(64) NOT NULL, 7 | did varchar(64) NOT NULL, 8 | dr_groupid varchar(64) NOT NULL, 9 | key_type varchar(64) NOT NULL DEFAULT '0', 10 | value_type varchar(64) NOT NULL DEFAULT '0', 11 | PRIMARY KEY (dr_ruleid) 12 | ) ENGINE = InnoDB 13 | DEFAULT CHARSET = utf8; 14 | /*!40101 SET character_set_client = @saved_cs_client */; 15 | 16 | -- dr_ruleid refers to owning inbound rule 17 | DROP TABLE IF EXISTS dsip_failfwd; 18 | /*!40101 SET @saved_cs_client = @@character_set_client */; 19 | /*!40101 SET character_set_client = utf8 */; 20 | CREATE TABLE dsip_failfwd ( 21 | dr_ruleid varchar(64) NOT NULL, 22 | did varchar(64) NOT NULL, 23 | dr_groupid varchar(64) NOT NULL, 24 | key_type varchar(64) NOT NULL DEFAULT '0', 25 | value_type varchar(64) NOT NULL DEFAULT '0', 26 | PRIMARY KEY (dr_ruleid) 27 | ) ENGINE = InnoDB 28 | DEFAULT CHARSET = utf8; 29 | /*!40101 SET character_set_client = @saved_cs_client */; 30 | 31 | DROP TABLE IF EXISTS dsip_prefix_mapping; 32 | DROP VIEW IF EXISTS dsip_prefix_mapping; 33 | /*!40101 SET @saved_cs_client = @@character_set_client */; 34 | /*!40101 SET character_set_client = utf8 */; 35 | CREATE VIEW dsip_prefix_mapping AS 36 | SELECT 37 | prefix, 38 | CAST(ruleid AS char) AS ruleid, 39 | CAST(priority AS char) AS priority, 40 | '0' AS key_type, 41 | '0' AS value_type 42 | FROM dr_rules 43 | WHERE groupid='FLT_INBOUND_REPLACE'; 44 | /*!40101 SET character_set_client = @saved_cs_client */; 45 | -------------------------------------------------------------------------------- /gui/static/css/highlight/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original highlight.js style (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #F0F0F0; 12 | } 13 | 14 | 15 | /* Base color: saturation 0; */ 16 | 17 | .hljs, 18 | .hljs-subst { 19 | color: #444; 20 | } 21 | 22 | .hljs-comment { 23 | color: #888888; 24 | } 25 | 26 | .hljs-keyword, 27 | .hljs-attribute, 28 | .hljs-selector-tag, 29 | .hljs-meta-keyword, 30 | .hljs-doctag, 31 | .hljs-name { 32 | font-weight: bold; 33 | } 34 | 35 | 36 | /* User color: hue: 0 */ 37 | 38 | .hljs-type, 39 | .hljs-string, 40 | .hljs-number, 41 | .hljs-selector-id, 42 | .hljs-selector-class, 43 | .hljs-quote, 44 | .hljs-template-tag, 45 | .hljs-deletion { 46 | color: #880000; 47 | } 48 | 49 | .hljs-title, 50 | .hljs-section { 51 | color: #880000; 52 | font-weight: bold; 53 | } 54 | 55 | .hljs-regexp, 56 | .hljs-symbol, 57 | .hljs-variable, 58 | .hljs-template-variable, 59 | .hljs-link, 60 | .hljs-selector-attr, 61 | .hljs-selector-pseudo { 62 | color: #BC6060; 63 | } 64 | 65 | 66 | /* Language color: hue: 90; */ 67 | 68 | .hljs-literal { 69 | color: #78A960; 70 | } 71 | 72 | .hljs-built_in, 73 | .hljs-bullet, 74 | .hljs-code, 75 | .hljs-addition { 76 | color: #397300; 77 | } 78 | 79 | 80 | /* Meta color: hue: 200 */ 81 | 82 | .hljs-meta { 83 | color: #1f7199; 84 | } 85 | 86 | .hljs-meta-string { 87 | color: #4d99bf; 88 | } 89 | 90 | 91 | /* Misc effects */ 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /docs/source/user/domains.rst: -------------------------------------------------------------------------------- 1 | Adding a Domain 2 | ^^^^^^^^^^^^^^^ 3 | 4 | To add a domain click on Domains then click the green add button. 5 | 6 | .. image:: images/add_a_domain.png 7 | :align: center 8 | 9 | Fill in the domain name. (Note: You can create 1 or more domains by separating them with commas). 10 | 11 | - Select Realtime DB or Local Subscriber table (for multiple domains) 12 | - Select Pass Thru to PBX (single domain). 13 | 14 | Note: Details can be found in Realtime DB if you want to ensure that the Kamailio configuration file is setup to point to the Asterisk Realtime database configuration. Details on how to populate the table can be found in the Local Suscriber table if you want to use the built in subscriber table that's part of Kamailio. Use the pass thru to register info to the FreePBX server so that you don’t have to change how authentication is done. 15 | 16 | 17 | .. image:: images/add_new_domain522.png 18 | :align: center 19 | 20 | - For the List of backend PBX ID's you should use the ID assigned to each PBX that you want to be part of that domain. Such as naming the ID number thats assigned to media-02.voipmuch.com for example in :doc:`PBX(s) and Enpoints `. 21 | 22 | .. image:: images/add_new_domain_dev522.png 23 | :align: center 24 | 25 | - Click ADD 26 | 27 | You will then be returned back to the List of domains page and you should see your new domain added. You can delete this domain by clicking the red trash can to the right of the page. 28 | 29 | 30 | .. image:: images/list_of_domains1.png 31 | :align: center 32 | 33 | 34 | Be sure to click the Reload Kamailio button to apply changes. 35 | 36 | 37 | .. image:: images/reload_button.png 38 | :align: center 39 | 40 | -------------------------------------------------------------------------------- /docs/source/user/api.rst: -------------------------------------------------------------------------------- 1 | dSIPRouter API Intro 2 | ==================== 3 | 4 | The complete API is defined as a public Postman Workspace, which can be found `here `_ 5 | 6 | The steps to obtain the API Token key and examples of using the API via curl are below, but we highly recommend using Postman for testing the API. 7 | 8 | Getting Your Token 9 | ------------------ 10 | 11 | Your token was provided to you after you installed dSIPRouter. You can reset your token if you didn't write it down, by executing the following command 12 | 13 | .. code-block:: bash 14 | 15 | DSIP_HOSTNAME= 16 | DSIP_TOKEN= 17 | dsiprouter setcredentials -ac $DSIP_TOKEN 18 | 19 | Executing Kamailio stats API 20 | ---------------------------- 21 | 22 | .. code-block:: bash 23 | 24 | curl -k -H "Authorization: Bearer $DSIP_TOKEN" -X GET https://$DSIP_HOSTNAME:5000/api/v1/kamailio/stats 25 | 26 | Executing Lease Point API 27 | ------------------------- 28 | 29 | Create a new endpoint lease 30 | 31 | .. code-block:: bash 32 | 33 | curl -k -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X GET "https://$DSIP_HOSTNAME:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org" 34 | 35 | Revoking and replacing with your own lease ID 36 | 37 | .. code-block:: bash 38 | 39 | curl -k -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "https://$DSIP_HOSTNAME:5000/api/v1/endpoint/lease/1/revoke" 40 | 41 | Further Reading 42 | +++++++++++++++ 43 | 44 | All available routes are documented in the :doc:`routes documentation <../routes/index>`. 45 | -------------------------------------------------------------------------------- /kamailio/defaults/dr_gateways.sql: -------------------------------------------------------------------------------- 1 | -- update dr_gateways schema 2 | ALTER TABLE dr_gateways 3 | MODIFY COLUMN `address` VARCHAR(253) NOT NULL, 4 | MODIFY COLUMN `pri_prefix` VARCHAR(64) NOT NULL DEFAULT '', 5 | MODIFY COLUMN `attrs` VARCHAR(255) NOT NULL DEFAULT '', 6 | MODIFY COLUMN `description` VARCHAR(255) NOT NULL DEFAULT ''; 7 | 8 | -- update dr_gateways attrs column when entry created 9 | DROP TRIGGER IF EXISTS insert_dr_gateways; 10 | DELIMITER // 11 | CREATE TRIGGER insert_dr_gateways 12 | BEFORE INSERT 13 | ON dr_gateways 14 | FOR EACH ROW 15 | BEGIN 16 | 17 | -- set explicit defaults 18 | IF (NEW.gwid = 0) THEN 19 | SET NEW.gwid = NULL; 20 | END IF; 21 | IF (NEW.attrs IS NULL) THEN 22 | SET NEW.attrs = ''; 23 | END IF; 24 | 25 | SET @new_gwid := COALESCE(NEW.gwid, @new_gwid, ( 26 | SELECT auto_increment 27 | FROM information_schema.tables 28 | WHERE table_name = 'dr_gateways' AND table_schema = DATABASE())); 29 | 30 | -- only rewrite gwid,type part of attrs 31 | SET NEW.attrs = CONCAT(CAST(@new_gwid AS char), ',', CAST(NEW.type AS char), 32 | SUBSTRING(NEW.attrs, LENGTH(SUBSTRING_INDEX(NEW.attrs, ',', 2)) + 1)); 33 | SET @new_gwid = @new_gwid + 1; 34 | 35 | END;// 36 | DELIMITER ; 37 | 38 | -- update dr_gateways attrs column when entry updated 39 | DROP TRIGGER IF EXISTS update_dr_gateways; 40 | DELIMITER // 41 | CREATE TRIGGER update_dr_gateways 42 | BEFORE UPDATE 43 | ON dr_gateways 44 | FOR EACH ROW 45 | BEGIN 46 | 47 | -- only rewrite gwid,type part of attrs 48 | SET NEW.attrs = CONCAT(CAST(NEW.gwid AS char), ',', CAST(NEW.type AS char), 49 | SUBSTRING(NEW.attrs, LENGTH(SUBSTRING_INDEX(NEW.attrs, ',', 2)) + 1)); 50 | 51 | END;// 52 | DELIMITER ; 53 | -------------------------------------------------------------------------------- /docs/source/user/inbound_did_mapping.rst: -------------------------------------------------------------------------------- 1 | Inbound DID Mapping 2 | ====================== 3 | 4 | 5 | 6 | To Import a DID from a CSV file: 7 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 | 9 | 10 | 1) Click on Inbound DID Mapping. 11 | 12 | 13 | 14 | .. image:: images//dSIP_IN_DID_Map.png 15 | :align: center 16 | 17 | 18 | 19 | 2) Click on the green Import DID button underneath List on Inbound Mappings. 20 | 21 | 22 | 23 | .. image:: images//dSIP_IN_Import_DID.png 24 | :align: center 25 | 26 | 27 | 28 | 3) Click the Browse button and select the file that contains the DID numbers that you wish to use. 29 | 30 | 4) Click the green Add button. 31 | 32 | Click `CSV Example `_ to view a sample of the .CSV file 33 | 34 | 5) Click on the Reload Kamailio button in order for the changes to be updated. 35 | 36 | 37 | To Manually import a DID: 38 | ^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | 1) Click on Inbound DID Mapping 41 | 2) Click on the green ADD button. 42 | 43 | - Enter the name of the Inbound mapping 44 | - Enter the DID number in the DID field. 45 | - Select the Endpoint Group from the drop-down list 46 | 47 | Note: Each endpoint will contain at least two entries. One that leverages load balancing weights and another that randomly selects an endpoint. 48 | The one denoted with a LB is the one that uses the load balancing algorithm. If FusionPBX Domain Support is enabled you will see an additional 49 | entry for routing to the external interface of the FusionPBX server. 50 | 51 | - Click the green Add button. 52 | 53 | .. image:: images//dSIP_IN_DID_Map.png 54 | :align: center 55 | 56 | 57 | 58 | 3) Click on the Reload Kamailio button in order for the changes to be updated. 59 | -------------------------------------------------------------------------------- /gui/modules/domain/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Debug this script if in debug mode 4 | (( $DEBUG == 1 )) && set -x 5 | 6 | # ENABLED=1 --> install, ENABLED=0 --> do nothing, ENABLED=-1 uninstall 7 | ENABLED=1 8 | 9 | # Import dsip_lib utility / shared functions if not already 10 | if [[ "$DSIP_LIB_IMPORTED" != "1" ]]; then 11 | . ${DSIP_PROJECT_DIR}/dsiprouter/dsip_lib.sh 12 | fi 13 | 14 | function installSQL { 15 | local TABLES=(dsip_multidomain_mapping dsip_domain_mapping) 16 | 17 | printwarn "Adding/Replacing the tables needed for Domain Mapping within dSIPRouter..." 18 | 19 | # Check to see if table exists 20 | withRootDBConn --db="$KAM_DB_NAME" mysql -sN -e "select count(*) from ${TABLES[0]} limit 1" >/dev/null 2>&1 21 | 22 | if [ $? -eq 0 ]; then 23 | printwarn "The dSIPRouter tables ${TABLES[@]} already exists. Merging table data" 24 | ( 25 | cat ${DSIP_PROJECT_DIR}/gui/modules/domain/domain_mapping.sql; 26 | withRootDBConn --db="$KAM_DB_NAME" mysqldump --single-transaction --skip-triggers --skip-add-drop-table --no-create-info \ 27 | --insert-ignore ${TABLES[@]}; 28 | ) | withRootDBConn --db="$KAM_DB_NAME" mysql 29 | else 30 | echo -e "Installing schema for Domain Mapping" 31 | withRootDBConn --db="$KAM_DB_NAME" mysql <${DSIP_PROJECT_DIR}/gui/modules/domain/domain_mapping.sql 32 | fi 33 | } 34 | 35 | function install { 36 | installSQL 37 | printdbg "Domain module installed" 38 | } 39 | 40 | function uninstall { 41 | printdbg "Domain module uninstalled" 42 | } 43 | 44 | function main { 45 | if [[ ${ENABLED} -eq 1 ]]; then 46 | install && exit 0 || exit 1 47 | elif [[ ${ENABLED} -eq -1 ]]; then 48 | uninstall && exit 0 || exit 1 49 | else 50 | exit 0 51 | fi 52 | } 53 | 54 | main 55 | --------------------------------------------------------------------------------