Browse Source

Redundant media setup: failover due to tout on offer response

Optimise call acquiring; fix reference leak.
pull/253/head
Lucian Balaceanu 10 years ago
parent
commit
448fa9cef8
1 changed files with 17 additions and 8 deletions
  1. +17
    -8
      daemon/call_interfaces.c

+ 17
- 8
daemon/call_interfaces.c View File

@ -680,19 +680,28 @@ static const char *call_offer_answer_ng(bencode_item_t *input, struct callmaster
if (sdp_streams(&parsed, &streams, &flags))
goto out;
/* OP_ANSWER; OP_OFFER && !IS_FOREIGN_CALL */
call = call_get(&callid, m);
/* Failover scenario because of timeout on offer response: siprouter tries
* to establish session with another rtpengine2 even though rtpengine1
* might have persisted part of the session. rtpengine2 deletes previous
* call in memory and recreates an OWN call in redis */
if (opmode == OP_OFFER) {
call = call_get(&callid, m);
if (call && IS_FOREIGN_CALL(call)) {
rwlock_unlock_w(&call->master_lock);
call_destroy(call);
obj_put(call);
}
}
call = call_get_opmode(&callid, m, opmode);
if (call) {
if (IS_FOREIGN_CALL(call)) {
/* destroy call and create new one */
rwlock_unlock_w(&call->master_lock);
call_destroy(call);
obj_put(call);
call = call_get_or_create(&callid, m, CT_OWN_CALL);
}
}
else {
/* call == NULL, should create call */
call = call_get_or_create(&callid, m, CT_OWN_CALL);
}
}
errstr = "Unknown call-id";
if (!call)


Loading…
Cancel
Save