<div dir="ltr">Yes, <i>add_contact_alias</i> for register on the way to asterisk followed by <i>handle_ruri_alias</i> for requests from asterisk will do the job.<div><br></div><div>I assume you followed the famous <a href="https://github.com/havfo/WEBRTC-to-SIP">https://github.com/havfo/WEBRTC-to-SIP</a></div><div><br></div><div>Regards,</div><div>--Sergiu</div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 26, 2021 at 11:04 AM Vinicius Kwiecien Ruoso <<a href="mailto:vinicius@leads2b.com">vinicius@leads2b.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Asterisk 13 will be EOL soon, so that would be my last resort.<br>
<br>
Do you have any input if the contact alias should be enough to get<br>
this working in that case?<br>
<br>
On Thu, Mar 25, 2021 at 9:47 AM Sergiu Pojoga <<a href="mailto:pojogas@gmail.com" target="_blank">pojogas@gmail.com</a>> wrote:<br>
><br>
> Use asterisk 13 with chan_sip + PATH<br>
><br>
> Regardless, it's becoming off-topic as the quarrel is with Asterisk.<br>
><br>
> On Thu, Mar 25, 2021 at 8:16 AM Vinicius Kwiecien Ruoso <<a href="mailto:vinicius@leads2b.com" target="_blank">vinicius@leads2b.com</a>> wrote:<br>
>><br>
>> Hi David,<br>
>><br>
>> Each Asterisk is independent in my setup. Also, the issue is with<br>
>> calls from Asterisk with destination to a client connected via<br>
>> websocket. The browser is not directly connected to Asterisk, but to<br>
>> Kamailio.<br>
>><br>
>> Thanks,<br>
>> Vinicius<br>
>><br>
>> On Thu, Mar 25, 2021 at 7:01 AM David Villasmil<br>
>> <<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a>> wrote:<br>
>> ><br>
>> > Send the invite to all asterisk, whichever has it will respond.<br>
>> ><br>
>> > On Thu, 25 Mar 2021 at 01:41, Vinicius Kwiecien Ruoso <<a href="mailto:vinicius@leads2b.com" target="_blank">vinicius@leads2b.com</a>> wrote:<br>
>> >><br>
>> >> Hi Segiu,<br>
>> >><br>
>> >> Yeah, I understand that won't be the way forward, so I need another<br>
>> >> way for Kamailio to figure out the route to the websocket when<br>
>> >> Asterisk is making the call.<br>
>> >><br>
>> >> I've shared my config file, also with some attempts commented in the<br>
>> >> previous emails. The alternatives were to use an alias, or an encoded<br>
>> >> param. I think the alias would be a better alternative, but could not<br>
>> >> get it right yet.<br>
>> >><br>
>> >> Greetings,<br>
>> >> Vinicius<br>
>> >><br>
>> >> On Wed, Mar 24, 2021 at 7:16 PM Sergiu Pojoga <<a href="mailto:pojogas@gmail.com" target="_blank">pojogas@gmail.com</a>> wrote:<br>
>> >> ><br>
>> >> > Vinicius,<br>
>> >> ><br>
>> >> > The obvious is that PATH is broken in Asterisk's PJSIP and they won't do anything about it as it's marked "minor". It's been 2 yrs now that me and others have reported it.<br>
>> >> > [3] <a href="https://community.asterisk.org/t/wrong-d-uri-for-invites-with-pjsip-and-path/74079" rel="noreferrer" target="_blank">https://community.asterisk.org/t/wrong-d-uri-for-invites-with-pjsip-and-path/74079</a><br>
>> >> ><br>
>> >> > Bottom line: there's nothing wrong with Kamailio. Start looking for a workaround, don't bet on Sangoma to fix it any time soon, lol.<br>
>> >> ><br>
>> >> > Regards,<br>
>> >> > --Sergiu<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > On Wed, Mar 24, 2021 at 4:52 PM Vinicius Kwiecien Ruoso <<a href="mailto:vinicius@leads2b.com" target="_blank">vinicius@leads2b.com</a>> wrote:<br>
>> >> >><br>
>> >> >> Hi!<br>
>> >> >><br>
>> >> >> Thanks for the fast response. Sorry about not replying to the correct<br>
>> >> >> email, I've just entered the list and was not getting its individual<br>
>> >> >> emails.<br>
>> >> >><br>
>> >> >> > So it’s an outbound call to a webrtc registered user? If so, kamailio<br>
>> >> >> > should route it to wherever the called user is registered.<br>
>> >> >><br>
>> >> >> Yes, it is a call from the backend Asterisk to a user registered via<br>
>> >> >> the websocket. The register is not stored in Kamailio, so it needs to<br>
>> >> >> use the information in the INVITE message to be able to route to the<br>
>> >> >> correct connection.<br>
>> >> >><br>
>> >> >> > you'll need to share your config and logs. This should work in your scenario.<br>
>> >> >><br>
>> >> >> Turns out looking closer, Asterisk is not respecting the Path protocol<br>
>> >> >> [1] [2]. In the INVITE sent to Kamailio, there is no information about<br>
>> >> >> the path in the message.<br>
>> >> >><br>
>> >> >> To me the best second approach that should work is the "alias="<br>
>> >> >> information in the contact. That makes sense?<br>
>> >> >><br>
>> >> >> I'm sharing my current config as an attachment here. I'm new to<br>
>> >> >> Kamailio, so I might be missing something really obvious here.<br>
>> >> >><br>
>> >> >> [1] <a href="https://issues.asterisk.org/jira/browse/ASTERISK-28211" rel="noreferrer" target="_blank">https://issues.asterisk.org/jira/browse/ASTERISK-28211</a><br>
>> >> >> [2] <a href="https://community.asterisk.org/t/pjsip-path-module-issues/88046/12" rel="noreferrer" target="_blank">https://community.asterisk.org/t/pjsip-path-module-issues/88046/12</a><br>
>> >> >><br>
>> >> >> Thanks,<br>
>> >> >> Vinicius<br>
>> >> >><br>
>> >> >> On Tue, Mar 23, 2021 at 6:43 PM Vinicius Kwiecien Ruoso<br>
>> >> >> <<a href="mailto:vinicius@leads2b.com" target="_blank">vinicius@leads2b.com</a>> wrote:<br>
>> >> >> ><br>
>> >> >> > Hi!<br>
>> >> >> ><br>
>> >> >> > I'm using Kamaio in front of multiple Asterisk instances. At this<br>
>> >> >> > moment it works as a SIP over Websocket proxy, with rtpengine, for<br>
>> >> >> > browser clients to connect to Asterisk using WebRTC. I do not use the<br>
>> >> >> > registration module of Kamailio, as each backend Asterisk is<br>
>> >> >> > independent and handles its own registrations.<br>
>> >> >> ><br>
>> >> >> > Everything works great when making calls from the browser, and the<br>
>> >> >> > routing is correctly executed by Kamailio based on the request SIP<br>
>> >> >> > domain. We have an internal routing API that it calls to discover<br>
>> >> >> > which backend Asterisk to route the calls.<br>
>> >> >> ><br>
>> >> >> > The issue I have is when a call initiates from that backend Asterisk,<br>
>> >> >> > trying to reach a contact that is connected in Kamailio via the<br>
>> >> >> > websocket. The Asterisk sends the message to the proxy, and Kamailio<br>
>> >> >> > must route it to the corresponding websocket.<br>
>> >> >> ><br>
>> >> >> > I've tried a few approaches:<br>
>> >> >> > - using add_contact_alias + handle_ruri_alias: I have the alias with<br>
>> >> >> > alias=<ip>~<port>~ws in the contact registration, but for some reason<br>
>> >> >> > handle_ruri_alias cannot use it<br>
>> >> >> > - using the Path module on Asterisk, so when registering, the path is<br>
>> >> >> > recorded and sent back from Asterisk, Kamailio is also not respecting<br>
>> >> >> > that<br>
>> >> >> > - Using contact_param_encode and contact_param_encode and<br>
>> >> >> > contact_param_decode_ruri, but the encoded sip address is always the<br>
>> >> >> > invalid websocket, like sip:58c0ktrg@5hp0nn5hqqv9.invalid;transport=ws<br>
>> >> >> ><br>
>> >> >> > None with success. Any hints on that can be wrong? I can share more<br>
>> >> >> > detailed information.<br>
>> >> >> ><br>
>> >> >> > Greetings,<br>
>> >> >> > Vinicius<br>
>> >> >> _______________________________________________<br>
>> >> >> Kamailio (SER) - Users Mailing List<br>
>> >> >> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> >> >> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > Kamailio (SER) - Users Mailing List<br>
>> >> > <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> >> > <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> Kamailio (SER) - Users Mailing List<br>
>> >> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> >> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>> ><br>
>> > --<br>
>> > Regards,<br>
>> ><br>
>> > David Villasmil<br>
>> > email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a><br>
>> > phone: +34669448337<br>
>> > _______________________________________________<br>
>> > Kamailio (SER) - Users Mailing List<br>
>> > <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> > <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>><br>
>> _______________________________________________<br>
>> Kamailio (SER) - Users Mailing List<br>
>> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>