Re: [OpenSIPS-Users] OpenSips Load balancer. - Overcome limitations of Call Driven Load Balancing

2020-07-27 Thread Chandan PR
Hi Jon, and All

While I was thinking through this approach, one question popped up in my
thought.

Since we run on a full load most of the hours, even if we limit the number
of calls to the faulty destination, it is very much possible that call
drain can happen as the faulty destination errors out immediately.

The only option to make sure the faulty destination doesn't get any calls
is by disabling it right..

Let me know what you think.


On Fri, Jul 24, 2020 at 7:42 PM Jon Abrams  wrote:

> Hi Chandan,
>
> There may be something else purpose built for this, but you can use
> the dialog profiles to track and limit the port usage:
>
> set_dlg_profile("outcarrier","$avp(out_carrier_id)");
>
> if ($avp(out_max_call_limit) > 0)
> {
> set_dlg_profile("profile","$avp(out_qos_profile_id)");
> if
> (get_profile_size("profile","$avp(out_qos_profile_id)","$var(out_gw_count)"))
> {
> if ($var(out_gw_count)>$avp(out_max_call_limit))
> {
> xlog("LIMIT: Call $ci - Max call limit hit by
> $avp(src_addr) on QosProfile $avp(out_qos_profile_id) to gw
> $avp(out_gw_id)\n");
> return(-1);
> }
> }
> }
>
> On Fri, Jul 24, 2020 at 8:55 AM Chandan PR  wrote:
> >
> > Hello Everyone,
> >
> > Currently, we are using Open Sips Load balancer in Call Driven load
> balancing.
> >
> > Our scenario is as below:
> >
> > D - Total Destinations configured at OpenSips
> > P - No of Ports/Sessions Each Destination can handle concurrently
> > C - Total Capacity = D*P
> >
> > We have a Call Loader which loads calls to OpenSips at C and as when the
> result comes further calls get loaded.
> > For some reason, if any destination is not in the right state and sends
> error responses without accepting calls, this introduces a drain scenario.
> > In the drain scenario where all new calls are given to the faulty
> destination as it has more availability.
> >
> > We are currently handling this by
> >
> > Running the loader at 80% of C
> > Disabling the destination in Opensips if 75% of the calls fail for the
> particular destination (Attached loadbalancer.cfg file).
> >
> >
> > But even in this case, it is possible that may call error out as the
> destination is free and calls are loaded.
> >
> > We would like to avoid this scenario to the max possible extent by
> limiting the number of calls we send to this particular destination.
> >
> > Couple of options I see are as below:
> >
> > Wait for a brief period before sending the response to loader when the
> error happens
> > Make OpenSips aware of the destination capacity and adjust ports
> accordingly
> >
> > Write a custom script to poll destination capacity and use MI functions
> to adjust accordingly
> > Or is there any possibility to integrate similar to FreeSwitch driven
> routing
> >
> > Are there any other possibilities of adjusting the OpenSips capacity
> dynamically or make it limit the calls sent to the particular destination?
> >
> > --
> >
> > Regards,
> > Chandan Ravishankar
> > ___
> > 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
>


-- 

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


Re: [OpenSIPS-Users] Opensips MS Teams lost BYE

2020-07-27 Thread John Quick
Chris, it is not about removing lines from the script. It is about not
executing those lines when they are inappropriate.
i.e. "for any SIP requests or SIP responses coming from MS Teams"

Mark, there are several gotchas that I know of with Teams, but I cannot
guess which might apply in your case unless you are able to supply more
details. Is your problem with calls from Teams? Which end is hanging up
first and generating the BYE? Has a loose routed SIP request already got
through okay in that direction - e.g. ACK? Did you leave the call connected
for at least 30 seconds to make sure the call setup worked?

Here are some of the gotchas I know about that are not fully covered in the
blog:
*The double RR headers using FQDN mentioned in the blog must be added to
initial INVITE requests to and from the Teams Proxy - calls in *both*
directions
*Version 2.4.7 of OpenSIPS (and some v3 releases) have a bug that means RR
parameters are not always added - e.g. "r2=on"
*Do not send RR headers to Teams with ";lr=on" as can happen if you have a
Kamailio Proxy in the path. It must just be ";lr"
*Don't call fix_nated_contact for any SIP request or response coming from MS
Teams
*Don't let any downstream Proxy call fix_nated_contact for those requests
either
*If you want an easy life, remove REFER from the Allow header in INVITE's to
Teams and in 200 OK responses being returned to it

I used the siptrace module to capture the SIP packets passing between my SBC
and the Teams Proxy because I had no luck with sngrep decrypting the TLS
even when I pointed it to the certificate key. You need to be able to
inspect those packets to make sure the headers look correct, the ports and
protocols are as expected, etc. In the case of BYE not getting a response,
you could check exactly what is in the Via headers within the BYE.

John Quick
Smartvox Limited
Web: www.smartvox.co.uk



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


Re: [OpenSIPS-Users] Opensips MS Teams lost BYE

2020-07-27 Thread Johan De Clercq
i dont see how you can  handle moh and attended transfer with opensips only.

On Mon, Jul 27, 2020, 11:31 Chris Johnson  wrote:

> We were only able to remove one of the fix_nated_contact lines before it
> broke more than it did fix.
>
>
>
> We’re currently seeking support from Opensips directly to get it all
> working correctly.
>
>
>
> *From:* Mark Miranda 
> *Sent:* 24 July 2020 21:21
> *To:* john.qu...@smartvox.co.uk; OpenSIPS users mailling list <
> users@lists.opensips.org>
> *Cc:* Chris Johnson 
> *Subject:* Re: [OpenSIPS-Users] Opensips MS Teams lost BYE
>
>
>
> CAUTION: This email originated from outside of the organisation. Do not
> click links or open attachments unless you recognise the sender and know
> the content is safe.
>
> I have basically the same problem where the BYE packet does not seem to be
> routing properly, however I am not using any of the nat functions.
>
> > On Jul 6, 2020, at 3:46 AM, John Quick 
> wrote:
> >
> > Chris,
> >
> > You must not call fix_nated_contact() for any SIP requests or SIP
> responses
> > coming from MS Teams.
> > If you do, it will cause exactly the problems you describe for
> loose-routed
> > sequential requests such as BYE.
> >
> > Just to explain: fix_nated_contact() should only be used when the
> messages
> > come via a NAT router. It must not be used for messages coming from a
> Proxy
> > (assuming the Proxy adds a Record-Route header, as happens with Teams),
> even
> > though both cases may appear to need fixing when you use nat_uac_test().
> >
> > John Quick
> > Smartvox Limited
> > Web: www.smartvox.co.uk
> >
> >> I've managed to get the PBX to send the BYE to the SBC and it is now
> > forwarding on to MS (although MS are not sending a reply but we have
> opened
> > a case for this).
> >
> >> We are struggling to get the BYE packet to go back to MS Teams when the
> > call is initiated by Teams.
> >
> >
> > ___
> > 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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips MS Teams lost BYE

2020-07-27 Thread Chris Johnson
We were only able to remove one of the fix_nated_contact lines before it broke 
more than it did fix.

We're currently seeking support from Opensips directly to get it all working 
correctly.

From: Mark Miranda 
Sent: 24 July 2020 21:21
To: john.qu...@smartvox.co.uk; OpenSIPS users mailling list 

Cc: Chris Johnson 
Subject: Re: [OpenSIPS-Users] Opensips MS Teams lost BYE

CAUTION: This email originated from outside of the organisation. Do not click 
links or open attachments unless you recognise the sender and know the content 
is safe.

I have basically the same problem where the BYE packet does not seem to be 
routing properly, however I am not using any of the nat functions.

> On Jul 6, 2020, at 3:46 AM, John Quick 
> mailto:john.qu...@smartvox.co.uk>> wrote:
>
> Chris,
>
> You must not call fix_nated_contact() for any SIP requests or SIP responses
> coming from MS Teams.
> If you do, it will cause exactly the problems you describe for loose-routed
> sequential requests such as BYE.
>
> Just to explain: fix_nated_contact() should only be used when the messages
> come via a NAT router. It must not be used for messages coming from a Proxy
> (assuming the Proxy adds a Record-Route header, as happens with Teams), even
> though both cases may appear to need fixing when you use nat_uac_test().
>
> John Quick
> Smartvox Limited
> Web: www.smartvox.co.uk
>
>> I've managed to get the PBX to send the BYE to the SBC and it is now
> forwarding on to MS (although MS are not sending a reply but we have opened
> a case for this).
>
>> We are struggling to get the BYE packet to go back to MS Teams when the
> call is initiated by Teams.
>
>
> ___
> 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] How to delay a branch

