zoukankan      html  css  js  c++  java
  • 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
            ?

  • 相关阅读:
    .a包生成64位
    iOS教程
    iOS 难题解决日志------2层控制器 上面的控制器显示透明
    企业级的App发布流程
    如何从oc中去获取一个私有的变量.....
    iOS app的破解原理,就是去除已付费的账户信息的原理是什么?
    Could not launch "app_name"
    GCD时间轴
    Win8自动更新怎么关闭 取消Win8自动更新
    python3 elf文件解析
  • 原文地址:https://www.cnblogs.com/cutepig/p/4237804.html
Copyright © 2011-2022 走看看