|Binary Internal Interface v2.2|
The Binary Internal Interface is an OpenSIPS core interface which offers an efficient way for communication between individual OpenSIPS instances. This is especially useful in scenarios where realtime data (such as dialogs) cannot be simply stored in a database anymore, because failover would require entire minutes to complete. This issue can be solved with the new internal binary interface by replicating all the events related to the runtime data (creation / updating / deletion) to a backup OpenSIPS instance.
In order to listen for incoming Binary Packets, a bin: interface must be specified. Its number of listener processes can be tuned with tcp_children (default: 8)
listen = bin:10.0.0.150:5062 ... loadmodule "proto_bin.so"
Currently, dialog and usrloc are the first modules to make use of this interface, and they can now replicate all run-time events (creation/updating/deletion of dialogs/contacts) to one or more OpenSIPS instances. Configuration can be done as follows:
modparam("dialog", "accept_replicated_dialogs", 1) modparam("dialog", "replicate_dialogs_to", "184.108.40.206:5062")
The interface allows the module writer to build and send compact Binary Packets in an intuitive way.
In order to send packets, the interface provides the following primitives:
In order to receive packets, a module must first register a callback function to the interface:
Each time this callback is triggered, the information can be retrieved in the same order it was written using: