Re: [OpenSIPS-Users] Calls Disconnecting after 10 Minutes

2024-07-27 Thread M S
It can be Session-Expires header, or reinvites (in-dialog invite being sent
after 600 seconds)

On Sat, Jul 27, 2024 at 12:22 PM Alexander Perkins <
alexanderhenryperk...@gmail.com> wrote:

> Hi All.  We have an interesting situation.  If we send calls to our
> OpenSIPS proxy, they will disconnect after 600 seconds.  However, if we
> send them directly to our switch, this does not happen. Is there a timer,
> or something, I should be aware of?  If so, can someone point me in the
> right direction?  Any help would be appreciated.  I've been trying to
> figure this out for around three months.
>
> Thank you,
> Alex
> ___
> 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] Waiting for 200 OK

2024-04-09 Thread M S
Maybe using a timer route is the solution? Save 183 time in cache and check
if 200 ok is received within desired period, otherwise send reinvite...

On Tue, Apr 9, 2024, 4:48 PM Ben Newlin  wrote:

> You’re right, that timer would drop the call. Not sure why I was thinking
> that would work. Sorry!
>
>
>
> Ben Newlin
>
>
>
> *From: *Parthesh Bhavsar 
> *Date: *Tuesday, April 9, 2024 at 10:35 AM
> *To: *Ben Newlin 
> *Cc: *OpenSIPS users mailling list 
> *Subject: *Re: [OpenSIPS-Users] Waiting for 200 OK
>
> * EXTERNAL EMAIL - Please use caution with links and attachments *
>
>
> --
>
> It seems after setting T_fr_timeout parameter it was sending a CANCEL
> request to another leg but for my requirement I need to send Reinvite. Also
> for generating Reinvite I have used  dlg_send_sequential() as I use
> opensips as a proxy server. Any other modules on which I look for?
>
>
>
> Regards,
>
> *Parthesh Bhavsar | Software Engineer | VOIP*
>
>
>
>
>
> On Tue, Apr 9, 2024 at 7:36 PM Ben Newlin  wrote:
>
> The timing requirement can be solved using the $T_fr_timeout parameter [1].
>
>
>
> For sending a re-Invite back to the UAC I believe you’d have to be a B2BUA.
>
>
>
> [1] - https://opensips.org/docs/modules/3.4.x/tm.html#pv_T_fr_timeout
>
>
>
> Ben Newlin
>
>
>
> *From: *Users  on behalf of Parthesh
> Bhavsar via Users 
> *Date: *Tuesday, April 9, 2024 at 5:31 AM
> *To: *OpenSIPS users mailling list 
> *Subject: *[OpenSIPS-Users] Waiting for 200 OK
>
> * EXTERNAL EMAIL - Please use caution with links and attachments *
>
>
> --
>
> Hello,
>
> I have a requirement where If I get 183 responses then I need to wait for
> a specific period of time for 200 OK and if 200 OK is not received in that
> time then I need to send Reinvte back to UA with some modifications. I have
> gone through the SST module but have not  found anything relevant to match
> my requirements. Can anyone suggest some module or function on which I can
> go further to meet my requirements.
>
>
> Regards,
>
> *Parthesh Bhavsar | Software Engineer | VOIP*
>
>
>
>
>
> * *
>
> *Disclaimer*
>
> In addition to generic Disclaimer which you have agreed on our website,
> any views or opinions presented in this email are solely those of the
> originator and do not necessarily represent those of the Company or its
> sister concerns. Any liability (in negligence, contract or otherwise)
> arising from any third party taking any action, or refraining from taking
> any action on the basis of any of the information contained in this email
> is hereby excluded.
>
>
>
> *Confidentiality*
>
> This communication (including any attachment/s) is intended only for the
> use of the addressee(s) and contains information that is PRIVILEGED AND
> CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying
> of this communication is prohibited. Please inform originator if you have
> received it in error.
>
>
>
> *Caution for viruses, malware etc.*
>
> This communication, including any attachments, may not be free of viruses,
> trojans, similar or new contaminants/malware, interceptions or
> interference, and may not be compatible with your systems. You shall carry
> out virus/malware scanning on your own before opening any attachment to
> this e-mail. The sender of this e-mail and Company including its sister
> concerns shall not be liable for any damage that may incur to you as a
> result of viruses, incompleteness of this message, a delay in receipt of
> this message or any other computer problems.
>
>
>
> * *
>
> *Disclaimer*
>
> In addition to generic Disclaimer which you have agreed on our website,
> any views or opinions presented in this email are solely those of the
> originator and do not necessarily represent those of the Company or its
> sister concerns. Any liability (in negligence, contract or otherwise)
> arising from any third party taking any action, or refraining from taking
> any action on the basis of any of the information contained in this email
> is hereby excluded.
>
>
>
> *Confidentiality*
>
> This communication (including any attachment/s) is intended only for the
> use of the addressee(s) and contains information that is PRIVILEGED AND
> CONFIDENTIAL. Unauthorized reading, dissemination, distribution, or copying
> of this communication is prohibited. Please inform originator if you have
> received it in error.
>
>
>
> *Caution for viruses, malware etc.*
>
> This communication, including any attachments, may not be free of viruses,
> trojans, similar or new contaminants/malware, interceptions or
> interference, and may not be compatible with your systems. You shall carry
> out virus/malware scanning on your own before opening any attachment to
> this e-mail. The sender of this e-mail and Company including its sister
> concerns shall not be liable for any damage that may incur to you as a
> result o

Re: [OpenSIPS-Users] how to debug many dialogs stuck in state 5?

2024-04-02 Thread M S
Hi Bogdan,
When you say at the same time, you mean in the same script? or same route?
or same block for example?
Also what about using dialog and modules that use b2b in underlying layers,
for example mediaexchange?

Thank you!

On Mon, Apr 1, 2024 at 10:28 AM Bogdan-Andrei Iancu 
wrote:

> You should never use both dialog and b2b modules in the same time, for the
> same calls. Trying to have OpenSIPS both Proxy and B2B is a clear recipe
> for disaster.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>   https://www.siphub.com
>
> On 30.03.2024 07:53, Babak Yakhchali wrote:
>
> sorry for the late reply. After disabling modules and simplifying script
> logic I found that the issue was b2b entities module being enabled,
> downgrading to 3.2 solved the problem
>
> On Wed, Mar 20, 2024 at 5:19 PM Bogdan-Andrei Iancu 
> wrote:
>
>> Hi,
>>
>> What OpenSIPS version are you using? and what module do you use on top
>> of the dialog module?
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>https://www.opensips-solutions.com
>>https://www.siphub.com
>>
>> On 13.03.2024 13:55, Babak Yakhchali wrote:
>> > Hi
>> > When calling and immediately cancelling, the call is ended but
>> > dlg_list shows the dialog stuck in state 5. Increasing log level to 4
>> > shows these messages:
>> > Mar 13 15:15:37 : DBG:tm:timer_routine: timer
>> > routine:3,tl=0x7f1c861d06e0 next=(nil), timeout=26
>> > Mar 13 15:15:37 : DBG:tm:delete_handler: removing 0x7f1c861d0630
>> > Mar 13 15:15:37 : DBG:tm:delete_cell: delete_cell 0x7f1c861d0630:
>> > can't delete -- still reffed (-1)
>> > Mar 13 15:15:37 : DBG:tm:set_timer: relative timeout is 2
>> > Mar 13 15:15:37 : DBG:tm:insert_timer_unsafe: [3]: 0x7f1c861d06e0 (28)
>> > Mar 13 15:15:37 : DBG:tm:delete_handler: done
>> > Mar 13 15:15:39 : DBG:tm:timer_routine: timer
>> > routine:3,tl=0x7f1c861d06e0 next=(nil), timeout=28
>> > Mar 13 15:15:39 : DBG:tm:delete_handler: removing 0x7f1c861d0630
>> > Mar 13 15:15:39 : DBG:tm:delete_cell: delete_cell 0x7f1c861d0630:
>> > can't delete -- still reffed (-1)
>> > Mar 13 15:15:39 : DBG:tm:set_timer: relative timeout is 2
>> > Mar 13 15:15:39 : DBG:tm:insert_timer_unsafe: [3]: 0x7f1c861d06e0 (30)
>> > Mar 13 15:15:39 : DBG:tm:delete_handler: done
>> >
>> > How can I debug the issue? What are the possible causes of this?
>> > thanks
>> >
>> > ___
>> > 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] $DLG_dir

2024-03-27 Thread M S
1.10.5. $DLG_dir

Returns the direction of the request in dialog (as "upstream" string if the
request is generated by callee or "downstream" string if the request is
generated by caller) - to be used for sequential request. This PV will be
available only for sequential requests (not for replies), after doing
loose_route().

NULL will be returned if there is no dialog for the request.

On Wed, Mar 27, 2024 at 12:44 PM Prathibha B 
wrote:

