Module: kamailio Branch: master Commit: 9451625ff8cc7e02abc2c6cf95572bff9c086d20 URL: https://github.com/kamailio/kamailio/commit/9451625ff8cc7e02abc2c6cf95572bff...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-09-23T12:59:52+02:00
tsilo: ts_append_to() check if transation is active before adding new branches
---
Modified: modules/tsilo/ts_append.c
---
Diff: https://github.com/kamailio/kamailio/commit/9451625ff8cc7e02abc2c6cf95572bff... Patch: https://github.com/kamailio/kamailio/commit/9451625ff8cc7e02abc2c6cf95572bff...
---
diff --git a/modules/tsilo/ts_append.c b/modules/tsilo/ts_append.c index 7c43534..1079632 100644 --- a/modules/tsilo/ts_append.c +++ b/modules/tsilo/ts_append.c @@ -81,6 +81,16 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str * tindex, tlabel); return -1; } + if (t->flags & T_CANCELED) { + LM_DBG("trasaction [%u:%u] was cancelled\n", + tindex, tlabel); + return -2; + } + if (t->uas.status >= 200) { + LM_DBG("trasaction [%u:%u] sent out a final response already - %d\n", + tindex, tlabel, t->uas.status); + return -3; + }
orig_msg = t->uas.request;
@@ -91,7 +101,7 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str * } if(ret != 1) { LM_DBG("transaction %u:%u: error updating dset (%d)\n", tindex, tlabel, ret); - return -1; + return -4; }
return _tmb.t_append_branches();