Variables not evaluating

Status
Not open for further replies.

davemc

New Member
Aug 17, 2018
9
0
1
56
Auckland, New Zealand
I have a clean new fusionpbx install.

Outbound SIP calls via a gateway are not working because they are inviting the internal IP. SIP Profile external ext-sip-ip is set to $${external_sip_ip}

Variable external_sip_ip is set to an outside address 202.x.x.x

The variable won't evaluate correctly in fs_cli. A test variable won't evaluate at all.

I suspect variable handling is broken, but not sure how to debug this. How do vars get from db to freeswitch?

Code:
freeswitch@fones> eval $${external_sip_ip}
10.1.5.33           <<< naughty, should be external ip


freeswitch@fones> eval $${testpexy}
-ERR no reply       <<< naughty, should be test value 123
 

davemc

New Member
Aug 17, 2018
9
0
1
56
Auckland, New Zealand
Digging a bit deeper, file /etc/freeswitch/vars.xml is not being written.

On another system, any changes to Advanced/Variables are written to the above file on save by the FusionPBX web interface.

On this problem system, that file is not being updated.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
447
162
43
49
Would be useful to know what operating system this is and how FusionPBX was installed.
Default Settings you should check category Switch look for subcategory conf type dir value /etc/freeswitch and enabled true.

Next make sure the web server has permission to write to the /etc/freeswtch directory. That should be enough to fix it. Unless its CentOS and SELinux is preventing it writing to the file system.
 

davemc

New Member
Aug 17, 2018
9
0
1
56
Auckland, New Zealand
/var/www/fusionpbx/app/vars/var_edit.php calls
save_var_xml(); in
/var/www/fusionpbx/resources/switch.php

Which seems fairly straightforward code, but without any error traps or logging.
 

davemc

New Member
Aug 17, 2018
9
0
1
56
Auckland, New Zealand
Fantastic Mark

Web Interface::Advanced:: Default Settings::Switch::conf was indeed blank.

OS is Debian 8 via LXC on Proxmox 5.2. Install was done by one of my team, because I thought it was a straight forward task. Not sure how he did it or messed it up.

Yes, permissions ok and checked, owned by www-data.

Thanks for the very useful lead.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
447
162
43
49
If FreeSWITCH is running and you deleted the blank settings in Default Settings::Switch then you can run Upgrade -> App Defaults and it will make a request for information from FreeSWITCH to add the correct information to Default Settings. This is an easy way to get a wayward system back on track. After you get the correct values click on the Reload button on the top right. chown -R www-data:www-data /etc/fusionpbx/config.lua so that it can be updated and then run Upgrade -> App defaults this should rewrite the config.lua with the updated information. Then restart FreeSWITCH with service freeswitch restart.
 
Status
Not open for further replies.