> $DLG_dir returns null, when used in is_method("INVITE")
>
>
> --
> Regards,
> B.Prathibha
> ___
> 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] fetch username from the URI

2024-03-21 Thread M S
A wise man once said, the online manual should be your bible here :)
openSIPS | Documentation / Core Variables - 3.4



On Thu, Mar 21, 2024 at 1:09 PM Prathibha B 
wrote:

> I am getting the source and destination URI from $fu and $ru.  How to
> fetch the SIP username from the source and destination URI.
>
> What I've tried and not working:
> # Extract destination URI from the R-URI (Request-URI)
> $var(destination_uri) = $(ru);
>
> # Find the position of "@" character in the URI
> $var(at_position) = strstr($(ru), "@");
>
> # If "@" is found, extract the substring before it as the SIP
> username
> if ($var(at_position) != -1) {
> $var(destination_username) = substr($var(destination_uri),
> 4, $var(at_position) - 5);
> } else {
> $var(destination_username) = "Unknown";
> }
>
> --
> Regards,
> B.Prathibha
> ___
> 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 generate PRACK

2024-02-12 Thread M S
After 302, when you receive 183 from the provider (that expects PRACK), you
forward that 183 to the other side of conversation - and that side is
responsible for generating PRACK and sending it to opensips to forward to
the provider.

On Mon, Feb 12, 2024 at 1:16 PM Social Boh  wrote:

> Hello,
>
> the flow chart is this:
>
> -> INVITE (to OpensiSIP)
>
> Relay to Redirect Server
>
> Redirect server reply with a 302 and a contact that OpenSIPs use to create
>
> INVITE (OpenSIPs) ->
>
> <- 183 (provider) with  Require: 100rel
>
> PRACK (from OpenSIPs)
>
> I don't know how create this PRACK
>
> I have:
>
> modparam("b2b_entities", "passthru_prack", 0)
>
> but this is not enough and I have to use (I think)
>
> b2b_init_request("top hiding");
>
> but this function works only on Request Route and I catch the 302 in the
> failure route.
>
> Thank you
>
> Regards
>
> ---
> I'm SoCIaL, MayBe
>
> El 12/02/2024 a las 4:36 a. m., Ihor Olkhovskyi escribió:
>
> You should relay 183 to original source (ione that is sending INVITE) and
> got PRACK from there.
> That would be the most correct way of handling this
>
> Le lun. 12 févr. 2024 à 02:29, Social Boh  a écrit :
>
>> Maybe someone can help me.
>>
>> This is the scenario.
>>
>> OpenSIPs receive a INVITE and send it to a server that reply with a 302
>> message (always)
>>
>> Then OpenSIPs, in the failure route, take the user part present in the
>> 302 contact header, change the destination IP and send with t_relay
>>
>> The destination reply with a 183 with Require: 100rel header so OpenSIPs
>> have to reply with a PRACK. This is my problem.
>>
>> I don't know which is the best way to handle this (the PRACK)
>>
>> Thank you
>>
>> Regards
>>
>> ---
>> I'm SoCIaL, MayBe
>>
>> El 9/02/2024 a las 6:46 a. m., Social Boh escribió:
>> > Hello list,
>> >
>> > can OpenSIPs generate a PRACK message to reply a 180/183 message?
>> >
>> > Thank you
>> >
>> > Regards
>> >
>> > ---
>> > I'm SoCIaL, MayBe
>> >
>> >
>> > ___
>> > 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
>>
>
>
> --
> Best regards,
> Ihor (Igor)
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://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] SDP reroute and rewrite

2024-02-12 Thread M S
Hi Igor,
You are absolutely right. For anybody reading this in future, I figured it
works from branch_route because as Igor explained, that's where you have
access to unaltered packet. Thanks!

On Mon, Feb 12, 2024 at 10:35 AM Ihor Olkhovskyi 
wrote:

> Usually you work in failure_route with packet that was in a state when you
> called t_relay.
>
> Best practice would be to work with rtp-related procedures in branch
> routes, so you will get in failure_rroute unaltered packet, before
> rtp_offer manipulations from previous time.
>
> Cheers,
> Ihor
>
> Le sam. 10 févr. 2024 à 03:03, M S  a écrit :
>
>> Hi list,
>> When using rtpproxy_offer/answer, how can I rewrite SDP media IP/port if
>> for example the first route rejects the calls and I have to send the call
>> (in failure_route) to the next destination (where second destination uses
>> different media ip/port/rtpproxy set)?
>> If I just call rtpproxy_offer again, on second try it changes IPs to
>> something like:
>> m=audio 1106210576 RTP/AVP 8 0 101
>> c=IN IP4 172.17.182.213172.17.182.210
>> a=rtcp:11063 IN IP4 172.17.182.21310577 IN IP4 172.17.182.210
>>
>> I tried unforce and it didn't work.
>> Thanks!
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> --
> Best regards,
> Ihor (Igor)
> ___
> 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] SDP reroute and rewrite

2024-02-09 Thread M S
Hi list,
When using rtpproxy_offer/answer, how can I rewrite SDP media IP/port if
for example the first route rejects the calls and I have to send the call
(in failure_route) to the next destination (where second destination uses
different media ip/port/rtpproxy set)?
If I just call rtpproxy_offer again, on second try it changes IPs to
something like:
m=audio 1106210576 RTP/AVP 8 0 101
c=IN IP4 172.17.182.213172.17.182.210
a=rtcp:11063 IN IP4 172.17.182.21310577 IN IP4 172.17.182.210

I tried unforce and it didn't work.
Thanks!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] dbalias and location lookup branching

2023-09-27 Thread M S
Maybe a send_reply(404) after if(!lookup(location)), instead of drop?

On Tue, Sep 26, 2023 at 8:30 PM John Sliney  wrote:

> Hi,
>
> I’m currently attempting to take an INVITE from an Asterisk server that is
> requesting an extension number, perform dbalias lookups to have extensions
> turned into sip users (x1000 -> test_hardphone) and then do location
> lookups on those sip users.  There can be multiple sip users for each
> extension and multiple locations for each sip user.
>
> Using the code below partially works but when there are no location
> entries for the requested sip user, OpenSIPS returns a 500 and prints out
> “ERROR:  t_forward_nonack failed” how can I have OpenSIPS instead respond
> with a 404?
>
> ### CODE ###
>
> modparam("alias_db","append_branches",  1)
>
> route {
> if ( is_from_gw() ) {
> alias_db_lookup("dbaliases");
> t_on_branch("sip_user_branch");
> }
> route(relay);
> return(0);
> }
>
> branch_route[sip_user_branch] {
> route(lookup_sip_user);
> }
>
> route[lookup_sip_user] {
> if ( ! lookup("location")  ) {
> drop();
> }
> }
>
> route[relay] {
> if ( ! t_relay() ) {
> sl_reply_error();
> rtpproxy_unforce();
> return(0);
> }
> }
>
> ### CODE ###
>
> Any help would be appreciated, Thanks
> ___
> 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] DNS question

2023-09-04 Thread M S
Hi,
Opensips asks system's resolver.
Few things to check, make sure your nsswitch.conf file says "files dns"
which is default, also opensips use_naptr option should be yes (default is
yes).
to test, you can also remove dns from nsswitch.conf to make sure your
computer only resolves locally with hosts file. Lastly, you can also do a
tcpdump port 53 to see when/who asks what from who, to debug the issue.

M

On Mon, Sep 4, 2023 at 1:59 PM Saint Michael  wrote:

> Using opensips 3.1, I am sending calls to a carrier whose address is
> sip.x.com. I add an entry to /etc/hosts/ that redirects sip.x.com
> to a different address, and I test with "resolvectl query sip.x.com" an
> it works as I need it. But opensips keeps sending calls to the DNS address,
> not to my new address.
> I tried restarting opensips but the issue does not go away.
> I tried restarting systemd-resolved, and nothing
> I tried opensipsctl fifo cache_flush and it does hang.
>
> So how does Opensips obtains DNS information?
> ___
> 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 reach failure_route if remote end doesn't reply on INVITEs

2023-07-13 Thread M S
You can set DLG_timeout to 2sec for failure route to work, then also look
for ACK in main route to set DLG_timeout to 3600 (for example) if the call
was answered.

On Thu, Jul 13, 2023 at 10:28 AM Simon Gajski via Users <
users@lists.opensips.org> wrote:

> Hi
>
> I am running opensips 2.1.1 and have a question regarding accessing
> failure_route.
>
>
> In case I send INVITE to some destination where I receive 3xx, 4xx or
> 5xx reply, call goes to failure_route and uses next gw from there.
> Everything fine so far.
> But in some cases it hapens that opensips sends INVITE to a destination
> from where there is no reply.
> In this case opensips repeatedly sends INVITEs to that destination and
> doesn't do failover to failure_route.
>
> I played so far with $DLG_timeout variable, set to 2 sec.
> In this case opensips does failover to failure_route after 2 sec,
> however established call via next gw is also terminated after 2 sec.
>
>
> Is there another way to reach failure_route if remote end doesn't replay
> in expected time?
>
> BR
> Simon
>
>
>
> ___
> 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] rtpproxy n flag throws "Failed to get dialog"

