Picture of nick_name
Registered 342 days 22 hours
nick_name Thursday, 14 December 2023, 02:36 PM
Custom application - Start/End a call
Hello,


I'm new to the Innovaphone SDK and could use some guidance to get started. Can someone help me understand or point me in the right direction?

We have our own web application, intended for internal use only, with the front-end written in React and the back-end utilizing a NodeJs/Express server. I'm interested in learning how to initiate and end calls directly from our web application.

After some research in the wiki, here's what I've gathered:

1- I need to create a WebSocket app on the PBX

What URL should I configure?
Which APIs do I need access to? (PbxAPI / RCC)
What apps should I select on the last tab page?

2- Establish a WebSocket connection to the configured URL.

3- Log in to the app.

4- Utilize the available commands to initiate or terminate a call.

I'd appreciate any assistance or insights to ensure I set up the WebSocket app correctly and implement call functionalities in our web application. Thank you!
Andreas Fink
Moderator Registered 12 years 277 days
Andreas Fink (innovaphone) Thursday, 11 January 2024, 12:02 PM
1 of 1 users consider this post helpful
Re: Custom application - Start/End a call
Hello Nick,

> 1- I need to create a WebSocket app on the PBX
>
> What URL should I configure?
> Which APIs do I need access to? (PbxAPI / RCC)
> What apps should I select on the last tab page?
> https://sdk.innovaphone.com/14r1/doc/appwebsocket/AppWebsocket.htm
>
>
> 2- Establish a WebSocket connection to the configured URL.
>
> 3- Log in to the app.

There are two possibilities how a WebSocket connection between a PBX and an App Service (a back-end of an application or an external web service) is established:

1. The PBX establishes a WebSocket connection to an URL that is configured on the corresponding App Object, that was created solely for this application (the "websocket" option on the App Object must be enabled for outgoing WS connections). It will use the password stored on this app object to calculate a digest to be able to authenticate against the web service. In this case you have to accept an incoming WebSocket connection and also implement the authentication message flow (process incoming AppChallenge/AppChallengeResult and AppLogin/AppLoginResult messages, see AppWebsocket.htm).

2. The app service (in your case the NodeJS application) establishes a WebSocket connection to the PBX by using a universal URL http://1.2.3.4/PBX0/APPS/websocket, where only the host part must be adjusted to met the local configuration used in your PBX setup (e.g. https://pbx.example.com/PBX0/APPS/websocket). In this case you have to implement the authentication flow, but in different direction - your application send AppLogin and get AppLoginResult from the PBX. The password configured on the App Object is used to calculate the digest in the same way as in previous case. By defining the "app" property in the AppLogin message you define which App Object in the PBX is used to authenticate against the PBX.


https://sdk.innovaphone.com/14r1/doc/appwebsocket/AppWebsocket.htm



> 4- Utilize the available commands to initiate or terminate a call.

Depending on the application, you have to use different APIs provided by the PBX. In the case of a CRM application the RCC API for call control and TableUsers or Admin API for user enumeration could be used. Which API is allowed to be used is defined on the particular App Object where the WebSocket connection is established. It is also possible to access APIs provided by other App Services by enabling them on the Apps tab of the App Object ("What apps should I select on the last tab page?"). But in your case it is probably not required to use any other APIs.

Best Regards
Andreas Fink
← You can define your color theme preference here