TT#91151 add a free-form software ID config option

closes #1141

Change-Id: I99bd0d7ecc414e2b4f6e7e3fea72aab5935f8939
pull/1218/head
Richard Fuchs 4 years ago
parent 9d332f9b0f
commit fdac938ecf

@ -476,6 +476,7 @@ static void options(int *argc, char ***argv) {
{ "https-cert", 0,0, G_OPTION_ARG_STRING, &rtpe_config.https_cert,"Certificate for HTTPS and WSS","FILE"},
{ "https-key", 0,0, G_OPTION_ARG_STRING, &rtpe_config.https_key, "Private key for HTTPS and WSS","FILE"},
{ "http-threads", 0,0, G_OPTION_ARG_INT, &rtpe_config.http_threads,"Number of worker threads for HTTP and WS","INT"},
{ "software-id", 0,0, G_OPTION_ARG_STRING, &rtpe_config.software_id,"Identification string of this software presented to external systems","STRING"},
#ifdef WITH_TRANSCODING
{ "dtx-delay", 0,0, G_OPTION_ARG_INT, &rtpe_config.dtx_delay, "Delay in milliseconds to trigger DTX handling","INT"},
{ "max-dtx", 0,0, G_OPTION_ARG_INT, &rtpe_config.max_dtx, "Maximum duration of DTX handling", "INT"},
@ -734,6 +735,10 @@ static void options(int *argc, char ***argv) {
}
rtpe_config.cn_payload.len = len;
}
if (!rtpe_config.software_id)
rtpe_config.software_id = g_strdup_printf("rtpengine-%s", RTPENGINE_VERSION);
g_strcanon(rtpe_config.software_id, "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890-", '-');
}
void fill_initial_rtpe_cfg(struct rtpengine_config* ini_rtpe_cfg) {
@ -859,6 +864,7 @@ static void options_free(void) {
g_strfreev(rtpe_config.https_ifs);
g_free(rtpe_config.https_cert);
g_free(rtpe_config.https_key);
g_free(rtpe_config.software_id);
// free common config options
config_load_free(&rtpe_config.common);

@ -764,6 +764,13 @@ Number of worker threads for HTTP/HTTPS/WS/WSS. If not specified, then the same
number as given under B<num-threads> will be used. If no HTTP listeners are
enabled, then no threads are created.
=item B<--software-id=>I<STRING>
Sets a free-form string that is used to identify this software towards external
systems with, for example in outgoing ICE/STUN requests. Defaults to
B<rtpengine->I<VERSION>. The string is sanitised to replace all
non-alphanumeric characters with a dash to make it universally usable.
=item B<--dtx-delay=>I<INT>
Processing delay in milliseconds to handle discontinuous transmission (DTX) or

@ -307,7 +307,7 @@ static void output_finish_src(struct msghdr *mh) {
static void software(struct msghdr *mh, struct software *sw) {
int i;
i = snprintf(sw->str, sizeof(sw->str), "rtpengine-%s", RTPENGINE_VERSION);
i = snprintf(sw->str, sizeof(sw->str), "%s", rtpe_config.software_id);
output_add_data_len_pad(mh, sw, STUN_SOFTWARE, sw->str, i);
}

@ -114,6 +114,7 @@ struct rtpengine_config {
uint32_t silence_detect_int;
str cn_payload;
int reorder_codecs;
char *software_id;
};

Loading…
Cancel
Save