Skip to content

Commit

Permalink
rtpengine: do not use replace bson for delete
Browse files Browse the repository at this point in the history
Prevent the module for using replace-* attributes for any other
operation than offer or answer. This allows you to use the
rtpengine_manage() function easier.

Reported by Edwin Hoff

(cherry picked from commit d67fbb9)
  • Loading branch information
razvancrainea committed Nov 9, 2017
1 parent 3bc8378 commit 1084952
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions modules/rtpengine/rtpengine.c
Expand Up @@ -1149,9 +1149,12 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
break;

case 14:
if (str_eq(&key, "replace-origin"))
bencode_list_add_string(ng_flags->replace, "origin");
else if (str_eq(&key, "address-family")) {
if (str_eq(&key, "replace-origin")) {
if (!ng_flags->replace)
LM_DBG("%.*s not supported for %d op\n", key.len, key.s, *op);
else
bencode_list_add_string(ng_flags->replace, "origin");
} else if (str_eq(&key, "address-family")) {
err = "missing value";
if (!val.s)
goto error;
Expand Down Expand Up @@ -1193,9 +1196,12 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu
break;

case 26:
if (str_eq(&key, "replace-session-connection"))
bencode_list_add_string(ng_flags->replace, "session-connection");
else
if (str_eq(&key, "replace-session-connection")) {
if (!ng_flags->replace)
LM_DBG("%.*s not supported for %d op\n", key.len, key.s, *op);
else
bencode_list_add_string(ng_flags->replace, "session-connection");
} else
goto error;
break;

Expand Down

0 comments on commit 1084952

Please sign in to comment.