I want to know the way to add new asterisk applications and modules.For example I don't have the SetGlobalVar application in my asterisk machine.I want to add that.Is there any way.
Thanks in advance .
As for SetGlobalVar you can use Set with g option as described in Asterisk wiki. Instead of writing such application write simple program that changes dialplan.
If you want to add some other thing to Asterisk there is simpler option than adding application: use AGI with your favorite programming language.
You can also use the GLOBAL() function. For example:
exten => 1234,1,Set(GLOBAL(MY_GLOBAL_VAR)=value)
I might be completely off-base here, but, I believe what the OP is asking for is how to actually load this module.. Assuming your asterisk distribution shipped with func_global, just do "module load func_global.so". If you want it to load on asterisk startup, add it to your modules.conf.
If your distribution doesn't package asterisk with that module, then you're going to have to either rebuild the package and include it, or build just that module from vanilla asterisk sources, then copy it over to your lib/modules directory.
Depending on your Asterisk version, that application may actually not even exist any more. I believe it was removed with Asterisk 1.8 and following.
Related
I am looking for a way to interact with OptaPlanner directly from the command line interface (CLI) without having to use the graphical user interface (GUI).
More specifically, I am looking to pass an XML file to the Employee Rostering function, and to get the solved XML back. Ultimately, I am looking to interact with OctaPlanner from my PHP application.
Any documentation for this?
Here is some what of an example of what I which to achieve:
http://www.c0940097.ferozo.com/applying-optaplanner-to-everyday-problems/
The UI is only for the examples. Take a look at CloudBalancingHelloWorld.java which solves without a UI.
Or, if you're looking for a more enterprise approach, use OptaPlanner Execution Server (also ASL), which exposes everything as REST api's.
I registered a local utility through generic setup and then updated the __init__ code later. I was surprised to found that the object is not reinitialized when I restart the instance. The utility was just a simple object that subclass the general object class.
How can I make the Utility initialize again ?
**Edit: After see Martijn Pieters's explanation I understand that local utility is always persistent. So how can I delete it and then readd it later ?
Since the comments answered my question already, this is a little sum up so I can close the question:
Local Utilities are always persistent.
(Base on my experience) In Plone 4 uninstalling the product won't remove installed Local Utilities by default (I remembered it once did)
You can user pypi.python.org/pypi/wildcard.fixpersistentutilities/1.1b4 a try for uninstalling Local Utilities.
Thanks Martijn Pieters and vangheem
I'm using Qt.
I could not find the function or class to start application at booting time.
In windows, for example, add register to HKMU/Software/Microsoft/Windows/CurrentVersion/Run.
I wanna know the function/class like above example.
You can use QSettings in order to set a value at Windows Registry.
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run",
QSettings::NativeFormat);
and then use the setValue function.
However this will work only in Windows so it is better to use an #ifdef before calling it.
The only thing I can think of is the QtService framework. It is available for all the major platforms (look here). It might not be exactly what you were looking for but it may help.
It is also important to mention that a Windows service has no direct access to the graphical interface. This means that if the application is graphical, you'll probably have to redesign it.
There is no such API in Qt, you have to search for 3rdparty library or write whole code on your own.
Is it possible to create a directory in lua ? If so, how ?
You may find the LuaFileSystem library useful. It has a mkdir function.
require "lfs"
lfs.mkdir("/path/to/dir")
There's a "system" call (or something like that, this is from memory) which you should be able to use to run an arbitrary program, which could include the mkdir command.
EDIT: I found my Programming in Lua book. On page 203, it mentions how you could use an
os.execute("mkdir " .. dirname)
to "fake" a directory creation command.
EDIT 2: Take note of Jonas Thiem's warning that this command can be abused if the directory name comes from an untrusted source!
You may also want to look at Lua/APR, the Apache Portable Runtime binding for Lua. The docs can be found at here
One of the reasons I use Lua is that I can write code that runs across multiple OSes. I was using LFS for some time, but have found that using Lua/APR provides a more platform-neutral library. And there are lots of other useful routines in the APR.
You can use the paths package instead. Then you can simply do:
require 'paths'
paths.mkdir('your/dir')
I need to make so that my application can have only one instance running at a time. Also when it's launched with a command line parameter ( like when registered to open certain file types ) it should pass the parameter to an existing instance and quit immediately without displaying graphical interface. You all probably know what I mean. The framework used is Qt 4, and it seems like it must have some facilities for that. Any ideas?
There is a Qt Solutions project doing this:
Qt Single Application
There are several ways to do inter process communication. Examples can be found in Qt's examples section.
It's also possible to implement a this sort of class oneself using QSharedMemory
(see QSharedMemory::attach() ). It's capable of being used for both determining whether other instance is already running and communicating/sending messages. Except some pointer magic and memory copying it's quite straightforward.