入口函数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. Python面向对象编程、类

    一.面向对象编程 面向对象--Object Oriented Programming,简称oop,是一种程序设计思想.在说面向对象之前,先说一下什么是编程范式,编程范式你按照什么方式来去编程,去实现一 ...

  2. python-day29--socket

    一 .客户端/服务器架构 1.硬件C/S架构(打印机) 2.软件C/S架构 二. 三. 1.互联网协议就相当于计算机界的英语 2.数据传输的过程中包头一定要是固定的长度 四.socket层的位置 so ...

  3. hdu1864(01包)

    最大报销额 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  4. python 利用quick sort思路实现median函数

    # import numpy as np def median(arr): #return np.median(arr) arr.sort() return arr[len(arr)>>1 ...

  5. Win10 dell驱动触摸板安装

    Win10 dell驱动触摸板安装 在此之前安装驱动后要重启

  6. cf935E

    题解: 树形dp 要记录一个最小的,一个最大的 然后转移 代码: #include<bits/stdc++.h> using namespace std; ; ][],f[N*][],T[ ...

  7. Ubuntu中使用WPS

    ubunu系统下用WPS办公软件比较好,比较兼容MS office, ubuntu下WPS相关命令有:et,wps,wpp. 使用Ctrl+Alt+T打开命令端, "et"命令可以 ...

  8. 免费申请一年版Eset NOD32 Antivirus激活码(无限制)- 已失效

    You will receive a 1-year license of the antivirus software Eset NOD32 (version 6), including all up ...

  9. windowns 下备份mysql数据库

    @echo off & setlocal ENABLEEXTENSIONS :: ---------- 配置项 ---------- :: 备份放置的路径,加 \ set BACKUP_PAT ...

  10. 数据库SQL优化大总结之 百万级数据库优化方案(转载)

    网上关于SQL优化的教程很多,但是比较杂乱.近日有空整理了一下,写出来跟大家分享一下,其中有错误和不足的地方,还请大家纠正补充. 这篇文章我花费了大量的时间查找资料.修改.排版,希望大家阅读之后,感觉 ...