FreeCalypso > hg > themwi-system-sw
annotate mtctest/sig_handler.c @ 226:28441920fb35
beginning of number database version 2
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 13 Aug 2023 22:01:25 -0800 |
parents | 55ad0f4bb33c |
children |
rev | line source |
---|---|
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * In this module we handle all incoming messages from MNCC, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * printing all of them and generating protocol-required responses |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * for some. |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 */ |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <sys/types.h> |
159
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
8 #include <sys/time.h> |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <sys/socket.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <stdio.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <stdint.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include <stdlib.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include <string.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include <strings.h> |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 #include "../include/mncc.h" |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 #include "../include/gsm48_const.h" |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 extern int disconnect_mode; |
36
e8e82a4bf12b
themwi-test-mtc: implement dummy RTP via themwi-mgw
Mychaela Falconia <falcon@freecalypso.org>
parents:
21
diff
changeset
|
19 extern struct sockaddr_storage dummy_rtp_endp; |
159
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
20 extern struct timeval cur_event_time; |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 print_bearer_cap(bcap) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 struct gsm_mncc_bearer_cap *bcap; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 int i, sv; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 printf("Bearer cap: itcap=%d tmod=%d coding=%d rrq=%d\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 bcap->transfer, bcap->mode, bcap->coding, bcap->radio); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 printf(" speech: CTM=%d sv", bcap->speech_ctm); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 for (i = 0; i < 8; i++) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 sv = bcap->speech_ver[i]; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 if (sv < 0) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 break; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 printf(" %d", sv); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 printf(" data: ra=%d sig=%d async=%d nstop=%d ndata=%d\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 bcap->data.rate_adaption, bcap->data.sig_access, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 bcap->data.async, bcap->data.nr_stop_bits, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 bcap->data.nr_data_bits); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 printf(" urate=%d par=%d irate=%d transp=%d mtype=%d\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 bcap->data.user_rate, bcap->data.parity, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 bcap->data.interm_rate, bcap->data.transp, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 bcap->data.modem_type); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 print_cc_cap(cc) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 struct gsm_mncc_cccap *cc; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 printf("CC capabilities: DTMF=%d PCP=%d\n", cc->dtmf, cc->pcp); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 print_cause(cause) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 struct gsm_mncc_cause *cause; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 int i; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 printf("Cause: loc=%d coding=%d value=%d", cause->location, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 cause->coding, cause->value); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 if (cause->rec) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 printf(" rec=0x%02X", cause->rec_val); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 for (i = 0; i < cause->diag_len; i++) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 if (!(i & 15)) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 putchar(' '); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 printf(" %02X", cause->diag[i] & 0xFF); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 print_progress(prog) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 struct gsm_mncc_progress *prog; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 printf("Progress: loc=%d coding=%d descr=0x%02X", prog->location, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 prog->coding, prog->descr); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 print_useruser(uu) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 struct gsm_mncc_useruser *uu; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 printf("User-User IE: proto=0x%02X\n", uu->proto); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 /* dump to be implemented if and when we actually get a UU somewhere */ |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 print_keypad(kp) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 int kp; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 if (kp >= '!' && kp <= '~') |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 printf("Keypad code: %c\n", kp); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 else |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 printf("Keypad code: 0x%02X\n", kp); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 print_facility(fac) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 struct gsm_mncc_facility *fac; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 int i; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 printf("Facility IE: %d byte(s)", fac->len); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 for (i = 0; i < fac->len; i++) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 if (!(i & 15)) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 putchar(' '); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 printf(" %02X", fac->info[i] & 0xFF); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 print_ssver(ssv) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 struct gsm_mncc_ssversion *ssv; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 int i; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 printf("SS version IE: %d byte(s)", ssv->len); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 for (i = 0; i < ssv->len; i++) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 if (!(i & 15)) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 putchar(' '); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 printf(" %02X", ssv->info[i] & 0xFF); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 putchar('\n'); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 static void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 print_fields(msg) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 struct gsm_mncc *msg; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 if (msg->fields & MNCC_F_BEARER_CAP) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 print_bearer_cap(&msg->bearer_cap); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 if (msg->fields & MNCC_F_CCCAP) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 print_cc_cap(&msg->cccap); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 if (msg->fields & MNCC_F_CAUSE) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 print_cause(&msg->cause); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 if (msg->fields & MNCC_F_PROGRESS) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 print_progress(&msg->progress); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 if (msg->fields & MNCC_F_USERUSER) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 print_useruser(&msg->useruser); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 if (msg->more) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 printf("More data flag set\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 if (msg->fields & MNCC_F_KEYPAD) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 print_keypad(msg->keypad); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 if (msg->fields & MNCC_F_FACILITY) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 print_facility(&msg->facility); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 if (msg->fields & MNCC_F_SSVERSION) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 print_ssver(&msg->ssversion); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 static void |
213
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
160 print_sdp(sdp) |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
161 char *sdp; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
162 { |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
163 char *cp, *ep, *np; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
164 |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
165 for (cp = sdp; *cp; cp = np) { |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
166 ep = index(cp, '\n'); |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
167 if (ep) { |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
168 *ep = '\0'; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
169 np = ep + 1; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
170 } else |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
171 np = 0; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
172 ep = index(cp, '\r'); |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
173 if (ep) |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
174 *ep = '\0'; |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
175 printf("%s %s\n", cp == sdp ? "SDP:" : " ", cp); |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
176 } |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
177 } |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
178 |
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
179 static void |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 send_connect_ack() |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 struct gsm_mncc ack; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 printf("Sending connect ack\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 bzero(&ack, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 ack.msg_type = MNCC_SETUP_COMPL_REQ; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 ack.callref = 1; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 send_mncc_to_gsm(&ack, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 static void |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
192 send_rtp_connect() |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
193 { |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
194 struct gsm_mncc_rtp rtp; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
195 |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
196 printf("Sending MNCC_RTP_CONNECT\n"); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
197 bzero(&rtp, sizeof(struct gsm_mncc_rtp)); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
198 rtp.msg_type = MNCC_RTP_CONNECT; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
199 rtp.callref = 1; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
200 bcopy(&dummy_rtp_endp, &rtp.addr, sizeof(struct sockaddr_storage)); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
201 send_mncc_to_gsm(&rtp, sizeof(struct gsm_mncc_rtp)); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
202 } |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
203 |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
204 static void |
159
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
205 handle_dtmf_time() |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
206 { |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
207 static struct timeval last_dtmf_time; |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
208 struct timeval delta; |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
209 unsigned ms; |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
210 |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
211 if (timerisset(&last_dtmf_time) && |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
212 timercmp(&cur_event_time, &last_dtmf_time, >)) { |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
213 timersub(&cur_event_time, &last_dtmf_time, &delta); |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
214 if (delta.tv_sec >= 2) |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
215 printf("Time since last DTMF event: %u s\n", |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
216 (unsigned) delta.tv_sec); |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
217 else { |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
218 ms = delta.tv_sec * 1000 + delta.tv_usec / 1000; |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
219 printf("Time since last DTMF event: %u ms\n", ms); |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
220 } |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
221 } |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
222 bcopy(&cur_event_time, &last_dtmf_time, sizeof(struct timeval)); |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
223 } |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
224 |
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
225 static void |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 handle_signaling_msg(msg, msglen) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 struct gsm_mncc *msg; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 unsigned msglen; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 if (msglen != sizeof(struct gsm_mncc)) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 fprintf(stderr, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 "error: Rx MNCC message type 0x%x has wrong length\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 msg->msg_type); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 exit(1); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 if (msg->callref != 1) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 fprintf(stderr, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 "error: Rx MNCC message type 0x%x has unexpected callref 0x%x\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 msg->msg_type, msg->callref); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 exit(1); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 switch (msg->msg_type) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 case MNCC_SETUP_CNF: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 printf("MNCC_SETUP_CNF: call is answered\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 print_fields(msg); |
213
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
246 print_sdp(msg->sdp); |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
247 send_rtp_connect(); |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 send_connect_ack(); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 case MNCC_CALL_CONF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 printf("MNCC_CALL_CONF_IND: call is confirmed\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 print_fields(msg); |
213
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
253 print_sdp(msg->sdp); |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 case MNCC_ALERT_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 printf("MNCC_ALERT_IND: call is alerting\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 print_fields(msg); |
213
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
258 print_sdp(msg->sdp); |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 case MNCC_NOTIFY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 printf("NNCC_NOTIFY_IND: NOTIFY byte from MS: 0x%02X\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 msg->notify); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 case MNCC_DISC_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 printf("MNCC_DISC_IND: MS initiates disconnect\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 disconnect_mode = 1; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
268 printf("Responding with release request\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
269 msg->msg_type = MNCC_REL_REQ; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 case MNCC_FACILITY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 printf("MNCC_FACILITY_IND: call-related SS from MS\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
274 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
275 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 case MNCC_START_DTMF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 printf("MNCC_START_DTMF_IND: MS sending DTMF start\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 print_fields(msg); |
159
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
279 handle_dtmf_time(); |
39
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
280 if (msg->fields & MNCC_F_KEYPAD && |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
281 is_valid_dtmf_digit(msg->keypad)) { |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
282 printf("Responding with ACK\n"); |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
283 msg->msg_type = MNCC_START_DTMF_RSP; |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
284 } else { |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
285 printf("Responding with Reject\n"); |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
286 msg->msg_type = MNCC_START_DTMF_REJ; |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
287 mncc_set_cause(msg, GSM48_CAUSE_LOC_PRN_S_LU, |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
288 GSM48_CC_CAUSE_INVAL_MAND_INF); |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
36
diff
changeset
|
289 } |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
290 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
291 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 case MNCC_STOP_DTMF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 printf("MNCC_STOP_DTMF_IND: MS sending DTMF stop\n"); |
159
c8e9b295e88f
mtctest: add time reporting for DTMF events
Mychaela Falconia <falcon@freecalypso.org>
parents:
139
diff
changeset
|
294 handle_dtmf_time(); |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 msg->msg_type = MNCC_STOP_DTMF_RSP; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
298 case MNCC_MODIFY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
299 printf("MNCC_MODIFY_IND: MS requests call modification\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 msg->msg_type = MNCC_MODIFY_REJ; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 mncc_set_cause(msg, GSM48_CAUSE_LOC_PRN_S_LU, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 GSM48_CC_CAUSE_SERV_OPT_UNIMPL); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
306 case MNCC_HOLD_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
307 printf("MNCC_HOLD_IND: MS requests call hold\n"); |
138
0967f67c6ac3
mtctest: accept call hold and retrieve requests
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
308 msg->msg_type = MNCC_HOLD_CNF; |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 case MNCC_RETRIEVE_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 printf("MNCC_RETRIEVE_IND: MS requests call retrieve\n"); |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
313 send_rtp_connect(); |
138
0967f67c6ac3
mtctest: accept call hold and retrieve requests
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
314 msg->msg_type = MNCC_RETRIEVE_CNF; |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
315 send_mncc_to_gsm(msg, sizeof(struct gsm_mncc)); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 case MNCC_USERINFO_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 printf("MNCC_USERINFO_IND: user-user info\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
319 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
320 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 case MNCC_REL_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 printf("MNCC_REL_IND: final release\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 exit(0); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 case MNCC_REL_CNF: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 printf("MNCC_REL_CNF: final release in response to request\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 exit(0); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 case MNCC_REJ_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 printf("MNCC_REJ_IND: MT call rejected\n"); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 print_fields(msg); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 exit(0); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
334 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
335 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 static void |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
337 handle_rtp_msg(msg, msglen) |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 struct gsm_mncc_rtp *msg; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 unsigned msglen; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 if (msglen != sizeof(struct gsm_mncc_rtp)) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 fprintf(stderr, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 "error: Rx MNCC message type 0x%x has wrong length\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 msg->msg_type); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 exit(1); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 if (msg->callref != 1) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 fprintf(stderr, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 "error: Rx MNCC message type 0x%x has unexpected callref 0x%x\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 msg->msg_type, msg->callref); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 exit(1); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 } |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
353 switch (msg->msg_type) { |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
354 case MNCC_RTP_CREATE: |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
355 printf("MNCC_RTP_CREATE: RTP info from MSC\n"); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
356 printf("payload_type=0x%x payload_msg_type=0x%x\n", |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
357 msg->payload_type, msg->payload_msg_type); |
213
55ad0f4bb33c
themwi-test-mtc: print SDP emitted by new OsmoMSC
Mychaela Falconia <falcon@freecalypso.org>
parents:
159
diff
changeset
|
358 print_sdp(msg->sdp); |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
359 return; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
360 case MNCC_RTP_CONNECT: |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
361 printf("MNCC_RTP_CONNECT: error response\n"); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
362 return; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
363 case MNCC_RTP_FREE: |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
364 printf("MNCC_RTP_FREE: bogon\n"); |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
365 return; |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
366 } |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 void |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 msg_from_mncc(msg, msglen) |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
371 union mncc_msg *msg; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
372 unsigned msglen; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 switch (msg->msg_type) { |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 case MNCC_SETUP_CNF: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 case MNCC_CALL_CONF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
377 case MNCC_ALERT_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
378 case MNCC_NOTIFY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
379 case MNCC_DISC_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
380 case MNCC_FACILITY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 case MNCC_START_DTMF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 case MNCC_STOP_DTMF_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
383 case MNCC_MODIFY_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
384 case MNCC_HOLD_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 case MNCC_RETRIEVE_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 case MNCC_USERINFO_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 case MNCC_REL_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 case MNCC_REL_CNF: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 case MNCC_REJ_IND: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 handle_signaling_msg(msg, msglen); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
391 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
392 case MNCC_RTP_CREATE: |
139
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
393 case MNCC_RTP_CONNECT: |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
394 case MNCC_RTP_FREE: |
c731ec342ba0
mtctest: rework MNCC_RTP_CONNECT sending for hold/retrieve and CW
Mychaela Falconia <falcon@freecalypso.org>
parents:
138
diff
changeset
|
395 handle_rtp_msg(msg, msglen); |
21
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 return; |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 default: |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 fprintf(stderr, |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
399 "error: received unexpected MNCC message type 0x%x\n", |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
400 msg->msg_type); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
401 exit(1); |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
402 } |
cc0e1c6e33c3
themwi-test-mtc utility written, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
403 } |