入口函数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. Educational Codeforces Round 47 (Rated for Div. 2)G. Allowed Letters 网络流

    题意:给你一个字符串,和每个位置可能的字符(没有就可以放任意字符)要求一个排列使得每个位置的字符在可能的字符中,求字典序最小的那个 题解:很容易判断有没有解,建6个点表示从a-f,和源点连边,容量为原 ...

  2. Repeater中服务器按钮

    protected void Button1_Click(object sender, EventArgs e)        {            Button btn = sender as ...

  3. sql 2005 代码导入excel数据

     select * into bm from OpenDataSource( 'Microsoft.ACE.OLEDB.12.0', 'Data Source="G:\bm.xls" ...

  4. consumer的DubboResponseTimeoutScanTimer线程

    考虑这样一种情况,由于网络延时,consumer先抛出超时异常,一段时间后又收到了已经超时的响应,dubbo是怎么处理的? 拆分为3步看: 1. consumer的DubboResponseTimeo ...

  5. sql 判断字符串中是否含有数字和字母

    判断是否含有字母 select PATINDEX('%[A-Za-z]%', ‘ads23432’)=0 (如果存在字母,结果<>1) 判断是否含有数字 PATINDEX('%[0-9]% ...

  6. window的一些属性

    <!doctype html> <html> <head> <meta charset="utf-8"> <meta name ...

  7. MatchText MatchStr 区别

    区别就是 是否区分大小写. str=字符串,区分 text=文本,不区分 时间长了就忘了. function AnsiCompareText(const S1, S2: string): Intege ...

  8. 字符串 date 转标准 yyyyMMdd 格式

    学习转换成数字相加的思想 public static int ToDateInt(string dateStr)        {            if (string.IsNullOrEmpt ...

  9. C++虚析构函数的作用

    注:本文内容来源于zhice163博文,感谢作者的整理. 1.为什么基类的析构函数是虚函数? 在实现多态时,当用基类操作派生类,在析构时防止只析构基类而不析构派生类的状况发生. 下面转自网络:源地址  ...

  10. jQuery一句话实现全选

    一句话实现全选 function selectAll(checkbox){ $('input[type=checkbox]').prop('checked', $(checkbox).prop('ch ...