nalakag Posted August 30, 2014 Report Share Posted August 30, 2014 Hi, Is there api call available to get a list of currently active calls? Cheers Nalaka Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted September 3, 2014 Report Share Posted September 3, 2014 Yes. You can use the REST interface for this. If you want to know how it works, just use your web browser and watch the traffic between the PBX and the browser. It is based on websocket, which triggers the actual REST transaction. You can use Basic authentication instead of logging in if you want to use an external program like curl. Quote Link to comment Share on other sites More sharing options...
nalakag Posted September 9, 2014 Author Report Share Posted September 9, 2014 Thanks for the reply. Quote Link to comment Share on other sites More sharing options...
nalakag Posted September 9, 2014 Author Report Share Posted September 9, 2014 Hi, I've opened a connection to the server using a websocket in a client agent and then I send request with the following json object in the body. - {"action":"get-calls"} However, nothing is received in the onmessage method on the websocket client, even though there are new and existing active calls. Also, there are no errors returned from the server. Default page when I login using a browser - http://<server url>/reg_domains.htm - The websocket connects to ws://<server url>/ Is the server url that I am connecting to and the json message correct? Is there any documentation about the api calls/actions accessible via web sockets? Thanks Nalaka Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted September 10, 2014 Report Share Posted September 10, 2014 Well if there is no change with the calls you would not get any traffic on websocket. Websocket is really just to tell the browser that something has changed, but not what has changed. For that the browser will make a (non-websocket) standard REST call. Try to watch the traffic when there is a call coming into the system, or when someone hangs up. I think then you will understand the logic better. Quote Link to comment Share on other sites More sharing options...
nalakag Posted September 19, 2014 Author Report Share Posted September 19, 2014 Hi Admin, Perhaps you are describing something else. I am trying to replicate the behaviour on the Status -> Active Calls page on Vodia PBX Hosted 5.2.2c, on a rich client. Initially, there is a REST call made to load the page contents. However, after that all the data related to call statuses seem to be communicated over a websocket. I am confused as to why the onopen phase is successful and the onmessage phase does not get called, on my rich client. It is working on the webpage loaded from the PBX Server. Is the communication between the websockets (i.e. PBX server and PBX webpage) taking place over a custom channel? Thanks Nalaka Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted September 21, 2014 Report Share Posted September 21, 2014 No, everything should be visible in the browser. We are mostly using Chrome, where you can see the traffic between the PBX and the browser nicely listed at the bottom. If it is still not clear, you can as well use Wireshark to see what is going on on the network level (use HTTP instead of HTTPS). Quote Link to comment Share on other sites More sharing options...
hsidhu Posted February 26, 2016 Report Share Posted February 26, 2016 Hello, I tried the same thing by opening up websocket connection with javascript. The problem is when websocket handshake with PBX, PBX requested session token but you can't set header in websockets. To test it try this: (just to test) Login into PBX as admin in one tab and then open another tab with your javascript websocket code. Make call after that you should get messages from PBX server in Chrome frames. But there is one more solution and that is make http call to get session token like this (but doesn't work). Than open websocket and it should have session token. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted February 27, 2016 Report Share Posted February 27, 2016 You can set the authentication also with websockets; just watch what the browser is doing. We could add something with websockets that checks the authentication and set up the session for you; but the question is if that would really help you. Quote Link to comment Share on other sites More sharing options...
hsidhu Posted February 29, 2016 Report Share Posted February 29, 2016 Not sure if it possible to set header parameters in websocket call according : Authorization and websockets headers If we could figure out http login with ajax (from different origin) or work around CORS could help. Like I am trying to do in this post : javascript Rest api This will be possible if you guys can all API access list in 'Access-Control-Allow-Origin: IP' in header Example from Here Then it will be alot easy to setup websocket connection by first making the HTTP request and websocket Handshake. Quote Link to comment Share on other sites More sharing options...
Vodia Telephone System Posted February 29, 2016 Report Share Posted February 29, 2016 Yes, but that could create security problems. We will consider preparing a whole solution, maybe user based access with some authentication method but not just full access without question. Thanks. Quote Link to comment Share on other sites More sharing options...
hsidhu Posted March 1, 2016 Report Share Posted March 1, 2016 I fully agree, but to get live steam of active calls and active calls is important with off-course some limits and boundaries. Thanks for your help Best Regards Quote Link to comment Share on other sites More sharing options...
Vodia Telephone System Posted March 1, 2016 Report Share Posted March 1, 2016 In the mean time what you can do is override some functionality of our JS files by putting a copy of the file by the same name in the the html folder. The pbx will then use the javascript file instead where you can make changes. Changes like posting the results of active calls to any server (since POST allows cross origins). This should help you for now. Thanks. Quote Link to comment Share on other sites More sharing options...
hsidhu Posted March 1, 2016 Report Share Posted March 1, 2016 Thanks That's exactly I was going for after server to server websocket client solution. I uploaded those files Here. But one another thing I am wonder would make things easy if I could get status of all extension status at domain level. Now, I have to login into ext account to find the status and it only give user-state for the account which I am logging as. Its will be great I could get status of all extension in one output. {"action":"user-state","type":"extensions","account":"101", "code":"ringback", "chatstatus":"online"} Best Regards Quote Link to comment Share on other sites More sharing options...
hsidhu Posted March 10, 2016 Report Share Posted March 10, 2016 Another thing i am wonder if we can make jssip work with vodia. Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted March 11, 2016 Report Share Posted March 11, 2016 It might actually be time to get this going. Maybe the IETF meeting in Berlin should be the deadline for having this done. Quote Link to comment Share on other sites More sharing options...
hsidhu Posted June 24, 2016 Report Share Posted June 24, 2016 Any update on this topic? Quote Link to comment Share on other sites More sharing options...
Vodia PBX Posted June 25, 2016 Report Share Posted June 25, 2016 The next version will include a new WebRTC client in the user mode. It is not JSSIP compliant, and probably not even SIP compliant, but it uses websocket and the WebRTC API to make things happen. The end user does not care (as long as it works). The RFC is on our radar, and eventually we will "drift" in to that direction. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.