Skip to content

Commit

Permalink
parser/sdp: distinguish between RFC2543 and RFC3264 media hold type
Browse files Browse the repository at this point in the history
(cherry picked from commit 51be5b7)
  • Loading branch information
ovidiusas authored and miconda committed Feb 22, 2018
1 parent 9d9ae20 commit b99e6f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/parser/sdp/sdp.c
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/core/parser/sdp/sdp.h
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/core/parser/sdp/sdp_helpr_funcs.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit b99e6f3

Please sign in to comment.