Browse Source

MT#5393 Properly set dir flags for v4/v6 handling.

git.mgm/mediaproxy-ng/2.2
Andreas Granig 12 years ago
parent
commit
634b645b4e
2 changed files with 16 additions and 8 deletions
  1. +13
    -8
      daemon/call.c
  2. +3
    -0
      daemon/sdp.c

+ 13
- 8
daemon/call.c View File

@ -122,9 +122,6 @@ static void unkernelize(struct peer *);
static void relays_cache_port_used(struct relays_cache *c);
static void ng_call_stats(struct call *call, const str *fromtag, const str *totag, bencode_item_t *output);
static void stream_closed(int fd, void *p, uintptr_t u) {
struct callstream *cs = p;
struct streamrelay *r;
@ -1027,11 +1024,14 @@ static int setup_peer(struct peer *p, struct stream_input *s, const str *tag) {
switch (s->direction[i]) {
case DIR_INTERNAL:
cs->peers[i ^ p->idx].desired_family = AF_INET;
mylog(LOG_DEBUG, "dir %d/%d/%d is internal, use AF_INET", i, p->idx, i ^ p->idx);
break;
case DIR_EXTERNAL:
cs->peers[i ^ p->idx].desired_family = AF_INET6;
mylog(LOG_DEBUG, "dir %d/%d/%d is external, use AF_INET6", i, p->idx, i ^ p->idx);
break;
default:
mylog(LOG_DEBUG, "dir %d unknown (%d)", i, s->direction[i]);
break;
}
}
@ -2274,13 +2274,18 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, GQueue *streams, ben
}
/* XXX convert to a "desired-family" kinda thing instead */
diridx = 0;
if ((list = bencode_dictionary_get_expect(input, "direction", BENCODE_LIST))) {
diridx = 0;
for (it = list->child; it && diridx < 2; it = it->sibling) {
if (!bencode_strcmp(it, "internal"))
dirs[diridx++] = DIR_INTERNAL;
else if (!bencode_strcmp(it, "external"))
dirs[diridx++] = DIR_EXTERNAL;
if (!bencode_strcmp(it, "internal")) {
dirs[diridx] = DIR_INTERNAL;
out->desired_family[diridx] = DIR_INTERNAL;
}
else if (!bencode_strcmp(it, "external")) {
dirs[diridx] = DIR_EXTERNAL;
out->desired_family[diridx] = DIR_EXTERNAL;
}
++diridx;
}
for (gl = streams->head; gl; gl = gl->next) {


+ 3
- 0
daemon/sdp.c View File

@ -547,6 +547,9 @@ static int fill_stream(struct stream_input *si, struct sdp_media *media, int off
/* we ignore the media type */
si->stream.port = (media->port_num + (offset * 2)) & 0xffff;
si->direction[0] = flags->desired_family[0];
si->direction[1] = flags->desired_family[1];
return 0;
}


Loading…
Cancel
Save