2020-07-27 Thread ryan embgrets
Thanks everyone for your valuable feedback.

I think we can send the branches to be delayed back to opensips and in this
way, it would be a new call in opensips so we can easily handle it with
extra configs.

Anyways, we changed the business logic a bit(send to phones only if
registered) and were able to handle them using branch params.

Ryan.

On Fri, 24 Jul 2020 at 18:51, Liviu Chircu  wrote:

> On 24.07.2020 16:25, Ben Newlin wrote:
>
> I think the issue here is that the sleep function pauses the OpenSIPS
> process in which it is running; it doesn’t matter what type of route you
> call it in, the whole process will sleep. Since all message processing, and
> all branch routes, are running in the same process then sleeping that
> process will delay everything.
>
>
>
> Even asynchronous sleep is performed by suspending all message processing
> for that message, not individual branches.
>
> Spot on, Ben!  All branches are forked out by the same process: if you
> pause it, you pause the forking of the remaining branches in the set...
> which somehow leads me to believe that doing an async(sleep) after
> t_relay()'ing the last mobile phone branch _should work_, at least in
> theory... such that after the sleep is completed, the remaining branches in
> the set will be forked out.
>
> Now, the tricky part is making sure that the mobile phone branches are
> always ahead of the desk phone ones, so they parallel fork first.  I do not
> see an easy solution to this, nor are there any handy script functions to
> help you do this... you will have to "swap" the branch data around using
> the $branch properties and other variables (e.g. $ru, $du, $socket_out)
> until you obtain the desired effect.
>
> Curious to hear other opinions as well :)
>
> Best regards,
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
> OpenSIPS Summit 2020 Distributed
>   www.opensips.org/events/Summit-2020Distributed
>
> ___
> 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] Userblacklist module with mongodb

