A2billing AGI Issue - asterisk

Quick question: Whenever I make changes in agi-conf in the web interface of A2billing, those changes are not made whenever I listen to the dialplan that the agi-conf is placed in. what could be the problem? I am always sure to ensure I edit the correct agi-conf file.
Thanks in advance.

Asterisk wont take your changes to .conf files into account until it is reloaded, or the server rebooted.
you can do it from the Asterisk CLI
sudo asterisk -rvvvvv
then at the prompt
reload
You can reload asterisk directly using the following command:
sudo asterisk -rx "reload"

Those changes imidiatly apply to new calls of a2billing.
If you not see changes in call, check that you use correct agi-confX section(see debug log)

Related

Minecraft console get wrong commands

I started a local server and want to add some simple commands with python, the server is running with forge 1.12 and a couple of mods.
My idea was it to catch wrong commands and send the right result instead.
An easy test command would be /echo Hello World with the result in the chat Hello World.
To get the command I am using the last line of the latest console log file, which is equal to the current console content. But in the console I cant read wrong commands. So if I run the echo command I get an message in the chat Unknown command. Try /help for a list of commands.
I think there could be two solutions:
Add in any register the command to get it in the console, prevent on this way the server to response and get the command in the console to use it.
Find a config to print also wrong commands in the console.
Thanks for helping
There is no way to 'cancel' commands through API, but there is a trick to effectively cancel commands anyways. You want to be listening to the Forge CommandEvent, modifying the command to another existing command that does nothing (you can create one yourself). This gives you a place to handle all commands (you'll have to filter for unexisting commands, otherwise you'd cancel all commands), and it will prevent the Unknown Command message from showing.

pyinfra: how to know when an operation causes a change

Sometimes, you need to run more commands if one command causes a change on the remote system. Good examples would be:
You update a systemd service file. If the file was actually changed, then you need to restart the service.
You update the configuration for a service (like say /etc/dhcp/dhcpd.conf). If that file was changed, you need to restart the service.
Is there a way to do this with files.put? Ideally you could write code like:
changed = files.put(src='files/dhcpd.conf', dest='/etc/dhcp/dhcpd.conf')
if changed:
systemd.service(service='isc-dhcp-server', running=True, restarted=True)
In pyinfra, every operation returns an object that has a changed property that does what you want:
dhcpconfig = file.put(…)
if dhcpconfig.changed:
systemd.service(…)

When is a bash script passes to 'openstack server create --user-data ...' exactly executed?

I have a bash script that I want to be executed before a user can login to the server. I cannot find any information on when this script is exactly executed for different images. Can I assume that this is before a user is able to login using ssh? I'm using cirros.
openstack server create --user-data before_login.sh ...
As soon as your instance boots up this user-data script "before_login.sh" executes on it before any user login into the instance.
User-scripts run at final stage, this stage runs as late in boot as possible. Any scripts that a user is accustomed to running after logging into a system should run correctly here.
You can check below link for cloud-int behaviors for more information
https://cloudinit.readthedocs.io/en/latest/topics/boot.html

execute command after asterisk confbridge recording is finished

I'm trying to find answer how to make Asterisk execute some command (my script) after confbridge's recording is finished
There is the next info in confbridge.conf:
record_conference=yes
Records the conference call starting when the first user enters the
room, and ending when the last user exits the room.
It records file well but I want it sending wav file via email.
Could anybody help me?
My config now looks like this (if it's necessary):
exten => 333,1,ConfBridge(100010,100010_bridge_profile,100010_user_profile)
Dialplan scripting is limited to events relating to each call channel. To get event info for other parts of asterisk (such as the ConfBridge application) you should hook into the Asterisk Manager Interface (AMI).
There are many libraries already created to make working with the AMI easier. (That site may be outdated. Refer to the official Asterisk Wiki whenever possible.)
The AMI event you're interested in is "ConfBridgeEnd". Docs here.
You can use h-extension after confbridge, in which you have check if confbridge still active(last user).
If yes, run your script via System call.

Mixmonitor command is not working in asterisk dialplan

I have created a dialplan which on getting call from certain extention forward it and dial another number and then record their call using mixmonitor
exten => s,n,Mixmonitor(/var/www/html/recordings/answered/${DID}_${FROM}_${ANSWER}.wav)
but after farwading call it donot record anything in my folder created
Am i missing something,do i have to enable anything to make it work
Thanks in advance
1) check permission. Asterisk usualy run under asterisk user and not able write to folder owned by apache or root.
2) check file path exist.
3) if not help, enable debug on consoel and see what happens. For that you need add debug in /etc/asterisk/logger.conf to console=> line, do in asterisk consoel "core set debug 5".

Resources