[SR-Users] Kamailio + Websocket issues

Vinicius Kwiecien Ruoso vinicius at leads2b.com
Wed Mar 24 21:51:00 CET 2021


Hi!

Thanks for the fast response. Sorry about not replying to the correct
email, I've just entered the list and was not getting its individual
emails.

> So it’s an outbound call to a webrtc registered user? If so, kamailio
> should route it to wherever the called user is registered.

Yes, it is a call from the backend Asterisk to a user registered via
the websocket. The register is not stored in Kamailio, so it needs to
use the information in the INVITE message to be able to route to the
correct connection.

> you'll need to share your config and logs. This should work in your scenario.

Turns out looking closer, Asterisk is not respecting the Path protocol
[1] [2]. In the INVITE sent to Kamailio, there is no information about
the path in the message.

To me the best second approach that should work is the "alias="
information in the contact. That makes sense?

I'm sharing my current config as an attachment here. I'm new to
Kamailio, so I might be missing something really obvious here.

[1] https://issues.asterisk.org/jira/browse/ASTERISK-28211
[2] https://community.asterisk.org/t/pjsip-path-module-issues/88046/12

Thanks,
Vinicius

On Tue, Mar 23, 2021 at 6:43 PM Vinicius Kwiecien Ruoso
<vinicius at leads2b.com> wrote:
>
> Hi!
>
> I'm using Kamaio in front of multiple Asterisk instances. At this
> moment it works as a SIP over Websocket proxy, with rtpengine, for
> browser clients to connect to Asterisk using WebRTC. I do not use the
> registration module of Kamailio, as each backend Asterisk is
> independent and handles its own registrations.
>
> Everything works great when making calls from the browser, and the
> routing is correctly executed by Kamailio based on the request SIP
> domain. We have an internal routing API that it calls to discover
> which backend Asterisk to route the calls.
>
> The issue I have is when a call initiates from that backend Asterisk,
> trying to reach a contact that is connected in Kamailio via the
> websocket. The Asterisk sends the message to the proxy, and Kamailio
> must route it to the corresponding websocket.
>
> I've tried a few approaches:
> - using add_contact_alias + handle_ruri_alias: I have the alias with
> alias=<ip>~<port>~ws in the contact registration, but for some reason
> handle_ruri_alias cannot use it
> - using the Path module on Asterisk, so when registering, the path is
> recorded and sent back from Asterisk, Kamailio is also not respecting
> that
> - Using contact_param_encode and contact_param_encode and
> contact_param_decode_ruri, but the encoded sip address is always the
> invalid websocket, like sip:58c0ktrg at 5hp0nn5hqqv9.invalid;transport=ws
>
> None with success. Any hints on that can be wrong? I can share more
> detailed information.
>
> Greetings,
> Vinicius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list_kamailio_config.cfg
Type: application/octet-stream
Size: 22908 bytes
Desc: not available
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210324/2d2df1b7/attachment.obj>


More information about the sr-users mailing list