Browse Source

Delete full call if only one branch is left.

git.mgm/mediaproxy-ng/2.0
Andreas Granig 14 years ago
parent
commit
24e2a02f9f
1 changed files with 13 additions and 7 deletions
  1. +13
    -7
      daemon/call.c

+ 13
- 7
daemon/call.c View File

@ -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