Re: [OpenSIPS-Users] Call Branching in parallel and series

2022-11-01 Thread Liviu Chircu

On 01.11.2022 17:12, Conrad de Wet wrote:


This works, except I want to extend this even further. I want these 4 
branches to keep trying on a loop until the transaction timeout occurs 
or one of the calls is answered. Except I find that the 
“failure_route” has two main problems, firstly if I try a “t_relay()” 
in the failure_route, the original call gets relayed again and I can’t 
seem to refer back to the branch.


This causes the number of branches to quickly run out (I think max is 
16), as it seem to nest the branch. Also because the t_relay() appears 
to act on the main branch, all the urls are reset, so I don’t really 
know where I was originally sending this request to.


failure_route[my_on_failure]{

    seturi($branch(uri));   # <-- This is null

    t_relay(); # causes new branches that don’t seem to 
kill the old ones.


}


Hi, Conrad!

Re: the confusion around failure_route: the failure route callback 
actually means a "failure to relay", not a "failure of a specific 
branch".  So no matter how many branches you attempted to relay in 
parallel (1, 2, 8, etc.), it means they *all* failed (some explicitly 
with, e.g. a 404, others implicitly with a 408 internal timeout).  So 
now you're in this callback and you're only given the original 
Request-URI of the message, with an opportunity to build a new set of 
branches to relay (optionally with a new failure route callback), or 
just give up and pass the error message back upstream.


On topic:  I'm assuming the need to "keep trying these branches in a 
loop" stems from the fact that the "lookup()" operation may produce 
different results throughout the duration of the call attempt.  So 
instead of having a long transaction timeout, you prefer to have a 
shorter one and keep redo'ing the "failure_route + lookup()" loop in 
hope that the WS device comes online, correct?  If so, you may indeed 
often run into the "max branches exceeded" limitation quite easily this 
way, at least with how the code currently works...


Possible cheap workaround: recompile with a larger MAX_BRANCHES (say, go 
from 12 to 31).  At least you may get your PoC working this way and move 
to solving other problems.  Medium-term, maybe we can look into 
developing some support for creating lots of branches in the "master" 
OpenSIPS tree.


Best regards,

--
Liviu Chircu
www.twitter.com/liviuchircu  |www.opensips-solutions.com
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] - topology_hiding and no ACK

2022-11-01 Thread Nitesh Divecha
Bogdan,

Ah haa! Found it and fixed it!

Much appreciated for your help... This was a good learning experience!

Next up is PSTN routing and local call routing.


Cheers,
Nitesh



On Tue, Nov 1, 2022 at 10:55 AM Bogdan-Andrei Iancu 
wrote:

