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
?
- 上一篇 标 题 有什么办法快速把pc上的网址发送到手机上
- 下一篇 软件项目管理.