diff --git a/daemon/call.c b/daemon/call.c index dad3cbb65..9cfdc9842 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2455,6 +2455,8 @@ void __monologue_tag(struct call_monologue *ml, const str *tag) { struct call *call = ml->call; __C_DBG("tagging monologue with '"STR_FORMAT"'", STR_FMT(tag)); + if (ml->tag.s) + g_hash_table_remove(call->tags, &ml->tag); call_str_cpy(call, &ml->tag, tag); g_hash_table_insert(call->tags, &ml->tag, ml); } @@ -2672,7 +2674,7 @@ static struct call_monologue *call_get_dialogue(struct call *call, const str *fr /* the fromtag monologue may be newly created, or half-complete from the totag, or * derived from the viabranch. */ - if (!ft->tag.s) + if (!ft->tag.s || str_cmp_str(&ft->tag, fromtag)) __monologue_tag(ft, fromtag); __monologue_unkernelize(ft->active_dialogue); diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 4776a1237..e8e71d276 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -3693,6 +3693,169 @@ SDP +# media playback after a delete + +($sock_a, $sock_b) = new_call([qw(198.51.100.1 3020)], [qw(198.51.100.3 3022)]); + +offer('media playback after delete', { ICE => 'remove', replace => ['origin'], + 'rtcp-mux' => ['demux'], 'via-branch' => 'xxxx', flags => ['strict-source', 'record-call'], + 'transport-protocol' => 'RTP/AVP' }, < ['origin'], 'transport-protocol' => 'RTP/AVP', + 'rtcp-mux' => ['demux'], 'via-branch' => 'xxxx' }, < $ft }); + +# new to-tag +$tt = $tag_iter++ . "-test-totag"; + +offer('media playback after delete', { ICE => 'remove', replace => ['origin'], + 'transport-protocol' => 'transparent', flags => ['strict-source', 'record-call'], + 'rtcp-mux' => ['demux'], 'via-branch' => 'xxxx' }, < ['origin'], 'transport-protocol' => 'RTP/AVP', + 'rtcp-mux' => ['demux'], 'via-branch' => 'xxxx' }, < $tt, 'to-tag' => $tt, + blob => $wav_file }); +is $resp->{duration}, 100, 'media duration'; + +($seq, $ts, $ssrc) = rcv($sock_b, -1, rtpm(8 | 0x80, -1, -1, -1, $pcma_1)); +rcv($sock_b, -1, rtpm(8, $seq + 1, $ts + 160 * 1, $ssrc, $pcma_2)); +rcv($sock_b, -1, rtpm(8, $seq + 2, $ts + 160 * 2, $ssrc, $pcma_3)); +rcv($sock_b, -1, rtpm(8, $seq + 3, $ts + 160 * 3, $ssrc, $pcma_4)); +rcv($sock_b, -1, rtpm(8, $seq + 4, $ts + 160 * 4, $ssrc, $pcma_5)); + + + END { if ($rtpe_pid) {