[SR-Users] log_prefix missing

2019-03-07 Thread Joonas Kamailio

Dear List,

I am having a problem where log_prefix is missing on acc_cdr log row 
when call is canceled.


Here is an example of two lines of acc_cdr log file, first one is 
completed normally and second one is canceled before 200 OK:


Mar  6 12:04:48 edge3 kamailio[27669]: NOTICE: {2 1 BYE 
23d4e04c0c79ff6950accbd1706b9...@example.com} acc [acc_cdr.c:367]: 
log_write_cdr(): start_time=1551873885.018; end_time=1551873888.379; 
duration=3.361;
Mar  6 12:03:40 edge3 kamailio[27707]: NOTICE: acc [acc_cdr.c:367]: 
log_write_cdr(): start_time=1551873809.148; end_time=1551873809.148; 
duration=0;


I tried to take a debug on this matter and noticed that log_prefix is 
lost at this point:


Mar  6 13:54:25 edge3 kamailio[10665]: DEBUG: {1 102 INVITE 
6917f51f0955bd8b3a1aa62361a47...@example.com} tm [t_lookup.c:1019]: 
t_check_msg(): msg (0x7f1a889a8a30) id=0 global id=0 T start=0x7f1a8899b450
Mar  6 13:54:25 edge3 kamailio[10665]: DEBUG: {1 102 INVITE 
6917f51f0955bd8b3a1aa62361a47...@example.com} tm [t_lookup.c:1092]: 
t_check_msg(): T (0x7f1a8899b450) already found for msg (0x7f1a889a8a30)!
Mar  6 13:54:25 edge3 kamailio[10665]: DEBUG: {1 102 INVITE 
6917f51f0955bd8b3a1aa62361a47...@example.com} dialog [dlg_var.c:97]: 
cb_dlg_locals_reset(): resetting the local dialog shortcuts on script 
callback: 2147483650
Mar  6 13:54:25 edge3 kamailio[10665]: DEBUG: tm [t_reply.c:1806]: 
relay_reply(): branch=0, save=0, relay=0 icode=0 msg status=487
Mar  6 13:54:25 edge3 kamailio[10665]: DEBUG:  
[core/msg_translator.c:2288]: generate_res_buf_from_sip_res(): old size: 
483, new size: 399


On normal call the prefix stays in intact:

Mar  6 13:57:29 edge3 kamailio[10670]: DEBUG: {2 103 BYE 
03cd8f3464d42b7b01966e6b1154e...@example.com} tm [t_lookup.c:1088]: 
t_check_msg(): msg (0x7f1a95baad10) id=2 global id=2 T end=0x7f1a8899f8f0
Mar  6 13:57:29 edge3 kamailio[10670]: DEBUG: {2 103 BYE 
03cd8f3464d42b7b01966e6b1154e...@example.com} tm [t_reply.c:2237]: 
reply_received(): org. status uas=0, uac[0]=0 local=0 is_invite=0)
Mar  6 13:57:29 edge3 kamailio[10670]: DEBUG: {2 103 BYE 
03cd8f3464d42b7b01966e6b1154e...@example.com} tm [t_reply.c:1263]: 
t_should_relay_response(): -> T_code=0, new_code=200
Mar  6 13:57:29 edge3 kamailio[10670]: DEBUG: {2 103 BYE 
03cd8f3464d42b7b01966e6b1154e...@example.com} tm [t_reply.c:1806]: 
relay_reply(): branch=0, save=0, relay=0 icode=0 msg status=200
Mar  6 13:57:29 edge3 kamailio[10670]: DEBUG: {2 103 BYE 
03cd8f3464d42b7b01966e6b1154e...@example.com}  
[core/msg_translator.c:2288]: generate_res_buf_from_sip_res(): old size: 
491, new size: 407


The problem exists at least in the following version:

