igniterealtime / Openfire-Chat

Chat API (REST) for Openfire
https://discourse.igniterealtime.org/t/openfire-chat-api/68792
15 stars 8 forks source link

How to implement one-to-one message incoming listener in android using SSE rest api ? #15

Open meidikawardana opened 4 years ago

meidikawardana commented 4 years ago

Here are some detail about my problem:

a. I already installed ofswitch from https://github.com/Traderlynk/Etherlynk-Server, but I don't know how to check if it is enabled or not?

b. I really don't find any documentation or info about how I can open SIP websocket connection for a user?

c. Where I can find details about ofswitch plugin ?

d. How to create SSE connection on (Android) client?

e. How to code handler to handle incoming message, or incoming listener in android?

f. When I open https://localhost:7443/apps/sse/index.html , I see: HTTP ERROR 503. I assume I need to install a plugin or set something for it to work. Where I can find the detail it ?

I already posted to stackoverflow and igniterealme discourse forum but no one answered yet

deleolajide commented 4 years ago

a. I already installed ofswitch from https://github.com/Traderlynk/Etherlynk-Server, but I don't know how to check if it is enabled or not?

That version is out of date and no more supported. Use this

b. I really don't find any documentation or info about how I can open SIP websocket connection for a user?

There is none. Look at the source code of a client that uses it like Pade. You create a websocket connection to FreeSwith directly. If you want to use openfire as a proxy in order to reuse the SSL port 7443, then can use

"wss://" + options.hosts.server + "/sip/proxy?url=ws://" + pade.sip.server + ":5066";

c. Where I can find details about ofswitch plugin ?

None. Sorry, read the source code. It is a plugin that makes a connection to FreeSwitch and exposes the API so that other plugins like Openfire Chat can use it.

d. How to create SSE connection on (Android) client?

I have no idea. It is an HTTP Spec so try and google on how to

f. When I open https://localhost:7443/apps/sse/index.html , I see: HTTP ERROR 503

You need to provide basic authenticate headers and already login with the Openfire Chat REST API. Otherwise, there is no data to send you over the SSE connection.

Where I can find the detail it ?

None. Read the source code or get a developer account at signalwire.com, the hosted FreeSwitch service. They have a team supporting it an can afford to provide documentation.

deleolajide commented 4 years ago

Read https://discourse.igniterealtime.org/t/openfire-chat-api/68792/62

You might find something useful there