2023-02-16 Thread M S
Hello again :)
Rtpproxy documentation says:
"for all the calls that require notification, the rtpproxy_engage(),
rtpproxy_offer() and rtpproxy_answer() functions must be called with the “n”
flag"

I'm running rtpproxy_offer("froc") & rtpproxy_response("froc") and opensips
3.1.13, but as soon as I add n flag to both as rtpproxy_offer("frocn") &
rtpproxy_response("frocn"), I see below errors:

ERROR:rtpproxy:force_rtp_proxy_body: Failed to get dialog

And when I remove n flag, the error is gone. A bug maybe?

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


Re: [OpenSIPS-Users] Memory usage/leak - Opensips 3.1.13

2023-02-16 Thread M S
I will rephrase my question maybe someone has any ideas If I check memory
usage with pmap for highest using opensips process:
total kB 10774396 4579784 4564420
And this is the same as what top shows, around 4.5G memory usage.
If I use opensips-cli -x mi mem_pkg_dump for the same PID: heap size=
4294967296 used= 48336024, used+overhead=106291088, free=4188676208
And these numbers do not match. If pkg memory for this process is 48M as it
says, what is using 4.5G?
opensips parameters were -m 2G -M 4G

On Tue, Feb 14, 2023 at 12:14 AM M S  wrote:

> Hi List,
> I am trying to understand memory reports and find a possible memory leak.
> I have: -a Q_MALLOC_DBG -m 2048 -M 4096 and memdump=1, my system has 32G
> ram, 8 workers.
> When opensips starts I have 25G free memory. after 10days, I have only 12G
> free memory, top showing one of opensips processes using 10% of memory
> (others 8, 6, ...).
> I use:
> opensips-cli -x mi mem_shm_dump
> opensips-cli -x mi mem_pkg_dump PID
> and check log files:
> Feb 14 01:25:25 used= 5908928, used+overhead=7815352, free=2139668296
> Feb 14 01:47:04 used= 7184, used+overhead=57932536, free=4237034760
> Feb 14 01:51:49 used= 33771424, used+overhead=59342328, free=4235624968
> Feb 14 01:51:52 used= 34237368, used+overhead=60780080, free=4234187216
> Feb 14 01:51:54 used= 37329128, used+overhead=70855648, free=4224111648
> Feb 14 01:51:56 used= 34966280, used+overhead=63143104, free=4231824192
> Feb 14 01:51:59 used= 35916952, used+overhead=66163728, free=4228803568
> Feb 14 01:52:01 used= 41913864, used+overhead=86107616, free=4208859680
> Feb 14 01:52:04 used= 39219120, used+overhead=77303624, free=4217663672
> Feb 14 01:53:32 used= 27932400, used+overhead=41340488, free=4253626808
> Feb 14 01:53:37 used= 27933784, used+overhead=41333520, free=4253633776
> Feb 14 01:53:41 used= 27932272, used+overhead=41344296, free=4253623000
> Feb 14 01:53:48 used= 27939736, used+overhead=41346576, free=4253620720
> Feb 14 01:53:51 used= 27955128, used+overhead=41359952, free=4253607344
> Feb 14 01:53:53 used= 27953736, used+overhead=41364704, free=4253602592
> Feb 14 01:53:56 used= 27950760, used+overhead=41362688, free=4253604608
> Feb 14 01:53:58 used= 27954072, used+overhead=41373008, free=4253594288
> Feb 14 01:54:01 used= 27974952, used+overhead=41400704, free=4253566592
> Feb 14 01:54:03 used= 13399432, used+overhead=13933152, free=4281034144
>
> The memory usage based on above memory dumps looks normal, but for example
> the process with 41913864 used memory is what top shows to use 10% of all
> memory (3.2G). What am I missing here and is there anywhere else I need to
> check?
>
> Thank you!
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Memory usage/leak - Opensips 3.1.13

2023-02-13 Thread M S
Hi List,
I am trying to understand memory reports and find a possible memory leak. I
have: -a Q_MALLOC_DBG -m 2048 -M 4096 and memdump=1, my system has 32G ram,
8 workers.
When opensips starts I have 25G free memory. after 10days, I have only 12G
free memory, top showing one of opensips processes using 10% of memory
(others 8, 6, ...).
I use:
opensips-cli -x mi mem_shm_dump
opensips-cli -x mi mem_pkg_dump PID
and check log files:
Feb 14 01:25:25 used= 5908928, used+overhead=7815352, free=2139668296
Feb 14 01:47:04 used= 7184, used+overhead=57932536, free=4237034760
Feb 14 01:51:49 used= 33771424, used+overhead=59342328, free=4235624968
Feb 14 01:51:52 used= 34237368, used+overhead=60780080, free=4234187216
Feb 14 01:51:54 used= 37329128, used+overhead=70855648, free=4224111648
Feb 14 01:51:56 used= 34966280, used+overhead=63143104, free=4231824192
Feb 14 01:51:59 used= 35916952, used+overhead=66163728, free=4228803568
Feb 14 01:52:01 used= 41913864, used+overhead=86107616, free=4208859680
Feb 14 01:52:04 used= 39219120, used+overhead=77303624, free=4217663672
Feb 14 01:53:32 used= 27932400, used+overhead=41340488, free=4253626808
Feb 14 01:53:37 used= 27933784, used+overhead=41333520, free=4253633776
Feb 14 01:53:41 used= 27932272, used+overhead=41344296, free=4253623000
Feb 14 01:53:48 used= 27939736, used+overhead=41346576, free=4253620720
Feb 14 01:53:51 used= 27955128, used+overhead=41359952, free=4253607344
Feb 14 01:53:53 used= 27953736, used+overhead=41364704, free=4253602592
Feb 14 01:53:56 used= 27950760, used+overhead=41362688, free=4253604608
Feb 14 01:53:58 used= 27954072, used+overhead=41373008, free=4253594288
Feb 14 01:54:01 used= 27974952, used+overhead=41400704, free=4253566592
Feb 14 01:54:03 used= 13399432, used+overhead=13933152, free=4281034144

The memory usage based on above memory dumps looks normal, but for example
the process with 41913864 used memory is what top shows to use 10% of all
memory (3.2G). What am I missing here and is there anywhere else I need to
check?

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


[OpenSIPS-Users] mediaproxy

2022-12-08 Thread M S
I hope this is the right forum for this post, a few things about mediaproxy
:)

1. the keepalive disconnects relay from dispatcher with: 'missed 3
keepalive answers in a row. assuming the connection is down.' however the
logic behind it (_queued_keepalives += 1 for ping and _queued_keepalives -= 1
for pong) means that lost packets are accumulated, and it is not disconnect
after 3 "in a row". I believe it should be _queued_keepalives=0 for pong...
otherwise if i lose a ping today and one tomorrow, the next loss
disconnects whenever it is.

2. at around 1300 calls (with high CPS), opensips channel to
mediadispatcher gets timed out (even with timeout to 1s from 500ms
default). further checks showed it is due to relay not answering.
separating relay and dispatcher to different machines alleviates the
problem. I'm sure this depends on the environment used (cpu/etc) but I'm
wondering if other people have different performance results. I
have disabled all database and statistics on mediaproxy.

3. when there is a problem (e.g. severed connection between relay and
dispatcher) all the open ports on relay remain opened inside OS (netstat
shows udp ports inuse) - port leaking. after a few disconnects all
available ports are used and it starts throwing errors.

Ideas and comments would be appreciated!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] UPDATE (SDP) modification

2022-11-17 Thread M S
If UPDATE goes through rtpproxy offer/answer it gets modified automatically
too.

On Thu, Nov 17, 2022 at 10:06 PM Bela H  wrote:

> Yes, that is clear and working fine with all the calls don’t have UPDATE
> message. But how can I call rtpproxy offer/answer for UPDATE meassage?
>
>
>
>
>
> *From: *M S 
> *Sent: *Thursday, 17 November 2022 23:29
> *To: *OpenSIPS users mailling list 
> *Subject: *Re: [OpenSIPS-Users] UPDATE (SDP) modification
>
>
>
> if you call rtpproxy offer and answer, SDP is automatically modified.
>
>
>
> On Thu, Nov 17, 2022 at 7:08 AM Bela H  wrote:
>
> Hello,
>
>
>
> Is there any way to modify the UPDATE (SDP) content, i.e.
>
> c=IN IP4 aaa.xx.yyy.zzz
>
>
>
> The callee is sending this message from the PSTN network and I need to use
> rtpproxy. Without the UPDATE(SDP) modification the call is one way
> speech/mute.
>
>
>
> Cheers,
>
> Bela
>
> ___
> 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] UPDATE (SDP) modification

