diff --git a/CallCapture/CallCapture.cpp b/CallCapture/CallCapture.cpp index 888a63e..c82befa 100644 --- a/CallCapture/CallCapture.cpp +++ b/CallCapture/CallCapture.cpp @@ -9,6 +9,7 @@ #define VECTORS_COUNT 8 #define DEFAULT_USER_NUMBER 1 +#define DEFAULT_LINK_NUMBER 10 int main(int argc, const char* argv[]) { @@ -25,6 +26,7 @@ int main(int argc, const char* argv[]) { "connection", required_argument, NULL, 'c' }, { "identity", required_argument, NULL, 'i' }, { "network", required_argument, NULL, 'n' }, + { "unknown", required_argument, NULL, 'u' }, { "link", required_argument, NULL, 'l' }, { NULL, 0, NULL, 0 } }; @@ -32,13 +34,14 @@ int main(int argc, const char* argv[]) pcre* expression = NULL; const char* file = NULL; uint32_t network = 0; - uint32_t link = 10; + uint32_t unknown = DEFAULT_USER_NUMBER; + uint32_t link = DEFAULT_LINK_NUMBER; int position = 0; const char* error = NULL; int selection = 0; - while ((selection = getopt_long(argc, const_cast(argv), "e:c:n:l:", options, NULL)) != EOF) + while ((selection = getopt_long(argc, const_cast(argv), "e:c:u:n:l:", options, NULL)) != EOF) switch (selection) { case 'e': @@ -53,6 +56,10 @@ int main(int argc, const char* argv[]) openlog(optarg, 0, LOG_USER); break; + case 'u': + unknown = atoi(optarg); + break; + case 'n': network = atoi(optarg); break; @@ -77,6 +84,7 @@ int main(int argc, const char* argv[]) "Usage: %s" " --expression " " --connection " + " [--unknown ]" " --network " " --link " " [--identity ]" @@ -107,7 +115,7 @@ int main(int argc, const char* argv[]) uint32_t number = store.getPrivateIDForCall(call); if (number == 0) - number = DEFAULT_USER_NUMBER; + number = unknown; proxy.setTalkerID(number); syslog(LOG_INFO, "*** Found call-sign: %s (ID: %d)", call, number); diff --git a/SVXLink/echolink/BrandMeisterBridge.cpp b/SVXLink/echolink/BrandMeisterBridge.cpp index 20e04e9..335a873 100644 --- a/SVXLink/echolink/BrandMeisterBridge.cpp +++ b/SVXLink/echolink/BrandMeisterBridge.cpp @@ -18,6 +18,7 @@ BrandMeisterBridge::BrandMeisterBridge() proxy = NULL; store = NULL; talker = NULL; + unknown = ECHOLINK_DEFAULT_USER_NUMBER; } BrandMeisterBridge::~BrandMeisterBridge() @@ -29,6 +30,11 @@ BrandMeisterBridge::~BrandMeisterBridge() // Interface methods for ModuleEchoLink +void BrandMeisterBridge::setDefaultConfiguration(const char* configuration) +{ + unknown = strtol(configuration, NULL, 10); +} + void BrandMeisterBridge::setProxyConfiguration(const char* configuration) { char* pointer = const_cast(configuration); @@ -95,7 +101,7 @@ void BrandMeisterBridge::setTalker(const char* call, const char* name) uint32_t number = store->getPrivateIDForCall(call); if (number == 0) - number = ECHOLINK_DEFAULT_USER_NUMBER; + number = unknown; syslog(LOG_INFO, "Set talker ID to %d for call-sign %s", number, call); proxy->setTalkerID(number); @@ -125,9 +131,8 @@ void BrandMeisterBridge::handleChatMessage(const char* text) } else { - uint32_t number = ECHOLINK_DEFAULT_USER_NUMBER; - syslog(LOG_INFO, "Set talker ID to %d (call-sign was not fit into chat message)", number); - proxy->setTalkerID(number); + syslog(LOG_INFO, "Set talker ID to %d (call-sign was not fit into chat message)", unknown); + proxy->setTalkerID(unknown); } } } diff --git a/SVXLink/echolink/BrandMeisterBridge.h b/SVXLink/echolink/BrandMeisterBridge.h index 2c12442..da9a82d 100644 --- a/SVXLink/echolink/BrandMeisterBridge.h +++ b/SVXLink/echolink/BrandMeisterBridge.h @@ -13,6 +13,7 @@ class BrandMeisterBridge BrandMeisterBridge(); ~BrandMeisterBridge(); + void setDefaultConfiguration(const char* configuration); void setProxyConfiguration(const char* configuration); void setStoreConfiguration(const char* configuration); @@ -25,6 +26,7 @@ class BrandMeisterBridge PatchCordProxy* proxy; UserDataStore* store; char* talker; + int unknown; };