Module: kamailio
Branch: 5.3
Commit: be32a0896187b385cb9f708abaf72089e5c35adb
URL:
https://github.com/kamailio/kamailio/commit/be32a0896187b385cb9f708abaf7208…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-05-22T09:10:22+02:00
rtpmanage: enable hadling of PRACK requests
- they can have SDP
- use more compact bitwise match for method types
(cherry picked from commit de77beffb436e783031a6aa71c1887848cb2cc73)
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/be32a0896187b385cb9f708abaf7208…
Patch:
https://github.com/kamailio/kamailio/commit/be32a0896187b385cb9f708abaf7208…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 8f3c28a673..8b72e5b675 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -3603,11 +3603,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)
@@ -3616,7 +3616,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);
@@ -3684,7 +3684,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);