> Hi Nitesh,
>
> Be sure all the remove_hf() are on the right execution path and BEFORE the
> t_relay() for the sequential requests.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Bootcamp 5-16 Dec 2022, online
>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>
> On 11/1/22 2:15 PM, Nitesh Divecha wrote:
>
> Bogdan,
>
> Thanks for your feedback.
>
> After reading the docs and following this tutorial (
> https://opensips.org/Documentation/Tutorials-Topology-Hiding) I finally
> got it working. Thank you!
>
> INVITE is clean, topology is hidden and ACK is sent back and forth. Calls
> are holding good.
>
> While confirming each ACK and BYE, I noticed Originator's User-Agent is
> passed on again only on to ACK and BYE.
>
> I tried to define under:
>
> route{
>
> if (has_totag()) {
>
> if ( is_method("ACK") ) {
>
> if(remove_hf("User-Agent")){
> xlog("*** has-totag -> ACK
> User-Agent found and removed on $rm from $si (callid=$ci). ***\n");
> }
>
> }
>
> if (is_method("BYE")) {
>
> xlog("*** if is_method(BYE) on $rm from $si (callid=$ci) ***\n");
>
> if(remove_hf("User-Agent")){
>
> xlog("*** is_method BYE User-Agent found and removed on $rm from $si
> (callid=$ci). ***\n");
>
> }
>
> # do accounting even if the transaction fails
>
> do_accounting("db","failed");
>
> }
>
> }
>
> }
>
> But still Originator's User-Agent is passed on to ACK and BYE... Ignore
> the xlog(""), it is just my way of learning what each line is doing and if
> getting executed :-).
>
> Any suggestions?
>
> Cheers,
> Nitesh
>
>
>
>
>
>
>
>
>
> On Thu, Oct 27, 2022 at 11:34 AM Bogdan-Andrei Iancu 
> wrote:
>
>> Hi Nitesh,
>>
>> Where you have the loose_route() in your script right now, use
>> topology_hiding_match()
>>
>> https://opensips.org/html/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>   https://www.opensips-solutions.com
>> OpenSIPS Bootcamp 5-16 Dec 2022, online
>>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>>
>> On 10/27/22 3:51 PM, Nitesh Divecha wrote:
>>
>> Hey Bogdan-Andrei,
>>
>> Thanks for your feedback.
>>
>> To be honest - I don't know!
>>
>> I followed some online tutorials and tried to implement
>> "topology_hiding()" after is_method("INVITE") since the first message
>> sent to Outbound Provider is INVITE.
>>
>> I never tried topology_hiding_match().
>>
>> What is the right way to implement topology_hiding module? My scenario is
>> simple, I'm using the default cfg and making ATA register to OpenSIPS to
>> make Outbound PSTN calls.
>>
>> I guess Bootcamp is the answer :-)
>>
>> Cheers,
>> Nitesh
>>
>>
>> On Thu, Oct 27, 2022 at 4:02 AM Bogdan-Andrei Iancu 
>> wrote:
>>
>>> Hi Nitesh,
>>>
>>> Do you do topology_hiding_match() for the sequential requests (instead
>>> of the typical loose_route()) ?  As it seems you cfg fails to properly
>>> handle the in-dialog / sequential requests.
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>   https://www.opensips-solutions.com
>>> OpenSIPS Bootcamp 5-16 Dec 2022, online
>>>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>>>
>>> On 10/26/22 9:05 PM, Nitesh Divecha wrote:
>>>
>>> Hello All,
>>>
>>> I don't know if this is by design or me not implementing correctly! I'm
>>> a newbie to OpenSIPS...
>>>
>>> So I generated a new opensips_residential.cfg file and only edited it
>>> with topology_hiding("UC"); under INVITE. Plus all the extras to make ATA
>>> register successfully and SIP trunk.
>>>
>>> Every time I make a call two INVITE dialogs are created. One from ATA to
>>> OpenSIPS and second one from OpenSIPS to Outbound Provider. When a PSTN
>>> call is answered, the Outbound Provider sends 200 OK back to OpenSIPS, and
>>> OpenSIPS sends back 200 OK to ATA. Then ATA acknowledges with ACK back to
>>> OpenSIPS BUT OpenSIPS fails to send ACK to the Outbound Provider. So
>>> Outbound Provider sends 200 OK again to OpenSIPS and OpenSIPS sends 200 OK
>>> to ATA then ATA acknowledges with ACK back to OpenSIPS BUT OpenSIPS fails
>>> to send back ACK... This dance goes on for 30 secs and until Outbound
>>> Provider drops the call due to no ACK.
>>>
>>> On the sngrep it shows that call from ATA to OpenSIPS "COMPLETED" while
>>> OpenSIPS to Outbound Provider "CALL SETUP".
>>>
>>> If I comment out topology_hiding("UC"); then everything works perfectly
>>> and sngrep shows only one INVITE dialog from ATA to OpenSIPS to Outbound
>>> Provider except the Outbound Provider can see everything that is 

[OpenSIPS-Users] Call Branching in parallel and series

2022-11-01 Thread Conrad de Wet
Hi All, 
I’m trying to work out how to Fork/Branch calls to various contacts.
 
Firstly, my setup is that I have, let’s say, OpenSIPS-Gateway(os-gw) and 
OpenSIPS-Websocket clients (os-ws). Both of these are a load balanced array of 
servers. So when a client registers on os-ws he could register on any of the 
possible os-ws servers. With os-gw, again there can be N number of servers, but 
this plays little part in my issue, except that all calls are always sent from 
os-ws to os-gw for onward sending, even if the call is to be turned around on 
os-gw back to a registered user on os-ws (internal calling).
 
Let’s take this flow:
[os-ws(x)] <- INVITE > [os-gw(y)] < INVITE > [os-ws(z)]
 
It will be the responsibility of the os-gw to find the correct os-ws (by 
looking in the location table) and sending the call on to the correct os-ws 
server, so that in can reach the actual client endpoint. 
 
I’m busy with my own sort of “lookup()” replacement but with a few more 
encasements. I have managed to get the contacts list form the database, and can 
call something like:
 
seturi("sip:bob@10.0.0.3");
append_branch("sip:bob1@10.0.0.2");
append_branch("sip:bob2@10.0.0.2");
append_branch("sip:bob3@10.0.0.1");
t_relay();
 
This works, except I want to extend this even further. I want these 4 branches 
to keep trying on a loop until the transaction timeout occurs or one of the 
calls is answered. Except I find that the “failure_route” has two main 
problems, firstly if I try a “t_relay()” in the failure_route, the original 
call gets relayed again and I can’t seem to refer back to the branch.
 
This causes the number of branches to quickly run out (I think max is 16), as 
it seem to nest the branch. Also because the t_relay() appears to act on the 
main branch, all the urls are reset, so I don’t really know where I was 
originally sending this request to.
 
failure_route[my_on_failure]{
seturi($branch(uri));   # <-- This is null
t_relay(); # causes new branches that don’t seem to kill the 
old ones.
}
 
So basically, I’m trying to parallel fork the original call (probably no more 
than about 5), and have these branches, retry in a loop (series) until one of 
the contacts answers or the timeout occurs, at this time the cancel will be 
sent to all the “other” branches (probably t_cancel_branch("o") would work for 
that, but I have not been able to test this).
 
The ultimate benefit here: it would be possible that, even if a call has been 
sent to one of the endpoints and is ringing, another endpoint can come online 
and would soon begin to ring. You would have a choice of devices to answer the 
call with.
 
Thanks, Conrad


Sent from my iPhone___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] - topology_hiding and no ACK

