TT#54762 add option to enable automatic active/active switchover

Change-Id: Icddeb28cab72974d9dad0a241775a0763a56b027
pull/1285/head
Richard Fuchs 5 years ago
parent 3ada2ec0c1
commit 5802ff2379

@ -1384,7 +1384,7 @@ static const char *call_offer_answer_ng(struct ng_buffer *ngbuf, bencode_item_t
if (!call)
goto out;
if (IS_FOREIGN_CALL(call))
if (rtpe_config.active_switchover && IS_FOREIGN_CALL(call))
call_make_own_foreign(call, 0);
if (!call->created_from && addr) {

@ -429,6 +429,7 @@ static void options(int *argc, char ***argv) {
{ "redis-connect-timeout", 0, 0, G_OPTION_ARG_INT, &rtpe_config.redis_connect_timeout, "Sets a timeout in milliseconds for redis connections", "INT" },
{ "redis-delete-async", 'y', 0, G_OPTION_ARG_INT, &rtpe_config.redis_delete_async, "Enable asynchronous redis delete", NULL },
{ "redis-delete-async-interval", 'y', 0, G_OPTION_ARG_INT, &rtpe_config.redis_delete_async_interval, "Set asynchronous redis delete interval (seconds)", NULL },
{ "active-switchover", 0,0,G_OPTION_ARG_NONE, &rtpe_config.active_switchover, "Use call activity as indicator of active/standby state", NULL },
{ "b2b-url", 'b', 0, G_OPTION_ARG_STRING, &rtpe_config.b2b_url, "XMLRPC URL of B2B UA" , "STRING" },
{ "log-facility-cdr",0, 0, G_OPTION_ARG_STRING, &log_facility_cdr_s, "Syslog facility to use for logging CDRs", "daemon|local0|...|local7"},
{ "log-facility-rtcp",0, 0, G_OPTION_ARG_STRING, &log_facility_rtcp_s, "Syslog facility to use for logging RTCP", "daemon|local0|...|local7"},

@ -2024,7 +2024,7 @@ static int stream_packet(struct packet_handler_ctx *phc) {
}
#endif
if (IS_FOREIGN_CALL(phc->mp.call))
if (rtpe_config.active_switchover && IS_FOREIGN_CALL(phc->mp.call))
call_make_own_foreign(phc->mp.call, 0);
// this sets rtcp, in_srtp, out_srtp, and sink

@ -413,6 +413,13 @@ The default is 4.
Expire time in seconds for redis keys.
Default is 86400.
=item B<active-switchover>
With this option enabled, any activity (such as signalling or media) on a call
that was created through a Redis keyspace notification will make B<rtpengine>
take control of that call. Without this option, an explicit command is required
for B<rtpengine> to take (or relinquish) control of a call.
=item B<-q>, B<--no-redis-required>
When this parameter is present or B<NO_REDIS_REQUIRED='yes'> or B<'1'> in

@ -76,6 +76,7 @@ struct rtpengine_config {
int redis_delete_async_interval;
char *redis_auth;
char *redis_write_auth;
int active_switchover;
int num_threads;
int media_num_threads;
char *spooldir;

Loading…
Cancel
Save