diff --git a/daemon/call.c b/daemon/call.c index d207bf0e4..c18179638 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2797,9 +2797,9 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c for (__auto_type ll = flags->groups_other.head; ll; ll = ll->next) t_queue_push_tail(&ml->groups_other, call_str_dup(ll->data)); - if (t_hash_table_is_set(flags->bundles)) + if (t_hash_table_is_set(flags->bundles) && flags->bundle_accept) ML_SET(ml, BUNDLE); - else + else if (flags->bundle_reject) ML_CLEAR(ml, BUNDLE); ml->sdp_session_uri = call_str_cpy(&flags->session_uri); diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 277edd0c2..72c0e383a 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -853,6 +853,7 @@ static void call_ng_flags_bundle(str *s, unsigned int idx, helper_arg arg) { out->bundle_reject = true; break; case CSH_LOOKUP("require"): + out->bundle_offer = true; out->bundle_require = true; break; default: diff --git a/t/auto-daemon-tests-bundle.pl b/t/auto-daemon-tests-bundle.pl index 184bd277c..3321ff1da 100755 --- a/t/auto-daemon-tests-bundle.pl +++ b/t/auto-daemon-tests-bundle.pl @@ -216,10 +216,12 @@ rcv($sock_b, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800)); # mix up bundle ports snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160)); -rcv($sock_c, $port_a, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160)); +rcv($sock_d, $port_b, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160)); +rcv_no($sock_c); snd($sock_b, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800)); -rcv($sock_d, $port_b, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800)); +rcv($sock_c, $port_a, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800)); +rcv_no($sock_d); @@ -322,11 +324,232 @@ rcv($sock_a, $port_d, rtpm(105, 7000, 9000, 0x8741, "\x22" x 800)); # mix up bundle ports +snd($sock_a, $port_d, rtp(0, 2000, 6000, 0x1234, "\x44" x 160)); +rcv($sock_d, $port_b, rtpm(0, 2000, 6000, 0x1234, "\x44" x 160)); +rcv_no($sock_c); + +snd($sock_a, $port_c, rtp(105, 3000, 4000, 0x6321, "\x33" x 800)); +rcv($sock_c, $port_a, rtpm(105, 3000, 4000, 0x6321, "\x33" x 800)); +rcv_no($sock_d); + + + + +($sock_a, $sock_b, $sock_c, $sock_d) = + new_call([qw(198.51.100.14 6200)], + [qw(198.51.100.14 6202)], + [qw(198.51.100.14 6204)], + [qw(198.51.100.14 6206)]); + +($port_a, undef, $port_b) = offer('optional bundle offer w bundle-accept', + { bundle => ['accept'] }, < ['accept'] }, <