diff --git a/src/svxlink/svxlink/contrib/SipLogic/README.adoc b/src/svxlink/svxlink/contrib/SipLogic/README.adoc index 8d010910..aa903abf 100644 --- a/src/svxlink/svxlink/contrib/SipLogic/README.adoc +++ b/src/svxlink/svxlink/contrib/SipLogic/README.adoc @@ -5,8 +5,7 @@ Contrib: SipLogic # # SipLogic (beta) # Adi Bier / DL1HRC (dl1hrc [at] gmx.de) -# V0.2.0 - 15.03.2019 -# V0.2.1 - 05.09.2022 +# Version 15112022 # ---- SipLogic.conf is a sample configuration for a SipLogic connected to a Fritzbox diff --git a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.5 b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.5 index d944843f..59a5cff7 100644 --- a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.5 +++ b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.5 @@ -152,6 +152,9 @@ format transmitted must match the configuration (+49 != 0049). Whole SIP numbers as well as parts of phone numbers can be configured, with the evaluation taking place on the left-hand side. Example: PHONENUMBER_TO_TG=0049:262,0034:214,0043:232,0049123454543:991 +.TP +.B USE_TCP +If set, TCP is used as transport layer instead of UDP (default). . .SH FILES . diff --git a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.in b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.in index 57921565..07387cfe 100644 --- a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.in +++ b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.conf.in @@ -27,6 +27,7 @@ EVENT_HANDLER=@SVX_SHARE_INSTALL_DIR@/events.tcl SIP_PREAMP=3 SIP_LIMITER_THRESH=-1.0 PHONENUMBER_TO_TG=0049:262,0034:232,0041:222,017612345678:9999 +#USE_TCP=1 # ToDo, section still not active [Phonenumber_to_Tg] diff --git a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.cpp b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.cpp index 761f6aa9..3d55931e 100644 --- a/src/svxlink/svxlink/contrib/SipLogic/SipLogic.cpp +++ b/src/svxlink/svxlink/contrib/SipLogic/SipLogic.cpp @@ -89,7 +89,7 @@ using namespace pj; * ****************************************************************************/ #define DEFAULT_SIPLIMITER_THRESH -1.0 -#define PJSIP_VERSION "06112022" +#define PJSIP_VERSION "15112022" /**************************************************************************** @@ -552,11 +552,22 @@ bool SipLogic::initialize(Async::Config& cfgobj, const std::string& logic_name) return false; } + // use UDP or TCP? + bool use_tcp = false; + cfg().getValue(name(), "USE_TCP", use_tcp); + // Sip transport layer creation try { TransportConfig tcfg; tcfg.port = m_sip_port; - ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg); + if (use_tcp) + { + ep.transportCreate(PJSIP_TRANSPORT_TCP, tcfg); + } + else + { + ep.transportCreate(PJSIP_TRANSPORT_UDP, tcfg); + } ep.libStart(); } catch (Error& err) { cout << "*** ERROR creating transport layer in " @@ -572,6 +583,10 @@ bool SipLogic::initialize(Async::Config& cfgobj, const std::string& logic_name) acc_cfg.idUri += m_username; acc_cfg.idUri += "@"; acc_cfg.idUri += m_sipserver; + if (use_tcp) + { + acc_cfg.idUri += ";transport=tcp"; + } acc_cfg.idUri += ">"; acc_cfg.regConfig.registrarUri = "sip:"; acc_cfg.regConfig.registrarUri += m_sipregistrar;