LaunchDarkly integration with OpenSIPS 3.5

The realtime control, via flags or switches, is a critical aspect of any VoIP operation. The ability to manage the features in your system – like to toggle them on or off, to control their behavior – or the ability to manage the user’s permissions (or capabilities), are all falling under the generic title of feature flags.

There are many ways to implement such feature flags with OpenSIPS, like using ACLs, permissions or attributes over various entities. But in complex, highly integrated solutions, the feature flag support transcends the limits of OpenSIPS itself – you need the feature flags support to be used by various services (not only OpenSIPS or not only VoIP) and to be provisioned also by various tools (web interface, APIs, etc). In such cases, the feature flags support becomes a micro-service by itself.

And LauchDarkly is a provider for cloud based feature flags services. And Five9 was interested in using such feature flags in conjunction with OpenSIPS. And thanks to Five9 sponsoring, OpenSIPS 3.5 developed a new module to offer interfacing with the LaunchDarkly feature flags cloud.

The new Launch Darkly module provides connectivity to the Launch Darkly cloud service and also basic primitives to check the feature flags. To do that, the module is using the Launch Darkly C SDK . Please note in the module README the special instructions on how to properly compile the Launch Darkly SDK in order to fit OpenSIPS.

For the cloud connectivity part, the module is designed to be as resilient as possible, meaning it is able to operate also in situation when the cloud is not reachable (network lack of connectivity). The module is still able to start, the checks on the feature flags will return default values and the module will periodically attempt the reconnect.

In terms of feature flags operations, the Launch Darkly SDK offers a truly various set of possibilities. Nevertheless, the OpenSIPS module is implementing for now only the basic check over a feature flag:

$avp(extra) = "domainId=123456";
if (ld_feature_enabled("my-flag","opensips", $avp(extra), false))
xlog("-------TRUE\n");
else
xlog("-------FALSE\n");

Depending on the future usage cases, the module my be easily extended to offer more and more feature flags operations – any suggestions or, even more, any contributions on this, are more than welcome.

Thanks again to Five9 for sponsoring the development of this module. Five9 is also a Gold Sponsor for the OpenSIPS Summit 2024, so do not hesitate to join us and learn all the cool stuff on OpenSIPS 3.5 !

Leave a comment