All pastes #993218 Raw Edit

Alok

public text v1 · immutable
#993218 ·published 2008-04-22 13:56 UTC
rendered paste body
The New Telephony Interface. 

1. 'hcid' maintains a list of 'telephony devices'[a GList]. it also exports methods to create, destroy, update these devices.

2. 'hcid' also maintains a list of 'telephony drivers'[a GList]. it also exports methods to register, unregister  these drivers.
     
3. 'hcid' exports telephony methods. (which will be called by the services).

4. A service(example: audio) will register a telephony device with 'hcid' using 'register_telephony_device()'.

5. A telephony plugin will register a telephony driver with 'hcid' using 'register_telephony_driver()'.

6. Once the driver is registered, it scans through the list of devices, and if a suitable registered device is found (matches the driver name to device name, like in the linux kernel), it calls the 'probe' of the driver.  

Q. What information does the 'struct device' going to hold? In linux device driver senario, it holds the resource (IRQ, memory etc) information. 
 
7. The probe function can initializes the telephony subsystem. It also registers a structure of "callbacks" with hcid. These callbacks are function pointers to the C functions in the plugin which interact with the telephony system.

8. These callbacks will allow services to call functions in the plugin(via hcid).

9. But to allow the plugin to notify the services (a response to a previously issued command or issuing a new command to the audio service), it uses a hcid exported function 'update_telephony_status(telephony_device)'. 

10. The service will take action on the changed status of the device.