best way to change configuration files programmatically
Hello everyone, i'm doing a project and i need to edit xml (dialplan, users and so on) from an external software placed on another server. I saw that with mod_curl can read the dialplan or other configurations from remote places but i don't want to introduce latency when freeswitch parses the dialplan. I came from asterisk and it was possible to change files with Event API, i saw that with mod_event_socket (i think) it isn't possible to change conf files. Can you suggest me the best way to change xml files from remote server? Thanks in advice -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
You should be able to remotely run reloadxml using esl On 2 Oct 2013 15:59, "crazygabry" <crazygabry@gmail.com> wrote:
Hello everyone,
i'm doing a project and i need to edit xml (dialplan, users and so on) from an external software placed on another server. I saw that with mod_curl can read the dialplan or other configurations from remote places but i don't want to introduce latency when freeswitch parses the dialplan. I came from asterisk and it was possible to change files with Event API, i saw that with mod_event_socket (i think) it isn't possible to change conf files.
Can you suggest me the best way to change xml files from remote server?
Thanks in advice
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Use mod_xml_curl to change configurations, directory, dialplan, etc... On Wed, Oct 2, 2013 at 1:02 PM, Callum Guy <callum.guy@x-on.co.uk> wrote:
You should be able to remotely run reloadxml using esl On 2 Oct 2013 15:59, "crazygabry" <crazygabry@gmail.com> wrote:
Hello everyone,
i'm doing a project and i need to edit xml (dialplan, users and so on) from an external software placed on another server. I saw that with mod_curl can read the dialplan or other configurations from remote places but i don't want to introduce latency when freeswitch parses the dialplan. I came from asterisk and it was possible to change files with Event API, i saw that with mod_event_socket (i think) it isn't possible to change conf files.
Can you suggest me the best way to change xml files from remote server?
Thanks in advice
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
So you suggest to have a server witch Apache that contains all dialplans, directories and so on and let freeswitch ask to him while parsing xml right? Thank you very much -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
yeah something like that... i use nginx + php5-fpm to generate the XML though :) On Wed, Oct 2, 2013 at 3:53 PM, crazygabry <crazygabry@gmail.com> wrote:
So you suggest to have a server witch Apache that contains all dialplans, directories and so on and let freeswitch ask to him while parsing xml right?
Thank you very much
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
How about a shared directory? Or rcp the files? You can have a program that writes the XML to the shared directory and then connect via ESL and execute a reloadxml as suggested by Callum above. This avoids any delays from http requests or maintaining a HTTP server. I guess it would depend on how many Freeswitch servers you are configuring this way, and how often you are changing the XML files. Guillermo On Wed, Oct 2, 2013 at 5:05 PM, Vik Killa <vipkilla@gmail.com> wrote:
yeah something like that... i use nginx + php5-fpm to generate the XML though :)
On Wed, Oct 2, 2013 at 3:53 PM, crazygabry <crazygabry@gmail.com> wrote:
So you suggest to have a server witch Apache that contains all dialplans, directories and so on and let freeswitch ask to him while parsing xml right?
Thank you very much
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Guillermo Ruiz Camauer
That's called configuration management and you should use a proper tool from it, such as Chef or Puppet, rather than a homebrew collection of scripts. The next guy will thank you. On 2 October 2013 17:31, Guillermo Ruiz Camauer <grcamauer@gmail.com> wrote:
How about a shared directory? Or rcp the files? You can have a program that writes the XML to the shared directory and then connect via ESL and execute a reloadxml as suggested by Callum above. This avoids any delays from http requests or maintaining a HTTP server. I guess it would depend on how many Freeswitch servers you are configuring this way, and how often you are changing the XML files.
Guillermo
On Wed, Oct 2, 2013 at 5:05 PM, Vik Killa <vipkilla@gmail.com> wrote:
yeah something like that... i use nginx + php5-fpm to generate the XML though :)
On Wed, Oct 2, 2013 at 3:53 PM, crazygabry <crazygabry@gmail.com> wrote:
So you suggest to have a server witch Apache that contains all dialplans, directories and so on and let freeswitch ask to him while parsing xml right?
Thank you very much
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Guillermo Ruiz Camauer
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Or salt-stack. You can possibly put the configs in GIT and use a hook to trigger a reloadxml. -Avi
+1 - I've used SFTP for this in the past to push the config onto the server, verified it's valid XML and uploaded correctly with xmllint & md5sum, and then done reloadxml over ESL. You could either push from the central server or pull from the freeswitch ones (perhaps in a cronjob). I've also heard of people storing their configs in git and doing a git clone into the appropriate directory on the servers. Then it's just 'git pull' + reloadxml (well, depending on the module - but that's all you need for dialplan changes). You can also get FreeSWITCH to use wget to download the dialplan over HTTP. See https://wiki.freeswitch.org/wiki/Mod_xml_curl#Alternative_ways_of_storing_st... I can't remember if exec actions work during a reloadxml though. Truth is there's a million and one ways to get the file onto the server. :) If the wget one works on reloadxml that would be the simplest I guess though. Might cause problems if there's any HTTP error though (500 Internal Server Error -> blank result -> no dialplan, whereas copying the file you can verify it before you reloadxml). On 2 October 2013 21:31, Guillermo Ruiz Camauer <grcamauer@gmail.com> wrote:
How about a shared directory? Or rcp the files? You can have a program that writes the XML to the shared directory and then connect via ESL and execute a reloadxml as suggested by Callum above. This avoids any delays from http requests or maintaining a HTTP server. I guess it would depend on how many Freeswitch servers you are configuring this way, and how often you are changing the XML files.
Guillermo
On Wed, Oct 2, 2013 at 5:05 PM, Vik Killa <vipkilla@gmail.com> wrote:
yeah something like that... i use nginx + php5-fpm to generate the XML though :)
On Wed, Oct 2, 2013 at 3:53 PM, crazygabry <crazygabry@gmail.com> wrote:
So you suggest to have a server witch Apache that contains all dialplans, directories and so on and let freeswitch ask to him while parsing xml right?
Thank you very much
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Guillermo Ruiz Camauer
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I really like the SFTP Option... i'll probably try this first! any security suggestion? Thank you -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
security suggestion is very simple: you need to make it secure :) ________________________________ From: crazygabry <crazygabry@gmail.com> To: freeswitch-users@lists.freeswitch.org Sent: Thursday, October 3, 2013 1:31 AM Subject: Re: [Freeswitch-users] best way to change configuration files programmatically I really like the SFTP Option... i'll probably try this first! any security suggestion? Thank you -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
speaking more seriously, Git with SSH transport and public key authentication is your best choice: in this case, both Git repository and the client servers can be in the public network without much concern. "Gitolite" is a nice software package for an easy-to-setup private Git repository. Also with Git, you can easily track the changes and roll back quickly if necessary. You can also set up hooks which will notify the client servers that the new update is available and needs to be pulled. ________________________________ From: Stanislav Sinyagin <ssinyagin@yahoo.com> To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> Sent: Thursday, October 3, 2013 9:47 AM Subject: Re: [Freeswitch-users] best way to change configuration files programmatically security suggestion is very simple: you need to make it secure :) ________________________________ From: crazygabry <crazygabry@gmail.com> To: freeswitch-users@lists.freeswitch.org Sent: Thursday, October 3, 2013 1:31 AM Subject: Re: [Freeswitch-users] best way to change configuration files programmatically I really like the SFTP Option... i'll probably try this first! any security suggestion? Thank you -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
+1 for xml_curl, except I use nginx + uwsgi + django with as postgres backend. On 3 October 2013 09:37, Stanislav Sinyagin <ssinyagin@yahoo.com> wrote:
speaking more seriously,
Git with SSH transport and public key authentication is your best choice: in this case, both Git repository and the client servers can be in the public network without much concern.
"Gitolite" is a nice software package for an easy-to-setup private Git repository.
Also with Git, you can easily track the changes and roll back quickly if necessary. You can also set up hooks which will notify the client servers that the new update is available and needs to be pulled.
------------------------------ *From:* Stanislav Sinyagin <ssinyagin@yahoo.com> *To:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Sent:* Thursday, October 3, 2013 9:47 AM
*Subject:* Re: [Freeswitch-users] best way to change configuration files programmatically
security suggestion is very simple: you need to make it secure :)
------------------------------ *From:* crazygabry <crazygabry@gmail.com> *To:* freeswitch-users@lists.freeswitch.org *Sent:* Thursday, October 3, 2013 1:31 AM *Subject:* Re: [Freeswitch-users] best way to change configuration files programmatically
I really like the SFTP Option... i'll probably try this first! any security suggestion?
Thank you
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati...
Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- *Andrew Cassidy BSc (Hons) MBCS SSCA* Managing Director *T <info@cassidywebservices.co.uk> *03300 100 960 *F<info@cassidywebservices.co.uk> *03300 100 961 *E <info@cassidywebservices.co.uk> *andrew@cassidywebservices.co.uk *W <info@cassidywebservices.co.uk> *www.cassidywebservices.co.uk
Thank you i'll try this weekend and nginx + php5-fpm :) i'll let you know Thanks to you and to Callum Guy Gabriele -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/best-way-to-change-configurati... Sent from the freeswitch-users mailing list archive at Nabble.com.
participants (9)
-
Andrew Cassidy
-
Avi Marcus
-
Ben Langfeld
-
Callum Guy
-
crazygabry
-
Guillermo Ruiz Camauer
-
Stanislav Sinyagin
-
Steven Ayre
-
Vik Killa