Documentation

Documentation.Interface-Binary-1-11 History

Hide minor edits - Show changes to markup

March 20, 2014, at 09:01 PM by razvancrainea -
Changed lines 1-2 from:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface

(:title Binary Internal Interface - devel :)

to:
Documentation -> Manuals -> Manual 1.11 -> Binary Internal Interface

(:title Binary Internal Interface - 1.11 :)

Changed line 8 from:
Binary Internal Interface devel
to:
Binary Internal Interface v1.11
November 07, 2013, at 06:09 PM by liviu -
Changed line 31 from:

More details can be found in the dialog or usrloc documentation pages.

to:

More details can be found in the dialog and usrloc documentation pages.

November 07, 2013, at 06:04 PM by liviu -
Changed line 24 from:

Currently, the modules which make use of the interface are the dialog and usrloc modules, which 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:

to:

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:

November 07, 2013, at 06:03 PM by liviu -
Changed lines 24-25 from:

Currently, the only module to make use of the interface is the dialog module, which can now replicate all dialog-related events to one or more OpenSIPS instances. Configuration can be done as follows:

to:

Currently, the modules which make use of the interface are the dialog and usrloc modules, which 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:

Changed line 31 from:

More details can be found in the documentation page of the module.

to:

More details can be found in the dialog or usrloc documentation pages.

November 07, 2013, at 05:59 PM by liviu -
Changed line 17 from:

In order to send or listen for 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, 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)

September 23, 2013, at 05:58 PM by liviu -
Changed line 38 from:

In order to send packets the interface provides the following primitives:

to:

In order to send packets, the interface provides the following primitives:

September 23, 2013, at 05:58 PM by liviu -
Changed line 51 from:

Each time the callback is triggered, the information can be retrieved in the same order it was written using:

to:

Each time this callback is triggered, the information can be retrieved in the same order it was written using:

August 05, 2013, at 05:34 PM by 109.99.235.212 -
Changed line 1 from:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface
to:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface
August 05, 2013, at 03:41 PM by razvancrainea -
Changed lines 1-2 from:
Documentation -> Manuals -> Manual 1.11 -> Binary Internal Interface

(:title Binary Internal Interface - ver 1.11 :)

to:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface

(:title Binary Internal Interface - devel :)

Changed line 8 from:
Binary Internal Interface v1.11
to:
Binary Internal Interface devel
August 05, 2013, at 02:58 PM by razvancrainea -
Changed line 1 from:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface
to:
Documentation -> Manuals -> Manual 1.11 -> Binary Internal Interface
Changed line 31 from:

More details can be found in the documentation page of the module.

to:

More details can be found in the documentation page of the module.

August 05, 2013, at 02:58 PM by razvancrainea -
Changed line 2 from:

(:title Binary Internal Interface - devel :)

to:

(:title Binary Internal Interface - ver 1.11 :)

Changed lines 8-10 from:
Binary Internal Interface devel
Prev
to:
Binary Internal Interface v1.11
Prev
August 05, 2013, at 02:57 PM by razvancrainea -
Added lines 1-53:
Documentation -> Manuals -> Manual devel -> Binary Internal Interface

(:title Binary Internal Interface - devel :)


(:allVersions Interface-Binary 1.11 :)


Binary Internal Interface devel
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 send or listen for 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, the only module to make use of the interface is the dialog module, which can now replicate all dialog-related events 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 documentation page of the module.


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 the 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 March 20, 2014, at 09:01 PM