FreeCalypso > hg > themwi-interim
annotate libutil/dtmf_valid.c @ 14:44c1d4d787e9 default tip
themwi-test-mtc: add option to set bearer cap
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 28 Nov 2024 20:37:23 +0000 |
parents | b161dbfffdaa |
children |
rev | line source |
---|---|
1
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Here we implement a function that validates DTMF digits which arrive |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * from GSM MS via MNCC_START_DTMF_IND. |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 is_valid_dtmf_digit(c) |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 { |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 switch (c) { |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 case '0': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 case '1': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 case '2': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 case '3': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 case '4': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 case '5': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 case '6': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 case '7': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 case '8': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 case '9': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 case '*': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 case '#': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 case 'A': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 case 'B': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 case 'C': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 case 'D': |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 return(1); |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 default: |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 return(0); |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 } |
b161dbfffdaa
include, libutil: port from old ThemWi
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 } |