Browser-Phone icon indicating copy to clipboard operation
Browser-Phone copied to clipboard

Text chat is not working

Open prathibhatvm opened this issue 2 years ago • 19 comments

prathibhatvm avatar Mar 14 '22 04:03 prathibhatvm

Chat is not working in the latest version.

prathibhacdac avatar Apr 18 '22 08:04 prathibhacdac

Screenshot (171)

prathibhacdac avatar Apr 18 '22 10:04 prathibhacdac

Error message in console:

[Apr 18 16:01:04] ERROR[15962][C-00000000]: translate.c:1351 ast_translator_best_choice: Cannot determine best translation path since one capability supports no formats [Apr 18 16:01:04] WARNING[15962][C-00000000]: channel.c:6249 ast_request: No translator path exists for channel type SIP (native (g723|ulaw|alaw|gsm|g726|g726aal2|adpcm|slin|slin|slin|slin|slin|slin|slin|slin|slin|lpc10|g729|speex|speex|speex|ilbc|g722|siren7|siren14|testlaw|g719|opus|silk|silk|silk|silk)) to (none) [Apr 18 16:01:04] WARNING[15962][C-00000000]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 58 - Bearer capability not available) == Everyone is busy/congested at this time (1:0/0/1)

prathibhacdac avatar Apr 18 '22 10:04 prathibhacdac

I've configured XMPP and I get the below error:

WebSocket connection to 'wss://bp.erss.in/ws' failed: Error during WebSocket handshake: Unexpected response code: 400

prathibhacdac avatar Apr 18 '22 11:04 prathibhacdac

Console log says: WebSocket connection from '192.168.2.8:34462' could not be accepted - no protocols out of 'xmpp' supported

prathibhacdac avatar Apr 18 '22 11:04 prathibhacdac

Screenshot (172)

prathibhacdac avatar Apr 18 '22 11:04 prathibhacdac

You will need to decide if you are going to use SIP or XMPP.

SIP is not very good at all to use as a chat platform. Its very simple, and doesn't contain any features we are used to, without building it yourself. In this case you have to handle the incoming messages with a message context and process it (send the message on) with dial-plan. https://github.com/InnovateAsterisk/Browser-Phone#chan_pjsip

XMPP is better, but you will now have to setup and run an XMPP server. I used Openfire as my test server ( https://xmpp.org/software/servers/). In this case, behind the scenes, the browser phone will establish two websocket connections, one to the SIP server (normally Asterisk), and the other to Openfire.

When you type out a text message, the system will then send the text via XMPP (if you of course have the Chat Engline on XMPP).

InnovateAsterisk avatar Apr 18 '22 18:04 InnovateAsterisk

I've configured XMPP Server. Still getting the following error:

405 HTTP method GET is not supported by this URL org.jivesoftware.openfire.websocket.OpenfireWebSocketServlet-84ec6a1

prathibhacdac avatar Apr 19 '22 06:04 prathibhacdac

It could be that you are connecting to the Openfire legacy http port, not the websocket port. Unless you have configured Openfire differently to default it will be 7443 for secure websocket connections. This is all available on the settings pages, and you can change it to another port available there.

InnovateAsterisk avatar Apr 19 '22 07:04 InnovateAsterisk

Which version of openfire are you using? I'm using openfire version 4.7.1

prathibhacdac avatar Apr 19 '22 09:04 prathibhacdac

Yes, 4.7.1.

I think it's pretty much the defaults.

image

image

InnovateAsterisk avatar Apr 19 '22 10:04 InnovateAsterisk

Im not sure why its showing the old version number... im pretty sure i upgraded it.

InnovateAsterisk avatar Apr 19 '22 11:04 InnovateAsterisk

Now getting the error as XMPP failed to connect.

prathibhacdac avatar Apr 20 '22 07:04 prathibhacdac

Now getting the error as XMPP failed to connect.

Created the user with name profileUser in ejabberd and this error is resolved.

prathibhacdac avatar Apr 20 '22 07:04 prathibhacdac

The message is not getting delivered. There is only a single blue tick in the message.

prathibhacdac avatar Apr 20 '22 07:04 prathibhacdac

Selecting Buddy: 10105 MESSAGE: sip:[email protected] (extension) Last Activity for 10105 is now: 2022-04-20 07:52:25 UTC Message Accepted: 165044114562457A

prathibhacdac avatar Apr 20 '22 07:04 prathibhacdac

Screenshot (173)

prathibhacdac avatar Apr 20 '22 08:04 prathibhacdac

Nice work so far! (The problem you have now, is that you are still sending as SIP messages)

Now you need to build a peer relationship. This is done by making another XMPP user, first in Openfire, and then in the Browser Phone. So in your case 10105 must be a full XMPP peer user like 10100.

The way the browser phone builds peers, is a little different, (and admittedly needs some work,) but there is no accept/decline system that is typical of XMPP... its a little closer to Whatsapp, that also assumes that if you have manually added a contact, and that contact now sends you a message, then it should be allowed, right? Well, its the same here.

So, now that 10105 is a full SIP&XMPP peer, remove the 10105 SIP peer you have in 10100's buddy list, and add the new buddy as in XMPP peer - see below:

image

You will notice that all the information about the peer cannot be set, that's because it will be collected automatically.

When you add the peer, and send the peer a message, the peer is automatically build on the peer side, so you can both communicate, again, quite similar whatsapp... but without the block option. This is because of a basic assumption this software makes, and that is it will only be used in a single silo format - as in no public domain.

InnovateAsterisk avatar Apr 20 '22 09:04 InnovateAsterisk

Is it mandatory to add the buddy for receiving the chat messages?

prathibhacdac avatar May 10 '22 10:05 prathibhacdac