annotate mgw/udpsink.c @ 152:7176dc850d7a

sip-in hold/retr error handling: simply send BYE Because we know that the SIP state is CONNECTED at the time of any such error event, we can call initiate_bye() instead of disconnect_sip(), and thereby get rid of struct gsm_mncc_cause which will never be used in this scenario anyway.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Oct 2022 16:11:21 -0800
parents b3f74df7b808
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * There are times when we hold open some UDP sockets, but can't do
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * anything with incoming packets other than discard them. This
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * situation holds for dummy one-sided endpoints, for gateway
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * endpoints that haven't been fully connected yet, and for all RTCP
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * packets at the moment.
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * In this module we implement the generic UDP "black hole" sink.
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 */
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include <sys/types.h>
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include <sys/socket.h>
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #include <netinet/in.h>
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 #include <stdio.h>
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #include <stdlib.h>
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 void
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 udp_sink_rcvr(fd)
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 {
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 u_char buf[512];
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 recv(fd, buf, sizeof buf, 0);
b3f74df7b808 beginning of themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 }