2022-11-17 Thread M S
if you call rtpproxy offer and answer, SDP is automatically modified.

On Thu, Nov 17, 2022 at 7:08 AM Bela H  wrote:

> Hello,
>
>
>
> Is there any way to modify the UPDATE (SDP) content, i.e.
>
> c=IN IP4 aaa.xx.yyy.zzz
>
>
>
> The callee is sending this message from the PSTN network and I need to use
> rtpproxy. Without the UPDATE(SDP) modification the call is one way
> speech/mute.
>
>
>
> Cheers,
>
> Bela
> ___
> 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] 4xx response to invite

2022-11-15 Thread M S
Hi List,
If I use a block like:

if(is_method("invite") && !has_totags()) {
if() send_reply(402, "more money");
..
}

Then if an invite is received and  is true, a 402 is sent, and then an
ACK is received in response to 402, which has a to_tag too.
This ACK strangely matches both method=invite and !has_totags... and
therefore we (incorrectly) send another 402 in response to ACK.
Is this normal behaviour? or is this happening because I'm doing something
wrong like I need to send 100 Trying and then 402?

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


Re: [OpenSIPS-Users] graceful reload

2022-11-15 Thread M S
Thank you for your suggestions. I have been thinking about changing
sql_cacher options to return an additional field or so. that needs changing
mod_param. You are right about having multiple servers to move the loads
from one to another, but sometimes that is not available for some reason.
I understand that adding this functionality (if not available) means
complete design change, but if it is not available indeed it can be a
suggestion for future versions - after all it seems to me that modules are
.so libraries and they can be loaded/unloaded on the fly (kind of like how
Asterisk does)...

On Tue, Nov 15, 2022 at 4:40 PM Brett Nemeroff  wrote:

> What specific modules did you have in mind to reload.
>
> I know this might not be super helpful for your specific application, but
> you should always try to design your configs to not require this kind of
> rebooting. Sure with larger changes it may be unavoidable, but you should
> also have multiple servers set up so you can drain one and do a rolling
> restart. Happy to chat about a few options.
> -Brett
>
>
> On Tue, Nov 15, 2022 at 8:37 AM M S  wrote:
>
>> Hi list,
>> Is it possible to gracefully (without shutting down and restarting
>> opensips process) reload module configurations (modparam) or add new
>> modules to config? I know reload_routes can be used for routes, but what
>> about modules?
>>
>> Thank you.
>> ___
>> 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


[OpenSIPS-Users] graceful reload

2022-11-15 Thread M S
Hi list,
Is it possible to gracefully (without shutting down and restarting opensips
process) reload module configurations (modparam) or add new modules to
config? I know reload_routes can be used for routes, but what about modules?

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


[OpenSIPS-Users] dilalog profile

2022-11-14 Thread M S
Quick question, can a dialog belong to multiple profiles? Thanks!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] dialog termination

2022-11-07 Thread M S
Hi list,
How do we get notified if an unacknowledged dialog is terminated?
apparently dlg_on_hangup only works for state=4 dialog, when ACK is
received. What if INVITE is sent, dialog created, then RINGING is received,
then DECLINED is received?

Thank you!
___
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-02 Thread M S
you dont need $ru = (ds_select_dst(3, 7, , "default", 1));
just run ds_select_dst(...) and it sets $ru for you.

On Wed, Nov 2, 2022 at 9:10 PM Kevin Kennedy  wrote:

> I am seeing this in the debug after the hash of the contact, I am getting
> an error pv_set_ruri: str value required to set R-URI.
>
> DBG:dispatcher:ds_hash_pvar: Hashing sip:??@10.10.10.10:23233
> DBG:dispatcher:ds_select_dst: hash [3896938376], candidate [-1], weight
> sum [30]
> DBG:dispatcher:ds_select_dst: candidate is [2]
> DBG:dispatcher:ds_select_dst: using destination [2]
> DBG:dispatcher:ds_select_dst: selected [7-3/2] 
> ERROR:core:pv_set_ruri: str value required to set R-URI
> ERROR:core:do_assign: setting PV failed
> ERROR:core:do_assign: error at /etc/opensips/opensips.cfg:223
>
> Line 223 - $ru = (ds_select_dst(3, 7, , "default", 1));
>
> Not sure if you could help with what is causing this.
>
> Thank you
>
> Kevin
>
> On Wed, Nov 2, 2022 at 12:50 PM Kevin Kennedy 
> wrote:
>
>> I did find setting this, works for contact
>> modparam("dispatcher", "hash_pvar", "$ct.fields(uri)")
>>
>> But is there a way to break it up to only look at the tgrp and
>> trunk-context if available and if not available look at the URI as a whole?
>>
>> INVITE is still not looking at the hash and is still sending out based on
>> FQDN resolution resolved in the R-URI.  Not sure how to resolve this to
>> force it to match the hash.
>>
>> Thank you.
>>
>> Kevin
>>
>> On Wed, Nov 2, 2022 at 11:00 AM Kevin Kennedy 
>> wrote:
>>
>>> I am not seeing an option, but Is it possible to hash on the Contact
>>> Header?
>>>
>>> Right now I have it hashing on From Header and I know that the From on
>>> the Register and the From on the INVITE match except for the tag. I added
>>> the "u" flag and it is still not working.  What it is doing is looking at
>>> the DNS record of the R-URI domain and routing on that.
>>>
>>>  $ru = (ds_select_dst(1, 1, "u", "default", 1));
>>>
>>> How do I get it to not use the domain in the R-URI to route on.
>>>
>>> Thank you.
>>>
>>> Kevin
>>>
>>> On Tue, Nov 1, 2022 at 12:51 AM Bogdan-Andrei Iancu 
>>> wrote:
>>>
 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 <
 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 <
> 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 

Re: [OpenSIPS-Users] dialog behavior when no ACK is received

2022-10-31 Thread M S
Thanks, this looks like a good idea! changed your code a little to set
DLG_timeout=5 right after create_dialog (otherwise even though you set
DLG_timeout=12hrs for ACK, outside the if it gets reset to 5 again). I'm
testing and will let you know.


On Mon, Oct 31, 2022 at 2:27 AM John Burke via Users <
users@lists.opensips.org> wrote:

> Hello,
>
> One way to handle the ACK timeout scenario that you described is to
> initially set the dialog timeout to a low value, then increment to the
> desired value after receiving the ACK.  Here's a minimal example with some
> notes I have. In this config, your call would hang for 5sec before being
> auto-closed by the dialog module.
>
> route {
>   if (has_totag()) {
> # sequential request logic
> ...
> if (is_method("ACK"))
>   $DLG_timeout = 43200; # 12hrs
> ...
>   }
>
>   # to handle case of lost ACK, we set low dialog timeout then
>   # increase once ACK is received; without this the call will stay
>   # in DLG_STATE=3 until default dialog timeout is met
>   # NOTE: timer doesn't start until 200 received, so this is essentially
>   #   an ACK timeout (ie 200 -> ACK)
>   $DLG_timeout = 5;
>
>   ...
>   # initial request logic
> }
>
>
> If the code ever changes to start the DLG timer before the 200, then this
> doesn't work... but I think this is baked into RFC and in any rate my unit
> tests for this scenario have never failed when migrating versions :)
>
> Thanks,
> John Burke
>
>
> On 10/30/22 9:44 AM, M S wrote:
>
> Hi list,
> When a dialog is created with initial INVITE, it seems like it is not
> available to dlg_end_dlg until the call is answered (OK received) and the
> caller also acknowledges (ACK) to the OK message.
> So in a scenario where a caller sends an INVITE and then dies, the call
> goes to callee, gets answered, OK is sent to caller but there is no
> response, and the dialog stays open until default_timeout and that's when
> the CDR is generated (if default_timeout is 12 hours then a 12 hour call is
> in CDR).
> Anybody has any ideas how we can fix this? If I use PpB for dialog, it
> never PINGs the callee because apparently the dialog is not fully
> established on the callee side. If I use rtpengine to detect media timeout,
> it correctly detects it but when it calls dlg_end_dlg opensips says "dialog
> not found".
>
> Thank you!
>
> --
>
> * Please be cautious!* This email was sent from outside of Voxtelesys.
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://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


[OpenSIPS-Users] dialog behavior when no ACK is received

2022-10-30 Thread M S
Hi list,
When a dialog is created with initial INVITE, it seems like it is not
available to dlg_end_dlg until the call is answered (OK received) and the
caller also acknowledges (ACK) to the OK message.
So in a scenario where a caller sends an INVITE and then dies, the call
goes to callee, gets answered, OK is sent to caller but there is no
response, and the dialog stays open until default_timeout and that's when
the CDR is generated (if default_timeout is 12 hours then a 12 hour call is
in CDR).
Anybody has any ideas how we can fix this? If I use PpB for dialog, it
never PINGs the callee because apparently the dialog is not fully
established on the callee side. If I use rtpengine to detect media timeout,
it correctly detects it but when it calls dlg_end_dlg opensips says "dialog
not found".

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


