Something is wrong with my freeswitch config/startup

Status
Not open for further replies.

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite cool project, but I get blocked somewhere.
Probably mainly because I'm not familiar enough with freeswitch.

Got everything installed well, able to login and able to add an extension.
But when checking "DjangoPBX -> Status -> FS Log Viewer", it's last entry is from the install date.

Freeswitch is running, and in my point of view, it looks like it got started with the correct parameters:

Code:
root@Raspi4-Keller:/var/log# systemctl status freeswitch
● freeswitch.service - freeswitch
     Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-03-11 21:53:26 CET; 14min ago
    Process: 1376 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/ (code=exited, status=0/SUCCESS)
    Process: 1377 ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/lib/freeswitch /var/log/freeswitch /home/django-pbx/freeswitch /usr/share/freeswitch /var/run/freeswi>
    Process: 1398 ExecStart=/usr/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait -conf /home/django-pbx/freeswitch -log /var/log/freeswitch -db /var/lib/freeswitch/db -ru>
   Main PID: 1401 (freeswitch)
      Tasks: 29 (limit: 8741)
        CPU: 29.031s
     CGroup: /system.slice/freeswitch.service
             └─1401 /usr/bin/freeswitch -u django-pbx -g django-pbx -ncwait -conf /home/django-pbx/freeswitch -log /var/log/freeswitch -db /var/lib/freeswitch/db -run />

Mär 11 21:53:26 Raspi4-Keller freeswitch[1398]: FreeSWITCH[1398] Waiting for background process pid:1401 to be ready.....
...
Mär 11 21:53:26 Raspi4-Keller freeswitch[1398]: FreeSWITCH[1398] Waiting for background process pid:1401 to be ready.....
Mär 11 21:53:26 Raspi4-Keller freeswitch[1398]: FreeSWITCH[1398] System Ready pid:1401
Mär 11 21:53:26 Raspi4-Keller systemd[1]: Started freeswitch.service - freeswitch.

Is someone able to dig me into the right direction?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Someone else contacted me recently about getting this running on a Raspberry Pi. Your issue may be around freeswitch loading its modules, if there is nothing in the log and freeswitch is running, then chances are mod_logfile is not loaded. I will do a bit of digging into this and get back to you.

if you can get access to the freeswitch cli (fs_cli) then you can see if a module exists like this:
Code:
freeswitch@djangopbx-dev1> module_exists mod_logfile
true
freeswitch@djangopbx-dev1>
 

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite thanks for your answer!
"Someone else" is probably the same than me :)
Choose to write in forum instead of opening a github issue, because I think it's some kind of mistake in my config/installation and not an "issue".

mod_logfile is loaded:
Code:
freeswitch@Raspi4-Keller> module_exists mod_logfile
true
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Hi, yes I understand now, I have put 2 and 2 together!
I will try to work through a raspberry Pi install myself so I can better understand what you are encountering. Please bear with me, because I am quite busy at the moment.
Does anything change if you restart the Pi?
 

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite thanks!
Don't hurry!!
I'm looking for a long term replacement for my FusionPBX and don't have any pressure.
Due to this, I'm also fully fine if you drop me the required commands to get some insights by ping-pong conversation (so that you don't need to do the extra effort for a Raspi Pi installation).

Rebooting doesn't change anything. The "FS Log Views" last entry is the old one from the install date, while "systemctl status freeswitch" seem to run normal:
Code:
root@Raspi4-Keller:/home/pi# systemctl status freeswitch
● freeswitch.service - freeswitch
     Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-03-13 16:46:57 CET; 7min ago
    Process: 1406 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/ (code=exited, status=0/SUCCESS)
    Process: 1408 ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/lib/freeswitch /var/log/freeswitch /home/django-pbx/freeswitch /usr/share/freeswitch /var/run/freeswi>
    Process: 1430 ExecStart=/usr/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait -conf /home/django-pbx/freeswitch -log /var/log/freeswitch -db /var/lib/freeswitch/db -ru>
   Main PID: 1431 (freeswitch)
      Tasks: 29 (limit: 8741)
        CPU: 19.965s
     CGroup: /system.slice/freeswitch.service
             └─1431 /usr/bin/freeswitch -u django-pbx -g django-pbx -ncwait -conf /home/django-pbx/freeswitch -log /var/log/freeswitch -db /var/lib/freeswitch/db -run />

Mär 13 16:46:57 Raspi4-Keller freeswitch[1430]: FreeSWITCH[1430] Waiting for background process pid:1431 to be ready.....
...
Mär 13 16:46:57 Raspi4-Keller freeswitch[1430]: FreeSWITCH[1430] Waiting for background process pid:1431 to be ready.....
Mär 13 16:46:57 Raspi4-Keller freeswitch[1430]: FreeSWITCH[1430] System Ready pid:1431
Mär 13 16:46:57 Raspi4-Keller systemd[1]: Started freeswitch.service - freeswitch.

Also `journalctl -u freeswitch` doesn't has any additional useful information.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
I have done an install on an 8Gb Raspberry Pi 4. Choosing to build FreeSWITCH from source in the install.

There were a couple of issues that I noticed:
1. Freeswitch starts for some reason before all the default data is loaded, this causes some xml handler errors in the freeswitch log. Once the installation is complete stopping and starting freeswitch or a reboot results in a properly configured freeswitch.

2. Three settings in Switch Variables (Admin->Switch->Switch Variables) for the DSNs were set to True, when by default, they should have been False. I have now corrected this is the DjangoPBX repo. The work around is to simply edit these three settings and set them to false, see the screen shot below:

