<!--
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).
-->
Kamailio 5.3 app_ruby crash with example config,kamailio 5.2 withj same config and ruby not this isue
<!--
I try example app_ruby from app_ruby mod documentation and kamailio crash after call ruby method.
example ruby script:
cat /var/kamailio/ruby/test.rb
def info(si)
KSR.info("==== from ruby - src ip: #{si} - #{KSR.is_INVITE} - #{KSR::PV.get("$si")}\n")
#KSR.info("==== from ruby - src ip: #{si} - #{KSR.is_INVITE} - #{KSR::PV.sets("$var(tmp)","123456")},#{KSR::PV.get("$si")}\n")
KSR::PV.seti("$var(tmp)",12345)
KSR::SL.sl_send_reply(200, "OK-Ruby")
end
kamailio config:
loadmodule "app_ruby.so"
modparam("app_ruby", "load", "/var/kamailio/ruby/test.rb")
....
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
# authentication
route(AUTH);
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE")) {
record_route();
if(!ruby_run("info","$si")) {
xdbg("SCRIPT: failed to execute ruby function!\n");
}
xlog("L_INFO","RUBY -- $var(tmp)");
}
......
-->
### Troubleshooting
#### Reproduction
Install latest ruby from source:
https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Install kamailio 5.3 from git.
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Debugging Data
bt full
info locals
list:
[New LWP 6828]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/local/sbin/kamailio -P /var/run/kamailio/kamailio.pid -f /usr/local/etc/ka'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f2affe9cfbe in rb_current_thread () at vm_core.h:1742
1742 return rb_ec_thread_ptr(ec);
#0 0x00007f2affe9cfbe in rb_current_thread () at vm_core.h:1742
ec = 0x0
ec = <optimized out>
#1 ruby_cleanup (ex=0) at eval.c:178
state = <optimized out>
errs = {8388608, 7192328}
th = <optimized out>
nerr = <optimized out>
sysex = 0
step = 0
#2 0x00007f2b0012dc40 in ruby_sr_destroy () at app_ruby_api.c:219
No locals.
#3 0x00007f2b0014c166 in mod_destroy () at app_ruby_mod.c:122
No locals.
#4 0x00005647515cc367 in destroy_modules () at core/sr_module.c:746
t = 0x7f2b013852f8
foo = 0x7f2b01384488
__func__ = "destroy_modules"
#5 0x0000564751478aef in cleanup (show_status=1) at main.c:555
memlog = 1953722216
__func__ = "cleanup"
#6 0x000056475147a4e3 in shutdown_children (sig=15, show_status=1) at main.c:696
__func__ = "shutdown_children"
#7 0x000056475147d443 in handle_sigs () at main.c:796
chld = 0
chld_status = 134
any_chld_stopped = 1
memlog = -104142504
__func__ = "handle_sigs"
#8 0x0000564751487413 in main_loop () at main.c:1806
i = 8
pid = 6871
si = 0x0
si_desc = "udp receiver child=7 sock=192.168.144.33:5060\000\000\000\000\\3\271\377\177\000\000\243I\206QGV\000\000\000\000\000\004\000\000\000\000\000\000\200\000\000\000\000\000\006\000\000\000\000\000\000\000Lm\275\001+\177\000\000\060\000\000\000\060\000\000\000 X3\271\377\177\000\000PW3\271\377\177\000\000\bN?\001+\177\000"
nrprocs = 8
woneinit = 1
__func__ = "main_loop"
#9 0x000056475148ea71 in main (argc=15, argv=0x7fffb9335ce8) at main.c:2802
cfg_stream = 0x564752519260
c = -1
r = 0
tmp = 0x7fffb93369f0 ""
tmp_len = 32555
port = 29769255
proto = 32555
ahost = 0x0
aport = 0
options = 0x56475180db40 ":f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:x:X:Y:"
ret = -1
seed = 2159776292
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0x0
p = 0x7f2b01b85af5 <handle_intel+197> "H\205\300uf\213t$\004M\215\216\244"
st = {st_dev = 145, st_ino = 18, st_nlink = 2, st_mode = 16832, st_uid = 101, st_gid = 107, __pad0 = 0, st_rdev = 0, st_size = 40, st_blksize = 4096, st_blocks = 0, st_atim = {tv_sec = 1576675424, tv_nsec = 128734310}, st_mtim = {tv_sec = 1576675348, tv_nsec = 136871578}, st_ctim = {tv_sec = 1576675348, tv_nsec = 136871578}, __glibc_reserved = {0, 0, 0}}
tbuf = "0Y3\271\377\177\000\000xX3\271\377\177\000\000\bU\316\001+\177\000\000\006\000\000\000\000\000\000\000\370\177\256\001", '\000' <repeats 16 times>, " \000\000\000\357\265\275\205\000\000\000\000\200M\316\001+\177\000\000\330Y3\271\377\177\000\000 J\316\001+\177\000\000\000\000\000\000\000\000\000\000\070Z\316\001+\177\000\000\217\203\317\001+\177\000\000\005\000\000\000\000\000\000\000\070Z\316\001+\177\000\000\001", '\000' <repeats 15 times>, "\001\000\000\000\000\000\000\000 J\316\001+\177\000\000\207\210\312\001+\177\000\000\000\000\000\000\001\000\000\000\060Y3\271\377\177\000\000@Y3\271\377\177\000\000\200M\316\001+\177\000\000\000\000\000\000\000\000\000\000"...
option_index = 0
long_options = {{name = 0x56475181054a "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x56475180a46c "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x56475181054f "alias", has_arg = 1, flag = 0x0, val = 1024}, {name = 0x564751810555 "subst", has_arg = 1, flag = 0x0, val = 1025}, {name = 0x56475181055b "substdef", has_arg = 1, flag = 0x0, val = 1026}, {name = 0x564751810564 "substdefs", has_arg = 1, flag = 0x0, val = 1027}, {name = 0x56475181056e "server-id", has_arg = 1, flag = 0x0, val = 1028}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
__func__ = "main"
ec = 0x0
ec = <optimized out>
1737
1738 static inline rb_thread_t *
1739 rb_current_thread(void)
1740 {
1741 const rb_execution_context_t *ec = GET_EC();
1742 return rb_ec_thread_ptr(ec);
1743 }
1744
1745 static inline rb_vm_t *
1746 rb_current_vm(void)
<!--
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.
-->
```
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32308]: CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 28
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32276]: ALERT: <core> [main.c:766]: handle_sigs(): child process 32290 exited by a signal 6
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32276]: ALERT: <core> [main.c:769]: handle_sigs(): core was generated
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32276]: INFO: <core> [main.c:792]: handle_sigs(): terminating due to SIGCHLD
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32307]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32303]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32277]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32299]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32302]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32298]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32300]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32295]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32289]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32291]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32304]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32288]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32285]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32286]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32287]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32294]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32283]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32292]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32281]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32278]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32301]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32296]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32280]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32297]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32282]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32279]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32293]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32284]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32305]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32306]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
Dec 18 13:12:33 serZt2 /usr/local/sbin/kamailio[32308]: INFO: <core> [main.c:847]: sig_usr(): signal 15 received
```
#### 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).
-->
```
2019/12/18 13:28:14.572182 81.31.45.41:5060 -> 192.168.144.33:5060
INVITE sip:533533619@192.168.144.33 SIP/2.0
Via: SIP/2.0/UDP 10.10.10.11:5060;rport;branch=z9hG4bKPjMoJzLYnz.bFfyeQgAkPu40nh00yPaZUM
Max-Forwards: 70
From: sip:kovik@192.168.144.33;tag=AETpu82nyfAmiW96ruBDgrcHPm4w5Uc4
To: sip:533533619@192.168.144.33
Contact: <sip:kovik@10.10.10.11:5060;ob>
Call-ID: .kat6b9EbVAbAm8hSTPXG9eU5lME79QG
CSeq: 11527 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: PJSUA v2.9-svn Linux-4.19.0.6/x86_64/glibc-2.28
Proxy-Authorization: Digest username="kovik", realm="192.168.144.33", nonce="Xfoqml36KW5qVYVrbT87WbA0jHDV9rwC", uri="sip:533533619@192.168.144.33", response="ffafbe076bbdd23fa83aeba0b6f16504"
Content-Type: application/sdp
Content-Length: 631
v=0
o=- 3785664489 3785664489 IN IP4 192.168.1.183
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 96 97 98 99 3 0 8 9 120 121 122
c=IN IP4 192.168.1.183
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.1.183
a=sendrecv
a=rtpmap:96 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:98 speex/32000
a=rtpmap:99 iLBC/8000
a=fmtp:99 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:120 telephone-event/16000
a=fmtp:120 0-16
a=rtpmap:121 telephone-event/8000
a=fmtp:121 0-16
a=rtpmap:122 telephone-event/32000
a=fmtp:122 0-16
a=ssrc:639673449 cname:4bdc5ad63943ba5b
```
### 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`
```
version: kamailio 5.3.1 (x86_64/linux) 8d0d4e-dirty
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, 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: 8d0d4e -dirty
compiled on 08:29:21 Dec 18 2019 with gcc 8.3
```
```
ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
```
* **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`)
-->
```
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
uname -a
Linux serZt2 4.15.18-14-pve #1 SMP PVE 4.15.18-38 (Tue, 30 Apr 2019 10:51:33 +0200) 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/2180
- fixed a defect reported from Coverity Scan - Concurrent data access
violations in spi_gen.c for spi_data->spi_val.
- added a new conf param - ipsec_reuse_server_port - reuse or not
PCSCF server port for UA Re-registration.
- added description for the new parameter in ims_ipsec_pcscf_admin.xml.
- in fill_contact() for Request messages set received host, port and
proto fro request uri if alias is presented.
- A new server port is used for Re-registration, depending on the new
parameter ipsec_reuse_server_port.
- in create_ipsec_tunnel() return -1 when unable to convert ip address.
- in ipsec_forward() add supported and require secagree headers only
for Register reply with code 200. Set SND_F_FORCE_SOCKET for
request messages.
<!-- 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/2148
-- Commit Summary --
* ims_ipsec_pcscf: fixed warnings, added a new config param
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (209)
M src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml (22)
M src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c (2)
M src/modules/ims_ipsec_pcscf/spi_gen.c (14)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2148.patchhttps://github.com/kamailio/kamailio/pull/2148.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/2148
- added a new config param - ipsec_reuse_server_port - reuse or not
PCSCF server port for UA Re-registration.
- added description for the new parameter in ims_ipsec_pcscf_admin.xml.
parameter ipsec_reuse_server_port.
- in ipsec_forward() add supported and require secagree headers only
for Register reply with code 200.
- in fill_contact() for Request messages set received host, port and
proto from request uri if alias is presented.
<!-- 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/2164
-- Commit Summary --
* ims_ipsec_pcscf: new config param for ipsec
-- File Changes --
M src/modules/ims_ipsec_pcscf/cmd.c (192)
M src/modules/ims_ipsec_pcscf/doc/ims_ipsec_pcscf_admin.xml (22)
M src/modules/ims_ipsec_pcscf/ims_ipsec_pcscf_mod.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2164.patchhttps://github.com/kamailio/kamailio/pull/2164.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/2164
### Description
Implement a new TM logic to distribute calls to contacts belonging to the same subscriber similar to the weight mechanism that is used in lcr module. This mechanism should support primary/backup, load-sharing or a combination of both.
### Expected behavior
Currently, with the existing serial forking using q-value:
- if the q-values are different, the devices will ring serially but always in the same order
- if the q-values are equals, the devices will ring in parallel
With the new mechanism, instead, I have to be able, for example, to register 2 devices and send:
- the 50% of the call to device 1 and then to device 2 as a backup
- the 50% of the call to device 2 and then to device 1 as a backup
### Possible Solutions
A possible approach is to extend the existing load_contact function and re-use the q-value as a weight.
For example:
- contact 1 has Q value 1
- contact 2 has Q value 0.5
- contact 3 has Q value 0.5
- contact 4 has Q value 0
Then kamailio distributes the calls using the following proportion:
Q : total_Q = call_prob : 100
So:
- contact 1 has probability to ring of 50% (1 * 100 / 2)
- contact 2 has probability to ring of 25% (0.5 * 100 / 2)
- contact 3 has probability to ring of 25% (0.5 * 100 / 2)
- contact 4 has probability to ring of 0 (0 * 100 / 2) but it is used as backup option if all other contacts fail
This should solves the limitations of serial forking and allows to achieve equal or predictable weight-based call termination distribution.
--
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/2167
### Description
When trying to use the pseudovar $dns(xyz=>addr[0]) Kamailio script parser complains there is a syntax error and script won't start. However if a variable with value 0 is used, it works.
There is no reason why one should not access those indexes directly using the value 0.
Piece of code that does not work:
```
if(dns_query("$rd", "ddst")) {
$var(dest_ip) = $dns(ddst=>addr[0]); # We just need first IP
}
```
Piece of code that works:
```
if(dns_query("$rd", "ddst")) {
$var(i) = 0;
$var(dest_ip) = $dns(ddst=>addr[$var(i)]); # We just need first IP
}
```
I tried using the 0 with quotes, but no luck. I had to use a variable to access the index 0.
I have not tried the "type" attribute, maybe same problem can happen with it.
#### Reproduction
Try adding this piece of code to the script:
```
if(dns_query("$rd", "ddst")) {
$var(dest_ip) = $dns(ddst=>addr[0]); # We just need first IP
}
```
This will output this error when running kamailio -c:
```
0(22439) ERROR: ipops [ipops_pv.c:249]: pv_parse_dns_name(): invalid index [ddst=>addr[0]]
0(22439) ERROR: ipops [ipops_pv.c:261]: pv_parse_dns_name(): error at PV dns name: ddst=>addr[0]
0(22439) ERROR: <core> [core/pvapi.c:952]: pv_parse_spec2(): pvar "dns" has an invalid name param [ddst=>addr[0]]
0(22439) ERROR: <core> [core/pvapi.c:1107]: pv_parse_spec2(): wrong char [)/41] in [$dns(ddst=>addr[0])] at [18 (5)]
0(22439) CRITICAL: <core> [core/cfg.y:3508]: yyerror_at(): parse error in config file /etc/kamailio/routing.cfg, line 2398, column 20-38: Can't get from cache: $dns(ddst=>addr[0])
```
### Possible Solutions
Instead of direct index access with integer values, it is necessary to access it with a variable.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
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_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 67f967
compiled on 11:40:41 Mar 11 2019 with gcc 4.8.5
```
--
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/2179
# Description
I want proxy MSRP messages via Kamailio.
To get it working for SIP calls (not WebRTC) need alter SDP `m=message` media connection information:
1. set IP address to Kamailio TLS socket;
1. set port to Kamailio TLS socket.
At preset time I cannot find way to do it.
Could you add function like `msrp_manage` (like `rtpengine_manage`) that update SDP (request and answer) to allow proxy MSRP session via Kamailio socket.
--
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/2186