OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.28k stars 580 forks source link

Event-rabbitmq module - Feature request #961

Open achalkov opened 8 years ago

achalkov commented 8 years ago

Currently, event-rabbitmq can use heartbeat, but only by receiving heartbeat-requests, but by the amqp specifications (https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf p.4.2.7), rabbitmq-client also should send heartbeat requests in configured intervals. In case of that, rabbitmq-server with configured heartbeat interval, sometimes drops connection with opensips. To avoid that we should be capable to send amqp-heartbeats too.

razvancrainea commented 8 years ago

You can use the heartbeat parameter to enable heartbeats on the client side. However, note that according to the documentation of the AMQP library we are using, the functionality is limited:

Note rabbitmq-c only has partial support for heartbeats, as of v0.4.0 they are only serviced during amqp_basic_publish() and amqp_simple_wait_frame()/amqp_simple_wait_frame_noblock()

This means that the library only sends heartbeats frames when you actually publish something and wait for an reply.

In order to implement this properly, we probably need to bypass the library and find a workaround to send raw AMQP packets to the server. I will look into this.