version: kamailio 5.2.0 (x86_64/linux) c5216b
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
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: c5216b
compiled on 13:05:00 Jan  7 2019 with gcc 6.3.

Best Regards,
Joonas Keskitalo



___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Unable to start Kamailio with acc_json

2019-01-07 Thread Joonas Kamailio

Dear Daniel,

Thank you for your fast reply and patch. It seems to be working now.

Best Regards,
Joonas Keskitalo

Daniel-Constantin Mierla kirjoitti 7.1.2019 klo 16.44:

Hello,

can you try with the latest branch 5.2? I just pushed a commit with a
fix for it, but no testing:

   -
https://github.com/kamailio/kamailio/commit/06610073bb490355d87a774a74716195d3c01192

Somehow it was expected to be used together with mqueue module, see if
works fine now and let us know the results.

Cheers,
Daniel

On 07.01.19 15:22, Joonas Kamailio wrote:

Dear List,

I have a problem with initializing acc_json. As soon as I try to load
acc_json module, Kamailio fails to start. I get the following messages
to log with debug 4 (non-related messages omitted):

Jan  7 16:17:42 labkam2 kamailio[51089]: INFO: acc_json
[acc_json_mod.c:99]: mod_init(): janson version : 2.9
Jan  7 16:17:43 labkam2 kamailio: ERROR: 
[core/daemonize.c:303]: daemonize(): Main process exited before
writing to pipe

Running 'bt full' on coredump tells following:

(gdb) bt full
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
No locals.
#1  0x7f086d0a69fd in mod_init () at acc_json_mod.c:120
     __func__ = "mod_init"
#2  0x55f1699cc6a2 in init_mod (m=0x7f087c0983d0) at
core/sr_module.c:897
     __func__ = "init_mod"
#3  0x55f1699cca16 in init_modules () at core/sr_module.c:926
     t = 0x29ceb62d
     i = -1
     __func__ = "init_modules"
#4  0x55f16989445a in main (argc=3, argv=0x7ffc56d94378) at
main.c:2617
     cfg_stream = 0x55f16beb0010
     c = -1
     r = 0
     tmp = 0x7f087c9512e7 "__vdso_getcpu"
     tmp_len = 32764
     port = 1457078704
     proto = 32520
     options = 0x55f169c019f0
":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
     ret = -1
     seed = 2201341167
     rfd = 4
     debug_save = 0
     debug_flag = 0
     dont_fork_cnt = 0
     n_lst = 0x0
     p = 0xf0b0ff 
     st = {st_dev = 19, st_ino = 306346, st_nlink = 2, st_mode =
16832, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 80,
st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1543318847,
tv_nsec = 544329773}, st_mtim = {tv_sec = 1546870639,
     tv_nsec = 902332400}, st_ctim = {tv_sec = 1546870639,
tv_nsec = 902332400}, __glibc_reserved = {0, 0, 0}}
     __func__ = "main"

I have loaded "acc" module before loading "acc_json", are there any
other mandatory prerequisites? I am trying to use acc_json to output
accounting data to syslog. I just recompiled latest 5.2 kamailio but
problem still occurs. Kamailio version below:

root@labkam2:/opt/git/kamailio# kamailio -v
version: kamailio 5.2.0 (x86_64/linux) c5216b
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
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
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: c5216b
compiled on 16:13:00 Jan  7 2019 with gcc 6.3.0

Best Regards,
Joonas Keskitalo


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Unable to start Kamailio with acc_json

2019-01-07 Thread Joonas Kamailio

Dear List,

I have a problem with initializing acc_json. As soon as I try to load 
acc_json module, Kamailio fails to start. I get the following messages 
to log with debug 4 (non-related messages omitted):


Jan  7 16:17:42 labkam2 kamailio[51089]: INFO: acc_json 
[acc_json_mod.c:99]: mod_init(): janson version : 2.9
Jan  7 16:17:43 labkam2 kamailio: ERROR:  [core/daemonize.c:303]: 
daemonize(): Main process exited before writing to pipe


Running 'bt full' on coredump tells following:

(gdb) bt full
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
No locals.
#1  0x7f086d0a69fd in mod_init () at acc_json_mod.c:120
    __func__ = "mod_init"
#2  0x55f1699cc6a2 in init_mod (m=0x7f087c0983d0) at 
core/sr_module.c:897

    __func__ = "init_mod"
#3  0x55f1699cca16 in init_modules () at core/sr_module.c:926
    t = 0x29ceb62d
    i = -1
    __func__ = "init_modules"
#4  0x55f16989445a in main (argc=3, argv=0x7ffc56d94378) at main.c:2617
    cfg_stream = 0x55f16beb0010
    c = -1
    r = 0
    tmp = 0x7f087c9512e7 "__vdso_getcpu"
    tmp_len = 32764
    port = 1457078704
    proto = 32520
    options = 0x55f169c019f0 
":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"

    ret = -1
    seed = 2201341167
    rfd = 4
    debug_save = 0
    debug_flag = 0
    dont_fork_cnt = 0
    n_lst = 0x0
    p = 0xf0b0ff 
    st = {st_dev = 19, st_ino = 306346, st_nlink = 2, st_mode = 
16832, st_uid = 0, st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 80, 
st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1543318847, 
tv_nsec = 544329773}, st_mtim = {tv_sec = 1546870639,
    tv_nsec = 902332400}, st_ctim = {tv_sec = 1546870639, 
tv_nsec = 902332400}, __glibc_reserved = {0, 0, 0}}

    __func__ = "main"

I have loaded "acc" module before loading "acc_json", are there any 
other mandatory prerequisites? I am trying to use acc_json to output 
accounting data to syslog. I just recompiled latest 5.2 kamailio but 
problem still occurs. Kamailio version below:


root@labkam2:/opt/git/kamailio# kamailio -v
version: kamailio 5.2.0 (x86_64/linux) c5216b
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 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
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: c5216b
compiled on 16:13:00 Jan  7 2019 with gcc 6.3.0

Best Regards,
Joonas Keskitalo


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Sending INVITE from loopback subnet

2018-10-08 Thread Joonas Kamailio

Dear List,

I am trying to achieve a scenario where I can recognize the original 
peer and mask it as peer from subnet 10.0.7.0/24 with kamailio. Basic IP 
connectivity is established with the following network configuration 
(Debian9):


auto lo:1
iface lo:1 inet static
    address 10.0.0.0/24

And of course I have routed 10.0.0.0/24 to servers public IP address 
(hereby known as x.x.x.1) in my router.


Please consider the following scenario:

- Peer1 192.168.0.1 is sending INVITE to kamailio at IP x.x.x.1
- Kamailio sends INVITE to peer2 at 172.10.0.1 from socket 10.0.0.1
- Peer2 receives the INVITE and knows that since it came from IP 
10.0.0.1 it means that INVITE is originally from peer1
- IF peer2 sends INVITE to kamailio, it should be sent to peerX from 
socket 10.0.0.2


This works if I list both 10.0.0.1 and 10.0.0.2 with 'listen=' parameter 
but things get out of hand if I have multiple peers. In my tests I have 
noticed that 60 peers equals 60 listen parameters which equals roughly 
500 kamailio processes. At some point there are just too many processes 
and everything melts. If I omit the listen parameter altogether, 
kamailio has only one socket from /24 subnet and it is 10.0.0.0.


Error message when listen parameter is omitted:
[pv_core.c:2612]: pv_set_force_sock(): no socket found to match [10.0.0.1]

My kamailio has the following configuration in request_route:

$avp(e_private) = $(sht(get_private=>$si));
$fs = $avp(e_private);

I know that the case is a bit confusing and totally something normal 
people won't do. If you have any questions I am happy to answer.


Best Regards,
Joonas Keskitalo


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users