FreeCalypso > hg > themwi-system-sw
annotate librtpalloc/rtp_alloc_simple.c @ 206:c76f42e0cd3f
osmo-patches/osmo-bts-rtp-bfi.patch: mark as deprecated
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 06 Apr 2023 20:51:30 -0800 |
parents | f8c40090a0a8 |
children |
rev | line source |
---|---|
184
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * The library function implemented in this C module provides a |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * simple interface for obtaining a single RTP endpoint from |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * themwi-rtp-mgr. |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 */ |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <sys/types.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <sys/socket.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <sys/un.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <stdio.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <stdint.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <stdlib.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include <string.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include <strings.h> |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "../include/tmgw_const.h" |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "../include/rtp_alloc.h" |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 #include "rtpmgr_resp.h" |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 #include "rtp_alloc_simple.h" |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 static char ctrl_socket_pathname[] = "/var/gsm/rtp_alloc_socket"; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 static void |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 close_fds(resp) |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 struct rtp_alloc_resp_wrap *resp; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 unsigned n; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 for (n = 0; n < resp->num_fd; n++) |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 close(resp->fd_buf[n]); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 rtp_alloc_simple(ep_type, out) |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 int ep_type; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 struct rtp_alloc_simple *out; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 struct sockaddr_un sa; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 unsigned sa_len; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 int ctrl_fd, rc; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 struct rtp_alloc_req req; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 struct rtp_alloc_resp_wrap resp; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 unsigned expect_num_fd; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 switch (ep_type) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 case TMGW_EP_TYPE_GSM_ONLY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 case TMGW_EP_TYPE_PSTN_ONLY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 expect_num_fd = 2; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 break; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 case TMGW_EP_TYPE_GATEWAY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 expect_num_fd = 4; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 break; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 default: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 fprintf(stderr, |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 "rtp_alloc_simple() error: unknown EP type %d\n", |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 ep_type); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 ctrl_fd = socket(AF_UNIX, SOCK_SEQPACKET, 0); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 if (ctrl_fd < 0) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 perror("socket(AF_UNIX, SOCK_SEQPACKET, 0)"); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 fill_sockaddr_un(ctrl_socket_pathname, &sa, &sa_len); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 rc = connect(ctrl_fd, (struct sockaddr *) &sa, sa_len); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 if (rc < 0) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 perror(ctrl_socket_pathname); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 close(ctrl_fd); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 bzero(&req, sizeof req); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 req.ep_type = ep_type; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 rc = send(ctrl_fd, &req, sizeof req, 0); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 if (rc < 0) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 perror("send to RTP allocator socket"); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 close(ctrl_fd); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 rc = collect_rtpmgr_resp(ctrl_fd, 0, &resp); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 if (rc < 0) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 perror("recvmsg from RTP allocator socket"); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 close(ctrl_fd); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 close(ctrl_fd); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 if (resp.resp_len != sizeof(struct rtp_alloc_resp)) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 fprintf(stderr, |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 "error: response packet from themwi-rtp-mgr has wrong length (%u bytes)\n", |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 resp.resp_len); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 close_fds(&resp); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 if (resp.resp.res != RTP_ALLOC_OK) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 fprintf(stderr, "themwi-rtp-mgr returned error %u\n", |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 resp.resp.res); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 close_fds(&resp); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 if (resp.num_fd != expect_num_fd) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 fprintf(stderr, |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 "error: themwi-rtp-mgr returned %u descriptors instead of expected %u\n", |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 resp.num_fd, expect_num_fd); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 close_fds(&resp); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 return(-1); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 switch (ep_type) { |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 case TMGW_EP_TYPE_GSM_ONLY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 out->gsm_rtp_fd = resp.fd_buf[0]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 out->gsm_rtcp_fd = resp.fd_buf[1]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 break; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 case TMGW_EP_TYPE_PSTN_ONLY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 out->pstn_rtp_fd = resp.fd_buf[0]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 out->pstn_rtcp_fd = resp.fd_buf[1]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 break; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 case TMGW_EP_TYPE_GATEWAY: |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 out->gsm_rtp_fd = resp.fd_buf[0]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 out->gsm_rtcp_fd = resp.fd_buf[1]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 out->pstn_rtp_fd = resp.fd_buf[2]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 out->pstn_rtcp_fd = resp.fd_buf[3]; |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 } |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 bcopy(&resp.resp.gsm_addr, &out->gsm_addr, |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 sizeof(struct sockaddr_storage)); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 bcopy(&resp.resp.pstn_addr, &out->pstn_addr, |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 sizeof(struct sockaddr_storage)); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 return(0); |
f8c40090a0a8
librtpalloc: new library for talking to themwi-rtp-mgr
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 } |