From 3191b15c3333f16d6d511a700ff272db94ab2a17 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 2 Sep 2011 20:49:48 +0000 Subject: [PATCH] properly fix the upc/kapsch 3-way call connect issue --- daemon/call.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 9e882a23e..66ebcf92f 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -243,7 +243,7 @@ skip: return -1; } - pe2->used = 1; + pe->used = 1; drop: r->stats.packets++; @@ -735,6 +735,7 @@ static unsigned int call_streams(struct call *c, GQueue *s, const char *tag, int struct callstream *cs; struct peer *p; unsigned int ret; + int no_reuse = 0; q = g_queue_new(); /* new callstreams list */ @@ -761,15 +762,23 @@ static unsigned int call_streams(struct call *c, GQueue *s, const char *tag, int cs = l->data; g_queue_delete_link(c->callstreams, l); p = &cs->peers[1]; + if (cs->peers[0].used) + no_reuse = 1; } + if (no_reuse) + goto skip; + + for (l = c->callstreams->head; l; l = l->next) { cs = l->data; for (x = 0; x < 2; x++) { r = &cs->peers[x].rtps[0]; + /* if (r->up->used) continue; + */ if (r->peer.ip != t->ip) continue; if (r->peer.port != t->port) @@ -782,6 +791,7 @@ static unsigned int call_streams(struct call *c, GQueue *s, const char *tag, int } /* not found */ +skip: setup_peer(p, t, tag); g_queue_push_tail(q, p->up); continue;