Re: [OpenSIPS-Users] Random decision

2022-07-16 Thread M S
If your list is large, you can add them to a database, give each row an Id
number, then use it with sql_cacher and random number generator to randomly
look up a number in table.

On Sat, Jul 16, 2022 at 4:06 PM John Burke via Users <
users@lists.opensips.org> wrote:

> Hey Alexey,
>
> One solution might be to use a parallel set of AVPs (1 for CIDs, 1 for
> weight) and use "set_select_weight" [1] to select a random index. There is
> also a PR in to shuffle an AVP list in place [2].
>
> If your list of CIDs is large, then it may not be performant to load the
> list on every request and you may need to look into leveraging another
> module that has similar functionality (like dispatcher).
>
> [1]
> https://opensips.org/html/docs/modules/3.1.x/cfgutils.html#func_set_select_weight
>
> [2] https://github.com/OpenSIPS/opensips/pull/2852
>
> Thanks,
> John
>
>
>  Original message 
> From: Alexey Kazantsev via Users 
> Date: 7/16/22 7:52 AM (GMT-06:00)
> To: users@lists.opensips.org
> Subject: [OpenSIPS-Users] Random decision
>
> Hi list.
>
>
> I’m looking for a solution how to set caller id from a pre-defined list of
> phone numbers _randlomly_ .
> So, there is some number of caller ids allowed by our VoIP provider for
> outgoing calls.
> And I need to set it randomly, from the list.
>
> I know the solution how it can be achieved in Asterisk, but I also would
> like to know
>
> how to configure it in OpenSIPS.
>
> Not sure if the dialplan module is what I need.
> ---
> BR, Alexey
> https://alexeyka.zantsev.com/
>
> --
>
> * Please be cautious!* This email was sent from outside of Voxtelesys.
>
> ___
> 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] Dialog ping question

2022-07-10 Thread M S
Hi all,
I need to catch the replies to OPTIONS (ping) packets that
Create_dialog("Pp") sends to both sides, and then based on response code
and some other transaction information, i.e. I need to calculate the call
length (from pick up till that moment) to send Interim-Updates to RADIUS.
My questions are:
1. How do I  check for those internal OPTIONS replies? I can see replies in
a global onreply_route, but there is no transaction level information there
2. How do I calculate the call length? I assume if #1 above is fixed, I can
store answer time in a variable and then calculate length in onreply.

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


Re: [OpenSIPS-Users] Regex to test variable

2020-11-25 Thread M S
something with your regex. each header has a \r\n in the end too, also I'm
not sure you need \ before =

On Wed, Nov 25, 2020 at 4:26 PM Mark Farmer  wrote:

> Hi everyone
>
> I am trying to detect a string using sdp.line,m and a regex pattern but it
> is failing to match.
> I am trying to match the 101 at the end of the m=audio line:
>
> m=audio 25224 RTP/AVP 8 18 101
>
> This is my code:
>
> if (is_method("INVITE") && has_body_part("application/sdp")) {
> $var(audio_stream) = $(rb{sdp.line,m});
> xlog("CUSTOM_LOG: Audio stream is $var(audio_stream)\n");
> if ($var(audio_stream) =~ "^m\=audio.*101$") {
> $var(dtmf_compat)=1;
> } else $var(dtmf_compat)=0;
> if ($var(dtmf_compat)=0) {
> xlog("CUSTOM_LOG: Would do something else now");
> }
> xlog("CUSTOM_LOG: DTMF validity = $var(dtmf_compat)");
> }
>
> I can see that var(audio_stream) is being set correctly:
> CUSTOM_LOG: Audio stream is m=audio 25914 RTP/AVP 8 18 101
>
> But it seems not to match:
> CUSTOM_LOG: DTMF validity = 0
>
> Is anyone able to help me solve 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


[OpenSIPS-Users] dialog.c problem finding did

2020-11-20 Thread M S
Hi guys,
Checking on an issue with dialog and TH, I realized that there is a
potential bug while dialog id is added/retrieved from contact username.
If an endpoint has ".did." string in its contact name (if it
created its contact based on what opensips sent for example, by using the
same contact username and just changing the host part), then dialog module
cannot find the correct did in it - because dialog module always looks for
the first match of that string inside the username.
I believe this is where the problem happens in dialog.c in api_match_dialog:
   while( (p=q_memchr(s.s,DLG_SEPARATOR,s.len))!=NULL )
{
if ( s.s+s.len-p-1 > rr_param.len+2 ) {
if (strncmp( p+1, rr_param.s,
rr_param.len)==0 &&
p[rr_param.len+1]==DLG_SEPARATOR ) {
p += rr_param.len+2;
s.len = s.s+s.len-p;
s.s = p;
match_param = (void*)(&s);
break;
}
}
if (p+10){
p += rr_param.len+2;
s.len = s.s+s.len-p;
s.s = p;
match_param = (void*)(&s);
}
}
This will search for all occurrences of ".did." string, and uses the last
one.
My code compiles okay but I don't have a test setup to check. I can submit
a bug report to github but first I wanted to check if this is considered a
real bug, and if anyone can test whether my fix works.

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


Re: [OpenSIPS-Users] topology hiding bug?

2020-11-18 Thread M S
I investigated a bit more about this and although the effects might be
similar, I'm not sure if my case and yours are triggered by the same reason.
This is how this problem can be simulated: the problem of duplicating did
part in contact happens when the callee part sends back its contact with
the same username as opensip contact.
In my case, if opensips (during topology hiding) changes contact to
 and sends it to callee,
if callee (B side) responds with 200 OK and sets its contact to be:
 which is the same
username as opensips contact, but different ip (which I guess is correct by
RFC?) then opensips changes the contact (incorrectly) to

If developers of topology hiding module read this, maybe they have some
ideas about why this happens?

Thanks,
Mark

On Wed, Nov 18, 2020 at 2:03 PM Ricardo Martinez 
wrote:

> Hi.
>
> I have a very similar problem with the topology hiding module and with the
> mid_registrar module.
>
> I don’t know if maybe I’m doing something wrong or maybe this is the way
> it has to work?.  My scenario is as follows:
>
>
>
> Private PBX – OpenSIP (Topology Hiding + MidRegistrar) --  UAC
>
>
>
> When a REGISTER came from the UAC to the PBX I see something like this:
>
>
>
> 2020/11/18 09:49:00.290304 192.XXX.XXX.4:51045 -> 192.XXX.XXX.133:5060
>
> REGISTER sip:my.domain.com:5060 SIP/2.0
>
> Via: SIP/2.0/UDP
> 192.XXX.XXX.4:51045;branch=z9hG4bK-524287-1---300f9ecbae4e0c8d;rport
>
> Max-Forwards: 70
>
> *Contact:
> ;+sip.instance="";reg-id=1*
>
> To: "Ricardo Martinez"
>
> From: "Ricardo Martinez";tag=7bb10a6e
>
> Call-ID: 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM
>
> CSeq: 1 REGISTER
>
> Expires: 600
>
> Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO,
> MESSAGE
>
> Supported: outbound, path
>
> User-Agent: VEX release 6.2.2.0 stamp 104875
>
> Content-Length: 0
>
>
>
>
>
> But then pass through the OpenSIPS with Topology Hiding enabled and
> Mid_registrar enabled I see:
>
>
>
> 2020/11/18 09:49:00.291478 192.XXX.XXX.134:5060 -> 192.141.65.94:5060
>
> REGISTER sip:my.domain.com:5060 SIP/2.0
>
> Via: SIP/2.0/UDP 192.XXX.XXX.134:5060;branch=z9hG4bK4943.c7a48b07.0
>
> Max-Forwards: 69
>
> *Contact: <*
> *sip:d1@192.xxx.xxx.134;thinfo=VG9obzAdIFs3YnpWYl0DRWlTfWJgXn5ZdFpkW2ZiZFtlVDEdPhInMjoMNVJwQWUEMWU3XjZZIUJiWWRmQ28lCzNOYVhhfWVbYUF1QH5QYGBuWmBZcw--*
> *><**sip:2844375008405363...@192.xxx.xxx.134:5060**>;expires=3600*
>
> To: "Ricardo Martinez"
>
> From: "Ricardo Martinez";tag=7bb10a6e
>
> Call-ID: 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM
>
> CSeq: 1 REGISTER
>
> Expires: 3600
>
> Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO,
> MESSAGE
>
> Supported: outbound, path
>
> User-Agent: VEX release 6.2.2.0 stamp 104875
>
> Content-Length: 0
>
>
>
>
>
> As you can see the CONTACT is duplicated and I’m getting the next error:
>
> ERROR:mid_registrar:save_restore_rpl_contacts: 200 OK reply does not
> include all req contacts! (ci:
> 104875NWY1NThmMTJmOWMyNTdlNmY3OGIwZjZlNWIzMzk4NDM)
>
> Nov 18 09:58:00 sbcar /usr/local/sbin/opensips[11924]:
> ERROR:mid_registrar:mid_reg_resp_in: failed to process rpl contacts for AoR
> 'd1.922'
>
>
>
>
>
> Does someone have a clue on this?
>
>
>
> Regards,
>
> Ricardo
>
>
>
> *De:* Users  *En nombre de *M S
> *Enviado el:* martes, 17 de noviembre de 2020 22:24
> *Para:* OpenSIPS users mailling list 
> *Asunto:* [OpenSIPS-Users] topology hiding bug?
>
>
>
> Dear OpenSIPS development team,
>
> I have come across a strange case that sometime when I use
> topology_hiding("UD"), it makes a mistake in changing Contact field.
>
> Scenario is:
>
>
>
> A: (Contact: ) sends Invite to private IP
> of opensips, opensips changes Contact field to: (Contact: <
> sip:90006969.did.29c.2ed2...@public.ip>) and sends Invite from public IP
> to B.
>
> Then B sends 200 OK back to Opensips public IP, with correct Contact:
> (Contact: ). so far so good.
>
> Now Opensips sends 200 OK back to A from its private IP, and changes
> Contact to:
>
> Contact: 
>
>
>
> As you see, did part is repeated twice.. and that means when A replies
> with:
>
> ACK sip:90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37 SIP/2.0
>
>
>
> Opensips throws an error: ERROR:dialog:dlg_onroute: malformed route param
> [29c.2ed202e.did.29c.2ed202e]
>
>
>
> Is this a bug? I am using Opensips 3.1.0.
>
>
>
> 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