2022-11-01 Thread Bogdan-Andrei Iancu

Hi Nitesh,

Be sure all the remove_hf() are on the right execution path and BEFORE 
the t_relay() for the sequential requests.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 5-16 Dec 2022, online
  https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/

On 11/1/22 2:15 PM, Nitesh Divecha wrote:

Bogdan,

Thanks for your feedback.

After reading the docs and following this tutorial 
(https://opensips.org/Documentation/Tutorials-Topology-Hiding 
) I 
finally got it working. Thank you!


INVITE is clean, topology is hidden and ACK is sent back and forth. 
Calls are holding good.


While confirming each ACK and BYE, I noticed Originator's User-Agent 
is passed on again only on to ACK and BYE.


I tried to define under:

route{

if (has_totag()) {

if ( is_method("ACK") ) {

                              if(remove_hf("User-Agent")){
                                        xlog("*** has-totag -> ACK
User-Agent found and removed on $rm from $si (callid=$ci). ***\n");
                                }

}

if (is_method("BYE")) {

xlog("*** if is_method(BYE) on $rm from $si (callid=$ci)
***\n");

if(remove_hf("User-Agent")){

xlog("*** is_method BYE User-Agent found and removed
on $rm from $si (callid=$ci). ***\n");

}

# do accounting even if the transaction fails

do_accounting("db","failed");

}

}

}

But still Originator's User-Agent is passed on to ACK and BYE... 
Ignore the xlog(""), it is just my way of learning what each line is 
doing and if getting executed :-).


Any suggestions?

Cheers,
Nitesh









On Thu, Oct 27, 2022 at 11:34 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


Hi Nitesh,

Where you have the loose_route() in your script right now, use
topology_hiding_match()

https://opensips.org/html/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match



Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  
OpenSIPS Bootcamp 5-16 Dec 2022, online
   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/  


On 10/27/22 3:51 PM, Nitesh Divecha wrote:

Hey Bogdan-Andrei,

Thanks for your feedback.

To be honest - I don't know!

I followed some online tutorials and tried to implement
"topology_hiding()" after is_method("INVITE") since the first
message sent to Outbound Provider is INVITE.

I never tried topology_hiding_match().

What is the right way to implement topology_hiding module? My
scenario is simple, I'm using the default cfg and making ATA
register to OpenSIPS to make Outbound PSTN calls.

I guess Bootcamp is the answer :-)

Cheers,
Nitesh


On Thu, Oct 27, 2022 at 4:02 AM Bogdan-Andrei Iancu
mailto:bog...@opensips.org>> wrote:

Hi Nitesh,

Do you do topology_hiding_match() for the sequential requests
(instead of the typical loose_route()) ?  As it seems you cfg
fails to properly handle the in-dialog / sequential requests.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  

OpenSIPS Bootcamp 5-16 Dec 2022, online
   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/  


On 10/26/22 9:05 PM, Nitesh Divecha wrote:

Hello All,

I don't know if this is by design or me not implementing
correctly! I'm a newbie to OpenSIPS...

So I generated a new opensips_residential.cfg file and only
edited it with topology_hiding("UC"); under INVITE. Plus all
the extras to make ATA register successfully and SIP trunk.

Every time I make a call two INVITE dialogs are created. One
from ATA to OpenSIPS and second one from OpenSIPS to
Outbound Provider. When a PSTN call is answered, the
Outbound Provider sends 200 OK back to OpenSIPS, and
OpenSIPS sends back 200 OK to ATA. Then ATA acknowledges
with ACK back to OpenSIPS BUT OpenSIPS fails to send ACK to
the Outbound Provider. So Outbound Provider sends 200 OK
again to OpenSIPS and OpenSIPS sends 200 OK to ATA then ATA
acknowledges with ACK back to OpenSIPS BUT OpenSIPS fails to
send back ACK... This dance goes on for 30 secs and until
Outbound Provider drops the call due to no ACK.

On the sngrep it shows that call from ATA to 

Re: [OpenSIPS-Users] - topology_hiding and no ACK

2022-11-01 Thread Nitesh Divecha
Bogdan,

Thanks for your feedback.

After reading the docs and following this tutorial (
https://opensips.org/Documentation/Tutorials-Topology-Hiding) I finally got
it working. Thank you!

INVITE is clean, topology is hidden and ACK is sent back and forth. Calls
are holding good.

While confirming each ACK and BYE, I noticed Originator's User-Agent is
passed on again only on to ACK and BYE.

I tried to define under:

route{

if (has_totag()) {

if ( is_method("ACK") ) {

if(remove_hf("User-Agent")){
xlog("*** has-totag -> ACK
User-Agent found and removed on $rm from $si (callid=$ci). ***\n");
}

}

if (is_method("BYE")) {

xlog("*** if is_method(BYE) on $rm from $si (callid=$ci) ***\n");

if(remove_hf("User-Agent")){

xlog("*** is_method BYE User-Agent found and removed on $rm from $si
(callid=$ci). ***\n");

}

# do accounting even if the transaction fails

do_accounting("db","failed");

}

}

}

But still Originator's User-Agent is passed on to ACK and BYE... Ignore the
xlog(""), it is just my way of learning what each line is doing and if
getting executed :-).

Any suggestions?

Cheers,
Nitesh









On Thu, Oct 27, 2022 at 11:34 AM Bogdan-Andrei Iancu 
wrote:

> Hi Nitesh,
>
> Where you have the loose_route() in your script right now, use
> topology_hiding_match()
>
> https://opensips.org/html/docs/modules/3.2.x/topology_hiding.html#func_topology_hiding_match
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Bootcamp 5-16 Dec 2022, online
>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>
> On 10/27/22 3:51 PM, Nitesh Divecha wrote:
>
> Hey Bogdan-Andrei,
>
> Thanks for your feedback.
>
> To be honest - I don't know!
>
> I followed some online tutorials and tried to implement
> "topology_hiding()" after is_method("INVITE") since the first message
> sent to Outbound Provider is INVITE.
>
> I never tried topology_hiding_match().
>
> What is the right way to implement topology_hiding module? My scenario is
> simple, I'm using the default cfg and making ATA register to OpenSIPS to
> make Outbound PSTN calls.
>
> I guess Bootcamp is the answer :-)
>
> Cheers,
> Nitesh
>
>
> On Thu, Oct 27, 2022 at 4:02 AM Bogdan-Andrei Iancu 
> wrote:
>
>> Hi Nitesh,
>>
>> Do you do topology_hiding_match() for the sequential requests (instead of
>> the typical loose_route()) ?  As it seems you cfg fails to properly handle
>> the in-dialog / sequential requests.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>   https://www.opensips-solutions.com
>> OpenSIPS Bootcamp 5-16 Dec 2022, online
>>   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/
>>
>> On 10/26/22 9:05 PM, Nitesh Divecha wrote:
>>
>> Hello All,
>>
>> I don't know if this is by design or me not implementing correctly! I'm a
>> newbie to OpenSIPS...
>>
>> So I generated a new opensips_residential.cfg file and only edited it
>> with topology_hiding("UC"); under INVITE. Plus all the extras to make ATA
>> register successfully and SIP trunk.
>>
>> Every time I make a call two INVITE dialogs are created. One from ATA to
>> OpenSIPS and second one from OpenSIPS to Outbound Provider. When a PSTN
>> call is answered, the Outbound Provider sends 200 OK back to OpenSIPS, and
>> OpenSIPS sends back 200 OK to ATA. Then ATA acknowledges with ACK back to
>> OpenSIPS BUT OpenSIPS fails to send ACK to the Outbound Provider. So
>> Outbound Provider sends 200 OK again to OpenSIPS and OpenSIPS sends 200 OK
>> to ATA then ATA acknowledges with ACK back to OpenSIPS BUT OpenSIPS fails
>> to send back ACK... This dance goes on for 30 secs and until Outbound
>> Provider drops the call due to no ACK.
>>
>> On the sngrep it shows that call from ATA to OpenSIPS "COMPLETED" while
>> OpenSIPS to Outbound Provider "CALL SETUP".
>>
>> If I comment out topology_hiding("UC"); then everything works perfectly
>> and sngrep shows only one INVITE dialog from ATA to OpenSIPS to Outbound
>> Provider except the Outbound Provider can see everything that is ATA's IP
>> info, etc...
>>
>> Here is my cfg:
>>
>> route {
>> ...
>> if (dp_translate(10 ,$rU ,$rU) ) {
>> xlog("*** Dial plan translate from source $avp(src) to
>> $rU ***\n");
>>
>> $avp(furi) = "sip:xxx...@gothamcity.com";
>> uac_replace_from( , "$avp(furi)");
>> #strip(1);
>> if (!do_routing(0)) {
>> send_reply(500,"No PSTN Route found");
>> exit;
>> }
>> # t_on_branch("change_from");
>> route(relay);
>> exit;
>> }
>> ...
>> }
>>
>> route[relay] {
>> # for INVITEs enable some additional helper routes
>> if (is_method("INVITE")) {
>> # create_dialog();
>> 

Re: [OpenSIPS-Users] Loadbalancer for Registrations and calls

2022-11-01 Thread Giovanni Maruzzelli
We all understood what you are doing and why

It's just that... the answer is inside you! And it's wrong :) (famous quote
from an Italian comedian)

answered from mobile, please pardon terseness and typos,
-giovanni

On Mon, Oct 31, 2022, 20:41 Kevin Kennedy  wrote:

> Thank you all for your responses.  Maybe I am going about this all wrong.
> Maybe I can explain it better with a drawing of what I am trying to do.  I
> am trying to front end customers with Opensips to Load balance
> Registrations to 4 different SBC's.  These SBC's will have their own
> Registration cache and pass the Registration to the Application servers.  I
> need Opensips to send the INVITE/SUBSCRIBE to the SBC that it has sent the
> Registration to in order to match the Registration cache in that device.
> The only way I saw to do this was with Mid-Registrar and Dispatcher since
> Loadbalancer would not handle Registrations/Subscribes, etc.
>
> [image: image.png]
> Hopefully that can explain what I am trying to do better and help you
> understand what I am trying to accomplish.
>
> Thank you
>
> Kevin
>
> On Mon, Oct 31, 2022 at 6:07 AM Giovanni Maruzzelli 
> wrote:
>
>> On Mon, Oct 31, 2022 at 1:59 PM Giovanni Maruzzelli 
>> wrote:
>>
>>>
>>> You can use the hashing Bogdan proposed, so ds_select will go to the
>>> same machine because it gets the same result from hashing the same input.
>>> In this case, you must find "something" (eg a cleaned TO for register and a
>>> cleaned FROM for INVITE)
>>>
>>
>> or cleaned TO and cleaned TO, for inbound calls
>>
>> -giovanni
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Loadbalancer for Registrations and calls

2022-11-01 Thread Kevin Kennedy
Thank you all for your responses.  Maybe I am going about this all wrong.
Maybe I can explain it better with a drawing of what I am trying to do.  I
am trying to front end customers with Opensips to Load balance
Registrations to 4 different SBC's.  These SBC's will have their own
Registration cache and pass the Registration to the Application servers.  I
need Opensips to send the INVITE/SUBSCRIBE to the SBC that it has sent the
Registration to in order to match the Registration cache in that device.
The only way I saw to do this was with Mid-Registrar and Dispatcher since
Loadbalancer would not handle Registrations/Subscribes, etc.

[image: image.png]
Hopefully that can explain what I am trying to do better and help you
understand what I am trying to accomplish.

Thank you

Kevin

On Mon, Oct 31, 2022 at 6:07 AM Giovanni Maruzzelli 
wrote:

> On Mon, Oct 31, 2022 at 1:59 PM Giovanni Maruzzelli 
> wrote:
>
>>
>> You can use the hashing Bogdan proposed, so ds_select will go to the same
>> machine because it gets the same result from hashing the same input. In
>> this case, you must find "something" (eg a cleaned TO for register and a
>> cleaned FROM for INVITE)
>>
>
> or cleaned TO and cleaned TO, for inbound calls
>
> -giovanni
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Loadbalancer for Registrations and calls

2022-11-01 Thread Kevin Kennedy
Sorry, sent by mistake
continuation of email. DIspatcher module.  Is this what you are referring
to? Or are you referring to something else.

   -

   *alg* - the algorithm(s) used to select the destination address
   (variables are accepted).
   -

  “0” - hash over callid
  -

  “1” - hash over from uri.
  -

  “2” - hash over to uri.
  -

  “3” - hash over request-uri.
  -

  “4” - round-robin (next destination).
  -

  “5” - hash over authorization-username (Proxy-Authorization or
  "normal" authorization). If no username is found, round robin is used.
  -

  “6” - random (using rand()).
  -

  “7” - hash over the content of PVs string. Note: This works only when
  the parameter hash_pvar is set.
  -

  “8” - the first entry in set is chosen.
  -

  “9” - The *pvar_algo_pattern* parameter is used to determine the load
  on each server. If the parameter is not specified, then the
first entry in
  the set is chosen.
  -

  “X” - if the algorithm is not implemented, the first entry in set is
  chosen.
  From what we have always seen on the SBC's is the best identifier for
   looking up the registration cache is the CONTACT header.  As this will have
   the TGRP and Trunk-Context in it.


On Mon, Oct 31, 2022 at 1:00 PM Kevin Kennedy  wrote:

> I am pretty new to Opensips, so maybe I am not understanding what you mean
> by hashing.  The only place I see hashing is on the dispatcher module
>
>
> On Mon, Oct 31, 2022 at 12:44 PM Giovanni Maruzzelli 
> wrote:
>
>> We all understood what you are doing and why
>>
>> It's just that... the answer is inside you! And it's wrong :) (famous
>> quote from an Italian comedian)
>>
>> answered from mobile, please pardon terseness and typos,
>> -giovanni
>>
>> On Mon, Oct 31, 2022, 20:41 Kevin Kennedy  wrote:
>>
>>> Thank you all for your responses.  Maybe I am going about this all
>>> wrong.  Maybe I can explain it better with a drawing of what I am trying to
>>> do.  I am trying to front end customers with Opensips to Load balance
>>> Registrations to 4 different SBC's.  These SBC's will have their own
>>> Registration cache and pass the Registration to the Application servers.  I
>>> need Opensips to send the INVITE/SUBSCRIBE to the SBC that it has sent the
>>> Registration to in order to match the Registration cache in that device.
>>> The only way I saw to do this was with Mid-Registrar and Dispatcher since
>>> Loadbalancer would not handle Registrations/Subscribes, etc.
>>>
>>> [image: image.png]
>>> Hopefully that can explain what I am trying to do better and help you
>>> understand what I am trying to accomplish.
>>>
>>> Thank you
>>>
>>> Kevin
>>>
>>> On Mon, Oct 31, 2022 at 6:07 AM Giovanni Maruzzelli 
>>> wrote:
>>>
 On Mon, Oct 31, 2022 at 1:59 PM Giovanni Maruzzelli 
 wrote:

>
> You can use the hashing Bogdan proposed, so ds_select will go to the
> same machine because it gets the same result from hashing the same input.
> In this case, you must find "something" (eg a cleaned TO for register and 
> a
> cleaned FROM for INVITE)
>

 or cleaned TO and cleaned TO, for inbound calls

 -giovanni

 ___
 Users mailing list
 Users@lists.opensips.org
 http://lists.opensips.org/cgi-bin/mailman/listinfo/users

>>>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Loadbalancer for Registrations and calls

2022-11-01 Thread Kevin Kennedy
I am pretty new to Opensips, so maybe I am not understanding what you mean
by hashing.  The only place I see hashing is on the dispatcher module


On Mon, Oct 31, 2022 at 12:44 PM Giovanni Maruzzelli 
wrote:

> We all understood what you are doing and why
>
> It's just that... the answer is inside you! And it's wrong :) (famous
> quote from an Italian comedian)
>
> answered from mobile, please pardon terseness and typos,
> -giovanni
>
> On Mon, Oct 31, 2022, 20:41 Kevin Kennedy  wrote:
>
>> Thank you all for your responses.  Maybe I am going about this all
>> wrong.  Maybe I can explain it better with a drawing of what I am trying to
>> do.  I am trying to front end customers with Opensips to Load balance
>> Registrations to 4 different SBC's.  These SBC's will have their own
>> Registration cache and pass the Registration to the Application servers.  I
>> need Opensips to send the INVITE/SUBSCRIBE to the SBC that it has sent the
>> Registration to in order to match the Registration cache in that device.
>> The only way I saw to do this was with Mid-Registrar and Dispatcher since
>> Loadbalancer would not handle Registrations/Subscribes, etc.
>>
>> [image: image.png]
>> Hopefully that can explain what I am trying to do better and help you
>> understand what I am trying to accomplish.
>>
>> Thank you
>>
>> Kevin
>>
>> On Mon, Oct 31, 2022 at 6:07 AM Giovanni Maruzzelli 
>> wrote:
>>
>>> On Mon, Oct 31, 2022 at 1:59 PM Giovanni Maruzzelli 
>>> wrote:
>>>

 You can use the hashing Bogdan proposed, so ds_select will go to the
 same machine because it gets the same result from hashing the same input.
 In this case, you must find "something" (eg a cleaned TO for register and a
 cleaned FROM for INVITE)

>>>
>>> or cleaned TO and cleaned TO, for inbound calls
>>>
>>> -giovanni
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Loadbalancer for Registrations and calls

2022-11-01 Thread Bogdan-Andrei Iancu

Hi,

The REGISTERs of used X and the calls to user X will both have the X SIP 
URI into the TO URI, so hashing it will give the same value, so the same 
destination.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 5-16 Dec 2022, online
  https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/

On 10/30/22 7:16 AM, Kevin Kennedy wrote:
I have set the ds_select_dst used in the mid_registrar part of the 
script to hash the To URI


$ru = (ds_select_dst(1, *2*, , "default", 1));

but I am not seeing exactly how to do this for the INVITE. If I use 
ds_select_dst for the INVITE, it just chooses a random destination, 
not performing a match on the Registration destination.


Am I missing something with this?

Is there a way to pull information out of the usrloc contact 
kv-store.  The information that is needed is in the hop field of the 
json string.


Thank you.

On Fri, Oct 28, 2022 at 4:03 AM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


Hi Kevin,

You may try for REGISTERs to do hashing over TO uri and for
INVITEs over TO or RURI - so they may get to the same box.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  
OpenSIPS Bootcamp 5-16 Dec 2022, online
   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/  


On 10/25/22 1:13 AM, Kevin Kennedy wrote:

Yes that is correct.  Trying to send the INVITE to the same
dispatcher destination that the Registration is at.

I will check the Call-ID based dispatching algorithm

Thank you.
Kevin

On Mon, Oct 24, 2022 at 8:50 AM Bogdan-Andrei Iancu
mailto:bog...@opensips.org>> wrote:

Hi Kevin

1) use the call-id based dispatching alg, so the INVITE with
credentials will get sent to the same destination

2) yes, mid-register (as register SIP mechanism) is allows
the UA to receive calls only, it is not related to handling
the outbound calls of the UA. I understand you try to get a
call from A to B to be sent to the same dispatcher
destination as the registers of B, right ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  

