[sr-dev] git:master:51be5b7a: parser/sdp: distinguish between RFC2543 and RFC3264 media hold type

Ovidiu Sas osas at voipembedded.com
Fri Feb 2 20:23:45 CET 2018


Module: kamailio
Branch: master
Commit: 51be5b7a889e394927cce1009a09e1c2f52123ca
URL: https://github.com/kamailio/kamailio/commit/51be5b7a889e394927cce1009a09e1c2f52123ca

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date: 2018-02-02T14:23:08-05:00

parser/sdp: distinguish between RFC2543 and RFC3264 media hold type

---

Modified: src/core/parser/sdp/sdp.c
Modified: src/core/parser/sdp/sdp.h
Modified: src/core/parser/sdp/sdp_helpr_funcs.c

---

Diff:  https://github.com/kamailio/kamailio/commit/51be5b7a889e394927cce1009a09e1c2f52123ca.diff
Patch: https://github.com/kamailio/kamailio/commit/51be5b7a889e394927cce1009a09e1c2f52123ca.patch

---

diff --git a/src/core/parser/sdp/sdp.c b/src/core/parser/sdp/sdp.c
index e6708d8188..32db4f1949 100644
--- a/src/core/parser/sdp/sdp.c
+++ b/src/core/parser/sdp/sdp.c
@@ -584,11 +584,11 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_
 			if (stream->ip_addr.s && stream->ip_addr.len) {
 				if (stream->ip_addr.len == HOLD_IP_LEN &&
 					strncmp(stream->ip_addr.s, HOLD_IP_STR, HOLD_IP_LEN)==0)
-					stream->is_on_hold = 1;
+					stream->is_on_hold = RFC2543_HOLD;
 			} else if (session->ip_addr.s && session->ip_addr.len) {
 				if (session->ip_addr.len == HOLD_IP_LEN &&
 					strncmp(session->ip_addr.s, HOLD_IP_STR, HOLD_IP_LEN)==0)
-					stream->is_on_hold = 1;
+					stream->is_on_hold = RFC2543_HOLD;
 			}
 		}
 		++stream_num;
diff --git a/src/core/parser/sdp/sdp.h b/src/core/parser/sdp/sdp.h
index 6b24030485..ab32d93d86 100644
--- a/src/core/parser/sdp/sdp.h
+++ b/src/core/parser/sdp/sdp.h
@@ -32,6 +32,10 @@
 
 #include "../msg_parser.h"
 
+#define      NO_HOLD 0
+#define RFC2543_HOLD 1
+#define RFC3264_HOLD 2
+
 typedef struct sdp_payload_attr {
 	struct sdp_payload_attr *next;
 	int payload_num; /**< payload index inside stream */
diff --git a/src/core/parser/sdp/sdp_helpr_funcs.c b/src/core/parser/sdp/sdp_helpr_funcs.c
index 52fe655612..5657cea4a1 100644
--- a/src/core/parser/sdp/sdp_helpr_funcs.c
+++ b/src/core/parser/sdp/sdp_helpr_funcs.c
@@ -386,7 +386,7 @@ int extract_sendrecv_mode(str *body, str *sendrecv_mode, int *is_on_hold)
 		(strncasecmp(cp1, "a=recvonly", 10) == 0))) {
 		if ((strncasecmp(cp1, "a=inactive", 10) == 0) ||
 		    (strncasecmp(cp1, "a=sendonly", 10) == 0) ) {
-			*is_on_hold = 1;
+			*is_on_hold = RFC3264_HOLD;
 		} else {
 			return -1;
 		}




More information about the sr-dev mailing list