Browse Source

restore RTP port exclusion

pull/163/head
Richard Fuchs 11 years ago
parent
commit
d6dbc571cf
4 changed files with 18 additions and 6 deletions
  1. +0
    -3
      daemon/call.h
  2. +3
    -3
      daemon/main.c
  3. +14
    -0
      daemon/media_socket.c
  4. +1
    -0
      daemon/media_socket.h

+ 0
- 3
daemon/call.h View File

@ -517,9 +517,6 @@ INLINE str *call_str_init_dup(struct call *c, char *s) {
str_init(&t, s);
return call_str_dup(c, &t);
}
INLINE void callmaster_exclude_port(struct callmaster *m, u_int16_t p) {
//bit_array_set(m->ports_used, p); /* XXX fix */
}
INLINE struct packet_stream *packet_stream_sink(struct packet_stream *ps) {
struct packet_stream *ret;
ret = ps->rtp_sink;


+ 3
- 3
daemon/main.c View File

@ -583,7 +583,7 @@ no_kernel:
cu = NULL;
if (udp_listen_ep.port) {
// callmaster_exclude_port(ctx->m, udp_listenport); /* XXX fix */
interfaces_exclude_port(udp_listen_ep.port);
cu = control_udp_new(ctx->p, &udp_listen_ep, ctx->m);
if (!cu)
die("Failed to open UDP control connection port");
@ -591,7 +591,7 @@ no_kernel:
cn = NULL;
if (ng_listen_ep.port) {
// callmaster_exclude_port(ctx->m, ng_listenport); /* XXX fix */
interfaces_exclude_port(ng_listen_ep.port);
cn = control_ng_new(ctx->p, &ng_listen_ep, ctx->m);
if (!cn)
die("Failed to open UDP control connection port");
@ -599,7 +599,7 @@ no_kernel:
cl = NULL;
if (tcp_listen_ep.port) {
// callmaster_exclude_port(ctx->m, cli_listenport); /* XXX fix */
interfaces_exclude_port(cli_listen_ep.port);
cl = cli_new(ctx->p, &cli_listen_ep, ctx->m);
if (!cl)
die("Failed to open UDP CLI connection port");


+ 14
- 0
daemon/media_socket.c View File

@ -337,6 +337,20 @@ void interfaces_init(GQueue *interfaces) {
}
}
void interfaces_exclude_port(unsigned int port) {
GList *vals, *l;
struct intf_spec *spec;
vals = g_hash_table_get_values(__intf_spec_addr_type_hash);
for (l = vals; l; l = l->next) {
spec = l->data;
bit_array_set(spec->port_pool.ports_used, port);
}
g_list_free(vals);
}
struct local_intf *get_interface_address(const struct logical_intf *lif, sockfamily_t *fam) {
const GQueue *q;


+ 1
- 0
daemon/media_socket.h View File

@ -70,6 +70,7 @@ void interfaces_init(GQueue *interfaces);
struct logical_intf *get_logical_interface(const str *name, sockfamily_t *fam);
struct local_intf *get_interface_address(const struct logical_intf *lif, sockfamily_t *fam);
struct local_intf *get_any_interface_address(const struct logical_intf *lif, sockfamily_t *fam);
void interfaces_exclude_port(unsigned int port);
//int get_port(socket_t *r, unsigned int port, const struct local_intf *lif, const struct call *c);
//void release_port(socket_t *r, const struct local_intf *);


Loading…
Cancel
Save