Hi Giovanni,
glad that I could help you :)
About your questions:
sip.instance:
I've pushed in a branch (
https://github.com/kamailio/kamailio/tree/grumvalski/ts_append-instance) a change in tm t_append_branches function. Can you give it a try and let me know how it works for you? The change is really trivial, maybe too much. Basically I just add a comparison between the current checked branch uri (already added) and the current uri to add. If after testing everything looks fine we can merge/backport it.
DB backend for tsilo:
it doesn't have too much sense to store the tsilo data on db for several reasons:
1) it cannot be useful for restarting kamailio, because anyway after a restart all transactions are gone
2) it cannot be useful for replication scenarios since tm transaction are not replicable and only the proxy holding the transaction can add branches on it
For replication scenarios I'd suggest another approach. Given that, as said, the transaction is on a specific server and that the ts_append call is triggered by a REGISTER, let the REGISTER itself reach the proxy where the transaction is stored.
If you have only two proxies you can simply t_replicate all the REGISTERS between servers. If you have multiple and/or you want a more sophisticated logic, you could rely on htable and dmq to have a distributed table of ongoing transactions and selectively replicate the REGISTER.
Kamailio is flexible :)
Regards,
Federico