<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests.
If you have questions about using Kamailio or related to its configuration file,
ask on sr-users mailing list:
* http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing
C code, ask on sr-dev mailing list
* http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the
developers to troubleshoot the issue.
If you submit a feature request (or enhancement), you can delete the text of
the template and only add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
"ds_is_from_list" function from Dispatcher module give false result - when actually it should be true.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
modparam("dispatcher", "db_url",DBURL)
modparam("dispatcher", "table_name", "dispatcher")
modparam("dispatcher", "setid_col", "setid")
modparam("dispatcher", "destination_col", "destination")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
request_route {
xlog("L_INFO","[=Start Routing=]")
if(ds_is_from_list("1")) {
xlog("L_INFO","[=FROM ASTERISK=]");
} else {
xlog("L_INFO","[=TO ASTERISK=]");
}
if($si=="192.168.1.10") {
xlog("L_INFO","[=FROM ASTERISK BY IP=]");
} else {
xlog("L_INFO","[=TO ASTERISK BY IP=]");
}
root@kamailio:/var/log# kamctl dispatcher show
dispatcher gateways
+----+-------+---------------------+-------+----------+-------+-----------------+
| id | setid | destination | flags | priority | attrs | description |
+----+-------+---------------------+-------+----------+-------+-----------------+
| 1 | 1 | sip:192.168.1.10:5060 | 0 | 3 | | Main Asterisk |
| 2 | 2 | sip:192.168.1.11:5060 | 0 | 2 | | Backup Asterisk |
| 3 | 3 | sip:192.168.1.12:5060 | 0 | 1 | | Test Asterisk |
+----+-------+---------------------+-------+----------+-------+-----------------+
root@kamailio:/var/log#
cat /var/log/kamailio.log
[=Start Routing=]
**[=TO ASTERISK=]**
**[=FROM ASTERISK BY IP=]**
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
root@kamailio:/var/log# kamailio -v
version: kamailio 5.0.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 12:12:14 Sep 7 2017 with gcc 6.3.0
root@kamailio:/var/log#
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
Debian 9.1/ Linux kamailio1 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) 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/1235
#### Pre-Submission Checklist
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
This PR to fix a calculation error on the latency standard deviation
test with random values from 1-30
```
total[1726000000]value[3] count[2097152] std[8.654594] avg[15.541001] est[14.098082]
total[1727000000]value[2] count[2097152] std[8.654230] avg[15.542887] est[16.070623]
total[1728000000]value[2] count[2097152] std[8.655254] avg[15.546928] est[13.154167]
```
test with random values 1-500
```
total[1056000000]value[373] count[2097152] std[144.397552] avg[249.993790] est[297.913574]
total[1057000000]value[118] count[2097152] std[144.369400] avg[250.121262] est[222.419662]
total[1058000000]value[431] count[2097152] std[144.314056] avg[250.138077] est[295.765625]
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1236
-- Commit Summary --
* dispatcher: latency fix stdev calculation
-- File Changes --
M src/modules/dispatcher/dispatch.c (29)
M src/modules/dispatcher/dispatch.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1236.patchhttps://github.com/kamailio/kamailio/pull/1236.diff
--
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/1236