| 1 |
TODO items: |
| 2 |
|
| 3 |
|
| 4 |
1) Audio driver work: |
| 5 |
Properly abstract audio drivers (currently, we use only |
| 6 |
portaudio, but we may also want to support others. |
| 7 |
The most likely candidate here would be zaptel devices. |
| 8 |
|
| 9 |
Instead of the "switch" statements in the code, define an audio |
| 10 |
driver structure, with |
| 11 |
|
| 12 |
- function pointers for actual driver entry points. |
| 13 |
initialization: (scans available devices, sets up data |
| 14 |
structures) |
| 15 |
destruction: (stops everything, cleans up) |
| 16 |
"start": starts audio for a particular call? |
| 17 |
"stop": stops audio for a particular call? |
| 18 |
"playsound": plays a particular sound: can be used for |
| 19 |
incoming call notification, ringback, dialtone etc? |
| 20 |
"select": select input and output devices to use? |
| 21 |
[maybe extend this for zap devices to have "ring", etc |
| 22 |
functions?] |
| 23 |
|
| 24 |
|
| 25 |
- Common audio driver data members: |
| 26 |
a) perhaps an array of devices the driver has found, |
| 27 |
with for each device, a device name, an |
| 28 |
indication of whether this device is the default |
| 29 |
input or output, and whether this device |
| 30 |
supports input, output, or both. |
| 31 |
|
| 32 |
For portaudio, we probably want to switch to the "standard" |
| 33 |
portaudio callback interface, and away from pablio, which isn't |
| 34 |
really robust enough for our needs once we do this stuff. |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
2) Codecs: (I think that someone is working on this) |
| 39 |
|
| 40 |
Currently, the library assumes that all calls will be GSM only, |
| 41 |
and further assumes that all frames will be 20ms. It can |
| 42 |
control the frame size (within reason) for frames it sends out, |
| 43 |
but should deal gracefully with incoming frames that aren't |
| 44 |
20ms. |
| 45 |
|
| 46 |
Codecs should probably be implemented via a similar set of |
| 47 |
structure abstractions as audio drivers, above. They also need |
| 48 |
to handle incoming packets which may switch formats abruptly(?). |
| 49 |
|
| 50 |
DONE (or, at least, mostly done): |
| 51 |
============================================================== |
| 52 |
Call handling |
| 53 |
currently, the library really only supports one call, and not |
| 54 |
very well. It should have a collection of calls (either an |
| 55 |
array, or a linked list), and keep track of the current state of |
| 56 |
each call. |
| 57 |
|
| 58 |
An array might be easiest to manage, and would map well to a |
| 59 |
softphone client. We would then just refer to calls by their |
| 60 |
index, and a GUI client might present these like call |
| 61 |
appearances on their display. |
| 62 |
|
| 63 |
Incoming calls might come in on the first free call appearance, |
| 64 |
and outgoing calls by default would do the same. |
| 65 |
|
| 66 |
The state of each call might be similar to phonecore |
| 67 |
(incoming_incomplete, incoming, outgoing_incomplete, outgoing), |
| 68 |
but we'd also have to keep track of which call, if any, we |
| 69 |
currenly have "selected" -- i.e. which one we should connect to |
| 70 |
the audio system. |
| 71 |
|
| 72 |
We'd need to send events to the client whenever a call changed |
| 73 |
"state" in any way. |
| 74 |
|
| 75 |
We can make the number of calls in the array defined at runtime |
| 76 |
when the library is initialized. A very simple client like |
| 77 |
testcall would just ask for a single call, so it wouldn't have |
| 78 |
to worry about a lot of this. |
| 79 |
|
| 80 |
Events: |
| 81 |
We might want to consolidate the (currently three) callbacks |
| 82 |
that the library makes to clients, into a single callback, that |
| 83 |
passes back a structure with event info. I was thinking of a |
| 84 |
structure with an event type, and then a union of different |
| 85 |
structures depending on the event type. |
| 86 |
|
| 87 |
The only thing is that we might want to decide whether or not, |
| 88 |
or how clients will "register" for different event types, even |
| 89 |
if they're handled through the same callback mechanism. |
| 90 |
|
| 91 |
Ideally, the library would handle all of the events itself, via |
| 92 |
some "default" handlers. (I.e. for messages, it might just print |
| 93 |
them to stdout or stderr. For incoming calls, it might accept |
| 94 |
them by default). |
| 95 |
|
| 96 |
So, the choices then are whether the client should register for |
| 97 |
individual events, or perhaps it can just decline events as they |
| 98 |
happen, and then the library could handle them. |
| 99 |
|
| 100 |
|
| 101 |
|