Browse code

b/f: uac_auth: fix b06f2b1080: use SIP_FLAGS_NOCONTACT if Contact-hf present

Stefan Sayer authored on 19/08/2014 10:49:26
Showing 1 changed files
... ...
@@ -226,10 +226,16 @@ bool UACAuth::onSipReply(const AmSipRequest& req, const AmSipReply& reply,
226 226
 
227 227
 	    }
228 228
 
229
+	    int flags = SIP_FLAGS_VERBATIM | SIP_FLAGS_NOAUTH;
230
+	    size_t skip = 0, pos1, pos2, hdr_start;
231
+	    if (findHeader(hdrs, SIP_HDR_CONTACT, skip, pos1, pos2, hdr_start) ||
232
+		findHeader(hdrs, "m", skip, pos1, pos2, hdr_start))
233
+	      flags |= SIP_FLAGS_NOCONTACT;
234
+
229 235
 	    // resend request 
230 236
 	    if (dlg->sendRequest(ri->second.method,
231 237
 				 &(ri->second.body),
232
-				 hdrs, SIP_FLAGS_VERBATIM | SIP_FLAGS_NOAUTH | SIP_FLAGS_NOCONTACT) == 0) {
238
+				 hdrs,  flags) == 0) {
233 239
 	      processed = true;
234 240
               DBG("authenticated request successfully sent.\n");
235 241
 	      // undo SIP dialog status change