Re: [OpenSIPS-Users] problem with git branch for opensips 3.0

2019-06-12 Thread vasilevalex
Hi Johan,

opensips-cli should replace all the command line tools.
https://github.com/OpenSIPS/opensips-cli
But I think developers team can help more with docs about migration data.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] problem with git branch for opensips 3.0

2019-06-12 Thread vasilevalex
Hi, Johan.

Everything ok with git.
Just check this commit: 8a7abc05195fb4a29d5439871d7691c090c60d32
(https://github.com/OpenSIPS/opensips/commit/8a7abc05195fb4a29d5439871d7691c090c60d32)




-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] User location fields access

2019-06-11 Thread vasilevalex
Hi Vitalii,

Mostly used fields can be accessed after lookup. Socket: $fs, Flags:
isbflagset(). If I need more fields, I just store them in external cache
with E_UL_CONTACT_INSERT and E_UL_CONTACT_UPDATE.
I understand, that this is duplication of data, but this is also good way to
move all request to that data from OpenSIPS to cache.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] questions about tls_mgm DB provisioning

2019-06-07 Thread vasilevalex
Hi Carlos,

Yes sure 2 issues on github:
https://github.com/OpenSIPS/opensips/issues/1709
and https://github.com/OpenSIPS/opensips/issues/1714

There is patch for 2.4 in comments.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] questions about tls_mgm DB provisioning

2019-06-05 Thread vasilevalex
Let me guess, you are using not the latest version of 2.4 branch

DB provisioning of TLS configuration was incomplete. CA list took only first
certificate from all the list. Certificate was loaded only first, not the
chain. And yes, ca_list DB field was too small.

But now, with 7fd38342bba96f732881dea769b9df9ce5ac3e03 and this
37a0d113296db7f009c3469f7f78940130b2f367 everything should be fine.

It works for me, but it would be nice, if you can try this also :)



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Control TLS client domain

2019-03-26 Thread vasilevalex
Hi Bogdan,

Thanks for fix!

What do you think about reusing TLS connections? In master branch this
behavior still the same. OpenSIPS reuses TLS connections the same way as
regular TCP connections, but it should not. For reusing TCP connection we
check, if connection with the same dst IP:PORT exists. But for TLS it is not
enough. We additionally should check, what certificate uses this connection
(or what domain it is related).

And in documentation for tls_mgm module everywhere written: Note: If there
is already an existing TLS connection to the remote target, it will be
reused and setting this AVP has no effect.

This is the same case - we have only 1 destination target, but we should use
several TLS connections to this target with different TLS certificates. So
first connection will be successful, but SIP message for second domain which
should use another certificate will try to reuse this first connection, as
target is the same. And this message will fail.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] Control TLS client domain

2019-03-20 Thread vasilevalex
Hi all.

OpenSIPS 2.4.4
I have 2 gateways in Dynamic Routing module table. For both gateways I have
different sockets:
address: gw1, socket: tls::5061
address: gw2, socket: tls::5061

IP1 has certificate for TLS sip.domain1.com
IP2 has certificate for TLS sip.domain2.com

And something like this for tls management module:

loadmodule "tls_mgm.so"
modparam("tls_mgm", "client_domain_avp", "tls_cli_dom")
modparam("tls_mgm", "client_domain", "test1")
modparam("tls_mgm","certificate",
"[test1]/etc/opensips/tls/test1/fullchain.pem")
modparam("tls_mgm","private_key",
"[test1]/etc/opensips/tls/test1/privkey.pem")
modparam("tls_mgm","verify_cert", "[test1]0")
modparam("tls_mgm","require_cert", "[test1]0")
modparam("tls_mgm","tls_method", "[test1]TLSv1")
modparam("tls_mgm", "client_domain", "test2")
modparam("tls_mgm","certificate",
"[test2]/etc/opensips/tls/test2/fullchain.pem")
modparam("tls_mgm","private_key",
"[test2]/etc/opensips/tls/test2/privkey.pem")
modparam("tls_mgm","verify_cert", "[test2]0")
modparam("tls_mgm","require_cert", "[test2]0")
modparam("tls_mgm","tls_method", "[test2]TLSv1")
#Default domain
modparam("tls_mgm","certificate", "/etc/opensips/tls/test1/fullchain.pem")
modparam("tls_mgm","private_key", "/etc/opensips/tls/test1/privkey.pem")
modparam("tls_mgm","verify_cert", "0")
modparam("tls_mgm","require_cert", "0")
modparam("tls_mgm","tls_method", "TLSv1")
modparam("tls_mgm", "server_domain", "srv2=IP2:5061")
modparam("tls_mgm","certificate",
"[srv2]/etc/opensips/tls/test2/fullchain.pem")
modparam("tls_mgm","private_key",
"[srv2]/etc/opensips/tls/test2/privkey.pem")
modparam("tls_mgm","verify_cert", "[srv2]0")
modparam("tls_mgm","require_cert", "[srv2]0")
modparam("tls_mgm","tls_method", "[srv2]TLSv1")

