diff --git a/src/beacon.c b/src/beacon.c index 3fea714..a10355f 100644 --- a/src/beacon.c +++ b/src/beacon.c @@ -804,7 +804,12 @@ static void beacon_send (int j, dwgps_info_t *gpsinfo) * src > dest [ , via ] */ - strlcpy (beacon_text, mycall, sizeof(beacon_text)); + if (bp->source != NULL) { + strlcpy (beacon_text, bp->source, sizeof(beacon_text)); + } + else { + strlcpy (beacon_text, mycall, sizeof(beacon_text)); + } strlcat (beacon_text, ">", sizeof(beacon_text)); if (bp->dest != NULL) { diff --git a/src/config.c b/src/config.c index 8588a8c..08f71a3 100644 --- a/src/config.c +++ b/src/config.c @@ -5273,6 +5273,8 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_ b->freq = G_UNKNOWN; b->tone = G_UNKNOWN; b->offset = G_UNKNOWN; + b->source = NULL; + b->dest = NULL; while ((t = split(NULL,0)) != NULL) { @@ -5344,6 +5346,17 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_ b->sendto_chan = n; } } + else if (strcasecmp(keyword, "SOURCE") == 0) { + b->source = strdup(value); + for (p = b->source; *p != '\0'; p++) { + if (islower(*p)) { + *p = toupper(*p); /* silently force upper case. */ + } + } + if (strlen(b->source) > 9) { + b->source[9] = '\0'; + } + } else if (strcasecmp(keyword, "DEST") == 0) { b->dest = strdup(value); for (p = b->dest; *p != '\0'; p++) { diff --git a/src/config.h b/src/config.h index 562d307..8a708ae 100644 --- a/src/config.h +++ b/src/config.h @@ -160,6 +160,9 @@ struct misc_config_s { time_t next; /* Unix time to transmit next one. */ + char *source; /* NULL or explicit AX.25 source address to use */ + /* instead of the mycall value for the channel. */ + char *dest; /* NULL or explicit AX.25 destination to use */ /* instead of the software version such as APDW11. */