From 50017c0284498fd9b518208bf3b210a3f80434f6 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Fri, 10 Jun 2011 15:26:11 +0200 Subject: [PATCH] db_reg_agent: adds optional outbound_proxy --- apps/db_reg_agent/DBRegAgent.cpp | 7 +++++-- apps/db_reg_agent/DBRegAgent.h | 2 ++ apps/db_reg_agent/etc/db_reg_agent.conf | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index 71c486a2..c18df617 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -50,6 +50,7 @@ bool DBRegAgent::delete_removed_registrations = true; bool DBRegAgent::save_contacts = true; bool DBRegAgent::db_read_contact = false; string DBRegAgent::contact_hostport; +string DBRegAgent::outbound_proxy; bool DBRegAgent::save_auth_replies = false; unsigned int DBRegAgent::error_retry_interval = 300; @@ -143,6 +144,8 @@ int DBRegAgent::onLoad() contact_hostport = cfg.getParameter("contact_hostport"); + outbound_proxy = cfg.getParameter("outbound_proxy"); + error_retry_interval = cfg.getParameterInt("error_retry_interval", 300); if (!error_retry_interval) { WARN("disabled retry on errors!\n"); @@ -368,7 +371,7 @@ void DBRegAgent::createRegistration(long subscriber_id, user, // name user, // auth_user pass, - "", // proxy + outbound_proxy, // proxy contact_uri // contact ); @@ -447,7 +450,7 @@ void DBRegAgent::updateRegistration(long subscriber_id, user, // name user, // auth_user pass, - "", // proxy + outbound_proxy, // proxy contact)); // contact registrations_mut.unlock(); } diff --git a/apps/db_reg_agent/DBRegAgent.h b/apps/db_reg_agent/DBRegAgent.h index 8fec10f1..cc406021 100644 --- a/apps/db_reg_agent/DBRegAgent.h +++ b/apps/db_reg_agent/DBRegAgent.h @@ -134,6 +134,8 @@ class DBRegAgent static string contact_hostport; + static string outbound_proxy; + static bool save_auth_replies; static unsigned int error_retry_interval; diff --git a/apps/db_reg_agent/etc/db_reg_agent.conf b/apps/db_reg_agent/etc/db_reg_agent.conf index 7f43a598..76bda8bb 100644 --- a/apps/db_reg_agent/etc/db_reg_agent.conf +++ b/apps/db_reg_agent/etc/db_reg_agent.conf @@ -18,6 +18,11 @@ joined_query="select subscribers.subscriber_id as subscriber_id, subscribers.use #example with contact: # joined_query="select subscribers.subscriber_id as subscriber_id, subscribers.user as user, subscribers.pass as pass, subscribers.realm as realm, subscribers.contact as contact, registrations.registration_status as registration_status, registrations.expiry as expiry, registrations.last_registration as last_registration from subscribers left join registrations on subscribers.subscriber_id=registrations.subscriber_id;" +# outbound_proxy= +# set the outbound proxy to send registrations through +# +#outbound_proxy=sip:10.0.0.2:5070 + # contact_hostport= - overriding contact host:port # sets the contact host:port portion that is registered # default: empty