pchero / asterisk-zmq Goto Github PK
View Code? Open in Web Editor NEWzmq/json support asterisk AMI module. (zeromq, 0MQ)
zmq/json support asterisk AMI module. (zeromq, 0MQ)
Should be support through the cli.
Sometimes, asterisk-zmq returns "Respomse".
[Jul 18 21:42:41] DEBUG[22460] src/res_zmq_manager.c: Parse ami message. msg[Response: Success^M EventList: start^M Message: Peer status list will follow^M ^M Event: PeerlistComplete^M EventList: Complete^M ListItems: 0^M ^M ] [Jul 18 21:42:41] DEBUG[22460] src/res_zmq_manager.c: Parse complete. [Jul 18 21:42:41] DEBUG[22460] src/res_zmq_manager.c: Response cmd result. ret[153], msg[[{"Respomse":"Success","EventList":"start","Message":"Peer status list will follow"},{"Event":"PeerlistComplete","EventList":"Complete","ListItems":"0"}]]
Adapt the regex when parsing the request/response AMI message.
mercury*CLI> module load res_zmq_manager.so
Unable to load module res_zmq_manager.so
Command 'module load res_zmq_manager.so' failed.
[Jan 21 21:04:51] WARNING[16341]: loader.c:595 load_dynamic_module: Error loading module 'res_zmq_manager.so': /usr/lib/asterisk/modules/res_zmq_manager.so: undefined symbol: zmq_msg_init
[Jan 21 21:04:51] WARNING[16341]: loader.c:1079 load_resource: Module 'res_zmq_manager.so' could not be loaded.
Asterisk 13.5.0, using sample scripts like cmd_devicestatelist.py crashes Asterisk.
After re-compiling with debug info I can see on the console:
*CLI> [0MQ Manager Debug]: action command. command[Action: Setvar
ActionID: 1
Variable: DEVICE_STATE
Value: SIP/max=UNAVAILABLE
]
== Setting global variable 'DEVICE_STATE' to 'SIP/max=UNAVAILABLE'
WARNING: Memory corrupted after free of 0x7f05600078a0 allocated at json.c ast_json_malloc() line 140
WARNING: Memory corrupted after free of 0x7f05600099b0 allocated at json.c ast_json_malloc() line 140
[0MQ Manager Debug]: zmq_evt_handler. category[2048], event[VarSet], content[Event: VarSet
Privilege: dialplan,all
Channel: none
Uniqueid: none
WARNING: Memory corrupted after free of 0x7f0560007c60 allocated at json.c ast_json_malloc() line 140
Variable: DEVICE_STATE
Value: SIP/max=UNAVAILABLE
WARNING: Memory corrupted after free of 0x7f056004eed0 allocated at json.c ast_json_malloc() line 140
]
[0MQ Manager Debug]: Check value. tmp_line[Event: VarSet]
[0MQ Manager Debug]: Check value. tmp_line[Privilege: dialplan,all]
[0MQ Manager Debug]: Check value. tmp_line[Channel: none]
[0MQ Manager Debug]: Check value. tmp_line[Uniqueid: none]
[0MQ Manager Debug]: Check value. tmp_line[Variable: DEVICE_STATE]
[0MQ Manager Debug]: Check value. tmp_line[Value: SIP/max=UNAVAILABLE]
[0MQ Manager Debug]: Send event. ret[136], buf[{"Channel":"none","Event":"VarSet","Privilege":"dialplan,all","Uniqueid":"none","Variable":"DEVICE_STATE","Value":"SIP/max=UNAVAILABLE"}]
Any suggestions?
Moved from #9
Hi Sungtae, Hope you are doing well. facing some error while installing Install zmq-manager on Centos 6.7 Below are the Error reports src/res_zmq_manager.c: In function 'zmq_cmd_thread': src/res_zmq_manager.c:283: warning: implicit declaration of function 'zmq_msg_recv' src/res_zmq_manager.c:301: warning: passing argument 2 of 'zmq_send' from incompatible pointer type /usr/include/zmq.h:229: note: expected 'struct zmq_msg_t *' but argument is of type 'char *' src/res_zmq_manager.c:301: error: too many arguments to function 'zmq_send' src/res_zmq_manager.c:313: warning: passing argument 2 of 'zmq_send' from incompatible pointer type /usr/include/zmq.h:229: note: expected 'struct zmq_msg_t *' but argument is of type 'char *' src/res_zmq_manager.c:313: error: too many arguments to function 'zmq_send' src/res_zmq_manager.c: In function '_load_module': src/res_zmq_manager.c:449: warning: implicit declaration of function 'zmq_ctx_new' src/res_zmq_manager.c:449: warning: assignment makes pointer from integer without a cast src/res_zmq_manager.c: In function 'load_module': src/res_zmq_manager.c:518: warning: passing argument 2 of 'zmq_send' from incompatible pointer type /usr/include/zmq.h:229: note: expected 'struct zmq_msg_t *' but argument is of type 'char *' src/res_zmq_manager.c:518: error: too many arguments to function 'zmq_send' src/res_zmq_manager.c: In function 'zmq_evt_helper': src/res_zmq_manager.c:707: warning: passing argument 2 of 'zmq_send' from incompatible pointer type /usr/include/zmq.h:229: note: expected 'struct zmq_msg_t *' but argument is of type 'char *' src/res_zmq_manager.c:707: error: too many arguments to function 'zmq_send'
When zmq accept & process more than 2 requests, suddenly asterisk has down.
It's very easy to reproduction, but not a same situation...
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.