- 浏览: 227088 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
newLinuxJava:
http://www.voip-info.org/wiki/v ...
asterisk App Dial 拨号 发起外呼 -
newLinuxJava:
http://www.voip-info.org/wiki/v ...
asterisk App Dial 拨号 发起外呼 -
tsinglongwu:
这种做法在Server端getValue()方法是能获得修改后 ...
client-side programming客户端修改值,但服务端获取仍然旧值的解决办法 -
Listen_ing:
zk+spring+hibernate如何配置hibernat ...
zk+hibernate+spring零配置 -
peterxq181:
严重: Method not found in org.apa ...
zk+hibernate+spring零配置
现在回过头来把焦点转移到sipsock_read()函数。所有到来的sip包都在这里开始处理,在处理sip包期间,sipsock_read需要对sip的拥有者channel上锁,sipsock_read成功则返回0,失败则返回1。它解析sip包并且找到所在的dialog,或者创建新的dialog。并且把解析好的包交给handle_request()处理。 sipsock_read第一步接收socket数据,存到结构sip_request的data域中。 解析SIP包,获取sip request method,如INVITE, BYE等 随后找到对应的sip_pvt结构,或者创建新的sip_pvt结构,结构指针返回到变量p中。 在进一步操作之前,需要对p->owner上锁,这个操作会最多尝试100次直至成功。 如果上锁操作失败,将会返回503 sip消息。 更深一步的解析处理操作交给handle_request()函数处理,完了之后就是释放channel的锁。 函数handle_request()视数据包的类型而处理,如果是对外出包的回应,则交给handle_response()处理,如果是一个请求包,则视请求类型(INVITE, OPTIONS, REFER, BYE, CANCEL etc)交给不同的函数处理。如果是一个INVITE包,则交给handle_request_invite()处理,在那里将会创建一个新的channel,这个通道随后会执行一个单独的通道线程。这就是一个来电呼叫。如果这个呼叫被应答,则一个桥接通道或者PBX本身会回调sip_answer()函数。而真正的媒体数据,音频或者视频,则会在RTP子系统中处理,具体见rtp.c Outbound calls Outbound calls are set up by the PBX through the sip_request_call() function. After that, they are activated by sip_call(). Hanging up The PBX issues a hangup on both incoming and outgoing calls through the sip_hangup() function 现在回顾一下注册SIP通道驱动时,我们注册了一系列通道驱动的回调函数,这些有什么用呢?比如当需要发出一个outbound call时,则会调用sip_request_call()。而当需要hangup时,则调用sip_hangup()。15062 res = recvfrom(sipsock, req.data, sizeof(req.data) - 1, 0, (struct sockaddr *)&sin, &len);
15086 parse_request(&req);
15087 req.method = find_sip_method(req.rlPart1);
15099 /* Find the active SIP dialog or create a new one */
15100 p = find_call(&req, &sin, req.method); /* returns p locked */
15107 /* Go ahead and lock the owner if it has one -- we may need it */
15108 /* becaues this is deadlock-prone, we need to try and unlock if failed */
15109 if (!p->owner || !ast_channel_trylock(p->owner))
15110 break; /* locking succeeded */
15127 if (req.method != SIP_ACK)
15128 transmit_response(p, "503 Server error", &req); /* We must respond according to RFC 3261 sec 12.2 */
15129 /* XXX We could add retry-after to make sure they come back */
15130 append_history(p, "LockFail", "Owner lock failed, transaction failed.");
15131 return 1;
15134 if (handle_request(p, &req, &sin, &recount, &nounlock) == -1) {
15135 /* Request failed */
15136 if (option_debug)
15137 ast_log(LOG_DEBUG, "SIP message could not be handled, bad request: %-70.70s\n", p->callid[0] ? p->callid : "<no callid>");
15138 }
15139
15140 if (p->owner && !nounlock)
15141 ast_channel_unlock(p->owner);
01502 /*------Request handling functions */
01503 static int handle_request(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int *recount, int *nounlock);
01504 static int handle_request_invite(struct sip_pvt *p, struct sip_request *req, int debug, int seqno, struct sockaddr_in *sin, int *recount, char *e, int *nounlock);
01505 static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, int *nounlock);
01506 static int handle_request_bye(struct sip_pvt *p, struct sip_request *req);
01507 static int handle_request_register(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, char *e);
01508 static int handle_request_cancel(struct sip_pvt *p, struct sip_request *req);
01509 static int handle_request_message(struct sip_pvt *p, struct sip_request *req);
01510 static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e);
01511 static void handle_request_info(struct sip_pvt *p, struct sip_request *req);
01512 static int handle_request_options(struct sip_pvt *p, struct sip_request *req);
01513 static int handle_invite_replaces(struct sip_pvt *p, struct sip_request *req, int debug, int ignore, int seqno, struct sockaddr_in *sin);
01514 static int handle_request_notify(struct sip_pvt *p, struct sip_request *req, struct sockaddr_in *sin, int seqno, char *e);
01515 static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *current, struct sip_request *req, int seqno);
01516
01517 /*------Response handling functions */
01518 static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
01519 static void handle_response_refer(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int seqno);
01520 static int handle_response_register(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int ignore, int seqno);
01521 static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req, int ignore, int seqno);
01541 /*! \brief Definition of this channel for PBX channel registration */
01542 static const
发表评论
-
解决elastix登录显示非常慢以及禁用新闻的展示的问题
2011-06-10 11:12 1213解决登录显示非常慢的问题以及禁用新闻的展示 ... -
FreePBX 2.7.0.3 汉化
2011-06-09 15:46 17691,FreePBX 2.7.0.3 右侧语言选项,默认无 ... -
Asterisk 1.6的配置文件:chan_dahdi.conf
2010-12-24 13:56 2109Asterisk 1.6的配置文件:chan_dahdi.co ... -
Asterisk 安装笔记(2)- Zaptel 和 Dahdi 的配置
2010-12-24 13:53 1963Zap Channel Module Configurat ... -
Asterisk Extension中的Application命令详解七
2010-12-22 09:51 1142StripLSD( ) ... -
Asterisk Extension中的Application命令详解六
2010-12-22 09:50 1534MailboxExists() ... -
Asterisk Extension中的Application命令详解五
2010-12-22 09:46 1897Math( ) Performs mathema ... -
Asterisk Extension中的Application命令详解四
2010-12-22 09:44 2080Hangup( ) Unconditionall ... -
Asterisk Extension中的Application命令详解三
2010-12-22 09:43 3208CheckGroup( )检查特定组中的信道数。CheckG ... -
Asterisk Extension中的Application命令详解二
2010-12-22 09:41 2071AgentLogin( )允许呼叫代理 ... -
Asterisk Extension中的Application命令详解一
2010-12-22 09:39 1652AbsoluteTimeout() 设置呼叫最大呼叫时长 A ... -
拨号方案基础
2010-12-22 09:28 1215ApplicationAnswer(),Playback()和 ... -
模拟卡的疑难杂症
2010-12-22 09:23 4610, 不能编译zaptel和asterisk ... -
Asterisk的拨号计划命令
2010-12-22 09:21 1725Asterisk的拨号计划命 ... -
Asterisk 配置文详解和Freepbx功能键逐个数
2010-12-22 09:19 12832Asterisk 配置文详解 转自:http://www.ha ... -
Asterisk manager API(AMI)文档(中文版
2010-12-22 03:04 1400Asterisk控制接口(AMI)允许管理客户端程序连接到一个 ... -
SIP 中文翻译
2010-12-22 03:01 29431.介绍 extensions.conf中使用sip设备的语 ... -
队列振铃方式
2010-12-22 02:58 953队列振铃方式有:ringall,roundrobin,leas ... -
asterisk App Dial 拨号 发起外呼
2010-12-22 02:54 2803Synopsis Attempts to establi ... -
asterisk 集群配置的完全解决方案
2010-12-22 02:53 1164IAX 设置详细两台Asterisk服务器设置步骤如下:* 设 ...
相关推荐
asterisk 代码分析, sip_chan
基于sip协议,用asterisk作为服务器,实现voip软电话功能,实现了接听,呼叫,挂机,呼叫转移,以及通信录等功能。
COMPONENTE DE DELPHI PARA LLAMADAS EN ASTERISK POR EL PUERTO SIP ES NECESARIO HACER LA INTALACION CORRESPONDIENTE Y CARGAR LA RUTA DEL ARCHIVO FUENTE.
Asterisk 代码学习笔记,深入浅出asterisk,由于工作上的VOIP项目需要,最近亲密接触了一下asterisk工程代码。关于asterisk在VOIP上的伟大地位和作用,俺就不絮叨了,请看前作:Astersik+Radius简易攻略 国内对于...
asterisk 的7号信令处理模块,生成的SO直接就可调用
这个文件是在asterisk这个平台中主要是对cid的一个解析和通道的监听
asterisk 对7号信令的支撑模块,包含了chan_ss7等文件.
SIP协议讲座-Asterisk.pptSIP协议讲座-Asterisk.ppt
:eight-spoked_asterisk: 特征 :tangerine: 建筑学 :gem_stone: 入门 :person_gesturing_OK: 作者 本项目作者:米斯特宝。 高级工程师,企业家。 :glowing_star: 贡献者 感谢所有参与 Tigaui 开发的贡献者。 ...
开源免费项目帐户提供一些限制 :eight-spoked_asterisk: 完全覆盖。 如果你想贡献,请继续阅读。 玩得开心,拯救角膜 :smiling_face_with_smiling_eyes:涵盖的站点站点名称部分的满的 :check_mark: :check_mark: :...
chown -R asterisk:asterisk cn 修改sip_general_custom.conf(作为测试,在所有SIP 通道上启用提示语为中文,在实际应用中,可根据需要修改--zapata-channels.conf,sipXXX.conf,IAXXXX.conf...,也可在FreePBX的WEB界面...
包含asterisk 1.2/1.4/1.8通话流程、架构概述、内核框架、代码和功能分析、PSTN、卸载asterisk、CLI命令、DialPlan详解等等。重新排版整理
check_asterisk_siptrunk 该插件将通过星号管理界面(AMI)检查SIP对等方的状态 用法:check_asterisk_siptrunk.pl [-v | --verbose] [--host | -H主机] [--port | -P端口] --user AMIUser --pass AMIPass --peer ...
包含:asterisk.18.11.1源码...asterisk-18-current.tar.gz libedit_3.1-20210910.orig.tar.gz openssl-1.1.1.tar.gz jansson-2.11.tar.gz sqlite-autoconf-3380200.tar.gz pjproject-2.10.tar.gz libuuid-1.0.3.tar.gz
:eight-spoked_asterisk:特征 :check_mark_button:纽扣 :white_large_square:容器布局容器 :white_large_square: Icon图标 :white_large_square:友情链接 :leaf_fluttering_in_wind:建筑学 :gem_stone:安装 ...
Asterisk 是一个开放源代码的软件VoIP PBX系统,它是一个运行在Linux环境下的纯软件实施方案。Asterisk是一种功能非常齐全的应用程序,提供了许多电信功能,能够把你的x86机 器变成你自己的交换机,还能够当作一台...
Asterisk中pbx交换核心的源码 pbx是Asterisk的核心部分 重要哦
除了充当标准的SIP软电话外,Connect Me还通过视频和消息传递等功能丰富了IP PBX(Cisco,Avaya,阿尔卡特,Skype for Business,Mitel,Asterisk ...)和UC平台。 支持通过Internet致电或使用普通台式电话。 与您的...
即使您只具备电信基础知识,也可以使用Asterisk开发IP语音(VoIP)或传统PBX系统。 本指南是指导您从安装到配置此开源软件的指南,无论您是升级现有电话系统还是从头开始构建。 此更新的第五版非常适合Linux管理员...
本代码整理了Asterisk AMI 接口,下载之后,通过配置Asterisk用户名和密码即可连接到Asterisk,用户名和密码在代码中已给出,可自由修改。