asterisk channel driver dev ref
入口函數load_module
?? ?load_config
?? ?ast_channel_register console_tech
?? ?ast_cli_register_multiple
?? ?
console_tech需要提供一系列的毀掉函數,比如?? ?
?? ?static struct ast_channel_tech console_tech = {
?? ?.type = "Console",
?? ?.description = "Console Channel Driver",
?? ?.requester = console_request,
?? ?.send_digit_begin = console_digit_begin,
?? ?.send_digit_end = console_digit_end,
?? ?.send_text = console_text,
?? ?.hangup = console_hangup,
?? ?.answer = console_answer,
?? ?.read = console_read,
?? ?.call = console_call,
?? ?.write = console_write,
?? ?.indicate = console_indicate,
?? ?.fixup = console_fixup,
?? ?};
answer一般會啟動monitor thread
?
sample: chan_console.c
?
http://svn.asterisk.org/svn/asterisk/trunk/channels/chan_oss.c
https://code.google.com/p/asterisk-chan-dongle/
?
討論
http://lists.digium.com/pipermail/asterisk-dev/2008-January/031719.html
?
?
load_module
?? ?ast_calloc gpublic
?? ?pdiscovery_init
?? ??? ?cache_init
?? ??? ??? ?AST_RWLIST_HEAD_INIT
?? ?public_state_init
?? ??? ?reload_config
?? ??? ?discovery_restart
?? ??? ??? ?ast_pthread_create_background( do_discovery )
?? ??? ??? ?the thread loops all devices
?? ??? ??? ??? ?看看要做啥就做啥,比如
?? ??? ??? ??? ?打開設備opentty
?? ??? ??? ??? ?start_monitor monitor_thread do_monitor_phone
?? ??? ??? ??? ??? ?該線程監視data_fd和audio_fd
?? ??? ??? ??? ??? ??? ?port_status
?? ??? ??? ??? ??? ??? ??? ?tcgetattr
?? ??? ??? ??? ??? ??? ?at_wait
?? ??? ??? ??? ??? ??? ?at_read
?? ??? ??? ??? ??? ??? ?PVT_STAT
?? ??? ??? ??? ??? ??? ?at_read_result_iov
?? ??? ??? ??? ??? ??? ?at_read_result_classification
?? ??? ??? ??? ??? ??? ?at_response
?? ??? ??? ??? ?移除設備AST_RWLIST_REMOVE_CURRENT, pvt_free
?? ??? ?ast_channel_register(&channel_tech)
?? ??? ?cli_register
?? ??? ?app_register
?? ??? ?manager_register
?? ??? ?discovery_stop
?? ??? ?devices_destroy
?? ?
public_state
?? ?devices
?? ??? ?a list
?? ??? ?AST_RWLIST_HEAD_INIT
?? ??? ?AST_RWLIST_RDLOCK
?? ??? ?AST_RWLIST_TRAVERSE
?? ?discovery_lock
?? ??? ?a mutex
?? ??? ?ast_mutex_init
?? ??? ?ast_mutex_lock
?? ??? ?ast_mutex_destroy
?? ?discovery_thread
?? ??? ?a thread
?? ??? ??
?
總結
以上是生活随笔為你收集整理的asterisk channel driver dev ref的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android中适用于ListView、
- 下一篇: [Everyday Mathematic