staskobzar / amiws Goto Github PK
View Code? Open in Web Editor NEWAsterisk Management Interface (AMI) to Web-socket proxy
License: GNU General Public License v3.0
Asterisk Management Interface (AMI) to Web-socket proxy
License: GNU General Public License v3.0
Is it possible to send multiple 'Variable' key in 'Originate' and other AMI actions that supports this functionality?
I've tried three ways:
"var1=some1\r\nVariable: var2=some2\r\nVariable: var3=some3"
{
"var1": "some1",
"var2": "some2",
"var3": "some3"
}
[
"var1=some1",
"var2=some2",
"var3=some3"
]
In first case on Asterisk side I see only first variable with "modified tail" - "some1rnVariable: var2=some2rnVariable: var3=some3".
In second and third cases I see empty variables.
I want to send multiple variables to Asterisk without extra manipulations on Asterisk side.
Hi, I'm having trouble compiling on Centos 8:
CentOS Linux release 8.3.2011
[root@150620211711 amiws-master]# ./configure --with-ssl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for ranlib... ranlib
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking for yaml_parser_initialize in -lyaml... yes
checking for library containing CRYPTO_new_ex_data... -lcrypto
checking for library containing SSL_library_init... no
configure: error: openssl library not found
The OpenSSL libraries are already installed:
[root@150620211711 amiws-master]# rpm -qa |grep openssl
compat-openssl10-1.0.2o-3.el8.x86_64
openssl-1.1.1g-15.el8_3.x86_64
openssl-perl-1.1.1g-15.el8_3.x86_64
apr-util-openssl-1.6.1-6.el8.x86_64
openssl-pkcs11-0.4.10-2.el8.x86_64
openssl-devel-1.1.1g-15.el8_3.x86_64
openssl-ibmpkcs11-1.0.2-1.el8.x86_64
openssl-libs-1.1.1g-15.el8_3.x86_64
anope-openssl-2.0.9-3.el8.x86_64
I thank you in advance for your help.
A couple questions
Trying to isolate an issue, I am having. I am using amiws with about 80 high traffic asterisk servers. It seems be constantly reconnecting to some of them. Its likely something on my end, but I am trying to narrow it down. Do you know if this program does fine on that kind of load?
Is there some way to set an ID for each server instead of using the provided one? or maybe the hostname/ip instead?
No worries if not.
Also thank you so much for this! Saved me so much time and effort. Wonderful program.
Is is possible to specify somewhere a global filter so that customer specific information is all that is returned? For example every queue, sip peer, etc begins with customer-XXXX. So customername-sales queue, or customername-100 for extensions.
Hi.
now moongoose version is 6.7.
maybe it is old.
i tried change mongoose.h mongoose.c but i could not make.
anyway, change last version of frozen.h frozen.c is OK
moongoose 6.18 is OK
thank you.
Hello, one question ...
Is it possible to send a message using the command line so that only browsers receive the event without asterisk being involved?
The event could only reach the haulers with a different identification code.
Nothing would change, it would be just another feature.
Cards can be added to your board to track the progress of issues and pull requests. You can also add note cards, like this one!
Hello
I am trying to use this service because in my current structure many sessions are opened and closed constantly and with a time the manager happens to refuse connections.
The installation and startup of amiws is done without any problems.
I chose not to use ssl.
Linux CentOS 6.0
Asterisk: 1.6.2.24
Asterisk server: 192.168.100.254
Amiws server: 192.168.100.251
The configuration file looks like this:
log_facility : 40
log_level : 6
ws_port : 8000
web_root : /var/www/amiws/web_root
auth_domain : example.com
auth_file : /var/www/.htaccess
amihosts:
The connection is established with asterisk without problems.
amiws[6775]: AMI hosts connecting.
amiws[6775]: Listening Web Socket port 8000
amiws[6775]: Enabling HTTP Basic authentication.
amiws[6775]: AMI version: 1.1.0
amiws[6775]: AMI login with user: teste to server: ast01.example.com
The problem is that I can not access through port 8000.
In the first attempt to access the login screen appears, I enter the credentials, but only "Not Found" appears on the screen.
This appears when I try to access the browser:
amiws[6775]: New HTTP connection from 192.168.100.98:50833
amiws[6775]: Closed New Web Socket connection from 192.168.100.98:50833
Can anyone guide me?
Thank you very much in advance.
Hi,
thank you for your greatjob!
here is log
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for ranlib... ranlib
checking for gcc... gcc
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking for yaml_parser_initialize in -lyaml... yes
checking for library containing CRYPTO_new_ex_data... -lcrypto
checking for library containing SSL_library_init... no
configure: error: openssl library not found <--- how could i find ?
change mongoose.c and mongoose.h then complie it
is ti OK ?
i have a problem with instalation:
root@teste-painel-1:~/amiws# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for ranlib... ranlib
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking for yaml_parser_initialize in -lyaml... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking for gawk... (cached) mawk
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Doxyfile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating src/lib/Makefile
config.status: creating test/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
root@teste-painel-1:~/amiws# make
make all-recursive
make[1]: Entering directory '/root/amiws'
Making all in src
make[2]: Entering directory '/root/amiws/src'
Making all in lib
make[3]: Entering directory '/root/amiws/src/lib'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/amiws/src/lib'
make[3]: Entering directory '/root/amiws/src'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/amiws/src'
make[2]: Leaving directory '/root/amiws/src'
Making all in test
make[2]: Entering directory '/root/amiws/test'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/amiws/test'
make[2]: Entering directory '/root/amiws'
make[2]: Leaving directory '/root/amiws'
make[1]: Leaving directory '/root/amiws'
Hello
I noticed that the 'core show hints' command does not work.
All other commands work perfectly, only this one does not work.
I really need this command, is there anything I can do?
Hi, you can have the websocket server (amiws) send data to the client only after receiving a command from the Javascript script.
For example "ws.send ('start')"?
if yes, how can i do?
Hello, I need your help again.
I upgraded my asterisk version to 15.4.1, and some commands are not responding correctly.
On the first request I sent 'core show uptime' and got the answer in the 'Output' object correctly.
On the second request I sent 'queue show' in this case the 'Output' object returned empty.
In the third request I sent 'pjsip list endpoints' in this case the 'Output' object returned empty.
Notice that the response appears in the event but not in the 'Output' object, it is as if the json was not formatted correctly and because this notation can not be decoded.
I am using the latest version of 'amiws-master' and my linux is Centos 7.
Please, I need your help.
Hi,
Would it be possible to filter events based on the AMIServerID when opening a WebSocket? I want to use this as a proxy for multiple systems and I don't want every connected system to receive events from all connected PBX's / AMI Hosts.
Maybe by providing a header with the AMIServerID when opening the WebSocket or sending an action after the connection has been opened?
For example in Python:
ws.connect(ws_end_point, header={'AMIServerID': 1}
Congratulations on the excellent work.
I did all the tests and it works as indicated, I just have a question, is it possible to add token authentication to the websocket?
If this is how I could do it, if not, where could I start?
I am attentive, thank you. (Excuse my English, it is not my native language.)
my friend if you check duration from active channels after refresh well be enhancement because duration run on the front end and it reset in refresh page
Hi!
I installed amiws onto FreePBX server and made all settings in conf files
The "manager show connected" command shows that ami user connected as well, but in web interface I see message "Connection to server has been lost. Trying to reconnect..."
Where I can find logs that can show me what the cause of this message?
Thanks in advance!
Hello,
We are trying to install amiws in CentOS 7. We getting below error during ./configure even though we have installed latest libyaml
configure: error: YAML library not found.
>> Install libyaml and retry.
[root@Centos7 amiws-master]# yum install libyaml
Loaded plugins: langpacks
Package libyaml-0.1.4-11.el7_0.x86_64 already installed and latest version
Nothing to do
Hello,
I like the project, very good implementation very much, thanks for that.
I want to ask a question, as I'm having multiple servers connected to the AMIws instance, and I want to send an AMI command to one of them.
When I send the request, I get a reply from all the servers connected that the action has been executed on all servers.
I send the request through web-socket as follows:
{
"type":2,
"server_id":1,
"server_name":"server",
"ssl":false,
"data":{
"Action":"QueueAdd",
"ActionID":"actid",
"Queue":"queue",
"Interface":"SIP/ext",
"Penalty":"0",
"Paused":"true",
"MemberName":"name"
}
}
Thanks in advance.
Hey
This is my log when I send a command to server
Response Connected Time 3649 ms
Send cmd {"Action":"CoreStatus","ActionID":"getConnectedServers"}
Response Time 3987 ms
Received message: { "type": 4, "server_id": 1, "server_name": "callevo11", "ssl": false, "data": {"Response": "Error","Message": "Too many lines in message or allocation failure"}}
Why too slow and why this error message ?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.