<div dir="auto">Agreed, just go with dispatcher (I usually do random, which distributes the calls pretty well)</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 9 Sep 2022 at 12:00, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Vadim,<br>
<br>
The 2 INVITE requests are not part of the same dialog, so you cannot use <br>
dlg_val's - each initial INVITE is creating a different dialog.<br>
<br>
Now, if you really want, you can rely on the fact that the 2 INVITEs <br>
have the same call-id and and use the cachedb_local to remember which <br>
Ast box handled the first INVITE. But this somehow will invalidate the <br>
whole idea of balancing calls.<br>
<br>
Regards,<br>
<br>
Bogdan-Andrei Iancu<br>
<br>
OpenSIPS Founder and Developer<br>
   <a href="https://www.opensips-solutions.com" rel="noreferrer" target="_blank">https://www.opensips-solutions.com</a><br>
OpenSIPS Summit 27-30 Sept 2022, Athens<br>
   <a href="https://www.opensips.org/events/Summit-2022Athens/" rel="noreferrer" target="_blank">https://www.opensips.org/events/Summit-2022Athens/</a><br>
<br>
On 9/9/22 10:44 AM, Vadim Dumalekov wrote:<br>
> Thanks!<br>
><br>
> I have one more question. Why can't the dlg_val be set in this case.<br>
> This variable (dlg_val) is not passed to the second INVITE, although it is a SIP Dialog (INVITE -> 401 -> ACK -> INVITE ...)<br>
><br>
><br>
>> 9 сент. 2022 г., в 9:14, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>> написал(а):<br>
>><br>
>> Hi,<br>
>><br>
>> Considering the fact that Ast_2 cannot perform auth on a challenge done by Ast_1, you should re-consider the routing logic in OpenSIPS, and not to use LB, but rather dispatcher with hashing over call-id for example.<br>
>><br>
>> Regards,<br>
>><br>
>> Bogdan-Andrei Iancu<br>
>><br>
>> OpenSIPS Founder and Developer<br>
>>   <a href="https://www.opensips-solutions.com" rel="noreferrer" target="_blank">https://www.opensips-solutions.com</a><br>
>> OpenSIPS Summit 27-30 Sept 2022, Athens<br>
>>   <a href="https://www.opensips.org/events/Summit-2022Athens/" rel="noreferrer" target="_blank">https://www.opensips.org/events/Summit-2022Athens/</a><br>
>><br>
>> On 9/8/22 1:43 PM, Vadim Dumalekov via Users wrote:<br>
>>> Thank you for the answer!<br>
>>><br>
>>> Yes, of cource. But there is this situation:<br>
>>><br>
>>> UAC (INVITE w/o auth)  ->  OpenSIPS (LB: Ast_1)  ->  Ast_1 (401 Unauth)<br>
>>> UAC (INVITE with auth)  ->  OpenSIPS (LB: Ast_2)  ->  Ast_2 (401 Unauth)<br>
>>><br>
>>> ... etc, until LB selects the same Asterisk for two INVITE`s (w/o auth and with auth).<br>
>>><br>
>>><br>
>>> Vadim<br>
>>><br>
>>>> 8 сент. 2022 г., в 12:16, Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>> написал(а):<br>
>>>><br>
>>>> Hi Vadim,<br>
>>>><br>
>>>> If you have a cluster of ASterisk servers, each box from the cluster should be able to handle the auth response, even if the challenge was done by a different one. Otherwise it is not a cluster, but a bunch of servers.<br>
>>>><br>
>>>> Regards,<br>
>>>><br>
>>>> Bogdan-Andrei Iancu<br>
>>>><br>
>>>> OpenSIPS Founder and Developer<br>
>>>>   <a href="https://www.opensips-solutions.com" rel="noreferrer" target="_blank">https://www.opensips-solutions.com</a><br>
>>>> OpenSIPS Summit 27-30 Sept 2022, Athens<br>
>>>>   <a href="https://www.opensips.org/events/Summit-2022Athens/" rel="noreferrer" target="_blank">https://www.opensips.org/events/Summit-2022Athens/</a><br>
>>>><br>
>>>> On 9/7/22 3:52 PM, Vadim Dumalekov via Users wrote:<br>
>>>>> Hello!<br>
>>>>><br>
>>>>> Please help me. I'm using the Load_Balancer module for the incoming calls to an Asterisk cluster. When an INVITE is sent to one of the Asterisks, we receive the "401 Unauthorized" message from that server. But when UAC sends the INVITE with the authorization, the LB-module sends it to another Asterisk. Sometimes it happens multiple times.<br>
>>>>><br>
>>>>><br>
>>>>> Thanks in advance!<br>
>>>>><br>
>>>>> Vadim.<br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> Users mailing list<br>
>>>>> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
>>>>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
>>>> _______________________________________________<br>
>>>> Users mailing list<br>
>>>> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
>>>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
>>> _______________________________________________<br>
>>> Users mailing list<br>
>>> <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
>>> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div>