Server part of TLS works fine.
But I want OPTIONS to these gateways to be send with correct TLS
certificate.

local_route {
  if (is_method("OPTIONS")) {
# Get IP for outgoing socket
$var(ip_out) = $(fs{s.select,1,:});
switch($var(ip_out)) {
  case "IP1":
$avp(tls_cli_dom) = "test1";
  break;
  case "IP2":
$avp(tls_cli_dom) = "test2";
  break;
}
xlog("AVP for TLS:  $avp(tls_cli_dom) \n");
  }
}

So AVP for choosing client domain is set correctly during sending OPTIONS.
OpenSIPS uses different sockets for sending OPTIONS, but default TLS domain
for both gateways. What's wrong?



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] listen to IPv6

2019-03-18 Thread vasilevalex
OpenSIPS will not start with link-local address. You don't have IPv6 support
from ISP - doesn't matter. First you need to configure your local IPv6
network to run properly and only then try to run OpenSIPS with IPv6 support.

For example, we test our configuration with docker environment. You can
easily create virtual IPv4 and IPv6 networks with docker.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] listen to IPv6

2019-03-15 Thread vasilevalex
Just don't use link-local address.



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] topology_hiding : ACK has extra via header.

2019-01-29 Thread vasilevalex
Hi Johan,

We are using topology_hiding in tm mode.
I've checked your case, ACK has only one VIA header.

What about BYE from the phone (if phone ends call)? Does it has extra VIA?
Do you use dialog or tm mode for topology hiding?



-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Avoid plain text password in configuration files

2019-01-07 Thread vasilevalex
Hi Mickael,

I think most people keep configuration in git.

Just use m4.

Like this opensips_defs.m4:

