Delete full call if only one branch is left.

git.mgm/mediaproxy-ng/2.0
Andreas Granig 14 years ago
parent 542a171bb4
commit 24e2a02f9f

@ -1445,21 +1445,27 @@ char *call_delete_udp(const char **out, struct callmaster *m) {
goto err;
if(out[RE_UDP_D_VIABRANCH]) {
/* only delete selective branch */
/* search given branch */
while(c) {
next = c->next;
if(g_strcmp0(out[RE_UDP_D_VIABRANCH], c->viabranch) == 0) {
mylog(LOG_INFO, "[%s - %s] Deleting selective call branch",
c->callid, VIA2STR(c->viabranch));
if(c->prev)
c->prev->next = c->next;
call_destroy(c);
if(!c->prev && !c->next) {
mylog(LOG_INFO, "[%s - %s] Deleting full call because there is only one branch",
c->callid, VIA2STR(c->viabranch));
call_destroy_all_branches(c);
} else {
mylog(LOG_INFO, "[%s - %s] Deleting selective call branch",
c->callid, VIA2STR(c->viabranch));
if(c->prev)
c->prev->next = c->next;
call_destroy(c);
}
break;
}
c = next;
}
} else {
mylog(LOG_INFO, "[%s] Deleting all call branches", c->callid);
mylog(LOG_INFO, "[%s] Deleting full call", c->callid);
call_destroy_all_branches(c);
}

Loading…
Cancel
Save