Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently In a research project for work we were looking into integrating SIP phone functionality into our existing client flutter app. The main constraint was that it had to work with a 3cx server.
Unfortunately 3cx doesn't accept web socket connections and seeing as this was the only viable dart sip ua package on pub dev I had to go about adding the ability to connect to 3cx over tcp with this package.
I have successfully registered with a 3cx server and made calls between two clients.
I then went back and made sure that I could still register fine with an Asterisk server on FreePBX using the existing websockets.
In a nutshell what i did was abstract out the websocket class into a socket_interface. Then have web_socket and tcp_socket classes extend this abstracted interface.
In the example app when you register the connection, a type is chosen with a radio check box.
When what ever type is chosen, the sip_ua_helper creates the appropriate socket types and adds them to the array of sockets.
The rest of the package carries on as usual not caring about what type of socket is used. It just calls .send() on the socket interface and the sockets deal with how they connect.
At the risk of sounding lame, im hoping this will eventually be accepted as it will be my first contribution as a developer to public open source code :)