入口函数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的更多相关文章

  1. golang 中 channel 的详细使用、使用注意事项及死锁分析

    目录 1.什么是 channel,介绍管道 2.channel 的基本使用 3.channel 的使用场景 4.使用 channel的注意事项及死锁分析 什么是 channel 管道 它是一个数据管道 ...

  2. openerp - asterisk connector(转载)

    原文:http://www.akretion.com/open-source-contributions/openerp-asterisk-voip-connector OpenERP - Aster ...

  3. linux driver module

    本文将对Linux系统中的sysfs进行简单的分析,要分析sysfs就必须分析内核的driver-model(驱动模型),两者是紧密联系的.在分析过程中,本文将以platform总线和spi主控制器的 ...

  4. 安装asterisk

    在centos6.5上: yum -y install lynx mysql-server mysql mysql-devel php php-mysql php-mbstring tftp-serv ...

  5. Asterisk重要App

    elastix82*CLI> core show application  SoftHangup -= Info about application 'SoftHangup' =- [Synop ...

  6. Asterisk 代码架构概述

    from:http://blog.csdn.net/yetyongjin/article/details/7594447 近日分析Asterisk 1.8源码.Asterisk trunk上有这篇架构 ...

  7. devices-list

    转自:https://www.kernel.org/pub/linux/docs/lanana/device-list/devices-2.6.txt LINUX ALLOCATED DEVICES ...

  8. 【Python】 Django 怎么实现 联合主键?

    unique_together¶ Options.unique_together¶ Sets of field names that, taken together, must be unique: ...

  9. Linux下编译内核配置选项简介

    Code maturity level options代码成熟度选项 Prompt for development and/or incomplete code/drivers 显示尚在开发中或尚未完 ...

随机推荐

  1. bzoj2763: [JLOI2011]飞行路线 最短路

    题意:求最多可以有k条路免费的最短路 题解:用dis[x][k]表示从s开始用了k次免费机会到x的最短路,然后dij跑的时候优先队列里多维护一个k就好了 /********************** ...

  2. 在Eclipse中Attach Source

    在Eclipse中,有时需要查看类.方法和变量的声明和定义的源代码. 但是在F3查看一些在JDK库中声明/定义的类.方法和 变量的源代码时,Eclipse给你打开的却是相应的.class文件(byte ...

  3. 【转】EntityFramework动态组合Lambda表达式作为数据筛选条件,代替拼接SQL语句

    传统的操作数据库方式,筛选数据需要用StringBuilder拼接一大堆的WHERE子句. 在Entity Framework中,代码稍有不慎就会造成巨大性能消耗,如: using(var db=ne ...

  4. maven分别打包开发、生产配置文件

    项目工程针对开发和生产有两套配置,开发配置文件目录:src/main/resources/    applicationContext.xml (开发和生产共用)    dubbo.propertie ...

  5. write file to stroage trigger kernel warning

    when you write large files  to extern stroage, the kernel may have as follow context: [ 4560.236385] ...

  6. listview的两种适配器

    一. ArrayAdapter ListView listView = (ListView) findViewById(R.id.list_view);//ListView的参数为id listVie ...

  7. systemctl centos fedora 用法

    LinuxSystemctl是一个系统管理守护进程.工具和库的集合,用于取代System V.service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器.通过Syste ...

  8. JavaScript 自定义文本框光标——初级版

    文本框(input或textarea)的光标无法修改样式(除了通过color修改光标颜色).但笔者希望个人创建自己的网站时,文本框的光标有属于自己的风格.所以,尝试模拟文本框的光标,设计有自己风格的光 ...

  9. L241

    Parents, try to get enough sleep to role model good habits to children. Bessesen notes that some med ...

  10. NodeJS 难点(网络,文件)的 核心 stream 四: writable

    什么是可写流 白板 可写流是对数据流向设备的抽象,用来 消费  上游流过来的数据 通过可写流程序可以把数据写入设备, 常见的是 本地磁盘文件或者 TCP.HTTP 等网络响应. 看一个之前用过的例子 ...