OpenSIPS Bootcamp 5-16 Dec 2022, online
   https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/  


On 10/21/22 10:28 PM, Kevin Kennedy wrote:

I believe I have mid_registrar somewhat working with
dispatcher, but I seem to have a coulple issues.

1) When I receive the 401 request the second authentication
INVITE is sending to another $ru host in the dispatcher
instead of the initial one it sent to.
2) How do I send an outbound INVITE matching the
registration cache  to the same $ru that it is Registered to.
    mid_registrar_lookup uses the AOR instead of contact so
it is only allowing the Incoming INVITEs to reach the client.

Thank ou.

Thank you.

On Fri, Aug 19, 2022 at 8:46 AM Alex mailto:ayakim...@gmail.com>> wrote:

Hello,

setup mid registrar easy with this instruction.
https://www.opensips.org/Documentation/Tutorials-MidRegistrar

There is link to config

But It relays every Registration request every 60sec on
my server. Please let me know if you could set up like
on picture in instruction.





чт, 18 авг. 2022 г. в 18:37, Kevin Kennedy
mailto:kennedy4...@gmail.com>>:

I am looking for a configuration to be able to front
end multiple SBC's to load balance Registrations and
keep track of them to send INVITE's to the
corresponding SBC.

I am thinking of using a combination of Dispatcher
and midregister, but not sure how to set this up
correctly.

Any thoughts?

Thank you.

Kevin
___
Users mailing list
Users@lists.opensips.org

http://lists.opensips.org/cgi-bin/mailman/listinfo/users




-- 
С уважением,

Якимкин Алексей
___
Users mailing list
Users@lists.opensips.org