Screenshot from 2024-03-14 14-30-38.png

Apart form those issues, I have a fully working system on a Raspberry Pi, first time I have tried a Pi install. I have registered an extension and used it to call *9664 music on hold. Audio is good, the Switch dashboard shows one active call, and after the call a CDR record was correctly generated.

@JEBs If you want me to compare anything on my Pi to what you are seeing, just ask.
 

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite thanks for your effort and the promising results.

1. I also recognized the XML errors, but same as by you, they only happen during install time. Once restarted they're gone.

2. Also saw them in one of my previous install tries, but identified them as some kind of install error, because the new DB password doesn't got sed'ed the right way. In my previous tries I corrected the password (without noticeable changes). Did a new install today, switched them to "false" and restarted freeswitch, but unfortunately without success.

I'm pretty sure, and you already proved it by your install try: It's something goofy on my side or by my install tries.

In one of my previous install tries, I manually walked through the install script to see whats happen in detail and recognized a couple of issues.
Some seem to happen due to my additional voice VLAN, others by wrong hostname/IP resolutions, but those issues look secondary to me, as long as I'm unable to see some freeswitch logs (which in turn is also more a problem due to my limited knowledge of freeswitch. I'm pretty sure that there're some commands in freeswitch for debugging those to).

I worry I'm to unillumined and miss a major middle part.

After my last install try, I can log into the DjangoPortal, but don't get the top "Portal" menue. Only the top bar with it's domain switcher. Once changeing the domain I get "Admin" and "Logout" as clickable text hrefs. Have had that already in past some times, but it's fully unclear to me why it's happen.

We probably should wait for other Freeswitch/Raspberry Pi user which are more clever than me ;-)
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Ok, a couple of points:

My raspberry pi install was very simple - public IP, no NAT, no VLANS.

Logging in freeswitch is set to err, so unless there are errors nothing much appears in the log. You can change this by connecting to the fs_cli and issuing a:
fsctl loglevel debug.
fsctl loglevel err
will put it back again.

You can set it permanently in ~/freeswitch/autoload_configs/switch.conf.xml:

Code:
        <!-- Default Global Log Level - value is one of debug,info,notice,warning,err,crit,alert -->
        <param name="loglevel" value="err"/>

The menu is associated with the domain, so if your default domain did not get set up correctly or your login user is not associated with a domain, then you will not see a menu. See menu default below:

Screenshot from 2024-03-15 15-47-19.png
 

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite thanks for your patient and help!!!

My raspberry pi install was very simple - public IP, no NAT, no VLANS.
Whoop :oops:.
Your Raspi has a public IP? IPv4? I could do or planned to do that with an IPv6 but don't know how I could do that with an IPv4 :confused:
NAT is done by my router.
VLAN for sure is an extra level of complexity but because I already have that also with my old FusionPBX I thought I should get it also running with your DjangoPBX. However all my VoIP stuff is in an extra VLAN. I might move Django Portal Access and the like in the default PVID 1, but the voice stuff need to remain in a VLAN :rolleyes:

Logging in freeswitch is set to err, so unless there are errors nothing much appears in the log. You can change this by connecting to the fs_cli and issuing a:
fsctl loglevel debug.
fsctl loglevel err
will put it back again.

You can set it permanently in ~/freeswitch/autoload_configs/switch.conf.xml:

Code:
        <!-- Default Global Log Level - value is one of debug,info,notice,warning,err,crit,alert -->
        <param name="loglevel" value="err"/>
Yes, I'm a freeswitch unillumined! That's why people like me like to use a GUI like yours ;-)

That was my missing part. I had expected some kind of start or stop messages at least for a `systemctrl restart freeswitch`, but if I interpreted it right, logging was completely off.
Code:
freeswitch@Raspi4-Keller> fsctl loglevel
+OK log level: DISABLE [-1]

freeswitch@Raspi4-Keller> fsctl loglevel debug
+OK log level: DEBUG [7]

And now I get the expected messages as well as being able to see what's up with my registration...

Code:
2024-03-15 17:56:56.661838 97.77% [WARNING] sofia_reg.c:1787 SIP auth failure (REGISTER) on sofia profile 'internal' for [201@192.168.2.1] from ip 192.168.3.9
2024-03-15 17:57:27.601825 97.67% [WARNING] sofia_reg.c:1842 SIP auth challenge (REGISTER) on sofia profile 'internal' for [201@192.168.2.1] from ip 192.168.3.9
2024-03-15 17:57:27.641852 97.67% [WARNING] sofia_reg.c:3210 Can't find user [201@192.168.2.1] from 192.168.3.9

Will check/compare that later with my FusionPBX... as far as I remember it has something to do with ACL rules, SIP profiles
or the like. Need to adapt that anyway because it contained a fully unknown IP.

The menu is associated with the domain, so if your default domain did not get set up correctly or your login user is not associated with a domain, then you will not see a menu. See menu default below:

View attachment 3931

Hm... which part do i miss?

1710522339471.png

1710522422214.png

But when I press "Portal" in the top right edge (in the screen before), I get this:
1710522635836.png

Quite thanks once more for your help!!
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
No problem, I'm more than happy to help if I can.

Ok, I can see you have the default menu set for the domain. The next thing I would check is that the default menu is loaded. In Admin->Portal check what you have in Menu and Menu Items.
 

JEBs

New Member
Dec 19, 2018
15
1
3
57
Quite cool!
That's it!
Both have 0 entries. Will check the install script because I'm pretty sure that I pressed "y" for the "Load default menu" question.
 
Status
Not open for further replies.