Browse code

ims_icscf: Comply with RFC3261: If no contact-header is present, this is not an error, the UA is just fetching bindings. See: http://tools.ietf.org/html/rfc3261#section-10.2.3

Carsten Bock authored on 18/12/2014 10:35:28
Showing 1 changed files
... ...
@@ -127,22 +127,20 @@ int I_perform_user_authorization_request(struct sip_msg* msg, char* route, char*
127 127
     b = cscf_parse_contacts(msg);
128 128
 
129 129
     if (!b || (!b->contacts && !b->star)) {
130
-        LM_DBG("DBG:I_UAR: No contacts found\n");
131
-        return CSCF_RETURN_ERROR;
132
-    }
133
-
134
-    for (c = b->contacts; c; c = c->next) {
135
-
136
-        sos_reg = cscf_get_sos_uri_param(c->uri);
137
-        if (sos_reg == -1) {
138
-            //error case
139
-            LM_ERR("ERR:I_UAR: MSG_400_MALFORMED_CONTACT, responding with 400\n");
140
-            cscf_reply_transactional(msg, 400, MSG_400_MALFORMED_CONTACT);
141
-            return CSCF_RETURN_BREAK;
142
-        } else if (sos_reg == -2) {
143
-            LM_ERR("ERR:I_UAR: MSG_500_SERVER_ERROR_OUT_OF_MEMORY, responding with 500\n");
144
-            cscf_reply_transactional(msg, 500, MSG_500_SERVER_ERROR_OUT_OF_MEMORY);
145
-            return CSCF_RETURN_BREAK;
130
+        LM_DBG("DBG:I_UAR: No contacts found - just fetching bindings\n");
131
+    } else {
132
+        for (c = b->contacts; c; c = c->next) {
133
+            sos_reg = cscf_get_sos_uri_param(c->uri);
134
+            if (sos_reg == -1) {
135
+                //error case
136
+                LM_ERR("ERR:I_UAR: MSG_400_MALFORMED_CONTACT, responding with 400\n");
137
+                cscf_reply_transactional(msg, 400, MSG_400_MALFORMED_CONTACT);
138
+                return CSCF_RETURN_BREAK;
139
+            } else if (sos_reg == -2) {
140
+                LM_ERR("ERR:I_UAR: MSG_500_SERVER_ERROR_OUT_OF_MEMORY, responding with 500\n");
141
+                cscf_reply_transactional(msg, 500, MSG_500_SERVER_ERROR_OUT_OF_MEMORY);
142
+                return CSCF_RETURN_BREAK;
143
+            }
146 144
         }
147 145
     }
148 146