Alright, the new pull request is done: https://github.com/kamailio/kamailio/pull/3611
I have tested locally with all possible combinations (I hope). Yes, it's a bit complicated... having just a timeout in ms would have been much simpler. But I wanted to avoid breaking existing configurations.
Anyway... let me know what you prefer to do!