Module: kamailio
Branch: master
Commit: 28224ba2da2cc111239c173bedfcc4a7c295f394
URL: https://github.com/kamailio/kamailio/commit/28224ba2da2cc111239c173bedfcc4a…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-05T15:07:11+02:00
sl: Convert get_ticks() to the somewhat faster get_ticks_raw()
Avoid a multiplication on every call.
---
Modified: modules/sl/sl_funcs.c
Modified: modules/sl/sl_funcs.h
---
Diff: https://github.com/kamailio/kamailio/commit/28224ba2da2cc111239c173bedfcc4a…
Patch: https://github.com/kamailio/kamailio/commit/28224ba2da2cc111239c173bedfcc4a…
---
diff --git a/modules/sl/sl_funcs.c b/modules/sl/sl_funcs.c
index ec5a2ba..ac7701c 100644
--- a/modules/sl/sl_funcs.c
+++ b/modules/sl/sl_funcs.c
@@ -86,7 +86,7 @@ int sl_startup()
LOG(L_ERR,"ERROR:sl_startup: no more free memory!\n");
return -1;
}
- *(sl_timeout)=get_ticks();
+ *(sl_timeout)=get_ticks_raw();
return 1;
}
@@ -182,7 +182,7 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
sl_run_callbacks(SLCB_REPLY_READY, msg, code, reason, &buf, &dst);
- *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME;
+ *(sl_timeout) = get_ticks_raw() + SL_RPL_WAIT_TIME;
/* supress multhoming support when sending a reply back -- that makes sure
that replies will come from where requests came in; good for NATs
@@ -383,7 +383,7 @@ int sl_filter_ACK(struct sip_msg *msg, unsigned int flags, void *bar )
goto pass_it;
/*check the timeout value*/
- if ( *(sl_timeout)<= get_ticks() )
+ if ( *(sl_timeout)<= get_ticks_raw() )
{
DBG("DEBUG : sl_filter_ACK: to late to be a local ACK!\n");
goto pass_it;
diff --git a/modules/sl/sl_funcs.h b/modules/sl/sl_funcs.h
index 4928fc9..077ad93 100644
--- a/modules/sl/sl_funcs.h
+++ b/modules/sl/sl_funcs.h
@@ -24,8 +24,9 @@
#include "../../sr_module.h"
#include "../../parser/msg_parser.h"
+#include "../../timer_ticks.h"
-#define SL_RPL_WAIT_TIME 2 /* in sec */
+#define SL_RPL_WAIT_TIME S_TO_TICKS(2) /* in sec */
#define SL_TOTAG_SEPARATOR '.'
Module: kamailio
Branch: master
Commit: d2f695d63266a5e1762db2e762396e7943687180
URL: https://github.com/kamailio/kamailio/commit/d2f695d63266a5e1762db2e762396e7…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-05T15:07:03+02:00
sl: Reset timeout before sending the message
Fix a common race where the reply would arrive before resetting the timeout.
---
Modified: modules/sl/sl_funcs.c
---
Diff: https://github.com/kamailio/kamailio/commit/d2f695d63266a5e1762db2e762396e7…
Patch: https://github.com/kamailio/kamailio/commit/d2f695d63266a5e1762db2e762396e7…
---
diff --git a/modules/sl/sl_funcs.c b/modules/sl/sl_funcs.c
index a65a7b8..ec5a2ba 100644
--- a/modules/sl/sl_funcs.c
+++ b/modules/sl/sl_funcs.c
@@ -182,6 +182,8 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
sl_run_callbacks(SLCB_REPLY_READY, msg, code, reason, &buf, &dst);
+ *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME;
+
/* supress multhoming support when sending a reply back -- that makes sure
that replies will come from where requests came in; good for NATs
(there is no known use for mhomed for locally generated replies;
@@ -286,8 +288,6 @@ int sl_reply_helper(struct sip_msg *msg, int code, char *reason, str *tag)
if (ret<0) {
goto error;
}
-
- *(sl_timeout) = get_ticks() + SL_RPL_WAIT_TIME;
update_sl_stats(code);
return 1;
Module: kamailio
Branch: master
Commit: 8102ca5f67de979a3597a97f96a05c99d13fb29d
URL: https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-02T12:48:29+02:00
core: Don't bind to IPv6 addresses if auto_bind_ipv6 is disabled
With the following listen statement:
listen=udp:eth0:5060
Kamailio would try to bind to the IPv6 address(es) on that interface and fail with:
ERROR: <core> [udp_server.c:369]: udp_init(): might be caused by using a link local address, try site local or global
---
Modified: socket_info.c
---
Diff: https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
Patch: https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
---
diff --git a/socket_info.c b/socket_info.c
index aa8928a..ee48e11 100644
--- a/socket_info.c
+++ b/socket_info.c
@@ -1406,8 +1406,8 @@ static int fix_socket_list(struct socket_info **list, int* type_flags)
for (si=*list;si;){
next=si->next;
ai_lst=0;
- if (add_interfaces(si->name.s, 0, si->port_no,
- si->proto, &ai_lst)!=-1){
+ if (add_interfaces(si->name.s, auto_bind_ipv6 ? 0 : AF_INET,
+ si->port_no, si->proto, &ai_lst)!=-1){
if (si->flags & SI_IS_MHOMED){
if((new_si=new_sock2list_after(ai_lst->name.s, 0, si->port_no,
si->proto, si->useinfo.name.s,
Module: kamailio
Branch: master
Commit: 72ae9283fa969c13ba1c6d599c2844e1473883f4
URL: https://github.com/kamailio/kamailio/commit/72ae9283fa969c13ba1c6d599c2844e…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-02T12:47:45+02:00
tmx: Try to get branch_index for all replies
Just check if the tm context is set and return its branch_index.
The check for CORE_ONREPLY_ROUTE is flawed as the transaction may have
been set anyway (by t_check_trans() for example).
---
Modified: modules/tmx/t_var.c
---
Diff: https://github.com/kamailio/kamailio/commit/72ae9283fa969c13ba1c6d599c2844e…
Patch: https://github.com/kamailio/kamailio/commit/72ae9283fa969c13ba1c6d599c2844e…
---
diff --git a/modules/tmx/t_var.c b/modules/tmx/t_var.c
index 6e83761..83cd8c6 100644
--- a/modules/tmx/t_var.c
+++ b/modules/tmx/t_var.c
@@ -396,7 +396,7 @@ int pv_get_tm_branch_idx(struct sip_msg *msg, pv_param_t *param,
return -1;
/* statefull replies have the branch_index set */
- if(msg->first_line.type == SIP_REPLY && route_type != CORE_ONREPLY_ROUTE) {
+ if(msg->first_line.type == SIP_REPLY) {
tcx = _tmx_tmb.tm_ctx_get();
if(tcx != NULL)
idx = tcx->branch_index;