Backported patches against 4.0 kamailio version