1
votes

I want to write a shell script that can reload asterisk every 3 minutes. How to do this and what reload should I use? reload / reload sip or logger rotate? I am adding sip clients in sip.conf and I am also changing the extensions.conf. I would like to specify that I don't want to interrupt the calls (if there are between other sip clients) while I am reloading asterisk.

I am working in Ubuntu server.

1
Batch files => Windows. Shell scripts => Linux & Unix-type OSes. C++: completely unrelated.Mat
thx very much Mat. Could you help me with a response to my question?Angel Dream
Not really. There's too much stuff in there, some about Asterisk, some about scripting, and you don't show much of your research effort at solving this yourself. You should keep your questions on a single topic, and be sure to show that you've already tried things, and explain what exactly is giving you trouble. (Reloading a service every three minutes sounds really strange anyway, but I don't know Asterisk at all.)Mat

1 Answers

2
votes
# /usr/sbin/asterisk -h

Asterisk help gives:

-x "<CLI command>"

Execute an arbitrary CLI command. Using this command in combination with -r allows you to execute a CLI command without having to connect to the CLI and type it manually. An example would be to send a restart, which you would do by typing asterisk -rx "reload" from the command line.

You probably want to use asterisk -rx "reload when convenient" to reload the configuration when there isn't any call volume.