@alexyosifov commented on this pull request.
// Update contacts only for initial registration, for re-registration the existing contacts shouldn't be updated.
- if(ci.via_port == SIP_PORT){ + if(ci.via_port == SIP_PORT && req_sec_params == NULL){
**ipsec_create()** should be invoked exactly before 401 reply. From my practice in received REGISTER on 5060 there is always **sec-agree** header and this **if** block will never been TRUE.