[OpenSIPS-Users] topology hiding bug?

2020-11-17 Thread M S
Dear OpenSIPS development team,
I have come across a strange case that sometime when I use
topology_hiding("UD"), it makes a mistake in changing Contact field.
Scenario is:

A: (Contact: ) sends Invite to private IP of
opensips, opensips changes Contact field to: (Contact:
) and sends Invite from public IP
to B.
Then B sends 200 OK back to Opensips public IP, with correct Contact:
(Contact: ). so far so good.
Now Opensips sends 200 OK back to A from its private IP, and changes
Contact to:
Contact: 

As you see, did part is repeated twice.. and that means when A replies with:
ACK sip:90006969.did.29c.2ed202e.did.29c.2ed202e@172.24.8.37 SIP/2.0

Opensips throws an error: ERROR:dialog:dlg_onroute: malformed route param
[29c.2ed202e.did.29c.2ed202e]

Is this a bug? I am using Opensips 3.1.0.

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


[OpenSIPS-Users] dialog module mi dlg_list not working as expected?

2020-11-16 Thread M S
Hi,
I think something is not working as expected with dialog:
I check this callid and it exists:
[root@sbc2 ~]# opensips-cli -x mi dlg_list | grep
209eaf197691d8a937eb9d514104679c
"callid": "209eaf197691d8a937eb9d514104679c@192.168.20.190:5060
",

Then I try it like
https://opensips.org/html/docs/modules/3.1.x/dialog.html#mi_dlg_list :
[root@sbc2 ~]# opensips-cli -x mi dlg_list
209eaf197691d8a937eb9d514104679c@192.168.20.190:5060
ERROR: command 'dlg_list' returned: -32602: Invalid params (Command only
supports named parameters)

and if I go by my guess:
[root@sbc2 ~]# opensips-cli -x mi dlg_list callid=
209eaf197691d8a937eb9d514104679c@192.168.20.190:5060
ERROR: command 'dlg_list' returned: -32000: Server error

something broken?

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


Re: [OpenSIPS-Users] Crash at dialog.so

2020-11-11 Thread M S
Hi Liviu,
I did a quick look myself at dlg_timer.c (around the lines that crash
happens) and there is actually a FIXME note there too. it seems to me that
this issue happens when using create_dialog("PpB"), if one side is already
disconnected and also PpB doesn't receive a ping and decides to disconnect
the call, the module crashes. Basically, if the call is already
disconnected, we should not try to send BYE to them either.
For now, I removed "PpB" from create_dialog and the error has not occurred
again. I think that can be the workaround for now.

Thanks,
Mark

On Wed, Nov 11, 2020 at 3:40 PM Liviu Chircu  wrote:

> On 07.11.2020 13:27, M S wrote:
> > The server has a pretty high load, is Q_MALLOC_DBG safe?
>
> How "pretty" high of a load is that, in terms of "calls-per-second" and
> "max-concurrent-calls"?  Q_MALLOC_DBG will typically add +30-50% to
> shared/private memory usage, as well as maybe a 10% increase in CPU
> usage.  But OpenSIPS uses very few CPU and memory to begin with, so it
> will be quite safe to do.
>
> My advice: unless you're running more than 50 calls-per-second through
> it, there is no need to even start worrying about Q_MALLOC_DBG altering
> the system's behavior.  Below the 50 CPS level, the difference is
> unnoticeable.
>
> > also, is that an opensips command-line option? I don't see it in the
> > opensips man page...
> Yes, it's a "opensips" binary command-line option.  The man page needs
> updating, indeed, however you could try "opensips -h" and you'll see
> that option.
>
> --
> 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] Crash at dialog.so

2020-11-07 Thread M S
Will do, I didn't notice that I hit reply instead of reply all.
The server has a pretty high load, is Q_MALLOC_DBG safe? also, is that an
opensips command-line option? I don't see it in the opensips man page...

On Sat, Nov 7, 2020 at 12:18 PM Liviu Chircu  wrote:

> Please keep the "users" mailing list CC'ed at all times.  Both the
> question and discussion are of public interest, after all.
>
> On 07.11.2020 13:06, M S wrote:
> > I'm using CentOS 8 and couldn't find opensips-dbg package for it,
> > please advise.
>
> It's enough, no need for "opensips-dbg" as you seem to have the debug
> symbols already.
>
> Okay, so we're dealing with some kind of memory corruption, and this
> backtrace only begins to offer hints as to what's wrong, without
> decisive help.  The next step is to switch to the "-a Q_MALLOC_DBG"
> command-line option, trigger the crash again and see what that backtrace
> looks like.
>
> --
> 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


[OpenSIPS-Users] Crash at dialog.so

2020-11-07 Thread M S
Hi all,
I am using opensips 3.1.0:

kernel: traps: opensips[98311] general protection ip:543d22 sp:7ffcb17316e0
error:0 in opensips[40+34c000]
systemd[1]: Started Process Core Dump (PID 100247/UID 0).
kernel: opensips[98295]: segfault at 8 ip 7f697539df40 sp
7ffcb1731cb0 error 4 in dialog.so[7f6975332000+9b000]
kernel: Code: 41 57 41 56 41 55 41 54 55 53 48 81 ec 98 00 00 00 48 89 fb
89 74 24 54 4c 8b 35 d3 fb 22 00 49 8b 06 44 8b 6f 1c 49 c1 e5 05 <4c> 03
68 08 48 8b 48 18 41 8b 55 18 48 8b 71 08 4c 8d 3c 96 bf 01
systemd[1]: Started Process Core Dump (PID 100249/UID 0).
systemd[1]: opensips.service: Main process exited, code=dumped,
status=11/SEGV
systemd[1]: opensips.service: Failed with result 'core-dump'.
systemd-coredump[100248]: Process 98311 (opensips) of user 1001 dumped
core.#012#012Stack trace of thread 98311:#012#0  0x00543d22
fm_status (opensips)#012#1  0x00502c51 sig_usr (opensips)#012#2
0x7f69803f8dd0 __restore_rt (libpthread.so.0)#012#3  0x00542cc3
fm_remove_free (opensips)#012#4  0x7f69753476da build_extra_hdr
(dialog.so)#012#5  0x7f6975341717 dlg_options_routine
(dialog.so)#012#6  0x004c4a5d handle_timer_job (opensips)#012#7
0x0061124b handle_io (opensips)#012#8  0x00615c61
udp_start_processes (opensips)#012#9  0x0041a742 main_loop
(opensips)#012#10 0x7f69800476a3 __libc_start_main (libc.so.6)#012#11
0x0041b1ae _start (opensips)
systemd-coredump[100250]: Process 98295 (opensips) of user 1001 dumped
core.#012#012Stack trace of thread 98295:#012#0  0x7f697539df40
_unref_dlg (dialog.so)#012#1  0x7f6975635c69 empty_tmcb_list
(tm.so)#012#2  0x7f69755fb64a free_cell (tm.so)#012#3
0x7f69755fe42e free_hash_table (tm.so)#012#4  0x7f69755fab16
tm_shutdown (tm.so)#012#5  0x00507fb2 destroy_modules
(opensips)#012#6  0x005033f3 cleanup (opensips)#012#7
0x00503ef1 shutdown_opensips (opensips)#012#8  0x0050475d
handle_sigs (opensips)#012#9  0x0041ab01 main_loop
(opensips)#012#10 0x7f69800476a3 __libc_start_main (libc.so.6)#012#11
0x0041b1ae _start (opensips)

