sunflowers 发表于 2013-1-30 01:33:31

asterisk-1.6.2.6-2来电显示的bug修复以及asterisk-1.6.2.6-2 rpm重新打包

 
asterisk-1.6.2.6-2来电显示的bug修复
 
 
症状:第一次有来显,以后无来显(unknown),
 
 
环境:
 
 Elastix2.0
 
 CentOS5.4
 
本文主要内容以及注意事项:
 
1,给chan_dahdi.c打补丁
 
2,asterisk-1.6.2.6-2 rpm重新打包
 
3,解决打包过程中rpmbuild无法打包的问题
 
一,给chan_dahdi.c大补丁,以下为补丁文件
 
patch文件
 
 
Index: channels/chan_dahdi.c===================================================================--- channels/chan_dahdi.c(revision 256319)+++ channels/chan_dahdi.c(working copy)@@ -4330,11 +4330,20 @@idx = dahdi_get_index(ast, p, 1); -if ((p->sig == SIG_PRI) || (p->sig == SIG_SS7) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {+switch (p->sig) {+case SIG_PRI:+case SIG_BRI:+case SIG_BRI_PTMP:+case SIG_SS7: x = 1; ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);+/* Fall through */+case SIG_MFCR2: p->cid_num = '\0'; p->cid_name = '\0';+break;+default:+break; }x = 0;@@ -4529,8 +4538,6 @@ } #endif #ifdef HAVE_OPENR2-p->cid_num = '\0';-p->cid_name = '\0'; if (p->mfcr2 && p->mfcr2call && openr2_chan_get_direction(p->r2chan) != OR2_DIR_STOPPED) { ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel); /* If it's an incoming call, check the mfcr2_forced_release setting */@@ -10503,12 +10510,19 @@ ast_copy_string(tmp->context, conf->chan.context, sizeof(tmp->context)); ast_copy_string(tmp->parkinglot, conf->chan.parkinglot, sizeof(tmp->parkinglot)); tmp->cid_ton = 0;-if ((tmp->sig != SIG_PRI) || (tmp->sig != SIG_SS7) || (tmp->sig != SIG_BRI) || (tmp->sig != SIG_BRI_PTMP) || (tmp->sig != SIG_MFCR2)) {+switch (tmp->sig) {+case SIG_PRI:+case SIG_BRI:+case SIG_BRI_PTMP:+case SIG_SS7:+case SIG_MFCR2:+tmp->cid_num = '\0';+tmp->cid_name = '\0';+break;+default: ast_copy_string(tmp->cid_num, conf->chan.cid_num, sizeof(tmp->cid_num)); ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name));-} else {-tmp->cid_num = '\0';-tmp->cid_name = '\0';+break; } ast_copy_string(tmp->mailbox, conf->chan.mailbox, sizeof(tmp->mailbox)); if (channel != CHAN_PSEUDO && !ast_strlen_zero(tmp->mailbox)) { 
 
二,asterisk-1.6.2.6-2 rpm重新打包
 
1,打包环境配置以及依赖rpm的解决(重点)
 
  1)本文基于Elastix2.0环境,及Elastix2.0的asterisk-1.6.2.6-2.src.rpm制作
 
  2)安装WinSCP linux图形客户端,puTTY等 
 
  3)打包工具的安装,创建rpm文件需要rpm-build工具,Elastix2.0默认不提供这个工具,我们需要手动安装,
 
       命令行输入如下即可
 
       $ yum -y install rpm-build
 
 
  3)打包
 

[*]首先下载asterisk-1.6.2.6-2.src.rpm
[*]将下载的*.src.rpm通过WinSCP放入/opt目录(自由选择)
[*]cd到/opt目录输入命令     rpm -ivh asterisk-1.6.2.6-2.src.rpm,默认情况下会解压到/usr/src/redhat/SOURCES目录,如果解压出错输入命令  mkdir /usr/src/redhat
[*]cd /usr/src/redhat/SOURCES/asterisk-1.6.2.6
[*]tar -zxvf asterisk-1.6.2.6.tar.gz
[*]将修改后的chan_dahdi.c文件放入/usr/src/redhat/SOURCES/asterisk-1.6.2.6-2/channels目录内
[*]tar -czvf asterisk-1.6.2.6.tar.gz asterisk-1.6.2.6
[*]cd ../SPECS
[*]rpmbuild --bb asterisk.spec 
[*]运行上述命令时,停止命令,列出依赖 postgresql-devel libogg-devel, libvorbis-devel unixODBC-devel, libtool, sqlite-devel    net-snmp-develcurl-devel  libxml2-devel  speex-devel  mISDNuser-devel, mISDN-devel mISDNuser,然后我们安装这些程序
[*]yum -y install  postgresql-devel libogg-devel gsm-devel libvorbis-devel unixODBC-devel  libtool sqlite-devel    net-snmp-devel   curl-devel   libxml2-devel  alsa-lib-devel mISDN-devel
[*]注意上述11中无speex-devel mISDNuser-devel mISDNuser ,因为这三个包需要手动下载,使用yum 无法安装的,因为Elastix2.0使用的是speex1.2-rc1-1,但是在CentOS所有yum源中都是1.0.5、elastix官方未提供speex-devel -rc1的源,因此我们要手动下载,可使用英文版google搜索,附件内提供需要rpm,
[*]将mISDNuser-1.1.9.1-0.i386.rpm,mISDNuser-devel-1.1.9.1-0.i386.rpm,speex-devel-1.2rc1-1.i386.rpm放入/opt文件夹内
[*]依次安装rpm -ivh *.rpm ( mISDNuser-1.1.9.1-0.i386.rpm,mISDNuser-devel-1.1.9.1-0.i386.rpm,speex-devel-1.2rc1-1.i386.rpm),将*替换相应rpm
[*]现在进入/usr/src/redhat/SPECS
[*]rpmbuild --bb asterisk.spec
[*]Ok  等待编译 rpm生成
 
 
 
 
 
 
页: [1]
查看完整版本: asterisk-1.6.2.6-2来电显示的bug修复以及asterisk-1.6.2.6-2 rpm重新打包