DjangoPBX Beginners

Status
Not open for further replies.

chris021

New Member
Jan 29, 2024
6
1
3
New Zealand
First up I am blown away with how well thought out DjangoPBX is. THANK YOU Adrian! Also thanks to the mods here for giving DjangoPBX users a place to gather. For me the combo of Python, Freeswitch and Postgres is a match made in heven. If it was to be containerised in Docker my head would probably explode with excitement. I think it would be quite trivial to do so may have a crack once i know what I am doing with it.

I have used Freeswitch before but with static config files providing basic sip trunking so know a small bit about it.

I am fumbling my way around like a blind penguin at a disco, but am making steady progress. My previous exposure to Django and Freeswitch means I can follow the code enough to work most things out. If I had previous exposure to FusionPBX i think I be sorted.

The documentation is very good, but does apear to be authored for someone who kinda knows what they are doing. If you have stumbled across this thread and have already followed the very good getting started video: Getting Started (djangopbx.com) but now are a bit stuck as to "what next" I am happy to help share what i have figured out. as DjangoPBX is totally open sorce and deigned with simple concepts that someone as basic as me should be able to expand on, its very much worth the effort learning it. Afterall its just Freeswitch under the hood.

Thanks,


Chris021
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Hi Chris,
I am so glad that you like the project, if there is anything I can help you with, please just ask.

I have changed the defaults for mod_g729 following your observations in the installer.
There are quite a few changes going on at the moment, we are adding a few scalability features and I'm getting some great feedback from an ISP in the north of England about using the REST API in a real world situation - so this is improving day to day.

I Keep trying to make time to work on the documentation, I added a few more last weekend. If you wish to add to the documentation yourself, I am very happy with that. Pull requests on any of the DjangoPBX repositories are always welcome.
 

Dick Ollett

New Member
Nov 5, 2017
9
3
3
Love it so far, excellent code, perhaps you could integrate/document Neil Pang's acme.sh for getting the domain working
 
  • Like
Reactions: chris021

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Hi Dick,
Yes I will look at that, thank you for the heads up on it.
I have used dehydrated with a hook for editing the domain record for a good number of years and it has been reliable, but acme.sh may be better to integrate.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
This is really cool, I'm going to have to play with it this weekend, thanks for sharing the great work!
So glad you like it. There are still a lot of changes and updates going on at the moment so please bear with us. I will be updating the install script later today and then again on Sunday.
Quite a few people are now helping with testing, new ideas and bug fixes. It's starting to feel like a real community project!
 

yois

New Member
Jul 14, 2020
12
1
3
41
Woah, I just found out there's a new kid on the block. Long time FusionPBX user.

After stumbling across this post, I looked at the DjangoPBX website, but am lacking details. For the benefit of myself and others coming from Fusion - when did this project start? Is this project a complete rewrite? Is it a fork? (The screenshots look remarkably similar to FusionPBX). Is there feature parity, or is that even a goal? Is this project sticking to a membership model or can we all be free to share information so we can all get great work and ideas together?

This is all very exciting.
 

ardyhash

Member
Jan 7, 2021
80
9
8
44
Given Adrian is likely in a timezone where he's sleeping I'll try to answer based on my little research:

