Hi Mojtaba,
not looked in the code – but it could be related to be able to check with this function for request and replies. Replies will have the method name in their CSEQ.
If you have a requirement that is not available right now in the module, it can be of course extended (e.g. by pull request).
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: sr-users <sr-users-bounces(a)lists.kamailio.org> On Behalf Of Mojtaba
Sent: Friday, June 26, 2020 12:43 PM
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Subject: Re: [SR-Users] Question about textops
Any idea?
On Wed, 24 Jun 2020, 14:26 Mojtaba, <mespio(a)gmail.com<mailto:mespio@gmail.com>> wrote:
Hello,
Some confusing things while developing in Kamailio:
In is_method_f function in textops module, the code checks the HDR_CSEQ_F in msg also, and if the method name appears in CSEQ_F, The result is returned TRUE.
These question will arise why in this function, the CSEQ field in message will check?
if(parse_headers(msg, HDR_CSEQ_F, 0)!=0 || msg->cseq==NULL)
{
LM_ERR("cannot parse cseq header\n");
return -1; /* should it be 0 ?!?! */
}
if(m->s==0)
return (get_cseq(msg)->method_id&m->len)?1:-1;
else
return (get_cseq(msg)->method_id==METHOD_OTHER
&& get_cseq(msg)->method.len==m->len
&& (strncasecmp(get_cseq(msg)->method.s, m->s,
m->len)==0))?1:-1;
I think it would be nice to add new function like: is_cseq_method_f in module to avoid some problem understanding.
--
--Mojtaba Esfandiari.S
Managing the config value as a string (`char*`) doesn't change the string size, so the value is cut off to the default value size (26 chars).
<!-- 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
- [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
- [ ] 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/2372
-- Commit Summary --
* keepalive: manage the `ping_from` config value as str.
-- File Changes --
M src/modules/keepalive/keepalive_mod.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2372.patchhttps://github.com/kamailio/kamailio/pull/2372.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/2372
### Description
Kamailio is crashing every 2-3 calls with this sample config. I dont mind paying for a paid support. Please help :)
Ive used asterisk server to generate calls like
```
for i in `seq 1 4`;do asterisk -rx'originate Local/1@test application MusicOnHold';done
extensions.conf:
[test]
exten => 1,1,Set(CALLERID(all)=12345)
same=n,Dial(SIP/q_1_Test_Queue@1.1.1.1:5060)
request_route {
# MOH queue?
if ($rU=~"c_" || $rU=~"q_") {
if (mohq_process ()) {
if (is_method("INVITE")) {
route(ACCSTART);
xlog("L_INFO", "QUEUE JOIN: $ci $rm from $fu to $rU/$ruri (IP:$si:$sp)\n");
}
exit;
}
}
}
route[ACCPREPARE] {
$var(callid) = "$ci";
$var(referCallid) = "";
$var(did) = "$rU";
$var(clid) = "$fU";
}
route[ACCSTART] {
route(ACCPREPARE);
xlog("L_INFO", "ACC START: did $var(did) didid $var(didid) action $var(action)-$var(value) valueid $var(valueid) trunk $si:$sp\n refered-by $(hdr(Referred-By))");
}
```
### Troubleshooting
```
Jun 23 22:33:38 dialer-gw-qa kamailio: INFO: <script>: ACC START: did $rU didid 0 action 0-0 valueid 0 trunk 45.55.203.176:5060#012 refered-by <null>
Jun 23 22:33:38 dialer-gw-qa kamailio: INFO: <script>: QUEUE JOIN: 42c9d48d39329106158a600b6c4b059e@xxxx:5060 INVITE from sip:12345@xxxxx to q_1_Test_Queue/sip:q_1_Test_Queue@xxxxx:5060
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6825ad5 in t_check_msg (p_msg=0x7ffff76941a0, param_branch=0x0) at t_lookup.c:1086
1086 t_lookup.c: No such file or directory.
(gdb)
(gdb)
(gdb) bt
#0 0x00007ffff6825ad5 in t_check_msg (p_msg=0x7ffff76941a0, param_branch=0x0) at t_lookup.c:1086
#1 0x00007ffff6826997 in t_check (p_msg=0x7ffff76941a0, param_branch=0x0) at t_lookup.c:1137
#2 0x00007ffff68d1b94 in t_release (msg=0x7ffff76941a0) at tm.c:1528
#3 0x00007ffff68d1c0b in w_t_release (msg=0x7ffff76941a0, str=0x2 <error: Cannot access memory at address 0x2>, str2=0x7ffff76941a0 "\b") at tm.c:1540
#4 0x00007ffff64ce57f in ack_msg (pmsg=0x7ffff7695d38, pcall=0x7ffff2301050) at mohq_funcs.c:218
#5 0x00007ffff64e9431 in mohq_process (pmsg=0x7ffff7695d38) at mohq_funcs.c:2733
#6 0x0000555555731e23 in do_action (h=0x7fffffffcc90, a=0x7ffff76703b0, msg=0x7ffff7695d38) at core/action.c:1071
#7 0x000055555573fe86 in run_actions (h=0x7fffffffcc90, a=0x7ffff76703b0, msg=0x7ffff7695d38) at core/action.c:1576
#8 0x000055555574058c in run_actions_safe (h=0x7fffffffde80, a=0x7ffff76703b0, msg=0x7ffff7695d38) at core/action.c:1640
#9 0x0000555555593f30 in rval_get_int (h=0x7fffffffde80, msg=0x7ffff7695d38, i=0x7fffffffd000, rv=0x7ffff7670508, cache=0x0) at core/rvalue.c:915
#10 0x0000555555598a80 in rval_expr_eval_int (h=0x7fffffffde80, msg=0x7ffff7695d38, res=0x7fffffffd000, rve=0x7ffff7670500) at core/rvalue.c:1913
#11 0x0000555555731890 in do_action (h=0x7fffffffde80, a=0x7ffff7671ff8, msg=0x7ffff7695d38) at core/action.c:1047
#12 0x000055555573fe86 in run_actions (h=0x7fffffffde80, a=0x7ffff7671ff8, msg=0x7ffff7695d38) at core/action.c:1576
#13 0x0000555555731d8f in do_action (h=0x7fffffffde80, a=0x7ffff7672148, msg=0x7ffff7695d38) at core/action.c:1062
#14 0x000055555573fe86 in run_actions (h=0x7fffffffde80, a=0x7ffff7672148, msg=0x7ffff7695d38) at core/action.c:1576
#15 0x0000555555740698 in run_top_route (a=0x7ffff7672148, msg=0x7ffff7695d38, c=0x0) at core/action.c:1661
#16 0x0000555555747718 in receive_msg (
buf=0x555555a31820 <buf> "ACK sip:q_1_Test_Queue@xxxx:5060 SIP/2.0\r\nVia: SIP/2.0/UDP xxxx:5060;branch=z9hG4bK1415e654\r\nMax-Forwards: 70\r\nFrom: <sip:12345@xxx>;tag=as2aeac8b5\r\nTo: <sip:q_1_Test_Queu"..., len=429, rcv_info=0x7fffffffe270) at core/receive.c:423
#17 0x0000555555613318 in udp_rcv_loop () at core/udp_server.c:554
#18 0x00005555555857a5 in main_loop () at main.c:1471
#19 0x000055555559043b in main (argc=2, argv=0x7fffffffebb8) at main.c:2802
(gdb)
```
#### SIP Traffic
there is nothing special in the SIP dialog. everything looks correct.
### Possible Solutions
no solution yet.
### Additional Information
````
Happens with all versions of kamailio 5.2.1,5.3.1-5.3.5
version: kamailio 5.3.5 (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_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: unknown
compiled with gcc 8.3.0
```
* **Operating System**:
debian 10 latest updates
```
--
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/2370