Browse code

pv: pv_get_method fixed error "pv_get_method(): no CSEQ header"

GH #2761: Error obeserver when sent HTTP reply like

HTTP/1.1 200 OK
Sia: SIP/2.0/TCP 8.8.8.8:39813
Content-Type: application/json
Server: kamailio
Content-Length: 49

{"data":{"status-code":200,"reason-phrase":"OK"}}

Sergey Safarov authored on 03/06/2021 18:03:32
Showing 1 changed files
... ...
@@ -147,6 +147,9 @@ int pv_get_method(struct sip_msg *msg, pv_param_t *param,
147 147
 				(int)msg->first_line.u.request.method_value);
148 148
 	}
149 149
 
150
+	if (IS_HTTP_REPLY(msg))
151
+		return pv_get_null(msg, param, res);
152
+
150 153
 	if(msg->cseq==NULL && ((parse_headers(msg, HDR_CSEQ_F, 0)==-1) ||
151 154
 				(msg->cseq==NULL)))
152 155
 	{