Major refactoring of sip messaging