### Description
When running kamdbctl for the first time with `DBENGINE=MYSQL` , it will try to create the same user twice which causes a failure. Because the user is already there, the create fails and the install script fails
As a new user this is very confusing as it leads you to believe that you're blocked. However, if you enable prompt and run it twice and then skip adding access the second time, you can continue.
```
root@924dfe238957:/# /usr/sbin/kamdbctl create
Create the database 'kamailio'? (y/n): y
-e \E[37;33mINFO: creating database kamailio ...
Create database users with access privileges? (y/n): y
-e \E[37;33mINFO: granting privileges to database kamailio ...
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'kamailio'@'mariadb'
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'kamailioro'@'mariadb'
```
### Troubleshooting
If you modify `./usr/lib/x86_64-linux-gnu/kamailio/kamctl/kamdbctl.mysql` to echo the command instead, then you get the following debugging info.
```
root@924dfe238957:/# /usr/sbin/kamdbctl create
Create the database 'kamailio'? (y/n): y
-e \E[37;33mINFO: creating database kamailio ...
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE DATABASE kamailio CHARACTER SET latin1;
Create database users with access privileges? (y/n): y
-e \E[37;33mINFO: granting privileges to database kamailio ...
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'mariadb' IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 'kamailio'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailioro'@'mariadb' IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 'kamailioro'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'localhost' IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 'kamailio'@'localhost';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailioro'@'localhost' IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 'kamailioro'@'localhost';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailio'@'mariadb' IDENTIFIED BY 'kamailiorw';
GRANT ALL PRIVILEGES ON kamailio.* TO 'kamailio'@'mariadb';
mysql -h mariadb -P 3306 -uroot -ppasswd -e CREATE USER 'kamailioro'@'mariadb' IDENTIFIED BY 'kamailioro';
GRANT SELECT ON kamailio.* TO 'kamailioro'@'mariadb';
```
As you can see ` 'kamailioro'@'mariadb'` and ` 'kamailioro'@'mariadb'` are added twice which creates a 1396 error.
#### Reproduction
```
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3280
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3280(a)github.com>
<!-- 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 -->
- [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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds new functionality)
- [X] 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
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
I've marked this as a "breaking change" only because it slightly alters the error handling of the RPC dlg.list_match command, to draw attention to it. But the actual functionality is unchanged.
This PR adds a new script function to the dialog module: `dlg_get_matches`. This has the same behaviour as the RPC `dlg.list_match` command, but allows use in scripts. The results are returned in an XAVP of a specified name, as an array of fields.
```
dlg_get_matches(mkey, mop, mval, xavp_name[, max_results]);
Returns number of matches found. Or -1 if there's an error.
```
An example of use would be:
```
xlog("Extension is: $var(ext)\n");
$avp(dlg_count) = dlg_get_matches("turi", "sw", "sip:nexusone$var(ext)@", "dlg_matches");
xlog("Got $avp(dlg_count) matches.\n");
$var(i) = 0;
$var(matched) = 0;
while ($var(i) < $avp(dlg_count))
{
//Skip dialogs that are not early state
if ($xavp(dlg_matches[$var(i)]=>state) == 2)
{
xlog("Found matching dlg[$var(i)]: $xavp(dlg_matches[$var(i)]=>from_uri)\n");
}
}
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3005
-- Commit Summary --
* dialog: Adding dlg_get_matches function based on RPC dlg.list_match command.
* dialog: Adding documentation for dlg_get_matches function.
* dialog: Refactored dlg_get_matches and dlg.list_match RPC command to use a shared dlg_list_matches function.
-- File Changes --
M src/modules/dialog/dialog.c (793)
M src/modules/dialog/doc/dialog_admin.xml (92)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3005.patchhttps://github.com/kamailio/kamailio/pull/3005.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3005
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3005(a)github.com>
<!--
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
using KEMI API in Python v2.7.18 for Kamailio v5.6.2, I encounter error in `ksr_onsend_route`, it always gives following error,
```
ERROR: app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_onsend_route((null)): Unhandled exception in the Python code:
TypeError: an integer is required
```
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
Above error happens even if there is no code in this function and it returns success, e.g.
``` python
...
def ksr_onsend_route(self, msg):
return 1
...
```
#### Reproduction
It happens always whenever `ksr_onsend_route` function exists in `kamailio` class in KEMI python configuration for kamailio.
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Debugging Data
Nothing relevant in debug even with `debug=9` set.
<!--
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.
-->
#### 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).
-->
```
ERROR: app_python [python_support.c:154]: python_handle_exception(): apy_exec: ksr_onsend_route((null)): Unhandled exception in the Python code:
TypeError: an integer is required
```
#### 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).
-->
```
REGISTER sip:voip-test.sip-domain.de:5060 SIP/2.0.
Via: SIP/2.0/UDP x.x.x.x:5060;branch=z9hG4bK-1523596-64-0.
From: <sip:490000063@voip-test.sip-domain.de:5060>;tag=64.
To: <sip:490000063@voip-test.sip-domain.de:5060>.
Call-ID: call_id_64.
CSeq: 1 REGISTER.
Contact: sip:490000063@x.x.x.x:5060.
Max-Forwards: 70.
Content-Length: 0.
..
```
### Possible Solutions
I suspect the problem is at low level (native code) of app_python module.
<!--
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`
```
version: kamailio 5.6.2 (x86_64/linux)
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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
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:
compiled with gcc 10.2.1
```
```
Python 2.7.18
```
* **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 `lsb_release -a` and `uname -a`)
-->
```
Linux test-sip-server 5.10.0-17-amd64 #1 SMP Debian 5.10.136-1 (2022-08-13) x86_64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3274
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3274(a)github.com>
### Description
When I use Kamailio 5.6 with kazoo config file, then can see error messages:
```
WARNING: <core> [core/rvalue.c:1043]: rval_get_int(): automatic string to int conversion for "63823655406" failed
WARNING: <core> [core/rvalue.c:1949]: rval_expr_eval_int(): rval expression conversion to int failed (140,54-140,73)
```
This warning message related to commit bcd59d73e2fc5ae8e14cad520e726ef431f0563f.
Kazoo sending timestamp using the Gregorian format and timestamp value greater than max int value.
As a result, JSON string values with a timestamp cannot be parsed and converted to int.
As I understand required to add long format support into Kamailio.
This was tested using this Kamailio config.
```
listen=udp:127.0.0.1:5060
######## Advanced logger module ########
loadmodule "xlog.so"
######## Generic Hash Table container in shared memory ########
loadmodule "htable.so"
event_route[htable:mod-init] {
if ( 63823655406 > 0 ) {
xlog("L_ERR", "*** Kamailio support long data type!\n");
} else {
xlog("L_ERR", "*** Kamailio not support long data type!\n");
}
}
```
### Expected behavior
Kamailio is able to convert strings to long data type.
#### Actual observed behavior
Kamailio was not able to convert strings to long data type.
@lazedo, probable you want to know about this behavior.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3172
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3172(a)github.com>
<!-- 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
- [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:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
We have observed that when the call is answered and it is in active state more than 30 seconds, kamailio sends the notify messages with the "Idle" appearance to all the subscribed extensions. Practically it should not send the idle notification when the call is in active state.
We have tried to change the mod parameter "purge_expired_interval" to 3600 seconds. but still idle notification transmit in 30 seconds. To overcome this issue, we have commented below line in the sca.c file.
register_timer( sca_appearance_purge_stale, sca, sca->cfg->purge_expired_interval);
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3249
-- Commit Summary --
* Update sca.c - Fix done for Appearance purge stale
-- File Changes --
M src/modules/sca/sca.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3249.patchhttps://github.com/kamailio/kamailio/pull/3249.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3249
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3249(a)github.com>
### Description
The stirshaken module has an option to cache certificates instead of downloading it using http for each calls. The problem is that the module doesn't save the certificate chain in the cached file.
from here: https://github.com/kamailio/kamailio/blob/f7b35f05f31bd7cc01aea4572c79ba48d…
We see that only `cert->x` is saved to the file. It needs to save `cert->chainx` as well.
Similarly, the load function should load both the x509 and associated x509 chain.
### Troubleshooting
#### Reproduction
To reproduce, we need to configure the stirshaken module to do cerrtificate caching:
```
modparam("stirshaken", "vs_verify_x509_cert_path", 1)
modparam("stirshaken", "vs_ca_dir", "/path/to/ca")
modparam("stirshaken", "vs_cache_certificates", 1)
modparam("stirshaken", "vs_cache_dir", "/path/to/cert_cache")
modparam("stirshaken", "vs_cache_expire_s", 100)
```
Then send 2 calls featuring an identity header signed by a private key associated to a public certificate that includes a chain such as https://pstn-cdn.live.gtc.goto.com/certs/stirshaken/goto-2022-09
Verification for the fist call should work, but verification of x509 cert path will fail on second call
#### SIP Traffic
Example sip INVITE that should help reproduce the problem.
```
INVITE sip:+13855551212@216.82.227.102:5060 SIP/2.0
Max-Forwards: 61
f: <sip:+13852194167@reg.mydomain.net>;tag=as04e1a3e0
t: <sip:+13851212@somedomain.net>
m: <sip:+13852194167@reg.mydomain.net:5060>
i: 59ede93214794e1033b27ed249a90f15(a)reg.mydomain.net
CSeq: 102 INVITE
Date: Mon, 19 Sep 2022 15:04:01 GMT
l: 0
Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9wc3RuLWNkbi5saXZlLmd0Yy5nb3RvLmNvbS9jZXJ0cy9zdGlyc2hha2VuL2dvdG8tMjAyMi0wOSJ9.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxNTE0ODM4MjY0NyJdfSwiaWF0IjoxNjYzNTk5ODQxLCJvcmlnIjp7InRuIjoiMTM4NTIxOTQxNjcifSwib3JpZ2lkIjoiNTllZGU5MzIxNDc5NGUxMDMzYjI3ZWQyNDlhOTBmMTVAcmVnLmppdmVpcC5uZXQifQ.wX5H0FhPt99MPWbdk_xgZXOWCHPGRcS_RiGTBBE5mG_r6By6StdnsBWiipdU9xyLuG3nSPKKFybhdO1S8OIeSQ;info=<https://pstn-cdn.live.gtc.goto.com/certs/stirshaken/goto-2022-09>;alg=ES256;ppt=shaken
```
### Possible Solutions
The module should save/load `cert->chainx` as well. Maybe a new set of function in libstirshaken should be added to save/load a certificate (vs saving/loading x509)
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3246
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3246(a)github.com>
Hi,
When installing kamailio from deb repository (https://deb.kamailio.org/) with debian 11 amd64.
kamcmd autocompletion doesn't work.
Issue found with debian 11 on Kamailio v5.5.x and 5.6.x
OK via debian official repository.
Kamcli could be a replacement but such modules as LCR are not supported.
Thanks in advance,
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3284
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3284(a)github.com>