asterisk代码学习笔记.docx

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Asterisk1.2 配置文件参数读取相关的 ast_config_engine_register reload_queues-ast_config_load-ast_config_internal_load-load_func(queues.conf时就是config_text_file_load)- process_text_line - ast_category_browse - ast_variable_browse - queue_set_param asterisk.c/main- read_config_maps- ast_config_internal_load- config_text_file_load - ast_variable_browse - append_mapping chan_sip.c/ do_monitor do_monitor - ast_io_add - sip_do_reload- sip_poke_all_peers - sip_send_all_registers - ast_softhangup_nolock- ast_queue_frame - pthread_testcancel - ast_sched_wait - ast_io_wait- sipsock_read - ast_sched_runq //在调用callback时调用的函数是用ast_sched_add 时设置的回调。 收到一个invite时的处理函数: 系统初始化时: load_module -restart_monitor 起一个线程–do_monitor一个死循环,接收sip信令,\ This thread monitors all the SIP sessions and peers that needs notification of mwi (and thus do not have a separate thread) indefinitely\ -ast_io_add//设置回调函数sipsock_read, Add an I/O event to our SIP UDP socket, 有事件时则回调sipsock_read 读取socket数据 -rtp.c/ast_rtp_sendcng -ast_sched_wait -ast_io_wait//将调用sipsock_read -ast_sched_runq - sip_send_mwi_to_peer 在reload- sip_reload- restart_monitor 也会调用restart_monitor *************Chan_sip.c/ sip_tech 收到一个invite时的处理函数: sipsock_read -parse_request//解析了消息的头部和体部,解析方法名 - find_sip_method//找到方法名对应的ID - find_call-get_header -gettag -sip_alloc//找不到/不存在,就分配一个,这里的是主叫的sip_pvt -handle_request- get_header //当收到响应消息时,会调用handle_response -handle_response- hangup_sip2cause - __sip_semi_ack - __sip_ack - handle_response_peerpoke- transmit_request- reqprep - send_request- __sip_xmit- sendto - handle_response_invite - handle_request_options - handle_request_refer - handle_request_cancel - handle_request_bye - handle_request_message - handle_request_subscribe - handle_request_register - handle_request_info //当收到invite时,会调用handle_request_invite - handle_request_inv

文档评论(0)

676200 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档