<div dir="ltr"><div><br></div>Hello all,<div><br></div><div>I am testing VoLTE between Kamailio and several smart phones.  The phones requested re-synchronization from time to time.  However, I found the one phone could not re-syn while the other phones could. The main difference is that this phone send "auts" with no "response", and other phone requested re-sync with a "response".  Here is the comparison of two typical Authorization attribute:<br><div><br></div><div>1, no response:</div><div><div>Authorization:</div><div>    Authentication Scheme: Digest</div><div>    Nonce Value: "ruyNeVizArzCYHL7P8RARxEImZpylYAAzrS+UZA9LS4="</div><div>    Username: "<a href="mailto:460000123456005@ims.mnc000.mcc460.3gppnetwork.org">460000123456005@ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Authentication URI: "sip:<a href="http://ims.mnc000.mcc460.3gppnetwork.org">ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Realm: "<a href="http://ims.mnc000.mcc460.3gppnetwork.org">ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Algorithm: AKAv1-MD5,response=""</div><div>    QOP: auth,cnonce="86340c0486340c24"</div><div>    Nonce Count: 00000001,auts="UNjSbCZ9C8A7gHq2ngE="</div><div><br></div><div>2, no response:</div><div>Authorization:</div><div>    Authentication Scheme: Digest</div><div>    Username: "<a href="mailto:460000123456006@ims.mnc000.mcc460.3gppnetwork.org">460000123456006@ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Realm: "<a href="http://ims.mnc000.mcc460.3gppnetwork.org">ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Nonce Value: "XA2hWJsI0H1ElQORsxX9KjaGlvSLNIAAqUhXhX7iIgw="</div><div>    Algorithm: AKAv1-MD5,uri="sip:<a href="http://ims.mnc000.mcc460.3gppnetwork.org">ims.mnc000.mcc460.3gppnetwork.org</a>"</div><div>    Digest Authentication Response: "6ebd7700739d5e6d4f8d3c7009147fa3"</div><div>    QOP: auth,nc=00000001,cnonce="dsf232sun603405704xyx"</div><div>    Authentication Token: "F3k9aD3/Zd7ijAeKiWw="</div></div><div><br></div><div><br></div><div>I think the problem lies in module ims_auth.  On line 784 of kamailio/src/modules/ims_auth/authorize.c:</div><div><br></div><div><div>    if (!get_nonce_response(msg, &username, realm, &nonce, &response16, &qop, &qop_str, &nc, &cnonce, &uri, is_proxy_auth) ||</div><div>            !nonce.len || !response16.len) {</div><div>        LM_DBG("Nonce or response missing: nonce len [%i], response16 len[%i]\n", nonce.len, response16.len);</div><div>        return AUTH_ERROR;</div><div>    }</div></div></div><div><br></div><div>Basically the code skip re-sync request and return auth failure when "response" is empty. So the IMS server doesn't update SQN with UE and it responds 401 challenge with a old SQN. Re-synchronization can never succeed then.</div><div><br></div><div>By deleting the existence cheek of response, re-sync passed on my setup。</div><div><br></div><div><div>    if (!get_nonce_response(msg, &username, realm, &nonce, &response16, &qop, &qop_str, &nc, &cnonce, &uri, is_proxy_auth) ||</div><div>            !nonce.len ) {</div></div><div><br></div><div>I hope I didn't miss anything else and won't cause other problem.</div><div><br></div><div>Regards,</div><div>Wei-Jian Chen</div></div>