### Description
While running a simple load with a UAC(Sipp) and two UAS(Both Sipp) , with Kamailio in the middle, acting as a Call Stateful Proxy, I observed that the Dispatcher Module reports one call stuck despite NO calls being reported as Active in the Dialog Module.
Setup:
-------
|------> UAS1(sipp)
UAC(sipp) ----------------------Kamailio(Call Stateful Proxy)------------
|------> UAS2(sipp)
Scenario: The scenario is simple INVITE----- 200OK------ACK , with BYE being sent after 60 secs by UAC.
### Troubleshooting
Point noteworthy is that this is purely timing issue and happens generally with very long duration, like 24 hours or so, but can crop up withing a few hours also.
#### Reproduction
Just run the calls via sipp as described in the setup.
#### Debugging Data
**OUTPUT after cleanly stopping the test:**
> Output of "kamctl stats dialog" command
{
"jsonrpc": "2.0",
"result": [
"dialog:active_dialogs = 0",
"dialog:early_dialogs = 0",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 959",
"dialog:processed_dialogs = 1695662"
],
"id": 21282
}
> Output of "kamcmd dispatcher.list"
{
NRSETS: 1
RECORDS: {
SET: {
ID: 1
TARGETS: {
DEST: {
URI: sip:10.214.3.20:5060;transport=udp
FLAGS: AP
PRIORITY: 0
ATTRS: {
BODY: duid=sample-cas-1;maxload=1000
DUID: sample-cas-1
MAXLOAD: 1000
WEIGHT: 0
RWEIGHT: 0
SOCKET:
}
LATENCY: {
AVG: 2.409000
STD: 108.999000
EST: 1.124000
MAX: 9503
TIMEOUT: 22
}
RUNTIME: {
DLGLOAD: 997
}
}
DEST: {
URI: sip:10.214.3.19:5060;transport=udp
FLAGS: AP
PRIORITY: 0
ATTRS: {
BODY: duid=sample-cas-0;maxload=1000
DUID: sample-cas-0
MAXLOAD: 1000
WEIGHT: 0
RWEIGHT: 0
SOCKET:
}
LATENCY: {
AVG: 1.429000
STD: 40.279000
EST: 0.999000
MAX: 3502
TIMEOUT: 22
}
RUNTIME: {
DLGLOAD: 985
}
}
}
}
}
}
NOTE: Please see that the dispatcher shows a lot of calls stuck after overnight load, and there by we started seeing 404's sent back by Kamailio dispatcher module for most of the calls.
It is noteworthy that we have kept a close tab on the tests thereafter and caught an iteration where initially only call is stuck.
### Possible Solutions
The problem most likely seems to be in the dispatcher module, which does not seem to be incrementing/decrementing the load variable for each UAS( 'dload' variable to be precise), due to which the concurrent incrementing/decrementing of the 'dload' parameter makes the dispatcher report spurious values.
FIX: The following needs to be done.
1. File: **dispatch.c**
Function: **ds_load_add()**
Just before dset->dlist[dst].dload++; line, we must take a lock and release it thereafter. Like:
**lock_get(&dset->lock)**;
dset->dlist[dst].dload++;
**lock_release(&dset->lock);**
2: File: **dispatch.c**
Function: **ds_load_replace()** , the code needs a lock as well while decrementing. Like:
**lock_get(&idx->lock);**
if(idx->dlist[olddst].dload > 0) {
idx->dlist[olddst].dload--;
**lock_release(&idx->lock);**
......
} else {
**lock_release(&idx->lock);**
......
}
3. File: **dispatch.c**
Function: **ds_load_remove_byid** , the code needs a lock as well while decrementing. Like:
**lock_get(&idx->lock);**
if(idx->dlist[olddst].dload > 0) {
idx->dlist[olddst].dload--;
**lock_release(&idx->lock);**
...........
} else {
**lock_release(&idx->lock);**
........
}
NOTE: I believe the lock should be taken also for the the API "ds_get_leastloaded()" in dispatch.c because otherwise, we may get select incorrect destination, especially when we are at just about the same load and that is almost close to the 'maxload' value configured in the dispatcher list file. But I will wait for the community comments for this.
The above fix solved my issue, so please review the same and if you deem suitable, I could go ahead with the fix delivery.
### Additional Information
Kamailio Version:
[root@CPaaSVM ~]# kamailio -v
version: kamailio 5.3.2 (x86_64/linux) 7ba545
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
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: 7ba545
compiled on 19:01:39 May 1 2020 with gcc 4.8.5
NOTE: I do not think this is version specific and probably that it exists in the later versions also.
* **Operating System**:
Centos 7.7
--
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/2322
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.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.kamailio.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 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
<!--
When I am installed Kamailio and send to create the database with the command:
kamdbctl create
It gives me an error
-->
### Troubleshooting
#### Reproduction
<!--
In the installation run:
kamdbctl create
-->
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
[root@localhost ~]# kamailio -version
version: kamailio 5.3.4 (x86_64/linux) 117ff9
```
* **Operating System**:
<!--
Centos 7.8
-->
```
MySQL password for root:
INFO: test server charset
INFO: creating database kamailio ...
INFO: granting privileges to database kamailio ...
INFO: creating standard tables into kamailio ...
INFO: Core Kamailio tables succesfully created.
Install presence related tables? (y/n): y
INFO: creating presence tables into kamailio ...
INFO: Presence tables succesfully created.
Install tables for imc cpl siptrace domainpolicy carrierroute
drouting userblacklist htable purple uac pipelimit mtree sca mohqueue
rtpproxy rtpengine secfilter? (y/n): y
INFO: creating extra tables into kamailio ...
ERROR 1067 (42000) at line 1: Invalid default value for 'action'
ERROR: Creating extra tables failed at secfilter!
```
--
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/2328
Greetings,
Dispatcher RPC command allows to change the runtime state of a GW using its Group ID and the IP.
In my implementation i have 2 Kamailio machines in an HA setup and, as such, i have the GW configured twice with same group_id and different sockets (Different HA adressess - one for each machine).
I would like to be able to disable on runtime GWs that are configured with an HA adress that isn't present yet on that machine. To be able do that, the combination of GroupID + IP is not enough, but Socket + IP would be enough.
Is this possible to implement ?
Best Regards
--
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/2085
Module: kamailio
Branch: master
Commit: e97ce9f952f8f867ae5718df1dd940e0fca33f3e
URL: https://github.com/kamailio/kamailio/commit/e97ce9f952f8f867ae5718df1dd940e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-05-22T21:32:59+02:00
dispatcher: docs for dispatcher.set_duid_state command
---
Modified: src/modules/dispatcher/doc/dispatcher_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/e97ce9f952f8f867ae5718df1dd940e…
Patch: https://github.com/kamailio/kamailio/commit/e97ce9f952f8f867ae5718df1dd940e…
---
diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml
index 42dc66bb4a..c38988580c 100644
--- a/src/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/src/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1806,6 +1806,28 @@ onreply_route {
&sercmd; dispatcher.set_state ip 2 sip:127.0.0.1:5080
&sercmd; dispatcher.set_state ip 3 all
...
+</programlisting>
+ </section>
+ <section>
+ <section id="dispatcher.r.set_duid_state">
+ <title>
+ <function moreinfo="none">dispatcher.set_duid_state</function>
+ </title>
+ <para>
+ Sets the state for a destination by matching on 'duid' attribute. The
+ parameters first two parameter 'state' and 'group' are the same like
+ for RPC command 'dispatcher.set_state'. The third parameter 'duid' is
+ the value to be matched against the 'duid' attribute of dispatcher
+ destinations.
+ </para>
+ <para>
+ Example:
+ </para>
+<programlisting format="linespecific">
+...
+# prototype: &sercmd; dispatcher.set_duid_state _state_ _group_ _duid_
+&sercmd; dispatcher.set_duid_state ip 2 xyz
+...
</programlisting>
</section>
<section id="dispatcher.r.list">
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [*] Commit message has the format required by CONTRIBUTING guide
- [*] Commits are split per component (core, individual modules, libs, utils, ...)
- [*] Each component has a single commit (if not, squash them into one commit)
- [*] 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
- [ ] 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:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [*] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Added kemi support for
Parameter:
- event_callback
Functions:
- kazoo_subscribe(json_description)
- kazoo_publish
Documentation:
- added section for event_callback parameter
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2324
-- Commit Summary --
* kazoo: added kemi support for kazoo_subscribe(json_description) and kazoo_publish
* kazoo: added event_callback parameter in documentation
* kazoo: added event_callback parameter in documentation
* Merge branch 'master' of https://github.com/tao-communications/kamailio
-- File Changes --
M src/modules/kazoo/doc/kazoo_admin.xml (22)
M src/modules/kazoo/kazoo.c (105)
M src/modules/kazoo/kz_amqp.c (100)
M src/modules/kazoo/kz_amqp.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2324.patchhttps://github.com/kamailio/kamailio/pull/2324.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/2324