[sr-dev] [kamailio/kamailio] evapi: if there is no evapi clients are connected to kamailio, evapi trying to send data. (#1700)

2018-10-30 Thread Surendra Tiwari


### Description
right now, evapi module trying to send data even if no clients are connected 
.in the case new transaction is created and even suspended also. kamailio 
should not create the transaction if no evapi client is connected to kamailio.


### Troubleshooting

 Reproduction



 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`

```
(paste your output here)
```

* **Operating System**:



```
(paste your output here)
```


-- 
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/1700___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] rtpengine: stats for rtpengine command and reply from rtpengine (#1699)

2018-10-30 Thread Surendra Tiwari


### Description
rightnow, there is no stats about command sent to rtpengine and getting reply 
from rtpengine. There should be a stats that will tell that 
number of offer request sent:  
number of answer request sent:
number of delete request sent:
number of failed request for offer [after retry]:
number of failed request for answer [after retry]:
number of failed request for delete [after retry]:

This will help to identify actual number of failed request.


### Troubleshooting

 Reproduction



 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`

```
(paste your output here)
```

* **Operating System**:



```
(paste your output here)
```


-- 
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/1699___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] HeartBeat Module (#1698)

2018-10-30 Thread Surendra Tiwari


### Description
Right now, kamailio did not generate the heartbeat events a call. It's very 
important to have heartbeat event in kamailio so billing solution can be built 
independent of kamailio.

Heartbeat module can be built separately with having following parameters:
modparam("heartbeat","duration",30) // this will describe at what pace 
heartbeat will get generated for every call.
modparam("heartbeat","signature",caller=$dlg_var(caller);callee=$dlg_var(callee);account_id=$dlg_var(account_id))
 -- this will tell what data to send.


### Expected behavior

 Actual observed behavior

 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.4 (x86_64/linux) a1df59
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_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: a1df59 
compiled on 06:23:23 Oct 30 2018 with gcc 4.8.4
```

* **Operating System**:



```
root@ip-172-31-4-160:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 14.04.5 LTS
Release:14.04
Codename:   trusty

root@ip-172-31-4-160:~# uname -a
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/1698___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] dialog: xmlrpc command to check call is alive or not. (#1697)

2018-10-30 Thread Surendra Tiwari


### Description
rightnow, we can check using dlg.dlg_list command whether call is alive or not 
but this command will return all data about dialog. There should be a xmlrpc 
command that will just return whether call is alive or not.



### Expected behavior

 Actual observed behavior

 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`

```
(paste your output here)
```

* **Operating System**:



```
root@ip-172-31-4-160:~# uname -a
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/1697___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] rtpengine module is not retrying for rtpengine_offer. retry is working for rtpengine_answer and rtpengine_delete (#1696)

2018-10-30 Thread Surendra Tiwari


### Description
we are using rtpengine with kamailio [KSR-LUA]. kamailio sending the 
rtpengine_offer to rtpengine. If kamailio didn't get the response from the 
rtpengine then it's not retrying . for rtpengine_answer and rtpengine_delete 
retry is working pretty good.

we are using following rtpengine configuration
# - rtpengine params -
modparam("rtpengine", "db_url", DBURL)
modparam("rtpengine", "table_name" , "rtpengine")
modparam("rtpengine", "rtpengine_allow_op", 1)
modparam("rtpengine", "queried_nodes_limit", 4)
modparam("rtpengine", "rtpengine_retr", 2)
modparam("rtpengine", "rtp_inst_pvar", "$avp(RTP_INSTANCE)")
modparam("rtpengine", "setid_default", 1)
modparam("rtpengine", "rtpengine_tout_ms", 400)


### Troubleshooting

 Reproduction

This issue can be reproduced by above configuration. and need to use 
rtpengine_offer,rtpengine_answer and rtpengine_delete with ksr lua routing.


 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.4 (x86_64/linux) a1df59
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_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: a1df59 
compiled on 06:23:23 Oct 30 2018 with gcc 4.8.4
```

* **Operating System**:



```
root@ip-172-31-4-160:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 14.04.5 LTS
Release:14.04
Codename:   trusty

root@ip-172-31-4-160:~# uname -a
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/1696___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] Build failed in Jenkins: kamailio44-nightly-binaries » i386,squeeze,slave #129

