Covers setups when kamailio behind the service with HAPROXY protocol support but in other hand it also serves requests from other services that available per direct connection (such as B2BUA in the same local network).
#### Pre-Submission Checklist
- [*] 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:
- [*] PR should be backported to stable branches
- [*] Tested changes locally
#### Description
- function tcpconn_read_haproxy() returns 2 if PROXY header NOT found.
- Message about no header shown at the debug level.
- No errors
- TCP connection successfully establishes
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2206
-- Commit Summary --
* handle tcp request with tcp_accept_haproxy even no PROXY header found
* core:tcp allow to handle TCP connections even message does not contain PROXY protocol header
* core:tcp allow to handle TCP connections even message does not contain PROXY protocol header
-- File Changes --
M src/core/tcp_main.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2206.patchhttps://github.com/kamailio/kamailio/pull/2206.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/2206
Enable registration of pcscf contact callback during download from db location table and inserting pcontact (normally this callback is registered during handling of REGISTER). Refuse REGISTER when pcontact is expired since [0 to 20] seconds. Within this time window a NOTIFY is expected from scscf and in order to avoid race time conditions between scscf and pcscf REGISTER will be refused. Refuse REGISTER when pcontact is expired longer than 20 seconds - send PUBLISH (contact expired) to scscf to trigger NOTIFY. In both REGISTER refused scenarios routing script should reply 500 - Deregister in progress.
<!-- 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)
- [ ] 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 -->
In case a pcontact found in location db has to be inserted into pcscf cache depending on contact state also callbacks have to be registered for this pcontact. Registering of callback_pcscf_contact_cb is enabled in this module.
Handling of contact expiry is usually triggered in the scscf (mem_timer_udomain which runs every 10 secs). Sending of NOTIFY to pcscf may take up to 20 seconds from start of expiry due to timing conditions.
To avoid race time conditions between a REREGISTER and the expiry handler state machine in the scscf an approach is chosen to refuse a REREGISTER in time window of 20 seconds after pcontact expiry on the pcscf (thus allowing expiry handling to finish). REREGISTER is refused in this scenario with new return_code -2.
In case a REREGISTER arrives at pcscf and the respective pcontact is expired longer than time window of 20 seconds registration also is refused with rc -2 and additionaly PUBLISH is sent to scscf with expiry = 0.
The rc -2 shall be handled in register.cfg script as follows:
pcscf_save_pending("location");
switch ($retcode) {
case -1:
# Missing/wrong Information in REGISTER.
send_reply("400", "Information wrong - See log.");
exit;
break;
case -2:
# De-Register in Progress, or PUBLISH ongoing due to registration expiry,
# or new REGISTER blocked because registration just expired (up to 20sec).
append_to_reply("Retry-After: 30\r\n");
send_reply("500", "Deregister in progress - Please try again");
exit;
break;
}
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3317
-- Commit Summary --
* ims_registrar_pcscf: changes for ul db_mode DB_ONLY
-- File Changes --
M src/modules/ims_registrar_pcscf/ims_registrar_pcscf_mod.c (21)
M src/modules/ims_registrar_pcscf/notify.c (4)
M src/modules/ims_registrar_pcscf/save.c (37)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3317.patchhttps://github.com/kamailio/kamailio/pull/3317.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3317
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3317(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
- [ ] 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 -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2209
-- Commit Summary --
* add received_in_via function(use it in hiops module)
* hiops: new module in Kamailio
-- File Changes --
M src/core/msg_translator.c (25)
M src/core/msg_translator.h (3)
A src/modules/hiops/Alarm-Indicator.c (153)
A src/modules/hiops/Alarm-Indicator.h (57)
A src/modules/hiops/BIT_STRING.c (189)
A src/modules/hiops/BIT_STRING.h (33)
A src/modules/hiops/CMakeLists.txt (92)
A src/modules/hiops/Code.c (64)
A src/modules/hiops/Code.h (49)
A src/modules/hiops/CommunicationIdentifier.c (94)
A src/modules/hiops/CommunicationIdentifier.h (43)
A src/modules/hiops/GeneralizedTime.c (706)
A src/modules/hiops/GeneralizedTime.h (69)
A src/modules/hiops/HI1-Operation.c (94)
A src/modules/hiops/HI1-Operation.h (61)
A src/modules/hiops/IA5String.c (77)
A src/modules/hiops/IA5String.h (27)
A src/modules/hiops/INTEGER.c (1025)
A src/modules/hiops/INTEGER.h (82)
A src/modules/hiops/IP-value.c (130)
A src/modules/hiops/IP-value.h (55)
A src/modules/hiops/IPAddress.c (393)
A src/modules/hiops/IPAddress.h (67)
A src/modules/hiops/LawfulInterceptionIdentifier.c (126)
A src/modules/hiops/LawfulInterceptionIdentifier.h (38)
A src/modules/hiops/LocalTimeStamp.c (191)
A src/modules/hiops/LocalTimeStamp.h (50)
A src/modules/hiops/Makefile (15)
A src/modules/hiops/National-HI1-ASN1parameters.c (139)
A src/modules/hiops/National-HI1-ASN1parameters.h (43)
A src/modules/hiops/NativeEnumerated.c (207)
A src/modules/hiops/NativeEnumerated.h (32)
A src/modules/hiops/NativeInteger.c (332)
A src/modules/hiops/NativeInteger.h (37)
A src/modules/hiops/Network-Element-Identifier.c (198)
A src/modules/hiops/Network-Element-Identifier.h (60)
A src/modules/hiops/Network-Identifier.c (94)
A src/modules/hiops/Network-Identifier.h (48)
A src/modules/hiops/Notification.c (153)
A src/modules/hiops/Notification.h (57)
A src/modules/hiops/OBJECT_IDENTIFIER.c (764)
A src/modules/hiops/OBJECT_IDENTIFIER.h (139)
A src/modules/hiops/OCTET_STRING.c (1807)
A src/modules/hiops/OCTET_STRING.h (86)
A src/modules/hiops/PrintableString.c (109)
A src/modules/hiops/PrintableString.h (24)
A src/modules/hiops/Priority.c (125)
A src/modules/hiops/Priority.h (38)
A src/modules/hiops/TimeStamp.c (64)
A src/modules/hiops/TimeStamp.h (49)
A src/modules/hiops/UTCTime.c (179)
A src/modules/hiops/UTCTime.h (38)
A src/modules/hiops/asn_application.h (47)
A src/modules/hiops/asn_codecs.h (109)
A src/modules/hiops/asn_codecs_prim.c (312)
A src/modules/hiops/asn_codecs_prim.h (53)
A src/modules/hiops/asn_internal.h (128)
A src/modules/hiops/asn_system.h (137)
A src/modules/hiops/ber_decoder.c (283)
A src/modules/hiops/ber_decoder.h (64)
A src/modules/hiops/ber_tlv_length.c (178)
A src/modules/hiops/ber_tlv_length.h (50)
A src/modules/hiops/ber_tlv_tag.c (144)
A src/modules/hiops/ber_tlv_tag.h (60)
A src/modules/hiops/constr_CHOICE.c (1114)
A src/modules/hiops/constr_CHOICE.h (57)
A src/modules/hiops/constr_SEQUENCE.c (1425)
A src/modules/hiops/constr_SEQUENCE.h (60)
A src/modules/hiops/constr_TYPE.c (77)
A src/modules/hiops/constr_TYPE.h (180)
A src/modules/hiops/constraints.c (93)
A src/modules/hiops/constraints.h (63)
A src/modules/hiops/der_encoder.c (201)
A src/modules/hiops/der_encoder.h (68)
A src/modules/hiops/hi1ops.c (682)
A src/modules/hiops/hi1ops.h (102)
A src/modules/hiops/hi2ops.c (1319)
A src/modules/hiops/hi2ops.h (109)
A src/modules/hiops/hiops.c (272)
A src/modules/hiops/hiops.h (38)
A src/modules/hiops/per_decoder.c (93)
A src/modules/hiops/per_decoder.h (56)
A src/modules/hiops/per_encoder.c (151)
A src/modules/hiops/per_encoder.h (69)
A src/modules/hiops/per_opentype.c (378)
A src/modules/hiops/per_opentype.h (22)
A src/modules/hiops/per_support.c (483)
A src/modules/hiops/per_support.h (135)
A src/modules/hiops/tcp_socket.c (136)
A src/modules/hiops/tcp_socket.h (39)
A src/modules/hiops/xer_decoder.c (368)
A src/modules/hiops/xer_decoder.h (106)
A src/modules/hiops/xer_encoder.c (67)
A src/modules/hiops/xer_encoder.h (59)
A src/modules/hiops/xer_support.c (227)
A src/modules/hiops/xer_support.h (55)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2209.patchhttps://github.com/kamailio/kamailio/pull/2209.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/2209
### Description
On server used WebRTC clients. Some time Kamailio start flooding messages like this
```
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
```
I have enabled debug logs and can see more detailed output.
```
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
DEBUG: websocket [ws_conn.c:485]: wsconn_put_id(): wsconn put id [49]
DEBUG: websocket [ws_conn.c:490]: wsconn_put_id(): wsc [0xffff7b4af448] refcnt [2]
DEBUG: websocket [ws_conn.c:425]: wsconn_put_mode(): wsconn_put start for [0xffff7b4af448] refcnt [2]
DEBUG: websocket [ws_conn.c:439]: wsconn_put_mode(): wsconn_put end for [0xffff7b4af448] refcnt [1]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [52]
DEBUG: websocket [ws_conn.c:467]: wsconn_get(): wsconn_get returns wsc [0xffff7b4df8f8] refcnt [2]
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
DEBUG: websocket [ws_conn.c:485]: wsconn_put_id(): wsconn put id [52]
DEBUG: websocket [ws_conn.c:490]: wsconn_put_id(): wsc [0xffff7b4df8f8] refcnt [2]
DEBUG: websocket [ws_conn.c:425]: wsconn_put_mode(): wsconn_put start for [0xffff7b4df8f8] refcnt [2]
DEBUG: websocket [ws_conn.c:439]: wsconn_put_mode(): wsconn_put end for [0xffff7b4df8f8] refcnt [1]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [61]
DEBUG: websocket [ws_conn.c:467]: wsconn_get(): wsconn_get returns wsc [0xffff7b57bfa0] refcnt [2]
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
DEBUG: websocket [ws_conn.c:485]: wsconn_put_id(): wsconn put id [61]
DEBUG: websocket [ws_conn.c:490]: wsconn_put_id(): wsc [0xffff7b57bfa0] refcnt [2]
DEBUG: websocket [ws_conn.c:425]: wsconn_put_mode(): wsconn_put start for [0xffff7b57bfa0] refcnt [2]
DEBUG: websocket [ws_conn.c:439]: wsconn_put_mode(): wsconn_put end for [0xffff7b57bfa0] refcnt [1]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [70]
DEBUG: websocket [ws_conn.c:467]: wsconn_get(): wsconn_get returns wsc [0xffff7b5cc770] refcnt [2]
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
DEBUG: websocket [ws_conn.c:485]: wsconn_put_id(): wsconn put id [70]
DEBUG: websocket [ws_conn.c:490]: wsconn_put_id(): wsc [0xffff7b5cc770] refcnt [2]
DEBUG: websocket [ws_conn.c:425]: wsconn_put_mode(): wsconn_put start for [0xffff7b5cc770] refcnt [2]
DEBUG: websocket [ws_conn.c:439]: wsconn_put_mode(): wsconn_put end for [0xffff7b5cc770] refcnt [1]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [0]
DEBUG: websocket [ws_conn.c:461]: wsconn_get(): wsconn_get for id [76]
DEBUG: websocket [ws_conn.c:467]: wsconn_get(): wsconn_get returns wsc [0xffff7b62d0d0] refcnt [2]
INFO: websocket [ws_frame.c:814]: ws_keepalive(): tcp connection has been lost
```
On the server installed commit 1d03d9e8312e6e9b494f6d243fe9b2b4ea890eaf
### Troubleshooting
I do not know.
For me it looks random.
#### Reproduction
I do not know.
For me it looks random.
#### Debugging Data
not applicable
#### Log Messages
provided above
#### SIP Traffic
not applicable
### Possible Solutions
not known
### Additional Information
* **Kamailio Version**
Used commit 1d03d9e8312e6e9b494f6d243fe9b2b4ea890eaf
* **Operating System**:
```
[root@sbc-stage-a0 kamailio]# cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
```
kernel
```
Linux sbc-stage-a0.nga911.com 4.18.0-365.el8.aarch64 #1 SMP Thu Feb 10 16:12:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3278
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3278(a)github.com>
### 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>