[SR-Users] Cannot load usrloc table at startup using DMQ_USRLOC sync feature

2022-07-21 Thread Benedito Marques
I have an scenario with two kamailios, and no databases. At the first, I
authenticate one subscriber successfully and save in memory usrloc:


/etc/kamailio # kamailio --version
version: kamailio 5.4.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 16:13:18 Feb 15 2021 with gcc 9.3.0
/etc/kamailio #
/etc/kamailio #

---

/etc/kamailio # cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.12.3
PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/";
BUG_REPORT_URL="https://bugs.alpinelinux.org/";

---

 # Handle SIP registrations
route[REGISTRAR] {
if (!is_method("REGISTER")) return;

if (!save("location","0x05")) {
sl_reply_error();
}
exit;
}


--


/etc/kamailio # kamcmd ul.dump
{
Domains: {
Domain: {
Domain: location
Size: 1024
AoRs: {
Info: {
AoR: 1014@my.domain
HashID: -1989102610
Contacts: {
Contact: {
Address:
sip:1014@10.0.0.2:7071;ob
Expires: 299
Q: -1.00
Call-ID:
d5cf6d5f293647a59ba64ba996a793b0
CSeq: 43689
User-Agent:
MicroSIP/3.20.7
Received: sip:
10.0.0.2:7071
Path: [not set]
State: CS_NEW
Flags: 1
CFlags: 0
Socket: [not set]
Methods: 8159
Ruid:
uloc-62d95ca2-3c-1
Instance: [not set]
Reg-Id: 0
Server-Id: 0
Tcpconn-Id: -1
Keepalive: 0
Last-Keepalive:
1658412252
KA-Roundtrip: 0
Last-Modified:
1658412252
}
}
}
}
Stats: {
Records: 1
Max-Slots: 1
}
}
}
}
/etc/kamailio #



*The problem is*: when I start the second kamailio server, the current
usrloc users are not replicated to it, so in the second server the usrloc
is empty:



/etc/kamailio # kamcmd ul.dump
{
Domains: {
Domain: {
Domain: location
Size: 1024
AoRs: {
}
Stats: {
Records: 0
Max-Slots: 0
}
}
}
}



*The modules loaded:*

 - dmq.so
 - dmq_usrloc.so

*Params (sync enabled):*

modparam("dmq_usrloc", "enable", 1)
modparam("dmq_usrloc", "sync", 1)
modparam("dmq_usrloc", "usrloc_domain", "location")
modparam("dmq_usrloc", "usrloc_delete", 1)
modparam("dmq_usrloc", "replicate_socket_info", 0)


*Obs*: The DMQ replication is working perfectly. So, if I register another
user in server 1, server 2 receives the KDMQ message and the new user
appears on usrloc. The real problem is to load pre registered users at
startup.

*Log messages from second server at startup:*


0(51) DEBUG:  [core/sr_module.c:873]: init_mod(): dmq_usrloc
 0(51) INFO: dmq_usrloc [dmq_usrloc.c:81]: mod_init(): dmq usrloc
replication mode = 1
 0(51) DEBUG:  [core/sr_module.c:652]: find_mod_export_record():