2020-07-27 Thread ryan embgrets
Any pointer?

I am using mongo for other modules and don't want to keep separate
database(mysql) for this module only

Ryan.

On Sun, 19 Jul 2020 at 15:32, ryan embgrets  wrote:

> Greeting,
>
> I am just wondering if someone has been using mongodb for the user
> blacklist module or even if it is compatible with mongo?
>
> I have below configurations,
>
> loadmodule "db_cachedb.so"
> loadmodule "cachedb_mongodb.so"
>
> modparam("db_cachedb","cachedb_url","mongodb:globalblacklist://opensips:opensipsrw@localhost
> /opensips.globalblacklist")
>
> loadmodule "userblacklist.so"
> modparam("userblacklist", "db_url", "cachedb://mongodb:globalblacklist")
>
> But it does not seem to work, and gives below error
>
> ERROR:userblacklist:db_reload_source: got invalid result type from query.
>
> Any suggestions?
>
> Ryan.
>
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] bugs on smpp.

2020-07-27 Thread Răzvan Crainea

Hi, Johan!

Unfortunately we are not using those features in proto_smpp, and it is 
very hard for me to create a testing environment for something that I 
don't fully understand how it works. That's why those issues have been 
put back.
Nevertheless, they shouldn't be closed - this seems like a stale bot 
issue. If possible, please re-open the tickets, so we can keep track of 
them.


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/27/20 10:44 AM, Johan De Clercq wrote:

Hi,

a few months ago, volga629 and myself added bugs and a feature request 
for proto_smpp.

Now, after 30 days these issues are closed.

Is there any chance that these can be picked up ?

wkr,

___
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


[OpenSIPS-Users] bugs on smpp.

2020-07-27 Thread Johan De Clercq
Hi,

a few months ago, volga629 and myself added bugs and a feature request for
proto_smpp.
Now, after 30 days these issues are closed.

Is there any chance that these can be picked up ?

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


Re: [OpenSIPS-Users] opensips-cp for 3.1

2020-07-27 Thread Johan De Clercq
thanks Razvan,
btw, I will be starting on push notifications also.



Op ma 27 jul. 2020 om 09:32 schreef Răzvan Crainea :

