Picture of tsn
Registered 5 years 49 days
tsn Monday, 21 September 2020, 07:49 AM
PBX connection
Hi guys,

In the discussion http://class.innovaphone.com/moodle2/mod/forum/discuss.php?d=25360 I've found the following:

Because generally the PBX will connect to your service and there you can use the name of the PBX to accept the connection only for the desiered one. For that case there is no need to know the IP address. The name is something you need to define in the settings of your app. The calendar is an example of how that works. There you can give the name of the master PBX the calendar will accept connections from. All other PBX connections will be denied.

You can check that in the AppWebsocketMessage() function. When connected, you will get an PbxInfo message. The JSON for that message will have a "pbx" property which holds the name of the PBX connected. If the name is the same as the configured one, everything is fine. If not, close the connection by calling AppWebsocketClose(). (This are functions from the AppWebsocket class).

In my environment I see this connection happens but not always and usually I receive only once after restarting App Platform. And even this restart does not guarantee this connection to be happen.

My question is how I can configure this connection to be established all the time my App Instance is started?

Best regards,
Sergey
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 235 days
Daniel Deterding (innovaphone) Monday, 21 September 2020, 09:19 AM
Re: PBX connection
Hi Sergey,

this is a TCP connection with TCP keepalive. If the connection is lost without a gracefull shutdown, the PBX doesn't know at once that this connection is not available anymore. In such a case, it might take some minutes until the PBX realizes that this connection is dead and reconnects to the App instance.

Do you take care in your app, that your sessions are correctly closed if you stop the instance through the AP Manager? (in debugging scenario this doesn't work, as stopping debugging kills the app directly without the possibility to async close the open sessions).

Greetings,
Daniel
Picture of tsn
Registered 5 years 49 days
tsn Monday, 21 September 2020, 09:47 AM
Re: PBX connection
Hi Daniel,

Thank you for quick reply.

> Do you take care in your app, that your sessions are correctly closed if you stop the instance through the AP Manager?

Yes, I think it takes care to gracefully close the connection as I've tested with your default application. I've generated it when I create a new project using template in Visual Studio.
Picture of tsn
Registered 5 years 49 days
tsn Tuesday, 22 September 2020, 10:11 PM
Re: PBX connection
Hi Daniel,

Could you please clarify where I can find any logs for the PBX connection? Or maybe you can suggest some way to investigate this issue further as it may be some issue with our current configuration.
Picture of Daniel Deterding (innovaphone)
Moderator Registered 15 years 235 days
Daniel Deterding (innovaphone) Wednesday, 23 September 2020, 08:10 AM
Re: PBX connection
Hi Sergey,

there are different ways to trace these websocket messages:

1. On the PBX itself with a specific trace flag. Open the UI of your Gateway/IPVA and enable the PBX tracing flag under Maintenance -> Tracing. You will then see websocket traces inside the trace, which you can open on the same page (I attached a sample trace).

2. On the PBX itself with Wireshark traces. Go to Maintenance -> Tracing, enable "All IPv4 TCP/UDP Traffic" + "All IPv4 TLS Traffic" + "Enable RPCAP" and then Remote Capture with wireshark the TCP sessions directly, see http://wiki.innovaphone.com/index.php?title=Howto:Pcap#Capturing_with_wireshark

3. On the AP Manager: open the AP Manager, click on your App Service in the left tree, click on your App Instance in the right list and then on Diagnostics. Here you can enable AppWebsocket traces and also Webservertraffic which will enable you to see the incoming websocket connections to your App Instance.

Greetings,
Daniel
websocket.txt
← You can define your color theme preference here