Skip to content

Commit 68f8f9d

Browse files
committed
rtpengine: fix order of specified interface flags
When both 'external' and 'internal' flags were specified, 'internal' was always assigned as iniface, and 'external' as outiface. This commit makes sure that the order they are specified in is respected.
1 parent 948c439 commit 68f8f9d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

modules/rtpengine/rtpengine.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,10 +1704,17 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg,
17041704
continue;
17051705

17061706
case 8:
1707-
if (str_eq(&key, "internal"))
1708-
iniface = key;
1709-
else if (str_eq(&key, "external"))
1710-
outiface = key;
1707+
if (str_eq(&key, "internal")) {
1708+
if (iniface.s)
1709+
outiface = key;
1710+
else
1711+
iniface = key;
1712+
} else if (str_eq(&key, "external")) {
1713+
if (iniface.s)
1714+
outiface = key;
1715+
else
1716+
iniface = key;
1717+
}
17111718
else if (str_eq(&key, "RTP/AVPF"))
17121719
ng_flags->transport = 0x102;
17131720
else if (str_eq(&key, "RTP/SAVP"))

0 commit comments

Comments
 (0)