divert(-1)
ifdef(`PRODUCTION_ENV', `define(`MYSQL_DB',`opensips')',
`define(`MYSQL_DB',`opensips_test')')

define(`MYSQL1_URL',   
`mysql://MYSQL_USER:MYSQL_PASSWD@MYSQL1_HOST/MYSQL_DB')
define(`MYSQL2_URL',   
`mysql://MYSQL_USER:MYSQL_PASSWD@MYSQL2_HOST/MYSQL_DB')
define(`MYSQL3_URL',   
`mysql://MYSQL_USER:MYSQL_PASSWD@MYSQL3_HOST/MYSQL_DB')
define(`MYSQL4_URL',   
`mysql://MYSQL_USER:MYSQL_PASSWD@MYSQL4_HOST/MYSQL_DB')
divert(0)dnl
include(`cfg/opensips_global.m4')
include(`cfg/opensips_modules.m4')
include(`cfg/opensips_routes.m4')

and in secret file opensips.m4 (which is not in git):

divert(-1)
define(`MYSQL_USER', `opensips')
define(`MYSQL_PASSWD', `password')
divert(0)dnl
include(`cfg/opensips_defs.m4')

And final config:

m4 opensips.m4 > opensips.cfg




-
---
Alexey Vasilyev
--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] usrloc restart persistency on seed node

2018-12-20 Thread vasilevalex
Hi John,

I also use the same scheme, but only 2 servers.
And here we discussed restart persistency a little bit:
http://opensips-open-sip-server.1449251.n2.nabble.com/Clusterer-and-Full-Sharing-USRLOC-sync-state-persistence-tp7612340p7612342.html

So just add "opensipsctl fifo ul_cluster_sync" to start script of first
node.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] open source SIPREC server for use with opensips

2018-12-16 Thread vasilevalex
Hi, Dave.

Thanks a lot! I'm using yours drachtio-server with drachtio-srf for uaCSTA.
They are really cool.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] String to IP transformations

2018-12-13 Thread vasilevalex
Thanks, Liviu.

I created issue https://github.com/OpenSIPS/opensips/issues/1568




--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] String to IP transformations

2018-12-13 Thread vasilevalex
Hi, all.

OpenSIPS 2.4.3 this script:

$var(ip_1_s) = "[2001:6c8:5e00:1::249]";
$var(ip_1_b) = $(var(ip_1_s){ip.pton}); # Save binary IP to variable
$var(ip_1) = $(var(ip_1_s){ip.pton}{ip.ntop}); # Save string from binary IP
to variable
$var(ip_2_s) = "[2001:6c8:5e00:1::250]";
$var(ip_2_b) = $(var(ip_2_s){ip.pton}); # Save binary IP to variable
$var(ip_2) = $(var(ip_2_s){ip.pton}{ip.ntop}); # Save string from binary IP
to variable
xlog("IP1 is $(var(ip_1)) af is $(var(ip_1_s){ip.pton}{ip.family})");
xlog("IP2 is $(var(ip_2)) af is $(var(ip_2_s){ip.pton}{ip.family})");
if ($(var(ip_1_s){ip.pton}) == $(var(ip_2_s){ip.pton})) {
xlog("Binary addresses are EQUAL");
} else {
xlog("Binary addresses are DIFFERENT");
}
if ($(var(ip_1_s){ip.pton}{ip.ntop}) == $(var(ip_2_s){ip.pton}{ip.ntop})) {
xlog("Binary to string addresses are EQUAL");
} else {
xlog("Binary to string addresses are DIFFERENT");
}
if ($var(ip_1_b) == $var(ip_2_b)) {
xlog("Variable saved Binary addresses are EQUAL");
} else {
xlog("Variable saved Binary addresses are DIFFERENT");
}
if ($var(ip_1) == $var(ip_2)) {
xlog("Variable saved Binary to string addresses are EQUAL");
} else {
xlog("Variable saved Binary to string addresses are DIFFERENT");
}


I thought, that all 4 conditions should be false. But I got this:

Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: IP1 is
2001:6C8:5E00:1:0:0:0:249 af is INET6
Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: IP2 is
2001:6C8:5E00:1:0:0:0:250 af is INET6
Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: Binary addresses are EQUAL
Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: Binary to string addresses
are EQUAL
Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: Variable saved Binary
addresses are EQUAL
Dec 13 11:23:09 test64 /usr/sbin/opensips[6063]: Variable saved Binary to
string addresses are DIFFERENT

Where am I wrong? what is incorrect?




--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Not enough memory to sync cluster data

2018-12-07 Thread vasilevalex
Yes, shure.

Process::  ID=42 PID=30896 Type=TCP receiver

# opensips -V
version: opensips 2.4.3 (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: unknown
main.c compiled on 13:27:19 Nov 28 2018 with gcc 4.8.5

This is actually git 2.4 branch with couple patches:

git cherry-pick 94a3ede1e276984a91f93f6ece832d174b071ab8 
git cherry-pick 05ca54a37d82c605e2cd6d10e5a62fb4f7c35b78





--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Not enough memory to sync cluster data

2018-12-07 Thread vasilevalex
Hi all,

Yes, may be my assumption was wrong. @Răzvan please look at logs and routing
script parts:

Process of starting OpenSIPS (I skip repeated messages and add some
comments):
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: NOTICE:core:main: version:
opensips 2.4.3 (x86_64/linux)
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: INFO:core:main: using 512
Mb of shared memory
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: INFO:core:main: using 32
Mb of private process memory
<... skipped ...>
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: INFO:proto_bin:mod_init:
initializing BIN protocol
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: INFO:clusterer:mod_init:
Clusterer module - initializing
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]: INFO:usrloc:ul_init_locks:
locks array size 512
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
Dec  1 20:13:01 test02 /usr/sbin/opensips[30853]:
INFO:core:evi_publish_event: Registered event 
<... skipped normal start messages ...>
### Than there are a lot of such messages (300-400):
Dec  1 20:13:04 test02 /usr/sbin/opensips[30896]:
INFO:usrloc:receive_ucontact_delete: failed to fetch local urecord -
ignoring request (ci: '313534303437393137333433343135-n7utfvs2rllm')
Dec  1 20:13:04 test02 /usr/sbin/opensips[30896]:
INFO:usrloc:receive_ucontact_delete: failed to fetch local urecord -
ignoring request (ci: '313534333537353638353630323134-gbdnp67daddu')
Dec  1 20:13:04 test02 /usr/sbin/opensips[30896]:
INFO:usrloc:receive_ucontact_delete: failed to fetch local urecord -
ignoring request (ci: '313534333233353433383232373838-3a3w8ljwjq7f')
<... skipped ...>
### I think this delete messages came from Active server, when it starts
deleting dead contacts, as TLS connections were of course closed when
switching.
### Than there are a lot of messages generated by OpenSIPS event route
Dec  1 20:15:11 test02 /usr/sbin/opensips[30896]: ATTENTION! Used 26843600
of 33554432 private memory by PID 30896
Dec  1 20:15:11 test02 /usr/sbin/opensips[30896]: ATTENTION! Used 27194504
of 33554432 private memory by PID 30896
Dec  1 20:15:11 test02 /usr/sbin/opensips[30896]: ATTENTION! Used 27523656
of 33554432 private memory by PID 30896
Dec  1 20:15:11 test02 /usr/sbin/opensips[30896]: ATTENTION! Used 27850224
of 33554432 private memory by PID 30896
<... skipped ...>
### Than start error messages
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: ERROR:core:fm_malloc: not
enough free pkg memory (30400 bytes left, need 35904), please increase the
"-M" command line parameter!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]:
ERROR:rest_client:start_async_http_req: Init curl handle failed!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: ERROR:core:fm_malloc: not
enough free pkg memory (30400 bytes left, need 35904), please increase the
"-M" command line parameter!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]:
ERROR:rest_client:start_async_http_req: Init curl handle failed!
### rest_client called async from event route
<... skipped ...>
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
<... skipped ...>
### Than server start working like usual, without any unexpected errors.
Dec  1 20:27:52 test02 /usr

Re: [OpenSIPS-Users] Not enough memory to sync cluster data

2018-12-06 Thread vasilevalex
Thanks @Răzvan. As I said, I don't know opensips memory management so deep.
And I'm usually trying to use as many resources as actually required for the
task.
I just didn't want "overselling", like I have 80 opensips processes with 32
Mb each. That's ok if they all decide to use all the memory. But if I allow
128Mb for each one and they suddenly decide to allocate it :) I understand
that this is practically will never happen.

For now I'll just increase PKG memory.
Everybody thanks for help and explanation.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Not enough memory to sync cluster data

2018-12-05 Thread vasilevalex
Hi all,

Thank you @Liviu, this is exactly what I mean. Either use SHM or may be
split all data into smaller parts to fit PKG memory. This is just thoughts.
Because if people start using real data in cluster they will reach PKG limit
very fast.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] Not enough memory to sync cluster data

2018-12-02 Thread vasilevalex
Hi all,

I have simple cluster with full-sharing usrloc. Everything is in memory, no
DB for usrloc.
When starting backup server it syncing usrloc data. So I got errors:

Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: ERROR:core:fm_malloc: not
enough free pkg memory (30400 bytes left, need 35904), please increase the
"-M" command line parameter!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
unable to alloc a big enough fragment!
Dec  1 20:15:12 test02 /usr/sbin/opensips[30896]: INFO:core:fm_malloc:
attempting defragmentation...

Start parameters:
/usr/sbin/opensips -m 512 -M 32

And this errors starts with only little bit more than 500 phones.
When cluster in sync, on Backup server I has real_used_size about 11 Mb.

Of course I can increase package memory for example to 64 Mb. But what if I
want not 1000 phones, but 1 ? May be syncing must use shared memory?
Unfortunately I don't know this process so deep.
Thanks.




--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] uac_registrant clustering

2018-11-15 Thread vasilevalex
Hi Bogdan,

I hope, I didn't confuse you as original question was by another Alexey.

And I also think that sharing outbound registrations between two active
servers is something that has not much practical appliance.
But when we have Active/Passive cluster with virtual IP (both servers
running), it's better to have some way to disable outbound registrations on
backup server and to enable them when switching Backup->Active.
Perfect if it will be the same way, as Razvan wrote here:
https://github.com/OpenSIPS/opensips/issues/1532



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] uac_registrant clustering

2018-11-15 Thread vasilevalex
Hi, all.
In cluster environment it makes sense to have some way to enable/disable
outbound registrations. To keep backup server silent.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Remove usrloc record after terminating a tcp connection.

2018-11-09 Thread vasilevalex
Hi Vitalii,
You need just enable contact pinging and delete dead by nathelper module.
Here is answer to the same my question:
http://opensips-open-sip-server.1449251.n2.nabble.com/how-to-delete-contacts-on-dead-TCP-or-TLS-sessions-td7611306.html



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Clusterer and Full Sharing USRLOC sync state/persistence

2018-10-17 Thread vasilevalex
Hi Jock.

I also use full-sharing cluster with just two nodes. Everything in memory,
no DB.

Do you have "seed" node? Because without it, as far as I tested, it is
impossible to get out from "not synced state". All nodes unsynced so no one
can be taken as trusted point.

I made seed flag for one server. So the second server starts and trusts seed
node. If I restart seeding node, it starts clean (and this state is
considered trusted and synced for itself) then I have to run "opensipsctl
fifo ul_cluster_sync" on it to add all the data from cluster to it's clean
state. So it became synced and containing all data.

May be this is not the best way, but I don't know, how also can be solved
this state.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Active/Passive with VIP and dynamic routing

2018-10-10 Thread vasilevalex
Added both features.

probing_socket parameter:

https://github.com/OpenSIPS/opensips/pull/1485

MI function:

https://github.com/OpenSIPS/opensips/pull/1493



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Active/Passive with VIP and dynamic routing

2018-09-25 Thread vasilevalex
Sorry, I forget to notice, OpenSIPS v 2.4.2.

It has no such parameters for drouting, but it has 
modparam("drouting", "status_replication_cluster", CLUSTER_ID)

I use it, but still has
voiptest1 /usr/sbin/opensips[23151]: ERROR:core:proto_udp_send:
sendto(sock,0x7f5953d3b980,335,0,0x7f5953d3a0e8,16): Invalid argument(22)
[192.x.x.68:5060]
voiptest1 /usr/sbin/opensips[23151]: CRITICAL:core:proto_udp_send: invalid
sendtoparameters#012one possible reason is the server is bound to localhost
and#012attempts to send to the net
voiptest1 /usr/sbin/opensips[23151]: ERROR:tm:msg_send: send() to
192.x.x.68:5060 for proto udp/1 failed

because of no VIP socket on passive server.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] Active/Passive with VIP and dynamic routing

2018-09-25 Thread vasilevalex
Hello.

We have simple setup with clusterer, 2 servers sharing VIP with keepalived.
Both are active (I want to keep endpoints locations with full sharing
topology). There is mid_registrar on OpenSIPS and some Asterisks behind.

Phones use TLS, TCP and UDP. Asterisks use UDP. Routing to asterisks  is
performed by drouting module.

I need an advice. 
When OpenSIPS server has no VIP (Passive), so I can disable nathelper ping
to phones (and deleting dead records) by "opensipsctl fifo nh_enable_ping
0", but drouting still wants to check gateways and of course uses first
available udp interface for this (this is VIP). So there are a lot of errors
in logs.

What is the best way to deal with it?
I can put first physical interface and then VIP, but then I have to analyze
incoming protocol everywhere, and force_send_socket for each request.

Is there any other solution?

I think it would be nice to have parameter in drouting module to configure
IP-address or socket used for pinging. If it is NULL - use default behavior.
Or just to have the same MI command to disable checking gateways.

Thanks.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] routing calls to several asterisks

2018-08-30 Thread vasilevalex
In the same situation I used dialplan and dynamic routing modules like this:

# Get ID of destination Asterisk server according to CustomerID
dp_translate("1", "$var(cust_id)/$var(dst_srv)");
if ($var(dst_srv)==NULL) {
  exit;
}
# Set route for SIP according ID of Asterisk server from Dynamic routing
gateways table
route_to_gw("$var(dst_srv)");
route(relay);

Both modules load information from DB only during start time or via MI
command. So all these requests are made from memory. I think this is more
effective.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] Does topology hiding match RFC3261?

2018-08-22 Thread vasilevalex
I created issue and sent possible patch

https://github.com/OpenSIPS/opensips/issues/1447




--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] Does topology hiding match RFC3261?

2018-08-21 Thread vasilevalex
Hello.

OpenSIPS 2.4.2

I use topology hiding module without dialog module. So it changes Contact
URI, adding thinfo param (default).
But it is added like this:
Contact:


I checked it with RFC3261
https://tools.ietf.org/html/rfc3261#section-25.1

Contact=  ("Contact" / "m" ) HCOLON
  ( STAR / (contact-param *(COMMA contact-param)))
contact-param  =  (name-addr / addr-spec) *(SEMI contact-params)
name-addr  =  [ display-name ] LAQUOT addr-spec RAQUOT
addr-spec  =  SIP-URI / SIPS-URI / absoluteURI
display-name   =  *(token LWS)/ quoted-string
SIP-URI  =  "sip:" [ userinfo ] hostport
uri-parameters [ headers ]
SIPS-URI =  "sips:" [ userinfo ] hostport
uri-parameters [ headers ]
uri-parameters=  *( ";" uri-parameter)
uri-parameter =  transport-param / user-param / method-param
 / ttl-param / maddr-param / lr-param / other-param
other-param   =  pname [ "=" pvalue ]
pname =  1*paramchar
pvalue=  1*paramchar
paramchar =  param-unreserved / unreserved / escaped
param-unreserved  =  "[" / "]" / "/" / ":" / "&" / "+" / "$"
unreserved  =  alphanum / mark
  mark=  "-" / "_" / "." / "!" / "~" / "*" / "'"
 / "(" / ")"
  escaped =  "%" HEXDIG HEXDIG
contact-params =  c-p-q / c-p-expires
  / contact-extension
c-p-q  =  "q" EQUAL qvalue
c-p-expires=  "expires" EQUAL delta-seconds
contact-extension  =  generic-param
generic-param  =  token [ EQUAL gen-value ]
gen-value  =  token / host / quoted-string
quoted-string  =  SWS DQUOTE *(qdtext / quoted-pair ) DQUOTE
qdtext =  LWS / %x21 / %x23-5B / %x5D-7E
/ UTF8-NONASCII

So between LAQUOT and RAQUOT there is addr-spec. And according 
to RFC it can't contain  quoted-string, or even DQUOTE symbol.
And can't contain EQUAL sign. Or they must be escaped.
But if it is possible to move "thinfo" from Contact URI to Contact params,
it can be quoted string, like it is now.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] CANCEL Reason is not propagated

2018-08-16 Thread vasilevalex
I can't say if all the phones support it, but this is RFC 3326. So you can
just check in your model docs.
Most softphones also support it.
And yes, it is very useful.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] CANCEL Reason is not propagated

2018-08-16 Thread vasilevalex
Hello Răzvan,

Thank you very much for so fast response and fix!

I built branch 2.4 from git and now it works fine, as it should.

CANCEL Reason is propagated to client.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] CANCEL Reason is not propagated

2018-08-16 Thread vasilevalex
Hello.

OpenSIPS 2.4.2, OpenSIPS 2.4.1

If OpenSIPS receives CANCEL it is better to send original Reason to the
endpoint. For example somebody answered queue call and all the others will
get "Call completed elsewhere" and will have no missed call on the phone.

And there is even an article about this.
https://blog.opensips.org/2016/11/15/cancel-request-and-reason-header/

So in my config there is: 
# CANCEL processing
  if (is_method("CANCEL")) {
if (t_check_trans()) {
  rtpengine_delete();
  # flag 0x08 preserve the received Reason header
  t_relay("0x08");
}
exit;
 }

But finally on phone I've got "Originator cancel":

2018/08/16 06:19:17.949614 :5060 -> :5060
CANCEL sip:202@:5060 SIP/2.0
Via: SIP/2.0/UDP :5060;branch=z9hG4bK1d026f40
Max-Forwards: 70
From: "test-queue" >;tag=as5af2f2e9
To: :5060>
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@
CSeq: 102 CANCEL
User-Agent: asterisk
Reason: SIP;cause=200;text="Call completed elsewhere"
Content-Length: 0

2018/08/16 06:19:17.951722 :5060 -> :5060
SIP/2.0 200 canceling
Via: SIP/2.0/UDP :5060;received=;rport=5060;branch=z9hG4bK1d026f40
From: "test-queue" >;tag=as5af2f2e9
To: :5060>;tag=acf96d526e7e753a171e4824376d2012-8491
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@
CSeq: 102 CANCEL
Server: SIP Proxy
Content-Length: 0

2018/08/16 06:19:17.951884 :5060 -> 192.168.11.59:50153
CANCEL sip:202@192.168.11.59:5073;transport=tcp SIP/2.0
Via: SIP/2.0/TCP :5060;branch=z9hG4bKbe6e.f5a7989.0
From: "test-queue" ;tag=as5af2f2e9
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@
To: 
CSeq: 102 CANCEL
Max-Forwards: 70
Reason: SIP;cause=487;text="ORIGINATOR_CANCEL"
User-Agent: SIP Proxy
Content-Length: 0

192.168.11.59 - phone IP.

I tried t_relay("8"); - the same results. And of course, t_relay() without
parameters also uses default "Originator cancel"

But if OpenSIPS makes fork call for several devices with one account and
somebody answers, Cancel Reason is generated correctly - "Call completed
elsewhere".

So the problem only when I want to propagate Reason header.




--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid_registrar and Asterisk: OPTIONS

2018-06-25 Thread vasilevalex
Hi Alexey.

We are using the same configuration. This part of route script:

 # Routing messages initiated from Asterisk PBX servers
if (is_method("INVITE|OPTIONS|NOTIFY") && check_source_address("1"))
{
 if (mid_registrar_lookup("location")) {
route(rtpengine);
} else if (mid_registrar_lookup("location_inet6")) {
route(rtpengine6);
} else {
t_reply("404", "Not Found");
}
exit;
}

So as Asterisk servers don't know about proxy, we need to check permissions
(auth them by IP). Then I check if phone using IPv4 or IPv6 to call
RTPEngine with correct parameters. If you have just IPv4 and no media
proxying, so code will be just like this:

if (is_method("INVITE|OPTIONS|NOTIFY") && check_source_address("1")) {
if (mid_registrar_lookup("location")) {
route(relay);
} else {
t_reply("404", "Not Found");
}
exit;
}

Asterisk servers see all endpoints from one IP address - OpenSIPS IP, but
with real status.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] how to delete contacts on dead TCP or TLS sessions?

2018-06-25 Thread vasilevalex
Hi Liviu,

It was my misunderstanding. For some reason I decided, that contact pinging
is only for UDP. And thought only about TCP sessions and timeouts. And I
enabled all these nat flags only on UDP processing... :)

Thanks for help!



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] how to delete contacts on dead TCP or TLS sessions?

2018-06-25 Thread vasilevalex
Hello.

Can anybody help, what to do with TCP and TLS contacts after restart
OpenSIPS or switching from Active to Backup server?

I'm using mid_registrar with AoR throttling mode. When Active server fails
and Backup server starts, all TCP and TLS endpoints of course detect dead
TCP connection and create new connection to Virtual IP (which is processed
by Backup server). And everything work. But after switching each AoR has 2
contacts, first - is old and dead, second is working (so it doubles userloc
table). If there are several switching Active/Backup, so each AoR will have
number of contacts equal to number of switchings.

And in OpenSIPS logs I have a lot of messages because of dead TLS sessions:

/usr/sbin/opensips[28570]: ERROR:core:tcp_connect_blocking_timeout: timeout
99600 ms elapsed from 10 s
/usr/sbin/opensips[28570]: ERROR:proto_tls:tls_sync_connect:
tcp_blocking_connect failed
/usr/sbin/opensips[28570]: ERROR:proto_tls:proto_tls_send: connect failed
/usr/sbin/opensips[28570]: ERROR:tm:msg_send: send() to :4197 for proto
tls/3 failed
/usr/sbin/opensips[28570]: ERROR:tm:t_forward_nonack: sending request failed

And OpenSIPS deletes these dead contacts only after expiring interval, which
can be very long.
NAT is processed with

modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

So all TCP sessions have lifetime equal to register expiration.
How to delete contacts when TCP or TLS sessions dead?
Thanks.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-25 Thread vasilevalex
Hi Liviu!

After 2 days testing everything seems to work fine. Thanks a lot!



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-21 Thread vasilevalex
Hi Liviu.

I installed opensips with these commits on both servers. Now when we make
several switch-overs in short time phones don't loose their registration.
But I have new error in logs:
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!
ERROR:mid_registrar:calc_max_ct_diff: 'expires' key not found!

As I understand function calc_max_ct_diff is searching the same K/V store,
but it is empty.
So it returns error (-1) and process_contacts_by_aor returns 2, so  OpenSIPS
does not forward this REGISTER request but absorbs it.
And I've got situation for several devices when phones think that they are
registered, OpenSIPS think that phones are registered, but REGISTRAR
doesn't.

May be if we have empty K/V it's better to forward request to registrar? I'm
not shure... What do you think?
Thanks.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid registrar

2018-06-20 Thread vasilevalex
Hi Liviu!

Thank you very much. I'll test them and will answer here.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


Re: [OpenSIPS-Users] mid_registrar remove all bindings

2018-06-18 Thread vasilevalex
Hello.

Yes, it is possible.

https://tools.ietf.org/html/rfc3261#section-10.2.2



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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


[OpenSIPS-Users] mid_registrar remove all bindings

2018-06-18 Thread vasilevalex
Hello.

We have simple schema Phone -> OpenSIPS with mid_registrar -> Asterisk. And
there is strange process for REGISTER message from Phone with "*" in Contact
(remove all bindings).

After standard sequence with Authorization and receiving Ok from Asterisk,
mid_registar generates additional REGISTER message with sequence number of
first (Unauthorized register) message. Asterisk of course answers with
error. This message contains Contact:
;expires=0. But is it needed, if we already
removed all bindings, and got the answer, that they are removed?


 


Phone 10.10.10.138 (external ip)
OpenSIPS 10.20.20.248
Asterisk 10.30.30.49

SIP Trace:

2018/06/18 12:48:50.165993 10.10.10.138:46583 -> 10.20.20.248:5060
REGISTER sip:siptest.test.com SIP/2.0
Via: SIP/2.0/UDP 172.16.1.141:46583;branch=z9hG4bK-iqcvselns7gw;rport
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" 
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2923 REGISTER
Max-Forwards: 70
User-Agent: snom725/8.7.5.35
Contact: *
Allow-Events: dialog
X-Real-IP: 172.16.1.141
Supported: path, gruu
Expires: 0
Content-Length: 0



2018/06/18 12:48:50.166602 10.20.20.248:5060 -> 10.30.30.49:5060
REGISTER sip:10.30.30.49 SIP/2.0
Via: SIP/2.0/UDP 10.20.20.248:5060;branch=z9hG4bK0cb5.808b8e8.0
Via: SIP/2.0/UDP
172.16.1.141:46583;received=10.10.10.138;branch=z9hG4bK-iqcvselns7gw;rport=46583
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" 
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2923 REGISTER
Max-Forwards: 69
User-Agent: snom725/8.7.5.35
Contact: *
Allow-Events: dialog
X-Real-IP: 172.16.1.141
Supported: path, gruu
Expires: 0
Content-Length: 0



2018/06/18 12:48:50.167363 10.30.30.49:5060 -> 10.20.20.248:5060
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
10.20.20.248:5060;branch=z9hG4bK0cb5.808b8e8.0;received=10.20.20.248;rport=5060
Via: SIP/2.0/UDP
172.16.1.141:46583;received=10.10.10.138;branch=z9hG4bK-iqcvselns7gw;rport=46583
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" ;tag=as21b74178
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2923 REGISTER
Server: asterisk
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="56721c8c"
Content-Length: 0



2018/06/18 12:48:50.167614 10.20.20.248:5060 -> 10.10.10.138:46583
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
172.16.1.141:46583;received=10.10.10.138;branch=z9hG4bK-iqcvselns7gw;rport=46583
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" ;tag=as21b74178
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2923 REGISTER
Server: asterisk
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="56721c8c"
Content-Length: 0



2018/06/18 12:48:50.195562 10.10.10.138:46583 -> 10.20.20.248:5060
REGISTER sip:siptest.test.com SIP/2.0
Via: SIP/2.0/UDP 172.16.1.141:46583;branch=z9hG4bK-urxrbzyhmha1;rport
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" 
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2924 REGISTER
Max-Forwards: 70
User-Agent: snom725/8.7.5.35
Contact: *
Allow-Events: dialog
X-Real-IP: 172.16.1.141
Supported: path, gruu
Authorization: Digest
username="2552",realm="asterisk",nonce="56721c8c",uri="sip:siptest.test.com",response="093865994e1d93a398dfca21ae06f9cb",algorithm=MD5
Expires: 0
Content-Length: 0



2018/06/18 12:48:50.196083 10.20.20.248:5060 -> 10.30.30.49:5060
REGISTER sip:10.30.30.49 SIP/2.0
Via: SIP/2.0/UDP 10.20.20.248:5060;branch=z9hG4bKdbb5.def5a6b1.0
Via: SIP/2.0/UDP
172.16.1.141:46583;received=10.10.10.138;branch=z9hG4bK-urxrbzyhmha1;rport=46583
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" 
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2924 REGISTER
Max-Forwards: 69
User-Agent: snom725/8.7.5.35
Contact: *
Allow-Events: dialog
X-Real-IP: 172.16.1.141
Supported: path, gruu
Authorization: Digest
username="2552",realm="asterisk",nonce="56721c8c",uri="sip:siptest.test.com",response="093865994e1d93a398dfca21ae06f9cb",algorithm=MD5
Expires: 0
Content-Length: 0



2018/06/18 12:48:50.197335 10.30.30.49:5060 -> 10.20.20.248:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP
10.20.20.248:5060;branch=z9hG4bKdbb5.def5a6b1.0;received=10.20.20.248;rport=5060
Via: SIP/2.0/UDP
172.16.1.141:46583;received=10.10.10.138;branch=z9hG4bK-urxrbzyhmha1;rport=46583
From: "Aleksei Vasilev" ;tag=y72nni51cm
To: "Aleksei Vasilev" ;tag=as21b74178
Call-ID: 313532383539333131363438303132-6ep4fjxmjp16
CSeq: 2924 REGISTER
Server: asterisk
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 0
Date: Mon, 18 Jun 2018 12:48:50 GMT
Content-Length: 0


This one is strange:

2018/06/18 12:48:50.19

Re: [OpenSIPS-Users] mid registrar

2018-06-12 Thread vasilevalex
I have issue with very simple setup.

Two OpenSIPS servers (first is Active, second starts with keepalived only on
Active server failure, so not a cluster at all) connected to MariaDB with
same configs. Asterisk farm is registrar.

# USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset",
"single-instance-sql-write-through")
modparam("usrloc", "db_url", "DB_URL")

 Mid Registrar module
loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 2) /* 0 = mirror / 1 = ct / 2 = AoR */
modparam("mid_registrar", "outgoing_expires", 1800)
modparam("mid_registrar", "received_avp", "$avp(received_uri)")
modparam("mid_registrar", "tcp_persistent_flag",
"TCP_PERSIST_REGISTRATIONS")

This setup works somehow. Failover server starts with all locations
consistent and continues working. But when there are several switching
between Active/Failover in relatively short time, like 5-10 minutes then
most of the phones can't update their registrations because of the errors:

ERROR:mid_registrar:process_contacts_by_aor: 'last_reg_ts' key not found!

Only cleaning user location helps, like "opensipsctl ul rm " After that
phone can register again.



--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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