Any ideas what caused it?

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


Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
thank you!

On Tue, Nov 3, 2020 at 8:15 PM Federico Edorna  wrote:

> I didn't read that it was mysql, sorry. I think my suggestion is for
> another thread :)
>
> Anyway, it seems that proxysql <https://proxysql.com/> can be a choice
> for mysql...
>
>
> On Tue, Nov 3, 2020 at 3:46 PM M S  wrote:
>
>> Thanks for the suggestion Federico. I'm using Myql, is there an
>> equivalent?
>>
>> On Tue, Nov 3, 2020 at 3:42 PM Federico Edorna 
>> wrote:
>>
>>> If it helps, we are using pgbouncer <https://www.pgbouncer.org/> to
>>> avoid opening a lot of connections to db. Pgbouncer acts as a db server for
>>> opensips with full workers connections and opens just a few (on demand) to
>>> real db server. It helps a lot when you have backup/standby opensips, not
>>> increasing those db connections.
>>>
>>>
>>> On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
>>> wrote:
>>>
>>>> Maybe we should consider (as future extension) the possibility to
>>>> bundle
>>>> multiple UDP listeners on the same worker.  In this case, we can have a
>>>> large number of listeners with a relatively small number of workers/
>>>> processes.
>>>>
>>>> Regards,
>>>>
>>>> Bogdan-Andrei Iancu
>>>>
>>>> OpenSIPS Founder and Developer
>>>>https://www.opensips-solutions.com
>>>> OpenSIPS Bootcamp 2020 online
>>>>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>>>
>>>> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
>>>> > Hello!
>>>> >
>>>> > No, there is no way to prevent OpenSIPS from opening connections for
>>>> > each process. Did you try to start opensips with fewer workers, for
>>>> > example just 1, or 3? Does it start properly?
>>>> >
>>>> > Best regards,
>>>> >
>>>> > Răzvan Crainea
>>>> > OpenSIPS Core Developer
>>>> > http://www.opensips-solutions.com
>>>> >
>>>> > On 11/2/20 1:55 PM, M S wrote:
>>>> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
>>>> >> Is there a way to not open a process per interface, to not have 1200
>>>> >> or 600 workers? as I said in my previous email, I tried auto scaling
>>>> >> and it didn't work.
>>>> >> Also, I have increased MySQL max connections but it didn't fix
>>>> >> the problem - I wonder if anybody has experience with this...
>>>> >>
>>>> >> Thanks!
>>>> >>
>>>> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
>>>> >> mailto:bog...@opensips.org>> wrote:
>>>> >>
>>>> >> Hi OpenSIPer,
>>>> >>
>>>> >> With 600 interfaces (btw , have actually listed the 600 sockets
>>>> into
>>>> >> the cfg or pointed the socket to the interface?) with 2 workers
>>>> per
>>>> >> socket -> 1200 workers / processes. That means 1200 connections
>>>> to
>>>> >> your DB server, which may be a bottle neck (by default, mysql
>>>> >> accepts around 100 simultaneous connections).
>>>> >>
>>>> >> I suspect your mysql server cannot cope with the 1200 conn,
>>>> >> preventing OpenSIPS to properly start.
>>>> >>
>>>> >> Regards,
>>>> >>
>>>> >> Bogdan-Andrei Iancu
>>>> >>
>>>> >> OpenSIPS Founder and Developer
>>>> >>https://www.opensips-solutions.com
>>>> >> OpenSIPS Bootcamp 2020 online
>>>> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>>> >>
>>>> >> On 11/2/20 1:23 AM, M S wrote:
>>>> >>> Hi all,
>>>> >>> I have a machine with 600 subinterfaces. when I start opensips
>>>> >>> with 2 udp workers per interface, it doesn't start and keeps
>>>> >>> restarting.
>>>> >>> First error message was about too many connections to Mysql
>>>> which
>>>> >>> I fixed by increasing max_connections, but now I am getting:
>>>> >>>
>>>> >

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
That would be great if possible. or if you can expand auto_scaling to the
whole socket=udp:* group, not per IP...

On Tue, Nov 3, 2020 at 1:11 PM Bogdan-Andrei Iancu 
wrote:

> Maybe we should consider (as future extension) the possibility to bundle
> multiple UDP listeners on the same worker.  In this case, we can have a
> large number of listeners with a relatively small number of workers/
> processes.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2020 online
>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>
> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
> > Hello!
> >
> > No, there is no way to prevent OpenSIPS from opening connections for
> > each process. Did you try to start opensips with fewer workers, for
> > example just 1, or 3? Does it start properly?
> >
> > Best regards,
> >
> > Răzvan Crainea
> > OpenSIPS Core Developer
> > http://www.opensips-solutions.com
> >
> > On 11/2/20 1:55 PM, M S wrote:
> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
> >> Is there a way to not open a process per interface, to not have 1200
> >> or 600 workers? as I said in my previous email, I tried auto scaling
> >> and it didn't work.
> >> Also, I have increased MySQL max connections but it didn't fix
> >> the problem - I wonder if anybody has experience with this...
> >>
> >> Thanks!
> >>
> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
> >> mailto:bog...@opensips.org>> wrote:
> >>
> >> Hi OpenSIPer,
> >>
> >> With 600 interfaces (btw , have actually listed the 600 sockets into
> >> the cfg or pointed the socket to the interface?) with 2 workers per
> >> socket -> 1200 workers / processes. That means 1200 connections to
> >> your DB server, which may be a bottle neck (by default, mysql
> >> accepts around 100 simultaneous connections).
> >>
> >> I suspect your mysql server cannot cope with the 1200 conn,
> >> preventing OpenSIPS to properly start.
> >>
> >> Regards,
> >>
> >> Bogdan-Andrei Iancu
> >>
> >> OpenSIPS Founder and Developer
> >>https://www.opensips-solutions.com
> >> OpenSIPS Bootcamp 2020 online
> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
> >>
> >> On 11/2/20 1:23 AM, M S wrote:
> >>> Hi all,
> >>> I have a machine with 600 subinterfaces. when I start opensips
> >>> with 2 udp workers per interface, it doesn't start and keeps
> >>> restarting.
> >>> First error message was about too many connections to Mysql which
> >>> I fixed by increasing max_connections, but now I am getting:
> >>>
> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> >>> ERROR:core:db_do_init: could not add connection to the pool
> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> >>> ERROR:core:init_mod_child: failed to initializing module
> >>> sql_cacher, rank 683
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
> >>> (11)
> >>>
> >>> and:
> >>>
> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >>> ERROR:core:udp_start_processes: failed to send -1 status code
> >>>
> >>> Any ideas how I can fix this?
> >>> Also, can I just limit number of opensips forked processes, to run
> >>> just a certain number process instead of x numbers per interface?
> >>> I tried using auto_scaling but it did not help. in my
> >>> opensips.conf, I have:
> >>> socket=udp:*:5060
> >>> and adding an autoscaling profile in front of it seems to limit
> >>> the processes per interface again, not all...
> >>>
> >>> Any help is appreciated.
> >>>
> >>> Thanks!
> >>>
> >>> ___
> >>> Users mailing list
> >>> Users@lists.opensips.org <mailto: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
>
>
> ___
> 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] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
Thanks for the suggestion Federico. I'm using Myql, is there an equivalent?

On Tue, Nov 3, 2020 at 3:42 PM Federico Edorna  wrote:

