staskobzar/amiws

enhancement

ihabhamad opened this issue · 3 comments

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

Hello,
You are right, thanks.
In this project the front-end part is considered as an example that shows how to use amiws proxy. It is not supposed to be used in production.
I am not sure I can fix it anytime soon. If you have a patch that can fix it, please, feel free to create a pull request.
Have a good day!

Sorry, my c language very poor I build node js project, but is not stable like your app I tested your app is very powerful but duration it will be in backend I like it and am very sorry for can't help you because my poor experience on the c

Hello,

This is not back-end/c. Back-end is simply send all AMI events to web-socket. The time is processed in the Front-end.
When the page is reloaded, it send AMI command to Asterisk "CoreShowChannel" (check the source).
This will respond with event "CoreShowChannel" that has field "duration". See Vue example in the unit test spec file.
The bug is probably in the processing the Duration field and set it on page reload:
https://github.com/staskobzar/amiws/blob/master/web_root/amipack.js#L162

This is back-end project and the front-end is given only as an example. You can clone web-root (vanila javascript or vue) and fit it for your needs.