2018-10-30 Thread kamailio
See 


--
[...truncated 360.76 KB...]
+ '[' 3600 -eq 0 ']'
+ touch /var/run/lock/squeeze-i386.building.6443
+ case "$architecture" in
+ linux32 sudo DIST=squeeze ARCH=i386 cowbuilder --buildresult 

 --build 

 --basepath /var/cache/pbuilder/base-squeeze-i386.cow --debbuildopts -B 
--hookdir /usr/share/jenkins-debian-glue/pbuilder-hookdir/ --bindmounts 
'/tmp/apt-jdg_2BTlL7 ' --configfile=/tmp/tmp.srmMGRT6DG
 -> Copying COW directory
  forking: rm -rf /var/cache/pbuilder/build//cow.14423 
  forking: cp -al /var/cache/pbuilder/base-squeeze-i386.cow 
/var/cache/pbuilder/build//cow.14423 
I: removed stale ilistfile /var/cache/pbuilder/build//cow.14423/.ilist
  forking: chroot /var/cache/pbuilder/build//cow.14423 cowdancer-ilistcreate 
/.ilist find . -xdev -path ./home -prune -o \( \( -type l -o -type f \) -a 
-links +1 -print0 \) | xargs -0 stat --format '%d %i ' 
 -> Invoking pbuilder
  forking: pbuilder build --debbuildopts -B --hookdir 
/usr/share/jenkins-debian-glue/pbuilder-hookdir/ --bindmounts 
/tmp/apt-jdg_2BTlL7  --configfile /tmp/tmp.srmMGRT6DG --buildplace 
/var/cache/pbuilder/build//cow.14423 --buildresult 

 --debbuildopts -B --no-targz --internal-chrootexec chroot 
