Connect from android to Asterisk webrtc port 8089 websocket

Hi,
I am developing a voice call system with webrtc and asterisk, i do it in browser with jssip library, this library use websocket and connect to 8089/ws port of asterisk for signaling, asterisk configured to support webrtc as mentioned in document.
every thing worked find.

but in android i used some sip client like pjsip but all of them use port 5060 and do not use websocket port 8089 for signaling, i need to use websocket like browser in android. how can i do that? is there any library for this? or should i write it from scrach?

Hi,
I am developing a voice call system with webrtc and asterisk, i do it in
browser with jssip library, this library use websocket and connect to
8089/ws port of asterisk for signaling, asterisk configured to support
webrtc as mentioned in document. every thing worked find.

but in android i used some sip client like pjsip but all of them use port
5060

PJSIP will certainly use port 5060, because it’s a SIP library and SIP by
default uses port 5060.

and do not use websocket port 8089 for signaling, i need to use websocket
like browser in android. how can i do that? is there any library for this?

There probably is, but I think this is the wrong place to ask for that sort of
detail about Android app development.

or should i write it from scrach?

I don’t think this is an Asterisk question. You’ll be lucky if anyone here
knows this sort of thing.

You’re probably better off asking on some Android developers’ list.

Antony.

The HTTP module in Asterisk, in conjunction with the relevant PJSIP modules, will support WebRTC over websockets, you’ll need to enable WebRTC for the endpoint in pjsip.conf, and configure http.conf with your desired port, and SSL certificates.

You can NOT expect SIP devices to be able to connect to the WebRTC enabled endpoint. That is a SIP device using the same credentials as a the WebRTC client, will not always work properly due the the required encryption in the WebRTC communication.

But Asterisk is perfectly capable of supporting WebRTC over Websockets on port 8089.

1 Like

are you building an android app with flutter ?

no, its native with java or kotlin

i used jssip library in browser and it support sip over websocket and work find
but in android i can not find sip client to support sip over websocket.
is there any library?

  1. This is not an Adnroid list or community - you might be better off asking
    this sort of question on one of those.

  2. I have personally never used websockets, however I suspect your question
    may be misguided, as I don’t believe one uses “SIP over websocket” - one uses
    either SIP, or else websocket.s

See if WebSocket or SIP: Which is Better for Your App? - Symbl.ai
helps.

Antony.

Is that an opinion or a guess at how it works?

Anyways, most of the solutions I’ve seen with websockets, actually does send SIP packets over the websocket connection, using it as a transport for the SIP messages. When using websockets with Asterisk, you more or less replace TCP or UDP as a transport, with websocket.

Is that an opinion or a guess at how it works?

It’s based on a minimal amount of research (also please also see the link I
posted along with this information).

Anyways, most of the solutions I’ve seen with websockets, actually does
send SIP packets over the websocket connection, using it as a transport
for the SIP messages. When using websockets with Asterisk, you more or
less replace TCP or UDP as a transport, with websocket.

Okay, thanks for some enlightenment :slight_smile:

Antony.

Hello, you can use sip.js ou jssip with react-native to build an application on android and ios. Also check React Native WebRTC · GitHub for the webrtc part in react-native.

I did take a short look at it, but didn’t read it throughly.

What I got from it, it’s about choosing what to use for an isolated system, and for that, it’s more or less a matter of preferences, and what you pick for the server side. But adding another layer of signalling on top of websockets might be overkill, if all you need to do is to connect to users of a website.

However, in ANY case where you want to make some sort of direct connection to the PSTN, it will most likely be easier to use SIP as much as possible, to avoid having to convert between 2 different signalling protocols, or even inventing your own.

Also for a stand alone, not Telephone communications system, I would most likely use something other than Asterisk, there are lots of other options for realtime communications, that’s not really phone calls.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.