Hello,
As you will see I have merged my branch back into master.
These changes add a new event route [tm:branch-failure] to the tm module
which is run when any failure response is received on a transaction.
The event_route uses a new route type BRANCH_ROUTE which limits the
functions that can be run in the route.
The functions t_check_status(), t_next_contact_flow(), t_relay() and
unregister() can be used in this route.
A new pv $T_reply_ruid is accessible in this route which can be used to
unregister a single contact entry.
The following example route can be used on a registrar to handle failed
or invalid flows:
event_route[tm:branch-failure] {
xlog("L_INFO", "event_route[tm:branch-failure]\n");
if (t_check_status("430|403")) {
if (!unregister("location", "$tu", "$T_reply_ruid"))
{
xlog("L_WARN", "failed to unregister $tu with
ruid $T_reply_ruid\n");
}
if (!t_next_contact_flow())
{
xlog("L_INFO", "No more flows\n");
}
else
{
xlog("L_INFO", "Next flow\n");
t_relay();
}
}
}
Any bugs, memory leaks etc. let me know!
Hugh
--
Hugh Waite
Principal Design Engineer
Crocodile RCS Ltd.
```
Jun 6 14:38:43 spce lb[27903]: : tls [tls_init.c:557]: init_tls_h(): ERROR: tls: init_tls_h: installed openssl library version is too different from the library the Kamailio tls module was compiled with: installed "OpenSSL 1.0.1t 3 May 2016" (0x1000114f), compiled "OpenSSL 1.0.1k 8 Jan 2015" (0x100010bf).#012 Please make sure a compatible version is used (tls_force_run in kamailio.cfg will override this check)
Jun 6 14:38:43 spce lb[27903]: CRITICAL: <core> [main.c:2577]: main(): could not initialize tls, exiting...
```
openssl was upgraded from 1.0.1k-3+deb8u5 to 1.0.1t-1+deb8u2
This seems not to work properly
https://github.com/kamailio/kamailio/blob/master/modules/tls/tls_init.c#L54…
```
#if OPENSSL_VERSION_NUMBER < 0x00907000L
WARN("You are using an old version of OpenSSL (< 0.9.7). Upgrade!\n");
#endif
ssl_version=SSLeay();
/* check if version have the same major minor and fix level
* (e.g. 0.9.8a & 0.9.8c are ok, but 0.9.8 and 0.9.9x are not) */
if ((ssl_version>>8)!=(OPENSSL_VERSION_NUMBER>>8)){
LOG(L_CRIT, "ERROR: tls: init_tls_h: installed openssl library "
"version is too different from the library the Kamailio tls module "
"was compiled with: installed \"%s\" (0x%08lx), compiled "
"\"%s\" (0x%08lx).\n"
" Please make sure a compatible version is used"
" (tls_force_run in kamailio.cfg will override this check)\n",
SSLeay_version(SSLEAY_VERSION), ssl_version,
OPENSSL_VERSION_TEXT, (long)OPENSSL_VERSION_NUMBER);
if (cfg_get(tls, tls_cfg, force_run))
LOG(L_WARN, "tls: init_tls_h: tls_force_run turned on, ignoring "
" openssl version mismatch\n");
else
return -1; /* safer to exit */
}
```
---
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/662
We upgraded a system from 4.4.2 to 4.4.3 last week. After that, the uac_auth() function didn't do what it was supposed to do anymore.
This is the failure route in the config file:
```
failure_route[TRUNKAUTH] {
if (t_is_canceled()) {
exit;
}
if ($T_reply_code == 401 or $T_reply_code == 407) {
xlog("L_NOTICE", "[$pr:$si:$sp] [$cs $rm cid: $ci Status: $rs $rr F:$fU T:$tU R:$rU] Remote asked for authentication");
uac_auth();
t_relay();
exit;
}
}
```
In Kamailio 4.4.2 this works perfectly. In 4.4.3 when this code triggers, we get the following messages in our log:
```
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: NOTICE: <script>: [udp:1.2.3.4:5060] [102 INVITE cid: asdasdalsjdalsdaskjdlak Status: <null> <null> F:11111111 T:00491234567890 R:01234567890] Remote asked for authentication
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: ERROR: <core> [msg_translator.c:417]: clen_builder(): no message body found (missing crlf?)
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: ERROR: <core> [msg_translator.c:1963]: build_req_buf_from_sip_req(): Error while adjusting Content-Length
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: ERROR: tm [t_fwd.c:462]: prepare_new_uac(): could not build request
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: ERROR: tm [t_fwd.c:1723]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches
Sep 23 12:25:41 eustatius /usr/sbin/kamailio[13249]: ERROR: tm [tm.c:1415]: _w_t_relay_to(): ERROR: w_t_relay_to: t_relay_to failed
```
After downgrading to 4.4.2, everything works again.
--
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/797
```
Reading symbols from kamailio...Reading symbols from /usr/lib/debug/.build-id/10/824757bd1066806f2e19310929e17a9009a991.debug...done.
done.
[New LWP 5583]
[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/sbin/kamailio -f /etc/kamailio/proxy/kamailio.cfg -P /var/run/kamailio/kam'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 xavp_get_internal (name=0x7f486b2f7568, list=<optimized out>, idx=0, prv=0x0) at xavp.c:265
265 xavp.c: No such file or directory.
(gdb) bt
#0 xavp_get_internal (name=0x7f486b2f7568, list=<optimized out>, idx=0, prv=0x0) at xavp.c:265
#1 0x00007f486306b8b3 in pv_get_xavp (msg=0x7f4866d8e5f0, param=0x7f486b2f7768, res=0x7ffceb21ed90)
at pv_xavp.c:134
#2 0x000000000058f96e in pv_get_spec_value (msg=0x7f4866d8e5f0, sp=0x7f486b2f7750,
value=0x7ffceb21ed90) at pvapi.c:1307
#3 0x00007f479badb45d in lua_sr_pv_get (L=0x2b46aa0) at app_lua_sr.c:906
...
(gdb) f 3
#3 0x00007f479badb45d in lua_sr_pv_get (L=0x2b46aa0) at app_lua_sr.c:906
906 app_lua_sr.c: No such file or directory.
(gdb) p pvn
$5 = {s = 0x2c47588 "$xavp(caller_dom_prefs=>dummy)", len = 30}
(gdb) f 2
#2 0x000000000058f96e in pv_get_spec_value (msg=0x7f4866d8e5f0, sp=0x7f486b2f7750,
value=0x7ffceb21ed90) at pvapi.c:1307
1307 pvapi.c: No such file or directory.
(gdb) p sp
$6 = (pv_spec_p) 0x7f486b2f7750
(gdb) p *sp
$7 = {type = PVT_XAVP, getf = 0x7f486306b810 <pv_get_xavp>, setf = 0x7f486306c640 <pv_set_xavp>,
pvp = {pvn = {type = 1, nfree = 0x0, u = {isname = {type = 1798272592, name = {n = 0, s = {
s = 0x0, len = 0}, re = 0x0}}, dname = 0x7f486b2f7650}}, pvi = {type = 0, u = {
ival = 0, dval = 0x0}}}, trans = 0x0}
(gdb) f 1
#1 0x00007f486306b8b3 in pv_get_xavp (msg=0x7f4866d8e5f0, param=0x7f486b2f7768, res=0x7ffceb21ed90)
at pv_xavp.c:134
134 pv_xavp.c: No such file or directory.
(gdb) p xname
$8 = (pv_xavp_name_t *) 0x7f486b2f7650
(gdb) p *xname
$9 = {name = {s = 0x7f486b2f77b6 "caller_dom_prefs=>dummy)", len = 16}, index = {type = PVT_NONE,
getf = 0x0, setf = 0x0, pvp = {pvn = {type = 0, nfree = 0x0, u = {isname = {type = 0, name = {
n = 0, s = {s = 0x0, len = 0}, re = 0x0}}, dname = 0x0}}, pvi = {type = 0, u = {
ival = 0, dval = 0x0}}}, trans = 0x0}, next = 0x7f486b2f7568}
(gdb) p *xname->next
$10 = {name = {s = 0x7f486b2f77c8 "dummy)", len = 5}, index = {type = PVT_NONE, getf = 0x0,
setf = 0x0, pvp = {pvn = {type = 0, nfree = 0x0, u = {isname = {type = 0, name = {n = 0, s = {
s = 0x0, len = 0}, re = 0x0}}, dname = 0x0}}, pvi = {type = 0, u = {ival = 0,
dval = 0x0}}}, trans = 0x0}, next = 0x0}
(gdb) p avp
$11 = <optimized out>
(gdb) p avp->val
value has been optimized out
(gdb) p avp->val.v
value has been optimized out
(gdb) p avp->val.v.xavp
value has been optimized out
```
Relevant code?
```
static sr_xavp_t *xavp_get_internal(str *name, sr_xavp_t **list, int idx, sr_xavp_t **prv)
{
sr_xavp_t *avp;
unsigned int id;
int n = 0;
if(name==NULL || name->s==NULL)
return NULL;
id = get_hash1_raw(name->s, name->len);
if(list && *list)
avp = *list;
else
avp = *_xavp_list_crt;
while(avp)
{
if(avp->id==id && avp->name.len==name->len
&& strncmp(avp->name.s, name->s, name->len)==0)
{
if(idx==n)
return avp;
n++;
}
if(prv)
*prv = avp;
avp = avp->next;
}
return NULL;
}
```
--
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/808