Is it possible to execute 2 or more commands in one CLI remote connection with -rx option?
For example: asterisk -rx "core show version; core show channels; sip set debug off"
Which means 1 connection, 3 commands and 3 outputs.
Instead of: asterisk -rx "core show version"; asterisk -rx "core show channels"; asterisk -rx "sip set debug off"
Which means 3 connections with single command.
I made mistake by using linux nohup asterisk -rx "channel originate bla bla bla" > /dev/null 2>&1 &
command in my application for ultra fast calls bulks. Because I didn’t know about CLI connection limits (only 128 active connections).
Now I have to use AMI for this, but I’m lazy and just wanted for fast solution
If I remove nohup it will fix problem, but calls will originate not so fast in cycle (because it will connect to cli, then execute command, and will wait for output).
I don’t want to use old method - callfiles. AMI is the best way for this in my opinion.
Partial file reading, Creating a lot of files in one folder, Then move them to another folder - It is cringe in 2k21
I’ll try to redesign my app code to use AMI instead of asterisk -x in weekends. I hope I can overcome my laziness.
If I can’t - I have an idea: originate some weird command like channel originate Local\number1*number2*number3*number999@my-super-context/n application someapplication.
And in my-super-context try to cut numbers with ${CUT} by * symbol and dial each of them with While dialplan function
Another idea:
use asterisk -r command in my application
wait for some output
spam originate commands without any waiting for output
If you are creating the files in a directory on the same file system as your spool directory this should not be a issue. If the file systems are different, mv becomes cp and you can get partial files.
Just out of curiosity, how many calls are you trying to initiate at once?
I have a SIP trunk with 300 concurrent calls availability.
Before making a bulk, my application first checks the number of free channels in SIP trunk (off course with asterisk -rx + grep + sed command) .
Usually in my app ~3000-10000 calls are made per day + SMS.
It’s not only for notifying, users are using a speech recognition + synthesize + another dificult call scenarios.
If user create some bulks with 10000 numbers, my app have to call them ASAP.
While I had a trunk with 100 simultaneous calls, there were no problems. After the provider increased the channels to 300, problems began with nohup+asterisk -rx
Now instead of resting on the weekend I have to rewrite the code to AMI or call files.
BTW how fast is AMI originating and call files? Will it handle 300 calls initialize in 1 second?