found export of  in module usrloc
[/usr/lib/kamaili

Re: [SR-Users] incomplete values and Wrong Counting for $hfl and $hflc

2022-07-21 Thread Patrick Karton
Hello Daniel,

Thanks for feedbacks.


im using $hfl($var(hname)) with $var(hname) being "Record-Route"? and it 
produces wrong results like explained.

and indeed with static name like  $hflc(Record-Route) and $hfl(Record-Route) 
the results are correct. i did not test first with static name because i tought 
the results were the same.

i already opened an issue on github 
https://github.com/kamailio/kamailio/issues/3194
[https://opengraph.githubassets.com/df419938d8c8caea7d003e117bb64b318aef7b31a1d8e09e0c970649db55c3d7/kamailio/kamailio/issues/3194]
incomplete values and Wrong Counting for $hfl and $hflc · Issue #3194 · 
kamailio/kamailio
Description the counting and values provides by $hfl and $hflc are wrong and 
imcomplete Troubleshooting Reproduction Debugging Data route { $var(hname) = 
"Record-Route"; if (is_present_hf...
github.com



De : Daniel-Constantin Mierla 
Envoyé : jeudi 21 juillet 2022 15:43
À : Kamailio (SER) - Users Mailing List ; Patrick 
Karton 
Objet : Re: [SR-Users] incomplete values and Wrong Counting for $hfl and $hflc


Are you using it exactly like $hfl(Record-Route) or is it like 
$hfl($var(hname)) with $var(hname) being "Record-Route"?


The first variant is the one covered by $hfl()/$hflc(), parsing of the name 
being optimized at startup. On the second variant, the name is dynamic at 
runtime, based on the $var() value and simply compares the generic header names 
in the list, without any specific optimization for "Record-Route" case.


I noticed an issue opened on bug tracker and there was the second variant, 
while in this message seems to be the first variant. If the first variant 
fails, then it is a bug there. If it is the second that doesn't provide, it's 
because the feature is not there yet.


Cheers,
Daniel


On 21.07.22 15:00, Patrick Karton wrote:
the counting and values provided by $hfl and $hflc are wrong and incomplete 
from my understanding. looking at the source code these pseudo vars count the 
body values of Via, Record-Route and Route headers.

in kamalio 5.6.1

with
Record-Route: 
Record-Route: 
,

i get $hflc(Record-Route) == 2 instead of 3

and $(hfl(Record-Route)[0]) == 1.1.1.1
   $(hfl(Record-Route)[1]) == 2.2.2.2

 $(hfl(Record-Route)[3]) does not exists.









__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- 
www.linkedin.com/in/miconda
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] incomplete values and Wrong Counting for $hfl and $hflc

2022-07-21 Thread Daniel-Constantin Mierla
Are you using it exactly like $hfl(Record-Route) or is it like
$hfl($var(hname)) with $var(hname) being "Record-Route"?


The first variant is the one covered by $hfl()/$hflc(), parsing of the
name being optimized at startup. On the second variant, the name is
dynamic at runtime, based on the $var() value and simply compares the
generic header names in the list, without any specific optimization for
"Record-Route" case.


I noticed an issue opened on bug tracker and there was the second
variant, while in this message seems to be the first variant. If the
first variant fails, then it is a bug there. If it is the second that
doesn't provide, it's because the feature is not there yet.


Cheers,
Daniel


On 21.07.22 15:00, Patrick Karton wrote:
> the counting and values provided by $hfl and $hflc are wrong and
> incomplete from my understanding. looking at the source code these
> pseudo vars count the body values of Via, Record-Route and Route headers.
>
> in kamalio 5.6.1
>
> with 
> Record-Route: 
> Record-Route:
> ,
>
> i get $hflc(Record-Route) == 2 instead of 3 
>
> and $(hfl(Record-Route)[0]) == 1.1.1.1
>        $(hfl(Record-Route)[1]) == 2.2.2.2
>
>  $(hfl(Record-Route)[3]) does not exists.
>
>
>
>
>
>
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] incomplete values and Wrong Counting for $hfl and $hflc

2022-07-21 Thread Patrick Karton
the counting and values provided by $hfl and $hflc are wrong and incomplete 
from my understanding. looking at the source code these pseudo vars count the 
body values of Via, Record-Route and Route headers.

in kamalio 5.6.1

with
Record-Route: 
Record-Route: 
,

i get $hflc(Record-Route) == 2 instead of 3

and $(hfl(Record-Route)[0]) == 1.1.1.1
   $(hfl(Record-Route)[1]) == 2.2.2.2

 $(hfl(Record-Route)[3]) does not exists.






__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Using Kamailio with Teams

2022-07-21 Thread Pepelux
Hi

Check with sipdump if you are always sending to the same IP address for all
the dialog. sip..microsoft.com can change the resolution IP and it
could happen that you send to another IP address in the middle of the
dialog. It happend to me that ACK was sent to a different IP address that
send me the 200 Ok.

Regards

On Thu, 21 Jul 2022 at 08:17, Javier González Muñoz 
wrote:

> Hi, I’m using kamailio with Teams like SBC and asterisk.
>
>
>
> Works perfectly less one thing. When I make a call asterisk to Teams, in
> my Teams app I see 3 popup notifications, and 3 calls in my history. If I
> call Teams to Asterisk, perfect..
>
>
>
> When I make an asterisk to Teams call, I get the trace from Asterisk and I
> can see three 180, I don’t know if this is the problem, but are there any
> way to fix it? Limit to 1 notification?
>
>
>
> Thanks
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users