So far, the selected codec needs to be a member of the list. Instead,
make this API safe for any instance, member or not, by looking it up.
Remove the lookup from the only caller.
A subsequent patch adds another caller that would have needed a manual
lookup before calling sdp_audio_codecs_select().
Change-Id: Ic1b5ba46c6f4c58e518b080bcb9b5741cb70ccc3
Instead of generating the default codecs list for a RAN for each call,
place a pre-composed list in ran_infra.c.
(1) The main aim is to allow configuring this list -- subsequent commit
Ib5655214ce48c66d095e8f1b7b7106ac3ee43ec0 will add the VTY commands to
modify the predefined lists.
(2) As a free side effect, this also allows configuring the order of
preference for specific codecs.
(3) It may also save us some iterations of the codec_map[], which may
grow a lot more variants; for example, we could add one entry for each
possible AMR mode-set...
Change-Id: If46231a53f7512dbd81790fd30462d65fe059aa3
In ran_msg_iu.c for 3G:
Compose a list of RAB subflows from the AMR codecs present in the codec
list passed in from msc_a. These will hopefully result in the correct
RFCIs configured in the IuUP Initialization that the MGW receives.
Depends: osmo-iuh I61e0e9e75e3239662846fd797532acdefa9f73dc
Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
In ran_msg_a.c for 2G:
Use sdp_audio_codecs_to_speech_codec_list() to get the correct AMR cfg
bits in the outgoing Speech Codec List (MSC Preferred).
The static function to convert from Speech Versions is no longer used,
move its special-case for CSD to the caller location.
With this patch, a BSC now has a chance to select AMR rates matching the
other call leg, dynamically.
Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
These changes will allow dynamically negotiating AMR rates between 2G
and 3G, and between full-rate and half-rate, spanning from 2G and 3G RAN
all the way across to SDP over MNCC / SIP and back.
To ran_msg_assignment, add a full codecs list (sdp_audio_codecs).
So far, there was only the gsm0808_channel_type with a list of
permitted-speech entries, which is not a complete representation.
This patch only adds the list, the two users of this are added in
separate patches:
[2/3] In ran_msg_a.c for 2G:
Before this, we pass a gsm0808_channel_type to ran_msg_assignment, and
from *that* we derive a gsm0808_speech_codec_list -- this loses the AMR
rate config bits. So far, we always transmitted the default cfg bits
defined in gsm0808_speech_codec_defaults, enabling all supported S0-S15
AMR rate combinations. Instead, we'll directly derive the available AMR
rates from the list of SDP codecs resulting from the codecs filter.
[3/3] In ran_msg_iu.c for 3G:
Before this, we compose a fixed set of RAB SDU subflows, i.e. for
exactly and only AMR 12k2. Now, we'll ask for RAB subflows corresponding
to the AMR codec's mode-set fmtp present in the codec list.
Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
An upcoming test needs to model assignment of a specific AMR variant.
Use sdp_codec_from_str(), which adds the ability to add specific AMR
modes to Assignment Complete messages.
Change-Id: I37680b9bef5ff989b1fcb0816eedae09282d9351
It's a minor technicality, but it seems the newly added API to
iterate the codec_mapping can slightly improve this implementation:
For some reason, the Bearer Capabilities should reflect whether any HR
codec is possible with its listed Speech Versions. So far we looked only
whether the first match for a given Speech Version in the global const
codec_mapping is a HR codec. Instead, look through *all* entries for a
Speech Version, and see if any one of them indicates HR.
For example, an AMR-FR codec with a well adjusted mode-set can work with
a half rate channel.
Change-Id: Ic964af4bec21598836748279f3fee480e470738c
Enable fmtp matching in sdp_audio_codecs_by_descr(). This has profound
effects on the codec_filter and other loops that collect codec matches.
By properly matching the meaning of fmtp, msc_vlr_test_call.c now works
as expected: all AMR variants are picked up properly. Adjust
expectations.
Change-Id: I63dc27e76243074ae0f019d219cae4412d322a84
So far the API is pivoting on the payload type numbers as the "primary
key" for codec lists. However, working with variants of codecs, the
payload type numbers are just incidental, and the API isn't helpful.
- change the behavior to regard the subtype name and fmtp as the
defining identity of a codec: use sdp_audio_codec_cmp() to match.
- add argument 'once': flag to make sure a given subtype+fmtp exists
only once, regardless of payload type nr.
- add argument 'pick_unused_pt_nr': flag to make sure a new entry
doesn't duplicate payload type numbers.
This is preparation to properly match AMR variants, in order to fix the
expected error currently visible in msc_vlr_test_call.c:875.
Change-Id: I87db779dbab39dfdef2724488ccdb6959e6731ed
In msc_a_up_call_assignment_complete(), iterate all the new AMR modes
and rates recently added to codec_mapping, and enlist all possible
matches.
Change-Id: I6163a51765efff998e05c9ee4e82a0a3759f2043
These flags are redundant, the aim is to speed up comparisons of AMR
fmtp when traversing a long list of codec variants. It can skip a lot of
repetitive strcmp and fmtp string parsing when used by a loop.
Change-Id: Ic2c9b4983b5374621e02389900e3622faa29cad9