Module: kamailio
Branch: master
Commit: de77beffb436e783031a6aa71c1887848cb2cc73
URL:
https://github.com/kamailio/kamailio/commit/de77beffb436e783031a6aa71c18878…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-05-04T20:05:26+02:00
rtpmanage: enable hadling of PRACK requests
- they can have SDP
- use more compact bitwise match for method types
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/de77beffb436e783031a6aa71c18878…
Patch:
https://github.com/kamailio/kamailio/commit/de77beffb436e783031a6aa71c18878…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index d56e88e003..2d28895324 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3634,11 +3634,11 @@ rtpengine_manage(struct sip_msg *msg, const char *flags)
method = get_cseq(msg)->method_id;
- if (!(method==METHOD_INVITE || method==METHOD_ACK || method==METHOD_CANCEL
- || method==METHOD_BYE || method==METHOD_UPDATE))
+ if (!(method & (METHOD_INVITE|METHOD_ACK|METHOD_CANCEL|METHOD_BYE
+ |METHOD_UPDATE|METHOD_PRACK)))
return -1;
- if (method==METHOD_CANCEL || method==METHOD_BYE)
+ if (method & (METHOD_CANCEL|METHOD_BYE))
return rtpengine_delete(msg, flags);
if (msg->msg_flags & FL_SDP_BODY)
@@ -3647,7 +3647,7 @@ rtpengine_manage(struct sip_msg *msg, const char *flags)
nosdp = parse_sdp(msg);
if (msg->first_line.type == SIP_REQUEST) {
- if(method==METHOD_ACK && nosdp==0)
+ if((method & (METHOD_ACK|METHOD_PRACK)) && nosdp==0)
return rtpengine_offer_answer(msg, flags, OP_ANSWER, 0);
if(method==METHOD_UPDATE && nosdp==0)
return rtpengine_offer_answer(msg, flags, OP_OFFER, 0);
@@ -3715,7 +3715,8 @@ rtpengine_answer1_f(struct sip_msg *msg, char *str1, char *str2)
{
if (msg->first_line.type == SIP_REQUEST)
- if (msg->first_line.u.request.method_value != METHOD_ACK)
+ if (!(msg->first_line.u.request.method_value
+ & (METHOD_ACK | METHOD_PRACK)))
return -1;
return rtpengine_rtpp_set_wrap_fparam(msg, rtpengine_answer_wrap, str1, 2, OP_ANSWER);