> If it helps, we are using pgbouncer <https://www.pgbouncer.org/> to avoid
> opening a lot of connections to db. Pgbouncer acts as a db server for
> opensips with full workers connections and opens just a few (on demand) to
> real db server. It helps a lot when you have backup/standby opensips, not
> increasing those db connections.
>
>
> On Tue, Nov 3, 2020 at 9:13 AM Bogdan-Andrei Iancu 
> wrote:
>
>> Maybe we should consider (as future extension) the possibility to bundle
>> multiple UDP listeners on the same worker.  In this case, we can have a
>> large number of listeners with a relatively small number of workers/
>> processes.
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>https://www.opensips-solutions.com
>> OpenSIPS Bootcamp 2020 online
>>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>>
>> On 11/3/20 10:10 AM, Răzvan Crainea wrote:
>> > Hello!
>> >
>> > No, there is no way to prevent OpenSIPS from opening connections for
>> > each process. Did you try to start opensips with fewer workers, for
>> > example just 1, or 3? Does it start properly?
>> >
>> > Best regards,
>> >
>> > Răzvan Crainea
>> > OpenSIPS Core Developer
>> > http://www.opensips-solutions.com
>> >
>> > On 11/2/20 1:55 PM, M S wrote:
>> >> Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
>> >> Is there a way to not open a process per interface, to not have 1200
>> >> or 600 workers? as I said in my previous email, I tried auto scaling
>> >> and it didn't work.
>> >> Also, I have increased MySQL max connections but it didn't fix
>> >> the problem - I wonder if anybody has experience with this...
>> >>
>> >> Thanks!
>> >>
>> >> On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu
>> >> mailto:bog...@opensips.org>> wrote:
>> >>
>> >> Hi OpenSIPer,
>> >>
>> >> With 600 interfaces (btw , have actually listed the 600 sockets
>> into
>> >> the cfg or pointed the socket to the interface?) with 2 workers per
>> >> socket -> 1200 workers / processes. That means 1200 connections to
>> >> your DB server, which may be a bottle neck (by default, mysql
>> >> accepts around 100 simultaneous connections).
>> >>
>> >> I suspect your mysql server cannot cope with the 1200 conn,
>> >> preventing OpenSIPS to properly start.
>> >>
>> >> Regards,
>> >>
>> >> Bogdan-Andrei Iancu
>> >>
>> >> OpenSIPS Founder and Developer
>> >>https://www.opensips-solutions.com
>> >> OpenSIPS Bootcamp 2020 online
>> >>https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>> >>
>> >> On 11/2/20 1:23 AM, M S wrote:
>> >>> Hi all,
>> >>> I have a machine with 600 subinterfaces. when I start opensips
>> >>> with 2 udp workers per interface, it doesn't start and keeps
>> >>> restarting.
>> >>> First error message was about too many connections to Mysql which
>> >>> I fixed by increasing max_connections, but now I am getting:
>> >>>
>> >>> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
>> >>> ERROR:core:db_do_init: could not add connection to the pool
>> >>> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
>> >>> ERROR:core:init_mod_child: failed to initializing module
>> >>> sql_cacher, rank 683
>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>> pipe
>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>> >>> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
>> >>> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
>> >>> (11)
>> >>>
>> >>> and:
>> >>>
>> >>> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken
>> pipe
>> >>> ERROR:core:udp_start_processes: failed to send -1 status code
>> >>>
>> >&g

Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-03 Thread M S
Hi Razvan,
I tried, but it didn't start properly. I guess it is Mysql that returns an
error, but usually Opensips just prints a warning and continues running if
it cannot connect to database, right? I'm using Mysql for sql_cacher.
Is it possible that Opensips is running out of some other resources? I sent
the error messages I received in the original email...

Thanks!

On Tue, Nov 3, 2020 at 9:13 AM Răzvan Crainea  wrote:

> Hello!
>
> No, there is no way to prevent OpenSIPS from opening connections for
> each process. Did you try to start opensips with fewer workers, for
> example just 1, or 3? Does it start properly?
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 11/2/20 1:55 PM, M S wrote:
> > Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
> > Is there a way to not open a process per interface, to not have 1200 or
> > 600 workers? as I said in my previous email, I tried auto scaling and it
> > didn't work.
> > Also, I have increased MySQL max connections but it didn't fix
> > the problem - I wonder if anybody has experience with this...
> >
> > Thanks!
> >
> > On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu  > <mailto:bog...@opensips.org>> wrote:
> >
> > Hi OpenSIPer,
> >
> > With 600 interfaces (btw , have actually listed the 600 sockets into
> > the cfg or pointed the socket to the interface?) with 2 workers per
> > socket -> 1200 workers / processes. That means 1200 connections to
> > your DB server, which may be a bottle neck (by default, mysql
> > accepts around 100 simultaneous connections).
> >
> > I suspect your mysql server cannot cope with the 1200 conn,
> > preventing OpenSIPS to properly start.
> >
> > Regards,
> >
> > Bogdan-Andrei Iancu
> >
> > OpenSIPS Founder and Developer
> >https://www.opensips-solutions.com
> > OpenSIPS Bootcamp 2020 online
> >https://opensips.org/training/OpenSIPS_eBootcamp_2020/
> >
> > On 11/2/20 1:23 AM, M S wrote:
> >> Hi all,
> >> I have a machine with 600 subinterfaces. when I start opensips
> >> with 2 udp workers per interface, it doesn't start and keeps
> >> restarting.
> >> First error message was about too many connections to Mysql which
> >> I fixed by increasing max_connections, but now I am getting:
> >>
> >> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> >> ERROR:core:db_do_init: could not add connection to the pool
> >> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> >> ERROR:core:init_mod_child: failed to initializing module
> >> sql_cacher, rank 683
> >> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >> ERROR:core:udp_start_processes: failed to send -1 status code
> >> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect
> >> to local MySQL server through socket '/var/lib/mysql/mysql.sock'
> (11)
> >>
> >> and:
> >>
> >> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> >> ERROR:core:udp_start_processes: failed to send -1 status code
> >>
> >> Any ideas how I can fix this?
> >> Also, can I just limit number of opensips forked processes, to run
> >> just a certain number process instead of x numbers per interface?
> >> I tried using auto_scaling but it did not help. in my
> >> opensips.conf, I have:
> >> socket=udp:*:5060
> >> and adding an autoscaling profile in front of it seems to limit
> >> the processes per interface again, not all...
> >>
> >> Any help is appreciated.
> >>
> >> Thanks!
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org  <mailto: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
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] multiple sub interfaces - opensips crashes

2020-11-02 Thread M S
Thank you Bogdan. I actually use: socket=udp:*:5060 in config file.
Is there a way to not open a process per interface, to not have 1200 or 600
workers? as I said in my previous email, I tried auto scaling and it didn't
work.
Also, I have increased MySQL max connections but it didn't fix the problem
- I wonder if anybody has experience with this...

Thanks!

On Mon, Nov 2, 2020 at 9:24 AM Bogdan-Andrei Iancu 
wrote:

> Hi OpenSIPer,
>
> With 600 interfaces (btw , have actually listed the 600 sockets into the
> cfg or pointed the socket to the interface?) with 2 workers per socket ->
> 1200 workers / processes. That means 1200 connections to your DB server,
> which may be a bottle neck (by default, mysql accepts around 100
> simultaneous connections).
>
> I suspect your mysql server cannot cope with the 1200 conn, preventing
> OpenSIPS to properly start.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Bootcamp 2020 online
>   https://opensips.org/training/OpenSIPS_eBootcamp_2020/
>
> On 11/2/20 1:23 AM, M S wrote:
>
> Hi all,
> I have a machine with 600 subinterfaces. when I start opensips with 2 udp
> workers per interface, it doesn't start and keeps restarting.
> First error message was about too many connections to Mysql which I fixed
> by increasing max_connections, but now I am getting:
>
> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> ERROR:core:db_do_init: could not add connection to the pool
> ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
> ERROR:core:init_mod_child: failed to initializing module sql_cacher, rank
> 683
> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> ERROR:core:udp_start_processes: failed to send -1 status code
> ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to
> local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)
>
> and:
>
> ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
> ERROR:core:udp_start_processes: failed to send -1 status code
>
> Any ideas how I can fix this?
> Also, can I just limit number of opensips forked processes, to run just a
> certain number process instead of x numbers per interface? I tried using
> auto_scaling but it did not help. in my opensips.conf, I have:
> socket=udp:*:5060
> and adding an autoscaling profile in front of it seems to limit the
> processes per interface again, not all...
>
> Any help is appreciated.
>
> Thanks!
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://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] multiple sub interfaces - opensips crashes

2020-11-01 Thread M S
Hi all,
I have a machine with 600 subinterfaces. when I start opensips with 2 udp
workers per interface, it doesn't start and keeps restarting.
First error message was about too many connections to Mysql which I fixed
by increasing max_connections, but now I am getting:

ERROR:db_mysql:db_mysql_new_connection: initial connect failed
ERROR:core:db_do_init: could not add connection to the pool
ERROR:sql_cacher:child_init: Cannot connect to SQL DB from child
ERROR:core:init_mod_child: failed to initializing module sql_cacher, rank
683
ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
ERROR:core:udp_start_processes: failed to send -1 status code
ERROR:db_mysql:db_mysql_connect: driver error(2002): Can't connect to local
MySQL server through socket '/var/lib/mysql/mysql.sock' (11)

and:

ERROR:core:send_status_code: write(-1) failed (-1): 32, Broken pipe
ERROR:core:udp_start_processes: failed to send -1 status code

Any ideas how I can fix this?
Also, can I just limit number of opensips forked processes, to run just a
certain number process instead of x numbers per interface? I tried using
auto_scaling but it did not help. in my opensips.conf, I have:
socket=udp:*:5060
and adding an autoscaling profile in front of it seems to limit the
processes per interface again, not all...

Any help is appreciated.

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