> Hi, Johan!
>
> We haven't got a chance to tune OpenSIPS CP for 3.1, although we need to
> do this ASAP.
> Nevertheless, there were no major changes between 3.0 and 3.1, therefore
> you should be able to use 3.1.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 7/24/20 4:53 PM, johan wrote:
> >
> > Hi,
> >
> >
> > is it okay to use opensips-cp 3.0 for opensips 3.1 ?
> >
> >
> > wkr,
> >
> >
> > ___
> > 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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] opensips-cp for 3.1

2020-07-27 Thread Răzvan Crainea

Hi, Johan!

We haven't got a chance to tune OpenSIPS CP for 3.1, although we need to 
do this ASAP.
Nevertheless, there were no major changes between 3.0 and 3.1, therefore 
you should be able to use 3.1.


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/24/20 4:53 PM, johan wrote:


    Hi,


is it okay to use opensips-cp 3.0 for opensips 3.1 ?


wkr,


___
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] Need help regarding dp_translate in opensips 2.2 .

2020-07-27 Thread Răzvan Crainea

Hi, Sasmita!

You should only check the `$avp(trl)` value if `dp_translate` succeeeds.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/22/20 11:51 AM, Sasmita Panda wrote:

Hi All ,
in opensips 1.11 I was using dp_translate function as below and its 
working fine .


$avp(src) = $rd;
xlog("request domain,$avp(src)");
dp_translate("5", "$avp(src)/$avp(trl)");
$avp(grp)=$(avp(trl){s.int });

In opensips -2.2 i am using the same but its no working . The error is 
as below .


*WARNING:core:do_assign: no value in right expression at 
/usr/etc/opensips/opensips_carrier.cfg:318*

*
*
*line 318 refer to *$avp(grp)=$(avp(trl){s.int });  line .

What I am doing wrong . Please help me .

*/Thanks & Regards/*
/Sasmita Panda/
/Senior Network Testing and Software Engineer/
/3CLogic , ph:07827611765/

___
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] do_routing not populating variables

2020-07-27 Thread Răzvan Crainea

Hi, John!

According to your snippet, you're logging the attributes when do_routing 
fails - well, if do_routing fails, it means that id didn't find any 
rule, gateway or carrier that is able to handle the call, therefore it 
is normal that all of them are NULL.


Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/21/20 10:34 PM, John Kiniston wrote:

Running 2.4

I'm not sure if I'm calling do_routing right, I'm using it in a test.

if(!do_routing("1","","","$avp(rule_attrs_pvar)","$avp(gw_attrs_pvar)","$avp(carrier_attrs_pvar)")){
I log what I get back but nothing is populated.
xlog("L_INFO"," return codes $avp(rule_attrs_pvar) $avp(gw_attrs_pvar) 
$avp(carrier_attrs_pvar)");

--
A human being should be able to change a diaper, plan an invasion, 
butcher a hog, conn a ship, design a building, write a sonnet, balance 
accounts, build a wall, set a bone, comfort the dying, take orders, give 
orders, cooperate, act alone, solve equations, analyze a new problem, 
pitch manure, program a computer, cook a tasty meal, fight efficiently, 
die gallantly. Specialization is for insects.

---Heinlein

___
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] Dynamic Routing Stats

2020-07-27 Thread Răzvan Crainea

Hi, Mark!

Unfortunately the drouting module does not export any statistics. You 
can however use the statistics module[1] and define your own statistics, 
that you have to manually update them from the script according to your 
needs.


[1] https://opensips.org/docs/modules/3.1.x/statistics.html

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/17/20 4:39 PM, Mark Farmer wrote:

Hi everyone

I have been asked to look into getting Nagios to monitor active calls on 
specific Dynamic Routing gateways.


Looking at the drouting() docs I don't see any exported statistics.
Is there a way to do this please?

Many thanks
Mark.


___
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] Opensips 2.4.8 SEGFAULT

2020-07-27 Thread Răzvan Crainea

Hi, James!

Please compile your sources with memory debugging [1] (QM_MALLOC) to 
gather more information.


[1] https://www.opensips.org/Documentation/TroubleShooting-OutOfMem

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 7/16/20 8:30 PM, James via Users wrote:
I complied opensips 2.4.8 from git and I now have the correct output for 
my core dump I hope!




https://pastebin.com/rFbptVrW



version: opensips 2.4.8 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, 
F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535

poll method support: poll, epoll, sigio_rt, select.
git revision: 1e891b5e3
main.c compiled on 23:02:38 Jul 14 2020 with gcc 8


I am running Centos 8


Thanks,

James

___
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