diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 141ca4208..58fc65bb6 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -1644,6 +1644,9 @@ void call_ng_main_flags(sdp_ng_flags *out, str *key, bencode_item_t *value, case CSH_LOOKUP("frequencies"): call_ng_flags_freqs(out, value); break; + case CSH_LOOKUP("from-interface"): + out->direction[0] = s; + break; case CSH_LOOKUP("from-label"): case CSH_LOOKUP("label"): out->label = s; @@ -1916,6 +1919,9 @@ void call_ng_main_flags(sdp_ng_flags *out, str *key, bencode_item_t *value, call_ng_flags_str_list(out, value, ng_t38_option, NULL); break; #endif + case CSH_LOOKUP("to-interface"): + out->direction[1] = s; + break; case CSH_LOOKUP("to-label"): out->to_label = s; break; diff --git a/docs/ng_control_protocol.md b/docs/ng_control_protocol.md index 3623621d5..f0979a612 100644 --- a/docs/ng_control_protocol.md +++ b/docs/ng_control_protocol.md @@ -209,6 +209,12 @@ Optionally included keys are: This special keyword is provided only for legacy support and should be considered obsolete. It will be removed in future versions. + For commands that require only one interface (e.g. `publish`), use the + `interface=...` key. For commands that require two interfaces, as an + alternative to the `direction=` key, the two interfaces can be listed + separately, using `from-interface=...` for the first interface and + `to-interface=...` for the second one. + * `digit` or `code` Sets the replacement digit for `DTMF-security=DTMF`. @@ -311,6 +317,12 @@ Optionally included keys are: Contains one of the strings `off`, `immediate`, `delayed` or `heuristic`. This tells rtpengine which endpoint learning algorithm to use and overrides the `endpoint-learning` configuration option. This option can also be put into the `flags` list using a prefix of `endpoint-learning-`. +* `from-interface` + + Contains a string identifying the network interface pertaining to the + "received from" direction of this message. Identical to setting the first + `direction=` value. + * `frequency` or `frequencies` Sets the tone frequency or frequencies for `DTMF-security=tone` in Hertz. @@ -705,6 +717,12 @@ Optionally included keys are: dictionary. The response dictionary may also contain the optional key `message` with an explanatory string. No other key is required in the response dictionary. +* `to-interface` + + Contains a string identifying the network interface pertaining to the + "going to" direction of this message. Identical to setting the second + `direction=` value. + * `to-label` Commands that allow selection of two call participants (e.g. `block diff --git a/t/auto-daemon-tests-intfs.pl b/t/auto-daemon-tests-intfs.pl index 96e9dfa94..4cd18e643 100644 --- a/t/auto-daemon-tests-intfs.pl +++ b/t/auto-daemon-tests-intfs.pl @@ -97,4 +97,77 @@ SDP +new_call; + +offer('intfs selection alt', { 'from-interface' => 'foo', 'to-interface' => 'bar' }, <