/var/cache/pbuilder/build//cow.14423 cow-shell 

 
W: /root/.pbuilderrc does not exist
I: Running in no-targz mode
I: using fakeroot in build.
I: pbuilder: network access will be disabled during build
I: Current time: Wed Oct 31 04:24:01 UTC 2018
I: pbuilder-time-stamp: 1540959841
I: copying local configuration
I: mounting /proc filesystem
I: mounting /run/shm filesystem
I: mounting /dev/pts filesystem
I: Mounting /tmp/apt-jdg_2BTlL7
I: policy-rc.d already exists
I: Obtaining the cached apt archive contents
I: Installing the build-deps
I: user script /var/cache/pbuilder/build/cow.14423/tmp/hooks/D10-man-db starting
I: Preseed man-db/auto-update to false
I: user script /var/cache/pbuilder/build/cow.14423/tmp/hooks/D10-man-db finished
I: user script /var/cache/pbuilder/build/cow.14423/tmp/hooks/D20releaserepo 
starting
+ set -- /tmp/apt-jdg_2BTlL7/
+ TMPAPT=/tmp/apt-jdg_2BTlL7/
+ [ -d /tmp/apt-jdg_2BTlL7/ ]
+ UPDATE_PKGLIST=0
+ ls /tmp/apt-jdg_2BTlL7/*.list
+ [ -e /tmp/apt-jdg_2BTlL7//keyring.gpg ]
+ [ 0 = 1 ]
I: user script /var/cache/pbuilder/build/cow.14423/tmp/hooks/D20releaserepo 
finished
 -> Attempting to satisfy build-dependencies
 -> Creating pbuilder-satisfydepends-dummy package
Package: pbuilder-satisfydepends-dummy
Version: 0.invalid.0
Architecture: i386
Maintainer: Debian Pbuilder Team 
Description: Dummy package to satisfy dependencies with aptitude - created by 
pbuilder
 This package was created automatically by pbuilder to satisfy the
 build-dependencies of the package being currently built.
Depends: bison, debhelper (>= 8), libmysqlclient-dev, docbook-xml, erlang-dev, 
flex, libconfuse-dev, libcurl4-openssl-dev, libdb-dev (>= 4.6.19), libev-dev, 
libevent-dev, libexpat1-dev, libgeoip-dev (>= 1.4.5), libjson0-dev, 
libldap2-dev, liblua5.1-0-dev, libmemcached-dev, libncurses5-dev, libpcre3-dev, 
libperl-dev, libpq-dev, libradiusclient-ng-dev, libreadline-dev, libsasl2-dev, 
libsnmp-dev, libsqlite3-dev, libunistring-dev, libxml2-dev, libxmlrpc-c3-dev, 
openssl, pkg-config, python, python-dev, unixodbc-dev, uuid-dev, xsltproc, 
zlib1g-dev
dpkg-deb: building package `pbuilder-satisfydepends-dummy' in 
`/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'.
Selecting previously deselected package pbuilder-satisfydepends-dummy.
(Reading database ... 10562 files and directories currently installed.)
Unpacking pbuilder-satisfydepends-dummy (from 
.../pbuilder-satisfydepends-dummy.deb) ...
dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring 
anyway as you requested:
 pbuilder-satisfydepends-dummy depends on bison; however:
  Package bison is not installed.
 pbuilder-satisfydepends-dummy depends on debhelper (>= 8); however:
  Package debhelper is not installed.
 pbuilder-satisfydepends-dummy depends on libmysqlclient-dev; however:
  Package libmysqlclient-dev is not installed.
 pbuilder-satisfydepends-dummy depends on docbook-xml; however:
  Package docbook-xml is not installed.
 pbuilder-satisfydepends-dummy depends on erlang-dev; 

[sr-dev] Build failed in Jenkins: kamailio44-nightly-binaries » amd64,squeeze,slave #129

2018-10-30 Thread kamailio
See 


--
[...truncated 359.38 KB...]
+ '[' 3600 -eq 0 ']'
+ touch /var/run/lock/squeeze-amd64.building.19344
+ case "$architecture" in
+ sudo DIST=squeeze ARCH=amd64 cowbuilder --buildresult 

 --build 

 --basepath /var/cache/pbuilder/base-squeeze-amd64.cow --debbuildopts -sa 
--hookdir /usr/share/jenkins-debian-glue/pbuilder-hookdir/ --bindmounts 
'/tmp/apt-jdg_3Lg5T9 ' --configfile=/tmp/tmp.Uht9vUG2sx
 -> Copying COW directory
  forking: rm -rf /var/cache/pbuilder/build//cow.26901 
  forking: cp -al /var/cache/pbuilder/base-squeeze-amd64.cow 
/var/cache/pbuilder/build//cow.26901 
I: removed stale ilistfile /var/cache/pbuilder/build//cow.26901/.ilist
  forking: chroot /var/cache/pbuilder/build//cow.26901 cowdancer-ilistcreate 
/.ilist find . -xdev -path ./home -prune -o \( \( -type l -o -type f \) -a 
-links +1 -print0 \) | xargs -0 stat --format '%d %i ' 
 -> Invoking pbuilder
  forking: pbuilder build --debbuildopts -sa --hookdir 
/usr/share/jenkins-debian-glue/pbuilder-hookdir/ --bindmounts 
/tmp/apt-jdg_3Lg5T9  --configfile /tmp/tmp.Uht9vUG2sx --buildplace 
/var/cache/pbuilder/build//cow.26901 --buildresult 

 --debbuildopts -sa --no-targz --internal-chrootexec chroot 
/var/cache/pbuilder/build//cow.26901 cow-shell 

 
W: /root/.pbuilderrc does not exist
I: Running in no-targz mode
I: using fakeroot in build.
I: pbuilder: network access will be disabled during build
I: Current time: Wed Oct 31 04:23:31 UTC 2018
I: pbuilder-time-stamp: 1540959811
I: copying local configuration
I: mounting /proc filesystem
I: mounting /run/shm filesystem
I: mounting /dev/pts filesystem
I: Mounting /tmp/apt-jdg_3Lg5T9
I: policy-rc.d already exists
I: Obtaining the cached apt archive contents
I: Installing the build-deps
I: user script /var/cache/pbuilder/build/cow.26901/tmp/hooks/D10-man-db starting
I: Preseed man-db/auto-update to false
I: user script /var/cache/pbuilder/build/cow.26901/tmp/hooks/D10-man-db finished
I: user script /var/cache/pbuilder/build/cow.26901/tmp/hooks/D20releaserepo 
starting
+ set -- /tmp/apt-jdg_3Lg5T9/
+ TMPAPT=/tmp/apt-jdg_3Lg5T9/
+ [ -d /tmp/apt-jdg_3Lg5T9/ ]
+ UPDATE_PKGLIST=0
+ ls /tmp/apt-jdg_3Lg5T9/*.list
+ [ -e /tmp/apt-jdg_3Lg5T9//keyring.gpg ]
+ [ 0 = 1 ]
I: user script /var/cache/pbuilder/build/cow.26901/tmp/hooks/D20releaserepo 
finished
 -> Attempting to satisfy build-dependencies
 -> Creating pbuilder-satisfydepends-dummy package
Package: pbuilder-satisfydepends-dummy
Version: 0.invalid.0
Architecture: amd64
Maintainer: Debian Pbuilder Team 
Description: Dummy package to satisfy dependencies with aptitude - created by 
pbuilder
 This package was created automatically by pbuilder to satisfy the
 build-dependencies of the package being currently built.
Depends: bison, debhelper (>= 8), libmysqlclient-dev, docbook-xml, erlang-dev, 
flex, libconfuse-dev, libcurl4-openssl-dev, libdb-dev (>= 4.6.19), libev-dev, 
libevent-dev, libexpat1-dev, libgeoip-dev (>= 1.4.5), libjson0-dev, 
libldap2-dev, liblua5.1-0-dev, libmemcached-dev, libncurses5-dev, libpcre3-dev, 
libperl-dev, libpq-dev, libradiusclient-ng-dev, libreadline-dev, libsasl2-dev, 
libsnmp-dev, libsqlite3-dev, libunistring-dev, libxml2-dev, libxmlrpc-c3-dev, 
openssl, pkg-config, python, python-dev, unixodbc-dev, uuid-dev, xsltproc, 
zlib1g-dev
dpkg-deb: building package `pbuilder-satisfydepends-dummy' in 
`/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'.
Selecting previously deselected package pbuilder-satisfydepends-dummy.
(Reading database ... 10514 files and directories currently installed.)
Unpacking pbuilder-satisfydepends-dummy (from 
.../pbuilder-satisfydepends-dummy.deb) ...
dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring 
anyway as you requested:
 pbuilder-satisfydepends-dummy depends on bison; however:
  Package bison is not installed.
 pbuilder-satisfydepends-dummy depends on debhelper (>= 8); however:
  Package debhelper is not installed.
 pbuilder-satisfydepends-dummy depends on libmysqlclient-dev; however:
  Package libmysqlclient-dev is not installed.
 pbuilder-satisfydepends-dummy depends on docbook-xml; however:
  Package docbook-xml is not installed.
 pbuilder-satisfydepends-dummy depends on erlang-dev; 

Re: [sr-dev] [kamailio/kamailio] usrloc: call contact expired call back for a domain with db_mode: DB_ONLY (#1683)

2018-10-30 Thread Henning Westerholt
Thank you, merged into master branch.

-- 
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/pull/1683#issuecomment-434455815___
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] usrloc: call contact expired call back for a domain with db_mode: DB_ONLY (#1683)

2018-10-30 Thread Henning Westerholt
Merged #1683 into master.

-- 
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/pull/1683#event-1936204851___
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] pdb: fix SIGABRT in case of too long uris (#1693)

2018-10-30 Thread Lucian Balaceanu
Merged #1693 into master.

-- 
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/pull/1693#event-1934367108___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:e29c90ca: Merge pull request #1693 from lbalaceanu/pdb_fixabrt

2018-10-30 Thread GitHub
Module: kamailio
Branch: master
Commit: e29c90ca1a7e604a3a86d508e4ac0c7b57f382e8
URL: 
https://github.com/kamailio/kamailio/commit/e29c90ca1a7e604a3a86d508e4ac0c7b57f382e8

Author: Lucian Balaceanu 
Committer: GitHub 
Date: 2018-10-30T01:38:29-07:00

Merge pull request #1693 from lbalaceanu/pdb_fixabrt

pdb: fix SIGABRT in case of too long uris

---

Modified: src/modules/pdb/common.h
Modified: src/modules/pdb/pdb.c

---

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

---

diff --git a/src/modules/pdb/common.h b/src/modules/pdb/common.h
index 1ba16cdf98..7c52c97ce0 100644
--- a/src/modules/pdb/common.h
+++ b/src/modules/pdb/common.h
@@ -35,7 +35,8 @@
 #define OTHER_CARRIERID 1000
 #define MAX_CARRIERID 1000
 #define NULL_CARRIERID -1001
-#define PAYLOADSIZE 256
+/* hdr size + PAYLOADSIZE must add to 255 (uint8_t pdb_hdr.length) */
+#define PAYLOADSIZE 249
 
 
 #define IS_VALID_PDB_CARRIERID(id) ((id>=MIN_PDB_CARRIERID) && 
