sip: media-pipeline: Remove lport-rtp and lport-rtcp property

We're not setting the desired ports from the outside anymore, but rather
querying the ports that have been allocated by the operating system.

Therefore the lport-rtp and lport-rtcp property have become superfluous and are
being removed. We also adapt to changes outside of the pipeline code.
This commit is contained in:
Evangelos Ribeiro Tzaras
2022-02-28 11:38:06 +01:00
parent aeebdfbf53
commit 849f298609
9 changed files with 39 additions and 97 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Purism SPC
* Copyright (C) 2021-2022 Purism SPC
*
* This file is part of Calls.
*
@@ -61,17 +61,3 @@ protocol_is_valid (const char *protocol)
g_strcmp0 (protocol, "TCP") == 0 ||
g_strcmp0 (protocol, "TLS") == 0;
}
#define RTP_PORT_MIN 20000
#define RTP_PORT_MAX 65534
guint
get_port_for_rtp (void)
{
const guint rand_range = RTP_PORT_MAX - RTP_PORT_MIN;
guint rand = (g_random_int () % rand_range) + RTP_PORT_MIN;
/* RTP ports must be even */
return rand % 2 == 0 ? rand : rand + 1;
}
#undef RTP_PORT_MIN
#undef RTP_PORT_MAX