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.
>
> 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