Re: [sr-dev] [kamailio/kamailio] MemoryUtilization getting increase with lua routing (#1577)

2018-06-29 Thread Surendra Tiwari
@miconda rightnow our memory utilization are 97%.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1577#issuecomment-401450253___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] MemoryUtilization getting increase with lua routing (#1577)

2018-06-29 Thread Surendra Tiwari


### Description



We are using lua base routing with app_lua. We are seeing that our 
memory-utilization on that system continuously getting increase. our route.lua 
will have all routing logic same as 

https://github.com/kamailio/kamailio/blob/master/misc/examples/kemi/kamailio-basic-kemi-lua.lua

we are using following set of modules
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "maxfwd.so"
loadmodule "nathelper.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "path.so"
loadmodule "jsonrpcs.so"
loadmodule "app_lua.so"
loadmodule "dispatcher.so"
loadmodule "json.so"
loadmodule "cfg_rpc.so"
loadmodule "ctl.so"
loadmodule "ipops.so"
loadmodule "http_async_client.so"
loadmodule "dialog.so"

# - setting module-specific parameters ---

# - rr params -
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 0)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 1)

# - dispatcher params -
modparam("dispatcher", "list_file", DISPATCHER_FILE)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "ds_ping_interval", 10)
modparam("dispatcher", "ds_ping_from", "sip:p...@test.com")

# - nathelper params 
modparam("nathelper", "received_avp", "$avp(s:rcv)")

# - http_async_client ---
#  number of worker process for async req and res
modparam("http_async_client", "workers", 4)

# - ctl --
modparam("ctl", "binrpc", "tcp:MY_IP_ADDR:2086")

# - app_lua params 
modparam("app_lua", "reload", 1)
modparam("app_lua", "load", ROUTE_LUA)

#  dialog params 
modparam("dialog", "enable_stats", 1)
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "event_callback", "ksr_dialog_event")

cfgengine "lua"

### Troubleshooting

 Reproduction

We can easily reproduce by loading app_lua with kamailio-basic-kemi-lua.lua

https://github.com/kamailio/kamailio/blob/master/misc/examples/kemi/kamailio-basic-kemi-lua.lua


 Debugging Data

root@ip-172-31-4-160:~# kamcmd -s tcp:172.31.4.160:2046 tm.stats
{
current: 2220
waiting: 2198
total: 6113169
total_local: 1371
rpl_received: 11958486
rpl_generated: 6111711
rpl_sent: 12224635
6xx: 0
5xx: 6104789
4xx: 6831
3xx: 0
2xx: 1483
created: 6113169
freed: 6110949
delayed_free: 0
}

transaction are getting free as they are created so no transaction memory leak. 



```
U 54.183.198.87:5060 -> 172.31.4.160:5060
INVITE sip:919980950111@13.57.122.212:5060 SIP/2.0.
Record-Route: .
Via: SIP/2.0/UDP 
54.183.198.87:5060;branch=z9hG4bK62f3.22dfb9a43503cc12dafdcdbc9ab1e17d.0.
Via: SIP/2.0/UDP 
172.31.13.202:5060;rport=5060;received=13.232.78.75;branch=z9hG4bK-20254-2186327-0.
From: ;tag=2186327.
To: .
Call-ID: 2186327-20254@172.31.13.202.
CSeq: 1 INVITE.
Contact: .
Max-Forwards: 69.
User-Agent: Sipp/Linux.
Supported: replaces, outbound.
Content-Type: application/sdp.
Content-Length:   139.
X-ZT-Cust-IP: 13.232.78.75.
X-ZT-Trunk: 21979254854757081.zt.plivo.com.
.
v=0.
o=user1 53655765 2353687637 IN IP4 13.126.252.148.
s=-.
c=IN IP4 13.126.252.148.
t=0 0.
m=audio 6000 RTP/AVP 0.
a=rtpmap:0 PCMU/8000.

#
U 172.31.4.160:5060 -> 54.183.198.87:5060
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 
54.183.198.87:5060;branch=z9hG4bK62f3.22dfb9a43503cc12dafdcdbc9ab1e17d.0;rport=5060.
Via: SIP/2.0/UDP 
172.31.13.202:5060;rport=5060;received=13.232.78.75;branch=z9hG4bK-20254-2186327-0.
From: ;tag=2186327.
To: .
Call-ID: 2186327-20254@172.31.13.202.
CSeq: 1 INVITE.
Server: kamailio (5.1.3 (x86_64/linux)).
Content-Length: 0.
.

#
U 172.31.4.160:5060 -> 54.183.198.87:5060
SIP/2.0 408 Request Timeout.
Via: SIP/2.0/UDP 
54.183.198.87:5060;branch=z9hG4bK223b.cd9c3cb1d2dc6adc346e6fb7acdee708.0;rport=5060.
Via: SIP/2.0/UDP 
172.31.13.202:5060;rport=5060;received=13.232.78.75;branch=z9hG4bK-20254-2185727-0.
From: ;tag=2185727.
To: 
;tag=c99e9820d9036d36e5541ff825b95248-8c22.
Call-ID: 2185727-20254@172.31.13.202.
CSeq: 1 INVITE.
Server: kamailio (5.1.3 (x86_64/linux)).
Content-Length: 0.
.

```

 Log Messages



```
Jun 29 19:18:14 ip-172-31-4-160 kamailio[8119]: ERROR:  
[core/mem/q_malloc.c:287]: qm_find_free(): qm_find_free(0x7fe974b24000, 35992); 
Free fragment not found!
Jun 29 19:18:14 ip-172-31-4-160 kamailio[8119]: ERROR:  
[core/mem/q_malloc.c:421]: qm_malloc(): qm_malloc(0x7fe974b24000, 35992) called 
from http_async_client: http_multi.c: curl_shm_calloc(346), module: 
http_async_client; Free fragment not found!
Jun 29 19:18:14 ip-172-31-4-160 kamailio[8119]: ERROR: http_async_client 
[http_multi.c:437]: new_request(): curl_easy_init() failed!
```

 SIP Traffic



