HTTP request in Dialplan - freeswitch

How would I go about preforming a HTTP GET request in the dialplan to send data to another system. I have done this in asterisks using curl. I have looked in freeswitch's mod folder and it doesn't have mod_curl. I am using a default install of FusionPBX

On Debian 8 with the FreeSWITCH package you would run the following.
apt install freeswitch-mod-curl
Then go to the Menu -> Advanced -> Modules and make sure the module is setup to run automatically and make sure its started.
Then follow instructions found here.
https://wiki.freeswitch.org/wiki/Mod_curl

There actually is mod_curl, though not compiled by default. You may need to follow the steps to compile it yourself.
You have the option to use it directly in dialplan, or in lua script.

Related

Building documentation in RTD using a makefile

I created a package for sagemath and used Sphinx to create its documentation. Now I'm trying to create the necessary configuration files to build the documentation in readthedocs.
The problem is that I've come across is that in order for the documentation to build, I have to run sphinx inside a sagemath shell (that is, sage -sh -c "make html").
Is there any way to achieve so with the configuration file for readthedocs? Or to use a makefile to build the docs? Can't seem to find the information on their documetation.
At the moment, Read the Docs has a fixed build process that involves calling python -m sphinx -b html (with some more parameters) from the virtual environment where the requirements are installed. This is described in the documentation.
Therefore, running custom commands is not possible.
However, since sage is available from conda and Read the Docs supports conda environments, you might be able to build the docs without invoking a Sage shell.
Read the Docs has released a beta feature that allows users to override the build process completely and execute custom commands. You can achieve what you want by using build.commands config key in the configuration file (see https://docs.readthedocs.io/en/stable/config-file/v2.html)
Full documentation of this beta feature at https://docs.readthedocs.io/en/stable/build-customization.html#override-the-build-process

Xcode open a project by open directory get error

I have downloaded an open source project from GitHub, I want to use Xcode open it can make changes.
but when I open it I get error, can not open file:
how to solve this issue?
You need to follow the instruction in the INSTAll file
Varnish uses the GNU autotools. To build and install Varnish, simply
run the 'configure' script in the top-level directory, then run 'make'
and 'make install'. On Linux, you need to run 'ldconfig' as root
afterwards in order to update the shared library cache.
If you obtained the sources directly from the Git repository, you will
need to run autogen.sh first to create the configure script.
Varnish will store run-time state in $localstatedir/varnish; you may
want to tune this using configure's --localstatedir parameter.
Additional configure options of interest:
--enable-developer-warnings
enable strict warnings (default is NO)
--enable-debugging-symbols
enable debugging symbols (default is NO)

pp (perl compiler) issue - still has a dependency

I'm trying to use pp (the perl compiler) to create an application that can run independent of the perl installed library and interpreter.
It successfully creates a compiled executable although I had to use the -x -c options to get it to find dependencies successfully. It will run on my machine but when I try it on another machine I get this error so clearly there is still some dependency:
501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed)
I am running it on MacOS 10.14.1 if that makes any difference. Thanks!
LWP::Protocol::https is loaded dynamically when needed, so pp has no way of knowing it's needed by default.
Solution 1
Pass -x to pp, and make sure the module is actually loaded in the run pp uses to determine the modules to include. This would probably be achieved by using LWP to make an HTTPS request during that run. --xargs=... might come in useful for this.
Solution 2
Pass -M LWP::Protocol::https to pp. You could also pass -M 'LWP::Protocol::**' to get all protocols handlers you have installed.
Solution 3
Add use LWP::Protocol::https (); to your script or an included module. Including a comment indicating why you are doing this would be appropriate.
You were building Net::SSLeay on MacOS 10.14 linking it to libssl.44.dylib which is not present on MacOS 10.12 where you try to run it.
I've found it annoying having to switch between build and test systems to find out which of the libraries are missing or incompatible and need to be packed.
I am now using the following strategy:
I use perlbrew instead of system perl.
For alien dependencies I use homebrew instead of the system libraries.
I build the packed executable using pp and run the resulting program with export DYLD_PRINT_LIBRARIES=YES being set (on the development machine)
I examine the list of loaded libraries and add all those referenced in the homebrew directory tree (/usr/local/opt/ and /usr/local/cellar/in my case) using pp -l /full/path/name -l ...
I rebuild the executable.
I still check on a target machine before deploying, but chances are very high now that it just works.

Can't install any GoLang script in Linux

When I try to run any Go script it show me this error
I installed go lang step by step from this link
https://www.tecmint.com/install-go-in-linux/
When I setup go script like this
go get github.com/tomnomnom/waybackurls
I got error like this
github.com/tomnomnom/waybackurls
src/github.com/tomnomnom/waybackurls/main.go:191: u.Hostname undefined
(type *url.URL has no field or method Hostname)
If you are following the guide you linked by copy-pasting commands, you will have installed Go 1.7.3. The function url.Hostname() was added in Go 1.8.
I suggest completely ignoring that guide. Remove /usr/local/go, remove ~/go_projects and undo the path related stuff.
Instead, use the package manager of your OS to install Go.
Most likely, this means you should do either sudo apt install golang (for Ubuntu, Debian, ...) or sudo dnf install golang (Fedora, CentOS, ...).
That will give you the latest version that is supported by distro maintainer (which at the moment is probably 1.11 or 1.12, depending on your distro).
As an alternative to the packagemanager, download the latest version from https://golang.org/dl/.
This approach also gives you an installation that follows the Go ecosystem their conventions for paths (I'm not sure if ~/go_projects was ever a think, but it isn't today).

LibreOffice/OpenOffice "kinda portable / static" installation on FreeBSD (webhost)?

I would like to use a headless OpenOffice instance (to interface it with PHP) on my webhost's server. Of course I can't install stuff there with the usual package mechanism, since I am just an ordinary user. However, I would be allowed to run (more or less) whatever I want, and I have ssh access.
Is there a way to install LibreOffice/OpenOffice in some directory under my home directory, and also get all dependencies there? It would be advantageous if I didn't have to run the actual build on the webhost, since it would clog the server... But maybe I could manage to build it on some other FreeBSD host... I would want the build to be as static as possible, i.e. with as few outside dependencies as possible.
Can this be done?
For the record, the webhost is running FreeBSD 8.2-RELEASE-p3 on amd64.
Hmm, you may try to install ports-mgmt/pbi-manager port (it's basically a bunch of shellscripts) and use pbi_add command to install libreoffice PBI.
PBI packages contain all necessary dependencies and, AFAIK, can be installed without root permissions.

Resources