FreeCalypso > hg > themwi-system-sw
annotate libutil/dtmf_valid.c @ 199:e6c7ced3c031
mgw: accept zero-length RTP payload as BFI
Mainline OsmoBTS now has an option (rtp continuous-streaming)
that causes it to emit an RTP packet every 20 ms without gaps,
sending a BFI marker in the form of zero-length RTP payload
when it has nothing else to send. These codec-independent
BFI markers don't indicate TAF, but this provision is a good
start. Accept this BFI packet format in themwi-mgw.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 29 Mar 2023 20:23:43 -0800 |
parents | 64b9f0f90726 |
children |
rev | line source |
---|---|
39
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * Here we implement a function that validates DTMF digits which arrive |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * from GSM MS via MNCC_START_DTMF_IND. |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 is_valid_dtmf_digit(c) |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 { |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 switch (c) { |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 case '0': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 case '1': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 case '2': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 case '3': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 case '4': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 case '5': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 case '6': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 case '7': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 case '8': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 case '9': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 case '*': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 case '#': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 case 'A': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 case 'B': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 case 'C': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 case 'D': |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 return(1); |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 default: |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 return(0); |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 } |
64b9f0f90726
themwi-test-mtc: handle DTMF from MS
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 } |