While tracking down a pretty scary SIP issue related to SIP Session Timers, a PBX of a well known vendor doing some strange things in it's replies to in-dialog requests from the opposite site and a bug in OpenSIPS uac_replace_from() function, I've written a short route ripping out SST announcements of SIP INVITE requests.
As I'm pretty sure such thing could be useful to others to, I'd like to publish it here:
route[avoid-sst]
{
if (is_present_hf("Session-Expires"))
{
remove_hf("Session-Expires");
}
if (is_present_hf("Min-SE"))
{
remove_hf("Min-SE");
}
if (is_present_hf("Supported"))
{
if (subst('/^(Supported:.*)timer\s*,(.*)$/\1\2/i'))
{
# Success
} else if (subst('/^(Supported:.*),\s*timer(.*)$/\1\2/i')) {
# Success
} else if (search('^Supported:.*timer.*$')) {
remove_hf("Supported");
} else {
# Nothing to remove
return;
}
xlog("L_INFO", "SST support announcement suppressed");
}
}
That's all for now. For me it temporarily solved this nasty issue, if you should ever need to do something similar, the above code shall help you. It does so in a clean way and shall work in all scenarios - or at least in those I can immagine right now.
Regarding the bug: thanks to Bogdan for fixing it that fast, I'll know on monday whether the fix helped or not.