THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#416 - Setting only dlg_set_property("ka-dst") doesn't work
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=416
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#416 - Setting only dlg_set_property("ka-dst") doesn't work
User who did this - Daniel-Constantin Mierla (miconda)
----------
Thanks, applied to master and 4.1 branches.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=416#comment1385
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 5beb495d47fa16ed94c36e340011c09de50db9c7
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5beb495…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Apr 11 16:18:59 2014 +0200
srdb1: removed extern inline function prototypes
- the .c files are not linked against modules code, thus inline
replacing request cannot be resolved by compilers, the strict ones
(e.g., llvm) throw error
---
lib/srdb1/db_res.c | 12 ++++++------
lib/srdb1/db_res.h | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/srdb1/db_res.c b/lib/srdb1/db_res.c
index 8d2146e..aa4b026 100644
--- a/lib/srdb1/db_res.c
+++ b/lib/srdb1/db_res.c
@@ -41,7 +41,7 @@
/*
* Release memory used by rows
*/
-inline int db_free_rows(db1_res_t* _r)
+int db_free_rows(db1_res_t* _r)
{
int i;
@@ -70,7 +70,7 @@ inline int db_free_rows(db1_res_t* _r)
/*
* Release memory used by columns
*/
-inline int db_free_columns(db1_res_t* _r)
+int db_free_columns(db1_res_t* _r)
{
int col;
@@ -106,7 +106,7 @@ inline int db_free_columns(db1_res_t* _r)
/*
* Create a new result structure and initialize it
*/
-inline db1_res_t* db_new_result(void)
+db1_res_t* db_new_result(void)
{
db1_res_t* r = NULL;
r = (db1_res_t*)pkg_malloc(sizeof(db1_res_t));
@@ -123,7 +123,7 @@ inline db1_res_t* db_new_result(void)
/*
* Release memory used by a result structure
*/
-inline int db_free_result(db1_res_t* _r)
+int db_free_result(db1_res_t* _r)
{
if (!_r)
{
@@ -143,7 +143,7 @@ inline int db_free_result(db1_res_t* _r)
* Allocate storage for column names and type in existing
* result structure.
*/
-inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
+int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
{
RES_NAMES(_r) = (db_key_t*)pkg_malloc(sizeof(db_key_t) * cols);
if (!RES_NAMES(_r)) {
@@ -173,7 +173,7 @@ inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols)
* \param _res result set
* \return zero on success, negative on errors
*/
-inline int db_allocate_rows(db1_res_t* _res)
+int db_allocate_rows(db1_res_t* _res)
{
int len = sizeof(db_row_t) * RES_ROW_N(_res);
RES_ROWS(_res) = (struct db_row*)pkg_malloc(len);
diff --git a/lib/srdb1/db_res.h b/lib/srdb1/db_res.h
index 62fc11c..d802cc3 100644
--- a/lib/srdb1/db_res.h
+++ b/lib/srdb1/db_res.h
@@ -88,7 +88,7 @@ typedef struct db1_res {
* \param _r the result that should be released
* \return zero on success, negative on errors
*/
-extern inline int db_free_rows(db1_res_t* _r);
+int db_free_rows(db1_res_t* _r);
/**
@@ -98,20 +98,20 @@ extern inline int db_free_rows(db1_res_t* _r);
* \param _r the result that should be released
* \return zero on success, negative on errors
*/
-extern inline int db_free_columns(db1_res_t* _r);
+int db_free_columns(db1_res_t* _r);
/**
* Create a new result structure and initialize it.
* \return a pointer to the new result on success, NULL on errors
*/
-extern inline db1_res_t* db_new_result(void);
+db1_res_t* db_new_result(void);
/**
* Release memory used by a result structure.
* \return zero on success, negative on errors
*/
-extern inline int db_free_result(db1_res_t* _r);
+int db_free_result(db1_res_t* _r);
/**
* Allocate storage for column names and type in existing result structure.
@@ -121,7 +121,7 @@ extern inline int db_free_result(db1_res_t* _r);
* \param cols number of columns
* \return zero on success, negative on errors
*/
-extern inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
+int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
/**
@@ -129,6 +129,6 @@ extern inline int db_allocate_columns(db1_res_t* _r, const unsigned int cols);
* \param _res result set
* \return zero on success, negative on errors
*/
-extern inline int db_allocate_rows(db1_res_t* _res);
+int db_allocate_rows(db1_res_t* _res);
#endif /* DB1_RES_H */
Module: sip-router
Branch: master
Commit: 198e123e89c849da39efec1973c25c3c25a2be89
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=198e123…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Apr 10 08:56:13 2014 +0200
tm: avoid tryin to mitigate relaying 487 for local canceling branches when a reply is forced from config
- it can result in deadlock if there is a local retransmission timeout
and the response code is overwritten by admin in failure route with a
t_reply()
- reported by Jason Penton
---
modules/tm/h_table.h | 2 ++
modules/tm/t_cancel.c | 7 ++++++-
modules/tm/timer.c | 1 +
modules/tm/tm.c | 1 +
4 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h
index 5790935..977f3fe 100644
--- a/modules/tm/h_table.h
+++ b/modules/tm/h_table.h
@@ -155,6 +155,7 @@ enum kill_reason { REQ_FWDED=1, REQ_RPLD=2, REQ_RLSD=4, REQ_EXIST=8,
#define F_RB_NH_STRICT 0x200 /* next hop is a strict router */
/* must detect when neither loose nor strict flag is set -> two flags.
* alternatively, 1x flag for strict/loose and 1x for loose|strict set/not */
+#define F_RB_RELAYREPLY 0x400 /* branch under relay reply condition */
/* if canceled or intended to be canceled, return true */
@@ -320,6 +321,7 @@ typedef struct async_state {
#define T_ASYNC_CONTINUE (1<<12) /* Is this transaction in a continuation after being suspended */
#define T_DISABLE_INTERNAL_REPLY (1<<13) /* don't send internal negative reply */
+#define T_ADMIN_REPLY (1<<14) /* t reply sent by admin (e.g., from cfg script) */
/* unsigned short should be enough for a retr. timer: max. 65535 ms =>
* max retr. = 65 s which should be enough and saves us 2*2 bytes */
diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c
index 1b39648..c670041 100644
--- a/modules/tm/t_cancel.c
+++ b/modules/tm/t_cancel.c
@@ -245,7 +245,12 @@ int cancel_branch( struct cell *t, int branch,
/* remove BUSY_BUFFER -- mark cancel buffer as not used */
pcbuf=&crb->buffer; /* workaround for type punning warnings */
atomic_set_long(pcbuf, 0);
- if (flags & F_CANCEL_B_FAKE_REPLY){
+ /* try to relay auto-generated 487 canceling response only when
+ * another one is not under relaying on the branch and there is
+ * no forced response per transaction from script */
+ if((flags & F_CANCEL_B_FAKE_REPLY)
+ && !(irb->flags&F_RB_RELAYREPLY)
+ && !(t->flags&T_ADMIN_REPLY)) {
LOCK_REPLIES(t);
if (relay_reply(t, FAKED_REPLY, branch, 487, &tmp_cd, 1) ==
RPS_ERROR){
diff --git a/modules/tm/timer.c b/modules/tm/timer.c
index aae9532..5e340a7 100644
--- a/modules/tm/timer.c
+++ b/modules/tm/timer.c
@@ -345,6 +345,7 @@ static void fake_reply(struct cell *t, int branch, int code )
do_cancel_branch = is_invite(t) && prepare_cancel_branch(t, branch, 0);
/* mark branch as canceled */
t->uac[branch].request.flags|=F_RB_CANCELED;
+ t->uac[branch].request.flags|=F_RB_RELAYREPLY;
if ( is_local(t) ) {
reply_status=local_reply( t, FAKED_REPLY, branch,
code, &cancel_data );
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index 3bdc7fb..61d90ff 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -1319,6 +1319,7 @@ inline static int w_t_reply(struct sip_msg* msg, char* p1, char* p2)
* the safe version would lead to a deadlock
*/
+ t->flags |= T_ADMIN_REPLY;
if (is_route_type(FAILURE_ROUTE)) {
DBG("DEBUG: t_reply_unsafe called from w_t_reply\n");
ret = t_reply_unsafe(t, msg, code, r);