(id<=MAX_PDB_CARRIERID))
diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index 8f2f80c326..eb59656734 100644
--- a/src/modules/pdb/pdb.c
+++ b/src/modules/pdb/pdb.c
@@ -145,7 +145,7 @@ static struct server_list_t *server_list;
 /* debug function for the new client <-> server protocol */
 static void pdb_msg_dbg(struct pdb_msg msg, char *dbg_msg) {
 int i;
-char buf[PAYLOADSIZE];
+char buf[PAYLOADSIZE * 3 + 1];
 char *ptr = buf;
 
 for (i = 0; i < msg.hdr.length - sizeof(msg.hdr); i++) {
@@ -265,7 +265,7 @@ static int pdb_query(struct sip_msg *_msg, struct 
multiparam_t *_number, struct
 
/* prepare request */
reqlen = number.len + 1; /* include null termination */
-   if (reqlen > sizeof(struct pdb_bdy)) {
+   if (reqlen > PAYLOADSIZE) {
LM_ERR("number too long '%.*s'.\n", number.len, number.s);
return -1;
}
@@ -305,6 +305,7 @@ static int pdb_query(struct sip_msg *_msg, struct 
multiparam_t *_number, struct
 break;
 }
 
+   memset(, 0, sizeof(struct pdb_msg));
/* wait for response */
for (;;) {
if (gettimeofday(, NULL) != 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:783763e8: pdb: fix SIGABRT in case of too long uris

2018-10-30 Thread Lucian Balaceanu
Module: kamailio
Branch: master
Commit: 783763e8accef47aa563cd17d1e170250268751c
URL: 
https://github.com/kamailio/kamailio/commit/783763e8accef47aa563cd17d1e170250268751c

Author: Lucian Balaceanu 
Committer: Lucian Balaceanu 
Date: 2018-10-29T11:54:45+02:00

pdb: fix SIGABRT in case of too long uris

buf in pdb_msg_dbg should correctly accomodate for pdb_bdy size
pdb_hdr + pdb_bdy should add to pdb_hdr.length (max 255)

---

Modified: src/modules/pdb/common.h
Modified: src/modules/pdb/pdb.c

---

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

---

diff --git a/src/modules/pdb/common.h b/src/modules/pdb/common.h
index 1ba16cdf98..7c52c97ce0 100644
--- a/src/modules/pdb/common.h
+++ b/src/modules/pdb/common.h
@@ -35,7 +35,8 @@
 #define OTHER_CARRIERID 1000
 #define MAX_CARRIERID 1000
 #define NULL_CARRIERID -1001
-#define PAYLOADSIZE 256
+/* hdr size + PAYLOADSIZE must add to 255 (uint8_t pdb_hdr.length) */
+#define PAYLOADSIZE 249
 
 
 #define IS_VALID_PDB_CARRIERID(id) ((id>=MIN_PDB_CARRIERID) && 
(id<=MAX_PDB_CARRIERID))
diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index 8f2f80c326..eb59656734 100644
--- a/src/modules/pdb/pdb.c
+++ b/src/modules/pdb/pdb.c
@@ -145,7 +145,7 @@ static struct server_list_t *server_list;
 /* debug function for the new client <-> server protocol */
 static void pdb_msg_dbg(struct pdb_msg msg, char *dbg_msg) {
 int i;
-char buf[PAYLOADSIZE];
+char buf[PAYLOADSIZE * 3 + 1];
 char *ptr = buf;
 
 for (i = 0; i < msg.hdr.length - sizeof(msg.hdr); i++) {
@@ -265,7 +265,7 @@ static int pdb_query(struct sip_msg *_msg, struct 
multiparam_t *_number, struct
 
/* prepare request */
reqlen = number.len + 1; /* include null termination */
-   if (reqlen > sizeof(struct pdb_bdy)) {
+   if (reqlen > PAYLOADSIZE) {
LM_ERR("number too long '%.*s'.\n", number.len, number.s);
return -1;
}
@@ -305,6 +305,7 @@ static int pdb_query(struct sip_msg *_msg, struct 
multiparam_t *_number, struct
 break;
 }
 
+   memset(, 0, sizeof(struct pdb_msg));
/* wait for response */
for (;;) {
if (gettimeofday(, NULL) != 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:6745a6c7: rabbitmq: use fixup spve all

2018-10-30 Thread Daniel-Constantin Mierla
Module: kamailio
Branch: master
Commit: 6745a6c784218130a28896cbfa4ea520047d8fc6
URL: 
https://github.com/kamailio/kamailio/commit/6745a6c784218130a28896cbfa4ea520047d8fc6

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2018-10-30T07:21:48+01:00

rabbitmq: use fixup spve all

- allow tracking parameter number
- prefix to avoid conflict of common name function

---

Modified: src/modules/rabbitmq/rabbitmq.c

---

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

---

diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c
index 45556ef196..d5eedbdbf4 100644
--- a/src/modules/rabbitmq/rabbitmq.c
+++ b/src/modules/rabbitmq/rabbitmq.c
@@ -85,7 +85,7 @@ static int rabbitmq_disconnect(amqp_connection_state_t *conn);
 static int rabbitmq_reconnect(amqp_connection_state_t *conn);
 
 /* module fixup functions */
-static int fixup_params(void **param, int param_no)
+static int rbmq_fixup_params(void **param, int param_no)
 {
if(param_no == 5) {
if(fixup_pvar_null(param, 1) != 0) {
@@ -98,18 +98,18 @@ static int fixup_params(void **param, int param_no)
}
return 0;
} else {
-   return fixup_spve_null(param, 1);
+   return fixup_spve_all(param, param_no);
}
 
return -1;
 }
 
-static int fixup_free_params(void **param, int param_no)
+static int rbmq_fixup_free_params(void **param, int param_no)
 {
if(param_no == 5) {
return fixup_free_pvar_null(param, 1);
} else {
-   return fixup_free_spve_null(param, 1);
+   return fixup_free_spve_all(param, param_no);
}
 
return -1;
@@ -117,10 +117,10 @@ static int fixup_free_params(void **param, int param_no)
 
 /* module commands */
 static cmd_export_t cmds[] = {
-   {"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_params,
-   fixup_free_params, REQUEST_ROUTE},
+   {"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_spve_all,
+   fixup_free_spve_all, REQUEST_ROUTE},
{"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5,
-   fixup_params, fixup_free_params, REQUEST_ROUTE},
+   rbmq_fixup_params, rbmq_fixup_free_params, 
REQUEST_ROUTE},
{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