Django is not a rewrite of fusion, its more of an alternative to fusion which leverages a different stack (but they have freeswitch in common). It's first github commit was 3 years ago. It looks like a solid project, I love FusionPBX and am saving for the training but am interested in django because it feels like it will be easier for someone like me to integrate and use.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Hi @yois s, and thankyou @ardyhash I havn't quite gone to bed yet! (16:48 in the UK).
There are both similarities and differences. DjangoPBX is not a fork of anyhting, it utilises the Django Web framework (https://www.djangoproject.com/) - hence the name. The programming language is Python. The main goal is to end up with a completely open and community supported PBX project.
 
  • Like
Reactions: gflow

ardyhash

Member
Jan 7, 2021
80
9
8
44
I assumed UK but grossly miscalculated the time difference, thanks for the elaboration, I avoided restating anything that's already documented but perhaps in this case less isn't more.
 

chris021

New Member
Jan 29, 2024
6
1
3
New Zealand
@yois I have only every dabbled with FusionPBX so I can't give perspective on the pro / cons of migration but what I can share is why I've landed on DjangoPBX and plan to stick around.

1. Python. I am not a developer but when I cobble things together its in python. I can read python pretty well which means that I can read the DjangoPBX code and work out how stuff hangs together. I explained to a co-worker who also shares an interest in voice: "The author of djangoPBX is clearly smarter than me, but not by sooooo much that I can't follow along with the code and concepts :D:p"

2. Django. some of my favorite OS software is based on the Django framework for example Netbox. This means that I know if the project was to stagnate, and I need something, it is not outside my ability to do it myself.

3. Freeswitch. Freeswitch is hiding behind some of the biggest cloud voice systems its well worth learning. I have freeswitch with static config files in production handling a crazy amount of calls from a very very tiny machine.

4. Postgres - now while I have used more MSSQL I see many projects taking off using Postgres. I have used a number of low code tools, Appsmith, Retool etc and they all have Postgres with the greatest features and fastest support. I am now using SupaBase to back a number of my projects and haven't looked back. FusionPBX has from what I can gather, leveraged clustering / replication in Postgres very successfully.

5. FusionPBX. as djangoPBX and FusionPBX are both wrapping Freeswitch a lot of the FusionPBX documentation is actually relevant to point me in the right direction with DJangoPBX. I have no issues whatsoever with FusionPBX being opensource but sponsored with memberships etc, but looking in from the outside it did seem a bit complex... Perhaps with djangoPBX being so open we might see some feature bounties etc.

@Adrian Fretwell seems to be a top bloke with a clear vision so I am keen to be along for the ride!
 
  • Like
Reactions: Adrian Fretwell

ou812

New Member
Nov 2, 2016
28
4
3
61
I did a new install today using Debain bookworm and the install.sh from the Main branch, I noticed there is no requirements.txt file so I did the install without it.
I also installed from source.

The install completed without any issues, I can connect to the server through SSH using the domin name but I can not reach it using https.

Should I have used the requirements.txt file from the Debain 11 branch.


Thanks,
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
It picks the requirements file up from the application:

Screenshot from 2024-02-03 18-17-07.png

Unless you saw any errors from pip3 you should at least have a running web server.
However, I am aware there have been reports of nginx trying to start before the network layer is ready. This may be the issue in your case.
For systemd, this is resolved by adding a "wants" declaration to the nginx unit file, but I have checked and
/usr/lib/systemd/system/nginx.service looks OK on the installs that I have inspected.

If you think this may be your problem and your unit file already has the "Wants" line, you could try further delaying the start of nginx by adding:
ExecStartPre=/bin/sleep 10
just below the PID declaration.
 

ardyhash

Member
Jan 7, 2021
80
9
8
44
My first time going through the install script I just pressed enter instead of y when being prompted and it did not interpret those as yes. Try again and pay attention during the install, when prompted don't assume the defaults are to install.

Post reboot I got an https site, though I'd forgotten to map DNS before the install so I had no cert.
 
  • Like
Reactions: chris021

ou812

New Member
Nov 2, 2016
28
4
3
61
It picks the requirements file up from the application:

View attachment 3818

Unless you saw any errors from pip3 you should at least have a running web server.
However, I am aware there have been reports of nginx trying to start before the network layer is ready. This may be the issue in your case.
For systemd, this is resolved by adding a "wants" declaration to the nginx unit file, but I have checked and
/usr/lib/systemd/system/nginx.service looks OK on the installs that I have inspected.

If you think this may be your problem and your unit file already has the "Wants" line, you could try further delaying the start of nginx by adding:
ExecStartPre=/bin/sleep 10
just below the PID declaration.

I belive the issue is in the firewall, I did whitelist my ip before the install, if I stop the firewall service I can connect with https when I restart the service I can only connect with ssh.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Ports 80 and 443 are classed as public TCP services and are not blocked unless a source IP in in the block list.

You can trace a request through the firewall with (obviously substitute 1.2.3.4 with your IP address):
Code:
root~:# nft add chain inet filter trace_chain { type filter hook prerouting priority -501\; }
root~:# nft add rule inet filter trace_chain ip saddr 1.2.3.4 meta nftrace set 1
root~:# nft monitor trace
 

ardyhash

Member
Jan 7, 2021
80
9
8
44
I find it easier to start with clean system than try to troubleshoot an existing system. On a vanilla minimal Debian clean install:
1. install git
2. clone the install repo
3. edit the install script and run it answering yes to all prompts and accepting the defaults

I followed the three above and got it just worked, albeit I had to run the install script thrice but only because didn’t answer y to the prompts the first run then I forgot the password on the second.
 

ou812

New Member
Nov 2, 2016
28
4
3
61
The only way I can get access to https is to issue command, ufw allow from xxx.xxx.xxx.xxx
 

ardyhash

Member
Jan 7, 2021
80
9
8
44
The install script references nftables, are you able to start from a clean install? If not can you disable or remove ufw?
 

chris021

New Member
Jan 29, 2024
6
1
3
New Zealand
while on the topic of nftables, should additions to "SIP Customer List " and "SIP Gateway List" via the gui or by registration, survive a reboot?
 
Status
Not open for further replies.