Documentation

Documentation.Interface-Binary-2-2 History

Show minor edits - Show changes to output

August 04, 2018, at 03:21 PM by liviu -
Changed line 17 from:
In order to listen for incoming Binary Packets, a '''bin:''' interface must be specified. Its number of listener processes can be tuned with ''[[http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children]]'' (default: 8)
to:
In order to listen for incoming Binary Packets, a '''bin:''' interface must be specified. Its number of listener processes can be tuned with ''[[http://www.opensips.org/Documentation/Script-CoreParameters-2-2#toc92|tcp_children]]'' (default: 8)
August 04, 2018, at 03:18 PM by liviu -
Changed lines 17-18 from:
In order to listen for incoming Binary Packets, a ''bin:'' interface must be specified. Its number of listener processes can be tuned with ''[[http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children]]'' (default: 8)
to:
In order to listen for incoming Binary Packets, a '''bin:''' interface must be specified. Its number of listener processes can be tuned with ''[[http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children]]'' (default: 8)
Changed line 20 from:
listen = 10.0.0.150:5062
to:
listen = bin:10.0.0.150:5062
August 04, 2018, at 03:17 PM by liviu -
Changed line 17 from:
In order to listen for incoming Binary Packets, a ''bin:'' interface must be specified. Its number of listener processes can be tuned with ''{{http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children}}'' (default: 8)
to:
In order to listen for incoming Binary Packets, a ''bin:'' interface must be specified. Its number of listener processes can be tuned with ''[[http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children]]'' (default: 8)
August 04, 2018, at 03:17 PM by liviu -
Changed lines 17-18 from:
In order to listen for incoming Binary Packets, an interface must be specified using the ''bin_listen'' global script parameter. The number of listener processes can be tuned with the optional ''bin_children'' (default: 1)
to:
In order to listen for incoming Binary Packets, a ''bin:'' interface must be specified. Its number of listener processes can be tuned with ''{{http://www.opensips.org/Documentation/Script-CoreParameters-3-0#toc65|tcp_children}}'' (default: 8)
Changed lines 20-21 from:
bin_listen = 10.0.0.150:5062
bin_children = 2
to:
listen = 10.0.0.150:5062

...

loadmodule "proto_bin.so"
Changed line 34 from:
More details can be found in the [[http://www.opensips.org/html/docs/modules/1.12.x/dialog.html#id249108 | dialog ]] and [[ http://www.opensips.org/html/docs/modules/1.12.x/usrloc.html#usrloc-replication | usrloc ]] documentation pages.
to:
More details can be found in the [[https://www.opensips.org/html/docs/modules/2.2.x/dialog#idp3487424 | dialog ]] and [[ https://www.opensips.org/html/docs/modules/2.2.x/usrloc#usrloc-replication | usrloc ]] documentation pages.
November 28, 2016, at 11:33 AM by 109.99.227.30 -
Changed line 1 from:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-2-2|Manual devel]] -> Binary Internal Interface
to:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-2-2|Manual 2.2]] -> Binary Internal Interface
April 17, 2014, at 04:20 PM by liviu -
Changed lines 47-48 from:
* int bin_register_cb(char *mod_name, void (*)(int packet_type))
to:
* ''int bin_register_cb(char *mod_name, void (*)(int packet_type))''
Changed lines 52-53 from:
* int bin_pop_str(str *info) - retrieve a string from a received Binary Packet
* int bin_pop_int(void *info) - retrive an integer from a received Binary Packet
to:
* ''int bin_pop_str(str *info)'' - retrieve a string from a received Binary Packet
* ''int bin_pop_int(void *info)'' - retrive an integer from a received Binary Packet
March 20, 2014, at 09:00 PM by razvancrainea -
Added lines 1-53:
!!!!!Documentation -> [[Documentation.Manuals|Manuals]] -> [[Documentation.Manual-2-2|Manual devel]] -> Binary Internal Interface
(:title Binary Internal Interface - 2.2:)
----
(:allVersions Interface-Binary 2.2:)

\\

|| %color=#185662%[+'''Binary Internal Interface v2.2 '''+]%% ||

||[[Interface-CoreStatistics-2-2|Prev]] ||
----

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.
----
!!!! Configuring the Binary Internal Interface listeners

In order to listen for incoming Binary Packets, an interface must be specified using the ''bin_listen'' global script parameter. The number of listener processes can be tuned with the optional ''bin_children'' (default: 1)

[@
bin_listen = 10.0.0.150:5062
bin_children = 2
@]

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", "78.46.64.50:5062")
@]

More details can be found in the [[http://www.opensips.org/html/docs/modules/1.12.x/dialog.html#id249108 | dialog ]] and [[ http://www.opensips.org/html/docs/modules/1.12.x/usrloc.html#usrloc-replication | usrloc ]] documentation pages.

----
!!!! C Interface Overview (for module developers)

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:
* ''int bin_init(str *mod_name, int packet_type)'' - begins the contruction of a new Binary Packet
* ''int bin_push_str(const str *info)'' - add a string to the Binary Packet that is currently being built
* ''int bin_push_int(int info)'' - add an integer to the Binary Packet that is currently being built
* ''int bin_send(union sockaddr_union *dest)'' - sends the Binary Packet to a given destination over UDP

\\

In order to '''receive packets''', a module must first register a callback function to the interface:
* int bin_register_cb(char *mod_name, void (*)(int packet_type))

\\

Each time this callback is triggered, the information can be retrieved in the same order it was written using:
* int bin_pop_str(str *info) - retrieve a string from a received Binary Packet
* int bin_pop_int(void *info) - retrive an integer from a received Binary Packet

Page last modified on August 04, 2018, at 03:21 PM