```
(paste your sip traffic here)
```

### Possible Solutions

Re: [sr-dev] [kamailio/kamailio] continuously memory getting increases with app_lua (#1575)

2018-06-29 Thread Surendra Tiwari
Closed #1575.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1575#event-1708865710___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] continuously memory getting increases with app_lua (#1575)

2018-06-29 Thread Surendra Tiwari
hey sorry did it in bit hurry. adding other information


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1575#issuecomment-401367975___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] continuously memory getting increases with app_lua (#1575)

2018-06-29 Thread Daniel-Constantin Mierla
Making a report without relevant information is useless. Can you actually add 
proper details about the issue you are facing? What are those modules you are 
using? What kind of sip traffic you process? Is it system memory or kamailio 
pkg/shm memory?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1575#issuecomment-401365838___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] continuously memory getting increases with app_lua (#1575)

2018-06-29 Thread Surendra Tiwari


### Description




### Troubleshooting

 Reproduction


load app_lua with kamailio route file. route file should load other lua module 
or custom modules

 Debugging Data



```
(paste your debugging data here)
```

 Log Messages



```
(paste your log messages here)
```

 SIP Traffic



```
(paste your sip traffic here)
```

### Possible Solutions



### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.1.3 (x86_64/linux) 
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 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_LISTEN 16, 
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 11:06:51 May 10 2018 with gcc 4.8.4
```

* **Operating System**:



```
Linux ip-172-31-4-160 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 
UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1575___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:3e280360: sdpops: exported sdp_print() to kemi framework

2018-06-29 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 3e2803602873f3151b568a3f1a0a998aa16634f2
URL: 
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998aa16634f2

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2018-06-29T09:56:41+02:00

sdpops: exported sdp_print() to kemi framework

---

Modified: src/modules/sdpops/sdpops_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998aa16634f2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998aa16634f2.patch

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 3987f9ac0b..8b28a35ddb 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -1554,29 +1554,35 @@ static int w_sdp_with_codecs_by_name(sip_msg_t* msg, 
char* codecs, char *bar)
 /**
  *
  */
-static int w_sdp_print(sip_msg_t* msg, char* level, char *bar)
+static int ki_sdp_print(sip_msg_t* msg, int llevel)
 {
sdp_info_t *sdp = NULL;
-   int llevel = L_DBG;
 
if(parse_sdp(msg) < 0) {
LM_ERR("Unable to parse sdp\n");
return -1;
}
 
-   if(fixup_get_ivalue(msg, (gparam_p)level, )!=0)
-   {
+   print_sdp(sdp, llevel);
+   return 1;
+}
+
+
+/**
+ *
+ */
+static int w_sdp_print(sip_msg_t* msg, char* level, char *bar)
+{
+   int llevel = L_DBG;
+
+   if(fixup_get_ivalue(msg, (gparam_p)level, )!=0) {
LM_ERR("unable to get the debug level value\n");
return -1;
}
 
-   sdp = (sdp_info_t*)msg->body;
-
-   print_sdp(sdp, llevel);
-   return 1;
+   return ki_sdp_print(msg, llevel);
 }
 
-
 /**
  *
  */
@@ -2022,6 +2028,11 @@ static sr_kemi_t sr_kemi_sdpops_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+   { str_init("sdpops"), str_init("sdp_print"),
+   SR_KEMIP_INT, ki_sdp_print,
+   { SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
 
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
 };


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


[sr-dev] git:master:af9b6a47: dispatcher: small polishing of sample config file

2018-06-29 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: af9b6a47cc6600dc6d6036edda36d2ffc2de04d0
URL: 
https://github.com/kamailio/kamailio/commit/af9b6a47cc6600dc6d6036edda36d2ffc2de04d0

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2018-06-29T09:56:41+02:00

dispatcher: small polishing of sample config file

---

Modified: src/modules/dispatcher/doc/dispatcher.cfg

---

Diff:  
https://github.com/kamailio/kamailio/commit/af9b6a47cc6600dc6d6036edda36d2ffc2de04d0.diff
Patch: 
https://github.com/kamailio/kamailio/commit/af9b6a47cc6600dc6d6036edda36d2ffc2de04d0.patch

---

diff --git a/src/modules/dispatcher/doc/dispatcher.cfg 
b/src/modules/dispatcher/doc/dispatcher.cfg
index 7c2610ccf0..881cc10d1f 100644
--- a/src/modules/dispatcher/doc/dispatcher.cfg
+++ b/src/modules/dispatcher/doc/dispatcher.cfg
@@ -70,11 +70,12 @@ sip_warning=no
 ### Modules Section 
 
 # set module path
-mpath="/usr/local/lib/kamailio/modules/"
+#mpath="/usr/local/lib/kamailio/modules/"
 
 loadmodule "db_mysql.so"
 loadmodule "jsonrpcs.so"
 loadmodule "kex.so"
+loadmodule "corex.so"
 loadmodule "tm.so"
 loadmodule "tmx.so"
 loadmodule "sl.so"
@@ -156,8 +157,9 @@ request_route {
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");
-   if (is_method("INVITE|SUBSCRIBE"))
+   if (is_method("INVITE|SUBSCRIBE")) {
record_route();
+   }
 
# account only INVITEs
if (is_method("INVITE")) {
@@ -239,6 +241,7 @@ route[WITHINDLG] {
 route[REGISTRAR] {
if(!is_method("REGISTER"))
return;
+
sl_send_reply("404", "No registrar");
exit;
 }


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