diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp
index e340527d97e8c2454855771b8a736bd1cc1d1973..1e57c6f352b30dacc15ae3519e7887362892aa88 100644
--- a/daemon/src/sip/sipvoiplink.cpp
+++ b/daemon/src/sip/sipvoiplink.cpp
@@ -261,8 +261,8 @@ pj_bool_t transaction_request_cb(pjsip_rx_data *rdata)
         addrSdp = addrToUse;
 
     char tmp[PJSIP_MAX_URL_SIZE];
-    int length = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, sip_from_uri, tmp, PJSIP_MAX_URL_SIZE);
-    std::string peerNumber(tmp, length);
+    size_t length = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, sip_from_uri, tmp, PJSIP_MAX_URL_SIZE);
+    std::string peerNumber(tmp, std::min(length, sizeof tmp));
     sip_utils::stripSipUriPrefix(peerNumber);
 
     call->setConnectionState(Call::PROGRESSING);
@@ -545,7 +545,7 @@ void SIPVoIPLink::sendRegister(Account *a)
     if (pjsip_regc_init(regc, &pjSrv, &pjFrom, &pjFrom, 1, &pjContact, account->getRegistrationExpire()) != PJ_SUCCESS)
         throw VoipLinkException("Unable to initialize account registration structure");
 
-    if (!account->getServiceRoute().empty())
+    if (not account->getServiceRoute().empty())
         pjsip_regc_set_route_set(regc, sip_utils::createRouteSet(account->getServiceRoute(), pool_));
 
     pjsip_regc_set_credentials(regc, account->getCredentialCount(), account->getCredInfo());
@@ -1678,6 +1678,7 @@ void registration_cb(pjsip_regc_cbparam *param)
         }
 
     } else {
+        lookForReceivedParameter(param, account);
         if (account->isRegistered())
             account->setRegistrationState(Registered);
         else {