﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-八叶草(徐怀移)-随笔分类-asterisk</title><link>http://www.cppblog.com/byc/category/17750.html</link><description>学习资料记录</description><language>zh-cn</language><lastBuildDate>Wed, 17 Apr 2013 03:50:47 GMT</lastBuildDate><pubDate>Wed, 17 Apr 2013 03:50:47 GMT</pubDate><ttl>60</ttl><item><title>freepbc 呼出等待时间修改</title><link>http://www.cppblog.com/byc/archive/2013/04/17/199505.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Wed, 17 Apr 2013 03:17:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2013/04/17/199505.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/199505.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2013/04/17/199505.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/199505.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/199505.html</trackback:ping><description><![CDATA[modules\core\functions.inc.php<br />查找 macro-dialout-trunk<br />然后<br />&nbsp;$ext-&gt;add($context, $exten, '', new ext_dial('${OUT_${DIAL_TRUNK}}/${OUTNUM}', '300,${DIAL_TRUNK_OPTIONS}'));&nbsp; // Regular Trunk Dial<br /><br />&nbsp;&nbsp;$ext-&gt;add($context, $exten, 'skipoutnum', new ext_dial('${pre_num:4}${the_num}${post_num}', '300,${DIAL_TRUNK_OPTIONS}'));<br /><br />300 改成你自己设置的时间 <img src ="http://www.cppblog.com/byc/aggbug/199505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2013-04-17 11:17 <a href="http://www.cppblog.com/byc/archive/2013/04/17/199505.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>proxmox ve 2.2 elastix2.3模板制作</title><link>http://www.cppblog.com/byc/archive/2012/11/06/194720.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Tue, 06 Nov 2012 08:59:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/11/06/194720.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/194720.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/11/06/194720.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/194720.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/194720.html</trackback:ping><description><![CDATA[安装好proxmox ve 2.2<br />ssh 到 proxmox ve <br /><br />apt-get -y update<br />apt-get -y makedev<br />apt-get -y install build-essential make pve-headers-`uname -r`<br />cd /usr/src/<br />wget <a class="external free" title="http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz" href="http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz" rel="nofollow">http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz</a><br />tar zxfv dahdi-linux-complete-current.tar.gz<br />cd dahdi-linux-complete-*<br />make all<br />make install<br />make config<br />mkdir /etc/asterisk<br />service dahdi start<br />dahdi_genconf<br />vi /etc/dahdi/modules 全部加#号注释<br /><br />sed -i 's|ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length|ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp|' /etc/vz/vz.conf<br />/etc/init.d/vz restart<br /><br />//禁用ipv6<br />/boot/grub/grub.cfg 中 linux&nbsp;&nbsp; /vmlinuz-2.6.32-16-pve root=/dev/mapper/pve-root ro&nbsp; quiet 替换成 <font color="#000000" face="Verdana">linux&nbsp;&nbsp; /vmlinuz-2.6.32-16-pve root=/dev/mapper/pve-root ro&nbsp; ipv6.disable=1 quiet</font><br /><br /><br />在elastix2.3机器上 参考 <a href="http://wiki.openvz.org/Creating_a_CentOS_5.0_Template">http://wiki.openvz.org/Creating_a_CentOS_5.0_Template</a><br /><br />
<p>First, create a file called <strong>/tmp/exclude</strong> and add the following lines to it:</p>
<p>.bash_history</p>
<p>lost+found</p>
<p>/dev/*</p>
<p>/mnt/*</p>
<p>/tmp/*</p>
<p>/proc/*</p>
<p>/sys/*</p>
<p>/usr/src/*<br /><br />&nbsp;<strong>tar --numeric-owner -czvf /tmp/centos-5.7-x86_64-elasitx_orig-image.tar.gz -X /tmp/exclude /<br /></strong></p>
<ol><li>where &lt;<strong>ARCH</strong>&gt; represents the system architecture (<strong>i386</strong> or</li><li><strong>x86_64</strong>) and &lt;<strong>DISTRO</strong>&gt; represents the distribution (default, minimal, etc.).</li></ol>
<p>scp <strong>/tmp/centos-5.7-x86_64-elasitx_orig-image.tar.gz </strong>root@ip:/var/lib/vz/template/iso<br /><br />回到proxmox ve 机器 使用 web以<strong>centos-5.7-x86_64-elasitx_orig-image </strong>为模板创建vt虚拟机&nbsp; 假设 vm id 为 100<br />ssh 到 proxmox ve<br />cd /var/lib/vz/private/100<br />Edit the <strong>etc/inittab</strong> file and comment out the lines that respawn <strong>/sbin/mingetty</strong> on <strong>tty1</strong> through <strong>tty6</strong>. Just put a # at the beginning of the line. <br /><br />在 etc/inittab 文件最后面加入 <br />1:2345:respawn:/sbin/agetty tty1 38400 linux<br /><br />Remove the <strong>etc/mtab</strong> file and then create a symbolic link by typing <strong>ln -s /proc/mounts etc/mtab</strong><br />Remove all of the lines from <strong>etc/fstab</strong> except for the line that mounts <strong>/dev/pts</strong><br />Edit <strong>etc/rc.d/rc.sysinit</strong> and comment out the line that starts <strong>/sbin/start_udev</strong> by placing a # at the beginning of the line.<br /><br />mknod dev/ptmx c 5 2 <br />mkdir dev/pts</p>
<p>cd dev<br />/sbin/MAKEDEV ttyp ptyp<br />cd ../</p>
<p>mknod dev/null c 1 3</p>
<p>mknod -m 644 dev/random c 1 8</p>
<p>mknod dev/urandom c 1 9<br />mknod dev/tty9 c 4 9<br /><br />Create the <strong>var/lock/rpm</strong> folder.<br /><br />Edit <strong>etc/sysconfig/network</strong> and set <strong>NETWORKING_IPV6</strong> to <strong>no</strong>.<br />Add the following lines to <strong>etc/modprobe.d/blacklist.conf</strong>:<br />blacklist ipv6 </p>
<p>blacklist net-pf-10<br />&nbsp;</p>
<p>Disable any physical NICs by modifying the <strong>etc/sysconfig/network-scripts/ifcfg-ethX</strong> files (where <strong>X</strong> is the interface number starting from <strong>0</strong>) and setting <strong>ONBOOT</strong> to <strong>no</strong>.</p>
<p>Check etc/sysconfig/init to see if PROMPT=yes, and then change to no. Otherwise when startup init script rc will enter interactive mode and wait there forever</p>
<p>&nbsp;</p>
<p>vzctl set 100 --devnodes dahdi/pseudo:rw --save<br />vzctl start 100<br />vzctl enter 100<br />chkconfig haldaemon off<br />chkconfig dahdi off<br />chkconfig wanrouter off<br /><br />rm -rf /etc/init.d/dahdi<br />rm -rf /etc/init.d/wanrouter<br /><br />chkconfig acpid off<br />chkconfig kudzu off<br /><br />chkconfig xfs off <br />chkconfig rpcidmapd off <br />chkconfig rpcgssd off <br />chkconfig nfslock off<br />chkconfig mdmonitor off<br />chkconfig ip6tables off<br /><br />exit<br />cd /var/lib/vz/private/100<br />tar -czvf /var/lib/vz/template/cache/centos-5-x86_64-elasitx.tar.gz ./<br /><br /><br /><br /><br /><br /><br />&nbsp;</p><img src ="http://www.cppblog.com/byc/aggbug/194720.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-11-06 16:59 <a href="http://www.cppblog.com/byc/archive/2012/11/06/194720.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转 a2billing</title><link>http://www.cppblog.com/byc/archive/2012/10/11/193154.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Thu, 11 Oct 2012 02:56:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/10/11/193154.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/193154.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/10/11/193154.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/193154.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/193154.html</trackback:ping><description><![CDATA[A2Billing 安裝篇 <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk/Addons/A2Billing_%e5%ae%89%e8%a3%9d%e7%af%87">http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk/Addons/A2Billing_%e5%ae%89%e8%a3%9d%e7%af%87</a><br /><br />A2Billing 管理篇 
<div class="pageStatus">
<div id="sessionMsg">
<div class="inner">
<ul></ul></div></div></div>
<div class="PageDW-VoIPIPPBXIPPBXAsteriskIPPBXAddonsA2Billing">
<div id="page-top">
<div id="pageToc">
<div class="pageToc">
<h5><a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87">http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87</a></h5>
<ol style="list-style-type: none; padding-left: 0px; margin-left: 0px"><li><span>1.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e5.89.8d.e8.a8.80" rel="internal">前言</a></li><li><span>2.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e5.88.9d.e5.a7.8b.e5.8c.96.e8.a8.ad.e5.ae.9a" rel="internal">初始化設定</a></li><li><span>3.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e6.87.89.e7.94.a8.e4.b8.80.ef.bc.9a.e5.9c.8b.e9.9a.9b.e9.9b.bb.e8.a9.b1.e5.8d.a1.e6.a8.a1.e5.bc.8f" rel="internal">應用一：國際電話卡模式</a></li><li><span>4.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e6.87.89.e7.94.a8.e4.ba.8c.ef.bc.9aDID_.e8.bd.89.e6.8e.a5.e6.a5.ad.e5.8b.99" rel="internal">應用二：DID 轉接業務</a></li><li><span>5.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e6.87.89.e7.94.a8.e4.b8.89.ef.bc.9a.e9.a0.90.e4.bb.98.e5.88.b6.e3.80.81.e6.9c.88.e4.bb.98.e5.88.b6.e6.9c.83.e5.93.a1.e6.a8.a1.e5.bc.8f" rel="internal">應用三：預付制、月付制會員模式</a></li><li><span>6.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e6.87.89.e7.94.a8.e5.9b.9b.ef.bc.9a.e6.95.b4.e5.90.88_FreePBX_.e7.9a.84.e6.87.89.e7.94.a8" rel="internal">應用四：整合 FreePBX 的應用</a></li><li><span>7.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e6.87.89.e7.94.a8.e4.ba.94.ef.bc.9aCaller_ID_.e8.aa.8d.e8.ad.89.e6.a8.a1.e5.bc.8f" rel="internal">應用五：Caller ID 認證模式</a></li><li><span>8.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#F.A.Q" rel="internal">F.A.Q</a> 
<ol style="list-style-type: none; padding-left: 15px; margin-left: 0px"><li><span>8.1.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#Q.3a.e5.a6.82.e4.bd.95.e5.a4.a7.e9.87.8f.e5.88.aa.e9.99.a4_Customers.3f" rel="internal">Q:如何大量刪除 Customers?</a></li><li><span>8.2.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#Q.3a.e5.a6.82.e4.bd.95.e5.a4.a7.e9.87.8f.e5.88.aa.e9.99.a4_VoIP_Settings.3f" rel="internal">Q:如何大量刪除 VoIP Settings?</a></li><li><span>8.3.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#Q.3a.e5.a6.82.e4.bd.95.e8.ae.8a.e6.9b.b4.e7.b3.bb.e7.b5.b1.e9.a0.90.e8.a8.ad.e5.b9.a3.e5.88.a5_USD" rel="internal">Q:如何變更系統預設幣別 USD</a></li><li><span>8.4.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#Q.3a.e5.8c.af.e5.85.a5_ratecard_.e6.99.82.e7.b8.bd.e6.98.af.e5.87.ba.e7.8f.be.e9.8c.af.e8.aa.a4_ERROR.3a_file_type_is_not_allowed.3a_application.2fforce-download" rel="internal">Q:匯入 ratecard 時總是出現錯誤 ERROR: file type is not allowed: application/force-download</a></li><li><span>8.5.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e7.9b.b8.e9.97.9c.e9.80.a3.e7.b5.90" rel="internal">相關連結</a></li><li><span>8.6.</span> <a href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk_-_%e5%85%8d%e8%b2%bb_IP_PBX_%e7%b6%b2%e8%b7%af%e9%9b%bb%e8%a9%b1%e4%ba%a4%e6%8f%9b%e5%b9%b3%e5%8f%b0/Addons/A2Billing_%e7%ae%a1%e7%90%86%e7%af%87#.e7.99.bc.e7.8f.be_Bug" rel="internal">發現 Bug</a></li></ol></li></ol></div></div>
<div id="pageText" class="pageText">
<div id="section_1"><span id=".e5.89.8d.e8.a8.80"></span>
<h4 class="editable">前言</h4>
<p>A2Billing 是目前社群開發最熱門的計費系統套件，因為是開放原始碼授權所以可以合法免費使用。</p>
<p>本篇主要在是教導如何使用這套件，<strong>若還沒完成安裝的朋友，請先前往閱讀</strong> <a title="VoIP/IP PBX/軟體式 IP PBX/Asterisk/Addons/A2Billing 安裝篇" href="http://www.osslab.com.tw/VoIP/IP_PBX/%e8%bb%9f%e9%ab%94%e5%bc%8f_IP_PBX/Asterisk/Addons/A2Billing_%e5%ae%89%e8%a3%9d%e7%af%87" rel="internal">A2Billing 安裝篇</a>。</p></div>
<div id="section_2"><span id=".e5.88.9d.e5.a7.8b.e5.8c.96.e8.a8.ad.e5.ae.9a"></span>
<h4 class="editable">初始化設定</h4>
<p>系統在完成安裝後，第一個所要做的設定有：</p>
<p>// FreePBX UI &gt; Trunks</p>
<p style="margin-left: 40px">新增 Outbound Trunk，本篇以 Voxalot 為例。</p>
<p style="margin-left: 40px">Outgoing Settings<br />Trunk Name = voxalot</p><pre style="margin-left: 40px">host=us.voxalot.com
username=&lt;sip_number&gt;
fromuser=&lt;sip_number&gt;
secret=&lt;sip_pass&gt;
fromdomain=voxalot.com
nat=yes
insecure=port,invite
qualify=yes
canreinvite=yes
dtmfmode=auto
disallow=all
allow=ulaw&amp;alaw
type=peer
context=from-trunk</pre>
<p style="margin-left: 40px">新增 Inbound Trunk，這個主要在展示國際電話卡及 DID 轉接的應用，本篇以 iptel 為例。</p>
<p style="margin-left: 40px">Outgoing Settings<br />Trunk Name: iptel</p><pre style="margin-left: 40px">username=&lt;sip_username&gt;
type=friend
secret=&lt;sip_pass&gt;
qualify=yes
insecure=port,invite
host=iptel.org
fromuser=osslab
fromdomain=iptel.org
context=a2billing
</pre>
<p style="margin-left: 40px">Register String: &lt;sip_username&gt;:&lt;sip_pass&gt;@iptel.org/&lt;sip_number&gt;</p>
<p style="margin-left: 40px"><span style="color: rgb(255,0,0)">注意：context 必須是 a2billing</span><br /></p>
<p>// A2Billing Admin UI &gt; Trunk &gt; Create Provider</p>
<p style="margin-left: 40px">provider name = VOXALOT_PROVIDER<br />description = Voxalot Provider</p>
<p>// A2Billing Admin UI &gt; Trunk &gt; Add Trunk</p>
<p style="margin-left: 40px">voip-provider = VOXALOT_PROVIDER<br />label = VOXALOT_TRUNK<br />add prefix = 空白<br />provider tech = SIP<br />provider ip = voxalot<br />status = Active</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>provider ip 必須與 FreePBX 的 trunk name 相同</p></blockquote>
<p style="margin-left: 40px"></p>
<p>// A2Billing Admin UI &gt; Ratecard &gt; Create call plan</p>
<p style="margin-left: 40px">name = VOXALOT_CALLPLAN<br />remove inter prefix = YES</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>remove inter prefix = YES 若撥號有包含 00 或 011 開頭的國際冠碼，在套用 ratecard 的規則前會被去除。</p></blockquote>
<p>// A2Billing Admin UI &gt; Ratecard &gt; Create new ratecard</p>
<p style="margin-left: 40px">tariffname = VOXALOT_RATECARD<br />trunk = VOXALOT_TRUNK<br />description = through voxalot trunk</p>
<p>// A2Billing Admin UI &gt; Ratecard &gt; Add Rate</p>
<p style="margin-left: 40px">ratecard = VOXALOT_RATECARD<br />dialprefix = 1800<br />destination = US-Tollfree<br />buying rate = 1<br />buyrate min duration = 6<br />buyrate billing block = 6<br />selling rate = 1.5<br />sellrate min duration = 60<br />sellrate billing block = 60<br />trunk = VOXALOT_TRUNK</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ dialprefix 若撥號規則符合，會以此費率計算<br />＊ destination 用來敘述此費率的區域</p></blockquote>
<p>//新增 rate 後要再回到 call plan 將 rate card 加入到 call plan<br />A2Billing Admin UI &gt; Ratecard &gt; List Call Plan &gt; Edit: VOXALOT_CALLPLAN</p>
<p style="margin-left: 40px">ratecard = 選擇 VOXALOT_RATECARD, Add Ratecard</p></div>
<div id="section_3"><span id=".e6.87.89.e7.94.a8.e4.b8.80.ef.bc.9a.e5.9c.8b.e9.9a.9b.e9.9b.bb.e8.a9.b1.e5.8d.a1.e6.a8.a1.e5.bc.8f"></span>
<h4 class="editable">應用一：國際電話卡模式</h4>
<p>客戶操作流程：<br />&#9312; 使用手機或一般電話機撥打系統號碼(Access Number)</p>
<p>&#9313; 語音提示：輸入電話卡號＋＃</p>
<p>&#9314; 語音提示餘額，輸入目的地電話號碼（00＋國碼＋區碼＋電話號碼＋＃）</p>
<p>// A2Billing Admin UI &gt; Customers &gt; Create Customers</p>
<p style="margin-left: 40px">card number = &lt;隨機產生&gt;<br />card alias = &lt;隨機產生&gt;；web 登入帳號<br />webui password = &lt;隨機產生&gt;；web 登入密碼<br />balance = 50.0；不可為零，且必須以 USD 計算<br />call plan = VOXALOT_CALLPLAN<br />activated = YES<br />simultaneous access = INDIVIDUAL ACCESS<br />card type = PREPAID CARD<br />country = TAIWAN<br />sip account = NO<br />iax account = NO</p>
<p>實際操作：</p>
<p style="margin-left: 40px">因為本篇實做是以 iptel 的號碼作為系統號碼，所以用其他 IPTel 帳號撥入系統號碼，系統會提示語音：請輸入 card number，將剛剛新增的卡號輸入，完成後按＃，若正確，系統會提示餘額及可用通話時間，並提示：請輸入目的地電話號碼，將完整電話號碼 011 + 國碼 + 區碼 + 電話號碼 輸入，完成後按＃。</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ 新增電話卡(Customer)，有一些主要的設定，例如 card number, card alias, password，這些是由系統隨機產生，且沒有任何規則，hacker 無法事先計算出這些資訊。<br />＊ 附加在 card number 的 另一組代號 alias，這個號碼或 email 地址都可以用來登入用戶的網頁，密碼就是 webui password。 <br />＊ 若用戶撥號時有加 00，請注意 <strong>Call Plan</strong> 的 <strong>REMOVE INTER PREFIX</strong> 建議設為 <strong>YES</strong>，以避免 outbound 路由錯誤。</p></blockquote></div>
<div id="section_4"><span id=".e6.87.89.e7.94.a8.e4.ba.8c.ef.bc.9aDID_.e8.bd.89.e6.8e.a5.e6.a5.ad.e5.8b.99"></span>
<h4 class="editable">應用二：DID 轉接業務</h4>
<p>A2Billing 提供 DID 接駁至經由 outbound trunk 的外部號碼、SIP URI、</p>
<p>// A2Billing Admin UI &gt; DID &gt; Add DID Group</p>
<p style="margin-left: 40px">name = DID TWN</p>
<p>// A2Billing Admin UI &gt; DID &gt; Add DID</p>
<p style="margin-left: 40px">DID = 99474<br />billing = only dialout rate<br />DID group = DID TWN<br />country = TAIWAN<br />activated = YES<br />monthly rate = 0</p>
<p>// A2Billing Admin UI &gt; Customers &gt; Create Customers</p>
<p style="margin-left: 40px">balance = 50.0<br />call plan = VOXALOT_CALLPLAN<br />didgroup = DID TWN<br />activated = YES<br />card type = PREPAID CARD<br />country = TAIWAN<br />sip account = NO<br />iax account = NO</p>
<p><strong>設定轉接的目的號碼，可以透過 Admin UI 或 Customer UI 來作</strong><br />客戶自行購買 DID 號碼<br />// A2Billing Customer UI &gt; DID</p>
<p style="margin-left: 40px">select country = TAIWAN<br />select virtual phone number = 99474<br />voip call = NO<br />destination = 8864123456</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ select country 這裡內容會與 DID 的 country 相同<br />＊ 若沒有出現 DID number 可選擇，請檢查所登入的 customer 帳號的 DIDGROUP 是否正確<br />＊ voip call 若是 NO，輸入外部的 PSTN/SIP 號碼；若是 YES，輸入 SIP URI。</p></blockquote>
<p>管理員分配 DID 號碼給指定的客戶<br />// A2Billing Admin UI &gt; INBOUND DID &gt; Destination</p>
<p style="margin-left: 40px">destination = 8864123456<br />customer ID = 選擇適當的 customer<br />DID = 選擇適當的 DID<br />activated = yes<br />validated = 皆可<br />voip_call = no</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ voip call 若是 NO，輸入外部的 PSTN/SIP 號碼；若是 YES，輸入 SIP URI。</p>
<p>＊ 若需 DID 接入內部分機號碼(不經過 A2B 的 trunk)，可以這樣設<br />-- destination = Local/101@from-internal (適用 FreePBX 的分機 101)<br />-- destination = SIP/123456 (適用 A2Billing card number 123456)<br />-- voip_call = yes</p>
<p>* 如果 destination number 要走 A2B 的 trunk，不管該 trunk 是 SIP 或 Zaptel，voip_call 必須是 no。</p></blockquote>
<p>相關文章連結：</p>
<ul><li><a class=" external" title="http://www.elastix.org/en/component/kunena/33-a2billing/61386-inbound-did-billing-for-a2billing.html" href="http://www.elastix.org/en/component/kunena/33-a2billing/61386-inbound-did-billing-for-a2billing.html" rel="external nofollow" target="_blank">Elastix Forum :: Inbound DID Billing for A2Billing</a></li></ul></div>
<div id="section_5"><span id=".e6.87.89.e7.94.a8.e4.b8.89.ef.bc.9a.e9.a0.90.e4.bb.98.e5.88.b6.e3.80.81.e6.9c.88.e4.bb.98.e5.88.b6.e6.9c.83.e5.93.a1.e6.a8.a1.e5.bc.8f"></span>
<h4 class="editable">應用三：預付制、月付制會員模式</h4>
<p>用戶操作流程：<br />&#9312; 用戶使用 X-Lite 或 ATA 設備透過網路註冊為分機。</p>
<p>&#9313; 直接撥目的地電話號碼，例如 886+XXXXXXXX，886 是國碼。<br />過程中不會有任何額外的提示音，就像一般的 SIP 分機操作相同。</p>
<p>// A2Billing Admin UI &gt; Customers &gt; Create Customers</p>
<p style="margin-left: 40px">card number = &lt;隨機產生&gt;<br />card alias = &lt;隨機產生&gt;；web 登入帳號<br />webui password = &lt;隨機產生&gt;；web 登入密碼<br />balance = 50.0；不可為零，且必須以 USD 計算<br />call plan = VOXALOT_CALLPLAN<br />activated = YES<br />simultaneous access = INDIVIDUAL ACCESS<br />card type = PREPAID CARD<br />country = TAIWAN<br />sip account = YES<br />iax account = YES</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ 這裡與(應用一)模式設定相同，只差在 sip/iax account 為 YES。<br />＊ 新增 customer 後，要 reload Asterisk 後，SIP 用戶端才能註冊使用。</p></blockquote>
<p>// 取消 "輸入目的地號碼" 及其他提示音<br />// A2Billing Admin UI &gt; System Settings &gt; Global List<br />如果這裡的所有項目沒有 GROUP 為 <span style="color: rgb(255,0,0)">agi-conf</span><strong><span style="color: rgb(255,0,0)">2</span></strong> 的(可善用 GROUP 搜尋功能)，請先前往 <span style="color: rgb(0,0,255)">Add agi-conf &gt; CREATE AGI-CONF2</span>。</p>
<p>回到 Global List 找到 GROUP 為 <span style="color: rgb(255,0,0)">agi-conf</span><strong><span style="color: rgb(255,0,0)">2</span></strong> 且 KEY/VALUE 按以下所述修改：</p>
<p style="margin-left: 40px">use_dnid = yes</p>
<p>這個SIP帳號除了要撥外部的路由外，如果還要撥內部的其他 SIP 分機號，需要繼續下面的修改：</p>
<p style="margin-left: 40px">sip_iax_friends = yes<br />sip_iax_pstn_direct_call_prefix = 555<br />sip_iax_pstn_direct_call = yes</p>
<p>&#8251;是否要提示餘額的語音</p>
<p style="margin-left: 40px">say_balance_after_auth = no<br />say_timetocall = no</p>
<p>如果電話不通，不要提示輸入目的地號碼的語音</p>
<p style="margin-left: 40px">number_try = 1</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p>＊ 參數說明：</p>
<p>- <strong>Use DNID</strong> : YES 表示使用 DNID，並且不會提示 輸入目的地電話號碼的語音<br />- <strong>SIP Call = yes, SIP Call Prefix, Direct Call</strong>: 這三個參數是用來使 SIP 註冊帳號後，也能撥其他分機號碼，撥法為 555+SIP Extension<br />- <strong>Say Balance After Auth</strong>: 認證後是否提示餘額<br />- <strong>Say Duration</strong>: 是否提示剩餘通話時間</p>
<p>- 另一種比較快速的設定是：play_audio = no, use_dnid=yes, number_try=1。</p></blockquote>
<p>//為此模式新增 dialplan<br />//編輯 /etc/asterisk/extensions_a2billing.conf，在底下加入：</p><pre style="margin-left: 40px">[custom-a2billing-sipclient]
exten =&gt; _X.,1,Answer
exten =&gt; _X.,n,Wait(1)
exten =&gt; _X.,n,deadAGI(a2billing.php|2)
exten =&gt; _X.,n,Hangup
</pre>
<p>&nbsp;</p>
<p>// 在 A2Billing 套用新增的 dialplan<br />// A2Billing Admin UI &gt; Customer &gt; VoIP Settings<br />找到 SIP 分機項目，按編輯</p>
<p style="margin-left: 40px">Context = custom-a2billing-sipclient</p>
<p>// 最後，執行指令套用所有的修改</p>
<p># asterisk -rx "reload"</p>
<p><span style="color: rgb(0,0,255)"><strong>TIPs:</strong></span></p>
<blockquote>
<p><span style="color: rgb(255,0,0)">由於版本 1.7.x 的 bug 關係，在 UI 做完操作後，並不會同步修改 asterisk 的設定檔，所以請依照方式作手動修改：<br />編輯 /etc/asterisk/additional_a2billing_sip.conf ，修改 context 的內容。<br />要避免每次都要作手動修改，可以參考 F.A.Q 的方法。<br /></span></p></blockquote></div>
<div id="section_6"><span id=".e6.87.89.e7.94.a8.e5.9b.9b.ef.bc.9a.e6.95.b4.e5.90.88_FreePBX_.e7.9a.84.e6.87.89.e7.94.a8"></span>
<h4 class="editable">應用四：整合 FreePBX 的應用</h4>
<p>用途：FreePBX 的分機用戶，在 Outbound Calling 時可以透過 A2Billing 來計費，但其他原有PBX的功能都不會有影響。</p>
<p>// 編輯 /etc/asterisk/extensions_custom.conf</p><pre style="margin-left: 40px">[macro-dialout-trunk-predial-hook]
exten =&gt; s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten =&gt; s,2,MacroExit

[custom-freepbx-a2billing]
exten =&gt; _X.,1,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
exten =&gt; _X.,n,Hangup()
</pre>
<p>&nbsp;</p>
<p>// FreePBX UI &gt; Trunks &gt; Add Custom Trunk</p>
<p style="margin-left: 40px">Custom Dial String = A2B/2</p>
<p>Tips:</p>
<blockquote>
<p>2 代表是 agi-conf 2</p></blockquote>
<p>// FreePBX UI &gt; Outbound Routes <br />自行設定需要的參數，並導向剛剛的 Trunk。</p>
<p>// FreePBX UI &gt; Extensions<br />在需要計費的分機設定裡，參數 <span style="color: rgb(0,0,255)">accountcode</span> 填入 A2Billing 的 Card Number。</p>
<p>Tips:</p>
<blockquote>
<p>分機在外撥的路由規則，除了 outbound route 外，還要考慮 A2Billing 的，也就是 <span style="color: rgb(0,0,255)">RATES</span> 的相關設定。</p></blockquote>
<p>延伸閱讀</p>
<ul><li><a class="external" title="http://sysadminman.net/blog/2010/using-a2billing-to-account-for-extension-calls-in-elastix-1307" href="http://sysadminman.net/blog/2010/using-a2billing-to-account-for-extension-calls-in-elastix-1307" rel="external nofollow" target="_blank">Using A2Billing to account for extension calls in Elastix</a> (A2Billing 1.3.x)</li></ul></div>
<div id="section_7"><span id=".e6.87.89.e7.94.a8.e4.ba.94.ef.bc.9aCaller_ID_.e8.aa.8d.e8.ad.89.e6.a8.a1.e5.bc.8f"></span>
<h4 class="editable">應用五：Caller ID 認證模式</h4>
<p>用途：設定電話卡時除了使用輸入卡號的認證方式以外，還能以來電號碼(Caller ID) 辨識來認證。</p>
<ul><li>啟用 Caller ID 後，用戶不需要先輸入卡號，就可以直接撥目的地號碼。</li><li>一個卡號可以設定一組或多組的來電號碼。</li><li>使用 Admin UI 來管理來電號碼。</li><li>一旦啟用後，當用戶的來電號碼並非系統所允許時，系統會提示卡號的認證的方式。</li></ul>
<p>&nbsp;</p>
<p>// 啟用方式<br />A2Billing Admin UI &gt; Syetem Settings &gt;</p>
<p>以 agi-conf 的方式來設，可以很容易啟用/關閉這功能，需要用到的參數(Key)如下：</p>
<ul><li>cid_enable = yes ；yes 啟用，no 關閉，預設是關閉的</li><li>cid_askpincode_ifnot_callerid = yes ; 預設 yes，若 CID 認證失敗，系統會提示輸入 Card Number。</li><li>cid_auto_assign_card_to_cid = yes ; 預設 yes，用戶撥入系統後，如果 CID 認證失敗，系統會提示輸入 Card Number，一旦用戶輸入資訊正確，系統會自動新增 CID，以致於該用戶下次再撥入時，就可以通過 CID 認證，且不會再提示輸入 Card Number。</li><li>cid_auto_create_card = no</li></ul>
<p>// 新增 Caller ID</p>
<p>A2Billing Admin UI &gt; Customers &gt; Caller-ID</p>
<p style="margin-left: 40px">CallerID = &lt;用戶的來電號碼&gt;<br />Activated = yes<br />ID Card = &lt;選擇卡號&gt;</p></div>
<div id="section_8"><span id="F.A.Q"></span>
<h4 class="editable">F.A.Q</h4>
<div id="section_9"><span id="Q.3a.e5.a6.82.e4.bd.95.e5.a4.a7.e9.87.8f.e5.88.aa.e9.99.a4_Customers.3f"></span>
<h5 class="editable">Q:如何大量刪除 Customers?</h5>
<p>Ans: A2Billing UI &gt; Customers &gt; Add::Search &gt; Search Customers</p>
<p>設定搜尋條件 &gt; 按 Search &gt; 再按旁邊的 Delete All</p>
<p>注意：這個方法無法將 VoIP Setting 一併刪除。</p></div>
<div id="section_10"><span id="Q.3a.e5.a6.82.e4.bd.95.e5.a4.a7.e9.87.8f.e5.88.aa.e9.99.a4_VoIP_Settings.3f"></span>
<h5 class="editable">Q:如何大量刪除 VoIP Settings?</h5>
<p>Ans: 目前沒有合適的作法。</p></div>
<div id="section_11"><span id="Q.3a.e5.a6.82.e4.bd.95.e8.ae.8a.e6.9b.b4.e7.b3.bb.e7.b5.b1.e9.a0.90.e8.a8.ad.e5.b9.a3.e5.88.a5_USD"></span>
<h5 class="editable">Q:如何變更系統預設幣別 USD</h5>
<p>Ans: 要改兩個地方，修改 base_currency 的參數及更新 currency list。</p>
<ol><li>A2Billing UI &gt; System Settings &gt; Global List<br />搜尋 GROUP = global, Key = base_currency<br />base_curreny = twd</li><li>即使修改了幣別，系統預設的 currency list 仍是以美金 1:1 計算，所以必須修改這個匯率對照表為 TWD 1:1。<br />A2Billing UI &gt; BILLING &gt; Currency List &gt; CLICK HERE TO UPDATE NOW</li></ol></div>
<div id="section_12"><span id="Q.3a.e5.8c.af.e5.85.a5_ratecard_.e6.99.82.e7.b8.bd.e6.98.af.e5.87.ba.e7.8f.be.e9.8c.af.e8.aa.a4_ERROR.3a_file_type_is_not_allowed.3a_application.2fforce-download"></span>
<h5 class="editable">Q:匯入 ratecard 時總是出現錯誤 ERROR: file type is not allowed: application/force-download</h5>
<p>Ans: 將副檔名 csv 改成 txt。</p></div>
<div id="section_13"><span id=".e7.9b.b8.e9.97.9c.e9.80.a3.e7.b5.90"></span>
<h5 class="editable">相關連結</h5>
<ul><li><a class=" external" title="http://blogtech.oc9.com/index.php?view=article&amp;id=237:as20091005&amp;option=com_content&amp;Itemid=6" href="http://blogtech.oc9.com/index.php?view=article&amp;id=237%3Aas20091005&amp;option=com_content&amp;Itemid=6" rel="external nofollow" target="_blank">Asterisk: optimizing a2billing mysql database with more than 1,000,000 rates in cc_ratecard</a></li><li><a class=" external" title="http://sysadminman.net/blog/category/a2billing-100-call-plan-hosting/" href="http://sysadminman.net/blog/category/a2billing-100-call-plan-hosting/" rel="external nofollow" target="_blank">一些有用的教學(英文)</a></li></ul></div>
<div id="section_14"><span id=".e7.99.bc.e7.8f.be_Bug"></span>
<h5 class="editable">發現 Bug</h5>
<p>&nbsp;</p>
<table style="width: 100%; table-layout: fixed" border="1" cellspacing="1" cellpadding="1">
<tbody>
<tr>
<td style="width: 100px">版本</td>
<td>問題描述</td></tr>
<tr>
<td style="width: 100px">1.7.0/1</td>
<td>修改 VoIP Settings 的 內容，不會同步更新 Asterisk 設定</td></tr>
<tr>
<td style="width: 100px"></td>
<td><span style="color: rgb(0,0,255)">Ans:這是因為 A2Billing 預設是啟動了 Realtime Asterisk 模式(Asterisk 以資料庫型式儲存設定)，若只是檢查 *.conf 來判斷 Asterisk 是否更新是不準確的，然而這 bug 卻造成 A2Billing 無法以 relatime 模式更新 Asterisk。暫時的解決方法是使 A2Billing 關閉 realtime asterisk 模式，恢復成 *.conf 方式來更新 asterisk，步驟如下： </span>
<p><span style="color: rgb(0,0,255)">A2Billing UI &gt; System Settings &gt; Global List<br />搜尋 GROUP = global</span></p>
<p style="margin-left: 40px"><span style="color: rgb(0,0,255)">use_realtime = no (預設為 yes)</span></p>
<p><span style="color: rgb(0,0,255)">Notes: 當關閉了 Realtime 後，爾後若有新增/編輯 VoIP Settings 時，在 CONFIRM DATA 之後，需要在作以下步驟完成 Asterisk 的更新：</span></p>
<ol><li><span style="color: rgb(0,0,255)">點選 GENERATE ADDITIONAL_A2BILLING_SIP.CONF</span></li><li><span style="color: rgb(0,0,255)">click here to reload your asterisk server</span></li></ol></td></tr>
<tr>
<td style="width: 100px">1.7.0</td>
<td>新增 CUSTOMER 時，若 balance 欄位維持預設的 0，仍可以存檔</td></tr>
<tr>
<td style="width: 100px"></td>
<td><span style="color: rgb(0,0,255)">Ans: 這項不確定是否為 bug，但在 1.3.x 穩定版，存檔前系統會檢查 balance 不可為 0。 </span></td></tr>
<tr>
<td style="width: 100px">1.7.0</td>
<td>若建立電話卡是有 SIP 註冊帳號的，刪除這個電話卡後，SIP 終端仍可以註冊，但已無法正常撥出。</td></tr>
<tr>
<td style="width: 100px">1.7.0</td>
<td>在 Customer UI 的 DID 功能，操作 Release DID，按下 Release 後，雖然 DID 有 release，但畫面會成空白頁。</td></tr>
<tr>
<td style="width: 100px">1.7.0</td>
<td>在 Customer UI 的 DID 功能，從項目列表中刪除 destination number 時，所有欄位的值會出現空白，再按下 Delete 後，雖然資料仍會刪除，但需要再做一次 Release DID。</td></tr></tbody></table></div></div></div></div></div><img src ="http://www.cppblog.com/byc/aggbug/193154.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-10-11 10:56 <a href="http://www.cppblog.com/byc/archive/2012/10/11/193154.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asterisk 调试 设置</title><link>http://www.cppblog.com/byc/archive/2012/07/14/183302.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Fri, 13 Jul 2012 23:39:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/07/14/183302.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/183302.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/07/14/183302.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/183302.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/183302.html</trackback:ping><description><![CDATA[<h2>Logging</h2>
<p><wbr></p>
<p>Sometimes, when debugging an issue, it's useful to see and log extra information and at</p>
<p>other times, you want logging to be minimal. Asterisk provides a number of ways of</p>
<p>logging information, to files or to a syslog server. The file /etc/asterisk/logger.conf</p>
<p>contains the configuration elements for logging. Asterisk has different types of message</p>
<p>that can be logged these are:</p>
<p><wbr></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="203">
<p><wbr></p>
<p>Verbose</p>
<p><wbr></p></td>
<td valign="top" width="254">
<p><wbr></p>
<p>General 'chatter' about what is</p>
<p>happening on the system.</p>
<p>Verbosity levels greater than 3</p>
<p>display dialplan commands as</p>
<p>they are executed. This</p>
<p>generates lots of log information</p>
<p><wbr></p></td></tr>
<tr>
<td valign="top" width="203">
<p><wbr></p>
<p>Debug</p></td>
<td valign="top" width="254">
<p><wbr></p>
<p>Debug messages, normally only</p>
<p>used by programmers to extract</p>
<p>extended information</p>
<p><wbr></p></td></tr>
<tr>
<td valign="top" width="203">
<p><wbr></p>
<p>Notice</p>
<p><wbr></p></td>
<td valign="top" width="254">
<p><wbr></p>
<p>Non urgent alert messages</p></td></tr>
<tr>
<td valign="top" width="203">
<p><wbr></p>
<p>Warning</p></td>
<td valign="top" width="254">
<p><wbr></p>
<p>Warning alert messages,</p>
<p>something happened that might</p>
<p>be bad. Some tell you how bad</p>
<p>the warning is</p>
<p><wbr></p></td></tr>
<tr>
<td valign="top" width="203">
<p><wbr></p>
<p>Error</p>
<p><wbr></p></td>
<td valign="top" width="254">
<p><wbr></p>
<p>Error messages, something bad</p>
<p>happened &#8211; These should be rare.</p>
<p><wbr></p></td></tr></tbody></table>
<p><wbr></p>
<p>In logger.conf you will see the [logfiles] section, this is where you define the filename</p>
<p>and content of log files. Take a look at this example entry</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>[logfiles]</p>
<p>debug =&gt; debug</p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>This tells Asterisk to log debug messages (the right side of the =&gt;) to a file called debug</p>
<p>(the left side of the =&gt;) located in <strong>/var/log/asterisk/.</strong> This directory can be changed in</p>
<p><strong>/etc/asterisk/asterisk.conf</strong> by modifying the line <em>astlogdir =&gt; /var/log/asterisk</em> to point</p>
<p>to the desired directory. You can log multiple information types to the same file or you</p>
<p>can spread the information over a number of files. For example</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>[logfiles]</p>
<p>debug =&gt; debug</p>
<p>messages=&gt;warning, error</p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>Will log debug messages to a file called <em>debug</em>, and will also log warning and error</p>
<p>messages to a file called <em>messages</em>. There is a special &#8220;file&#8221; called <em>console</em> which when</p>
<p>used will cause the message types specified to be logged to the Asterisk console, for</p>
<p>example:</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>[logfiles]</p>
<p>console =&gt; debug, warning, error, notice, verbose</p>
<p><wbr></p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>Would log everything to the console (not to any files). The above is not recommended</p>
<p>since the amount of information that would be generated could be far to much to be of</p>
<p>any real use. If you change logger.conf you need to perform a reload or do a logger</p>
<p>rotate (see next section). You can also log messages to a syslog sever (remote logging</p>
<p>server), useful if you have either a lot of machines or want centralized logging. To do</p>
<p>this use the file syslog, with the suffix you will use in /etc/syslog.conf for example, in</p>
<p>logger.conf</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>[logfiles]</p>
<p>syslog.local0 =&gt; debug, warning, error, notice, verbose</p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>And /etc/syslog.conf </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>local0.* <wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr>@192.168.1.22</p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p><wbr></p>
<p>This would send the Asterisk logging information to the syslog server at 192.168.1.22.</p>
<p><wbr></p>
<p>Setting up a syslog server is beyond the scope of this document and is left as an exercise</p>
<p>for the reader.<br clear="all" /><strong>Rotate logs</strong></p>
<p><wbr></p>
<p>It is advisable to rotate your logs frequently, depending on the amount of logging you</p>
<p>have turned on and the about of data that is actually logged. Files larger than 2Gb can</p>
<p>cause some nasty effects resulting in Asterisk crashes. You can rotate logs by using the</p>
<p>command</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="580">
<p><wbr></p>
<p>logger rotate</p>
<p><wbr></p></td>
<td valign="top" width="32">
<p><wbr></p>
<p><wbr></p>
<p><wbr></p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>This will rename the old log and start a new one. It will also reload logger.conf and</p>
<p>adopt any changes you have made to it.</p>
<p><wbr></p>
<h3>Verbosity</h3>
<p><wbr></p>
<p>You can change the verbosity (how much information we get) of the output on processes attached to the Asterisk console by setting the level of verbosity. To do this we use the <strong><em>set verbose</em></strong> command, for example:</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="580">
<p><wbr></p>
<p>set verbose 999</p>
<p><wbr></p></td>
<td valign="top" width="32">
<p><wbr></p>
<p><wbr></p>
<p><wbr></p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>Sets the verbosity level to 999, Asterisk will tell you that the level of verbosity changed</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="611">
<p><wbr></p>
<p>asterisk*CLI&gt; set verbose 999</p>
<p>Verbosity is at least 999</p>
<p>asterisk*CLI&gt;</p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<p><wbr></p>
<p>You should see every message when it is set to this level, whereas setting it to 1 will</p>
<p>show very little information.</p>
<p><wbr></p>
<table border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td valign="top" width="32">
<p><wbr></p></td>
<td valign="top" width="103">
<p><br clear="all" /></p></td>
<td valign="top" width="507">
<p><em>Setting the verbosity level changes the level on every attached</em></p>
<p><em>process (connected via asterisk -r) not just the one you issue the</em></p>
<p><em>command from.</em></p>
<p><wbr></p></td></tr></thead>
<tbody></tbody></table>
<h2>Getting to Grips with sip.conf</h2>
<p><wbr></p>
<p>sip.conf is not difficult to understand, however there is a fundamental problem with SIP making it awkward to use. The problem is not so much with SIP itself, it's more to do with how we protect our networks. We all know that there are some nasty little people out there who are quite happy to steal your resources, make free calls using someone else's money etc. As a consequence of this we tend to put a firewall between them and us. This is where the problems start for SIP. In a network environment that requires no firewall, for example and Internal network, there will be no issues, but in a more complex network, perhaps using NAT (Network address translation) there are all sorts of hurdles to overcome.</p>
<p><wbr></p>
<p>You have a number of choices,</p><br /><br /><br /><br /><br />sip set debug on 设置显示更多的sip信息<br />sip set debug off关闭显示更多的sip信息<br />SIP Channels are only shown if registered<br />SIP SHOW INUSE will list all SIP extensions defined in SIP.CONF<br />SIP SHOW CHANNELS will list all SIP extensions registered at that time<br /><strong>sip set debug</strong> - Enable SIP debugging<br /><strong>sip set debug ip</strong> - Enable SIP debugging on IP<br /><strong>sip set debug off</strong> - Disable SIP debugging<br /><strong>sip set debug peer</strong> - Enable SIP debugging on Peername<br /><br /><br /><br />stop gracefully 优雅地停止asterisk<br />stop now 立即停止运行asterisk<br />core show codecs 显示所有支持的编解码器<br /><br />set verbose 10 <br />set debug 10<br /><br /><br /><strong>core set debug channel</strong> - Enable/disable debugging on a channel<br /><strong>core set debug</strong> - Set level of debug chattiness<br /><strong>core set debug off</strong> - Turns off debug chattiness<br /><strong>core set verbose</strong> - Set level of verboseness<br /><br /><strong>core show calls {uptime}</strong>: Display information on calls<br /><br /><br /><strong>logger set level {DEBUG|NOTICE}</strong>: Enables/Disables a specific logging level for this console<br />logger <font color="#cc0033">set level</font> debug off<br /><img src ="http://www.cppblog.com/byc/aggbug/183302.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-07-14 07:39 <a href="http://www.cppblog.com/byc/archive/2012/07/14/183302.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>elastix 220 自动报工号</title><link>http://www.cppblog.com/byc/archive/2012/06/27/180485.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Wed, 27 Jun 2012 07:46:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/06/27/180485.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/180485.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/06/27/180485.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/180485.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/180485.html</trackback:ping><description><![CDATA[<div>参考<br /><a href="http://brunoplum.iteye.com/blog/593263">http://brunoplum.iteye.com/blog/593263</a><br /><br />yum install libxml2-devel<br />yum install ncurses-devel<br />yum install openssl-devel<br />yum install zlib-devel<br />yum install mysql-devel<br /><br /><br /><br />wget <a href="http://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/certified-asterisk-1.8.11-cert2.tar.gz">http://downloads.asterisk.org/pub/telephony/certified-asterisk/releases/certified-asterisk-1.8.11-cert2.tar.gz</a><br />tar zxvf certified-asterisk-1.8.11-cert2.tar.gz<br />cd certified-asterisk-1.8.11-cert2<br />./configure<br />make menuselect (窗口太小可能弹不出选择界面&nbsp; 从新选择 make distclean&nbsp; ./configure) <br />add-ons 选择 res_config_mysql app_mysql cdr_mysql<br />applications 增加选择 app_voicemail<br />channel drivers&nbsp;增加选择 chan-dahdi<br /><br /><br />vi apps/app_queue.c<br /><br /><br /><br />try_calling((struct queue_ent *qe, 下面<br />char k_exten[15] = "";;&nbsp; <br />int k9i = 0;&nbsp; <br />int k9j = 0;&nbsp; <br />int k9_flag = 0;&nbsp;&nbsp; <br /><br /><br /><br />
<p>bridge = ast_bridge_call(qe-&amp;gt;chan,peer, &amp;amp;bridge_config); 前面<br />for(;k9i &lt; 15;k9i++){&nbsp; <br />&nbsp;&nbsp;&nbsp; if(member-&gt;interface[k9i]=='/'){&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k9_flag=1;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;&nbsp; <br />&nbsp;&nbsp;&nbsp; }&nbsp; <br />&nbsp;&nbsp;&nbsp; if(member-&gt;interface[k9i]=='@'){&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k9_flag=0;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;&nbsp; <br />&nbsp;&nbsp;&nbsp; }&nbsp; <br />&nbsp;&nbsp;&nbsp; if(k9_flag){&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; k_exten[k9j++]=member-&gt;interface[k9i];&nbsp; <br />&nbsp;&nbsp;&nbsp; }&nbsp; <br />}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />play_file(qe-&gt;chan, "number-report-begin"); <br />ast_say_digit_str(qe-&gt;chan, k_exten, AST_DIGIT_ANY, qe-&gt;chan-&gt;language);&nbsp; <br />play_file(qe-&gt;chan, "number-report-end");&nbsp; <br />play_file(peer, "beep");&nbsp; </p>
<p>&nbsp;<br />make<br />make install</p>vi /etc/asterisk/queues.conf<br />[general] 下面加入<br />setinterfacevar=yes<br /><br /><a href="/Files/byc/wav.zip">/Files/byc/wav.zip</a><br /></div><img src ="http://www.cppblog.com/byc/aggbug/180485.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-06-27 15:46 <a href="http://www.cppblog.com/byc/archive/2012/06/27/180485.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>星网锐捷 IDA 设备 查看IP </title><link>http://www.cppblog.com/byc/archive/2012/05/23/175909.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Wed, 23 May 2012 08:43:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/05/23/175909.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/175909.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/05/23/175909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/175909.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/175909.html</trackback:ping><description><![CDATA[使用电话机连接第一个FXS口<br />拨打 #190# 听到特殊提示音挂机<br />再拨打 #120# 就可以听到语音播报IP 。<br />默认IP 192.168.88.16<img src ="http://www.cppblog.com/byc/aggbug/175909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-05-23 16:43 <a href="http://www.cppblog.com/byc/archive/2012/05/23/175909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>elastix2.3 dashboard 无交换空间时 不显示 bug 补丁</title><link>http://www.cppblog.com/byc/archive/2012/05/22/175809.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Tue, 22 May 2012 14:06:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/05/22/175809.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/175809.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/05/22/175809.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/175809.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/175809.html</trackback:ping><description><![CDATA[paloSantoDataApplets.class.php&nbsp; 416行 <br />//SWAP USAGE<br />&nbsp;if($arrSysInfo['SwapTotal']==0){<br />&nbsp;&nbsp;$swap_usage_val = number_format(0.0,1);<br />&nbsp;}<br />&nbsp;else{<br />&nbsp;&nbsp;$swap_usage_val = number_format(100.0 * ($arrSysInfo['SwapTotal'] - $arrSysInfo['SwapFree'])/$arrSysInfo['SwapTotal'], 1);<br />}<br />paloSantoSysInfo.class.php 157行<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($this-&gt;arrSysInfo['SwapTotal']==0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $value = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $value = ($this-&gt;arrSysInfo['SwapTotal'] - $this-&gt;arrSysInfo['SwapFree'])/$this-&gt;arrSysInfo['SwapTotal'];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<img src ="http://www.cppblog.com/byc/aggbug/175809.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-05-22 22:06 <a href="http://www.cppblog.com/byc/archive/2012/05/22/175809.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>elastix2.3 中文语言包(voip88发布的elastix2.3中文版中抽取出来的)</title><link>http://www.cppblog.com/byc/archive/2012/05/22/175802.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Tue, 22 May 2012 12:36:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/05/22/175802.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/175802.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/05/22/175802.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/175802.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/175802.html</trackback:ping><description><![CDATA[使用方法 解压后直接覆盖<br />下载链接：<a href="/Files/byc/cn_elastix.2.3.zip">cn_elastix.2.3.zip</a><br />原始版本：<a href="http://bbs.voip88.com/thread-27724-1-1.html">http://bbs.voip88.com/thread-27724-1-1.html</a><br /><img src ="http://www.cppblog.com/byc/aggbug/175802.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-05-22 20:36 <a href="http://www.cppblog.com/byc/archive/2012/05/22/175802.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>elastix 2.3  升级到php5.2 CDR Report 出错 patch</title><link>http://www.cppblog.com/byc/archive/2012/05/15/175008.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Tue, 15 May 2012 12:44:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/05/15/175008.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/175008.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/05/15/175008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/175008.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/175008.html</trackback:ping><description><![CDATA[<p>html/libs/paloSantoDB.class.php<br /><br />163 行 （函数 fetchTable 内）<br />$r = $result-&gt;execute($param);<br />改为<br />if(isset($param))<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach($param as $key =&gt; $value)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; if(is_int($value))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $paramtype = PDO::PARAM_INT;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elseif(is_bool($value))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $paramtype = PDO::PARAM_BOOL;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elseif(is_null($value))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $param = PDO::PARAM_NULL;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; elseif(is_string($value))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $paramtype = PDO::PARAM_STR;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $paramtype = FALSE;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($paramtype )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result-&gt;bindValue($key+1,$value,$paramtype);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />}<br />$r = $result-&gt;execute();</p> <img src ="http://www.cppblog.com/byc/aggbug/175008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-05-15 20:44 <a href="http://www.cppblog.com/byc/archive/2012/05/15/175008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>elastix  (Monitoring -&gt; listen )ie  听录音 补丁</title><link>http://www.cppblog.com/byc/archive/2012/04/25/172745.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Wed, 25 Apr 2012 09:18:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/04/25/172745.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/172745.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/04/25/172745.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/172745.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/172745.html</trackback:ping><description><![CDATA[<p>/var/www/html/modules/monitoring/index.php 423行<br /><br />&lt;!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;embed src='index.php?menu=$module_name&amp;action=download&amp;id=$file&amp;rawmode=yes' width=300, height=20 autoplay=true loop=false&gt;&lt;/embed&gt;<br />--&gt;</p>
<p>&lt;OBJECT ID="MediaPlayer" WIDTH=300 HEIGHT=100 <br />&nbsp; CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" <br />&nbsp;&nbsp; TYPE="application/x-oleobject" <br />CODEBASE="<a href="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112</a>"&gt;<br />&nbsp; &lt;PARAM name="autoStart" value="true"&gt; <br />&nbsp; &lt;PARAM name="filename" value="index.php?menu=$module_name&amp;action=download&amp;id=$file&amp;rawmode=yes"&gt; <br />&nbsp; &lt;PARAM NAME="ShowControls" VALUE="True"&gt; <br />&nbsp; &lt;PARAM NAME="ShowStatusBar" VALUE="True"&gt; <br />&lt;EMBED TYPE="application/wav" SRC="index.php?menu=$module_name&amp;action=download&amp;id=$file&amp;rawmode=yes" <br />NAME="MediaPlayer" WIDTH=300 HEIGHT=100<br />&nbsp;autostart="true" showcontrols="true" showstatusbar="true"&gt;&lt;/EMBED&gt; <br />&lt;/OBJECT&gt;<br /></p><img src ="http://www.cppblog.com/byc/aggbug/172745.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-04-25 17:18 <a href="http://www.cppblog.com/byc/archive/2012/04/25/172745.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>freepbx-mysql密码修改</title><link>http://www.cppblog.com/byc/archive/2012/02/24/166442.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Fri, 24 Feb 2012 09:21:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/02/24/166442.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/166442.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/02/24/166442.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/166442.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/166442.html</trackback:ping><description><![CDATA[<a href="http://www.freepbx.org/support/documentation/faq/changing-the-mysql-password">http://www.freepbx.org/support/documentation/faq/changing-the-mysql-password</a><br /><br /><br />amportal.conf, cdr_mysql.conf, res_mysql.conf freepbx.conf<br />
<p>Once the password works, you need to update three files: </p>
<ul><li><strong>/etc/amportal.conf:</strong></li></ul>
<p><span style="font-family: monospace">AMPDBUSER=<em>asteriskuser</em><br /></span><br /><span style="font-family: monospace">AMPDBPASS=<em>mypass</em><br /></span></p>
<ul><li><strong>/etc/asterisk/cdr_mysql.conf:</strong></li></ul>
<p><span style="font-family: monospace">password=<em>mypass</em><br /></span><br /><span style="font-family: monospace">user=<em>asteriskuser</em><br /></span></p>
<ul><li><strong>/etc/asterisk/res_mysql.conf:</strong></li></ul>
<p><span style="font-family: monospace">dbuser = <em>asteriskuser</em><br /></span><br /><span style="font-family: monospace">dbpass = <em>mypass<br /><br /></em></span><span style="font-family: monospace"><em><strong>./etc/freepbx.conf<br />$amp_conf['AMPDBPASS']&nbsp;= '<em>mypass</em>';</strong></em></span></p><img src ="http://www.cppblog.com/byc/aggbug/166442.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-02-24 17:21 <a href="http://www.cppblog.com/byc/archive/2012/02/24/166442.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asterisk-cpp</title><link>http://www.cppblog.com/byc/archive/2012/01/06/163703.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Fri, 06 Jan 2012 03:22:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2012/01/06/163703.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/163703.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2012/01/06/163703.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/163703.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/163703.html</trackback:ping><description><![CDATA[项目地址 <a href="https://github.com/augcampos/asterisk-cpp">https://github.com/augcampos/asterisk-cpp</a><br />asterisk-cpp 功能部分还可以，但bug 实在太多，并发现有 设计结构不合理 产生的bug,不建议使用。<br /><img src ="http://www.cppblog.com/byc/aggbug/163703.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2012-01-06 11:22 <a href="http://www.cppblog.com/byc/archive/2012/01/06/163703.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>asterisk-dotnet 1.6.3.1   Asterisk 1.6.2.21  一直重复连接   BUG</title><link>http://www.cppblog.com/byc/archive/2011/12/09/161835.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Fri, 09 Dec 2011 08:47:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/12/09/161835.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/161835.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/12/09/161835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/161835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/161835.html</trackback:ping><description><![CDATA[asterisk-dotnet 1.6.3.1&nbsp;&nbsp;&nbsp;Fix Ping actionid with 1.6.0.10 version<br />asterisk 1.6 现在的版本是&nbsp; <a href="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.21.tar.gz">Asterisk 1.6.2.21<br /></a>问题 asterisk &nbsp;1.6.0.10&nbsp; 的 Ping 命令返回时没有actionId，但Aserisk 1.6.2.21Ping 命令返回却有actionId。<a href="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.21.tar.gz"><br /><br />详细看 ：https://issues.asterisk.org/bug_view_advanced_page.php?bug_id=13993<br /></a>补丁：<br />ManagerConnection.cs 1982 行改为<br />
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">!</span><span style="color: #0000ff">string</span><span style="color: #000000">.IsNullOrEmpty(actionId))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;hash&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;Helper.GetInternalActionId(actionId).GetHashCode();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;responseActionId&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;Helper.StripInternalActionId(actionId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;responseHandler&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;GetRemoveResponseHandler(hash);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(response&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.ActionId&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;responseActionId;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(responseHandler&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.cppblog.com/Images/dot.gif"  alt="" /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(response&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;buffer.ContainsKey(</span><span style="color: #000000">"</span><span style="color: #000000">ping</span><span style="color: #000000">"</span><span style="color: #000000">)&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;buffer[</span><span style="color: #000000">"</span><span style="color: #000000">ping</span><span style="color: #000000">"</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">Pong</span><span style="color: #000000">"</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;Helper.BuildResponse(buffer);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">foreach</span><span style="color: #000000">&nbsp;(ResponseHandler&nbsp;pingHandler&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;pingHandlers.Values)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pingHandler.HandleResponse(response);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pingHandlers.Clear();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(response&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;buffer.ContainsKey(</span><span style="color: #000000">"</span><span style="color: #000000">ping</span><span style="color: #000000">"</span><span style="color: #000000">)&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;buffer[</span><span style="color: #000000">"</span><span style="color: #000000">ping</span><span style="color: #000000">"</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">Pong</span><span style="color: #000000">"</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;Helper.BuildResponse(buffer);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">foreach</span><span style="color: #000000">&nbsp;(ResponseHandler&nbsp;pingHandler&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;pingHandlers.Values)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pingHandler.HandleResponse(response);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pingHandlers.Clear();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span></div><br /><br /><br /><img src ="http://www.cppblog.com/byc/aggbug/161835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-12-09 16:47 <a href="http://www.cppblog.com/byc/archive/2011/12/09/161835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Asterisk Manager Interface C++ Interpretor for Linux  [转]</title><link>http://www.cppblog.com/byc/archive/2011/11/27/161041.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Sun, 27 Nov 2011 10:54:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/11/27/161041.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/161041.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/11/27/161041.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/161041.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/161041.html</trackback:ping><description><![CDATA[<h3 class="post-title entry-title">Asterisk Manager Interface C++ Interpretor for Linux （<a href="http://advancedcodingconcepts.blogspot.com/2011/02/asterisk-manager-interface-c.html">http://advancedcodingconcepts.blogspot.com/2011/02/asterisk-manager-interface-c.html</a>）</h3>
<div class="post-header">
<div class="post-header-line-1"></div></div>
<div class="post-body entry-content">Through the past number of months in my full-time developer position for an online company and it's sales office, we've migrated to a VOIP telephony platform based on Asterisk, Linux and our custom call centre management application. <br /><br />In order to integrate an autodialer in to the application, I had originally written a script in PHP to read from two asterisk servers (local and offshore) to post information about whether an agent is on a call or not, and also inbound calls to the call centre application.<br /><br />The PHP script took a matter of hours to set up initially, but lacked proper structure - specifically, it could not track information when we switched to call queues, and was not easily portable between asterisk versions (1.8 locally, 1.2 in offshore)<br /><br />For the past week I have worked on the design and initial coding of an app in C++ that acts as a client to both servers, interprets the messages and creates internal structures. &nbsp;I'm releasing that code here for review, and to help other's save some time, as I haven't noticed any other software out there that could accomplish this elegantly. &nbsp;Currently, I am calling this application AMIflex based on the flexibility it provides to manage the Asterisk AMI protocol.<br /><br /><strong>This source code and it's derivatives can not be sold, licensed or packaged with any commercial software without my explicit permission.</strong><br /><br /><a href="http://www.experience-apex.com/amiflex.0.1.tar.bz2"><font color="#4d469c">Download the source code here (.tar.bz2, 6kb)</font></a><br /><br />Installation instructions: <br /><br />
<ol><li>unpack the file via "tar -xvjf" command</li><li>create /etc/amiflex directory, and add a "servers.conf" file in the following format </li></ol>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Server: server name (for display purposes only)</span></div>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Host: ip address or host name of ami server&nbsp;</span></div>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Username: AMI manager username</span></div>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Secret: AMI manager password/secret</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Optional fields:</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">RetryPeriod: number of seconds to wait between connection retries - ie if asterisk is rebooted (default: 300)</span></div>
<div><span style="background-color: #d0e0e3; font-family: Times, 'Times New Roman', serif" class="Apple-style-span">Port: port number (default 5038)</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">You can insert more than one server (connections will be maintained together) by entering the first server's details, placing a second new line after the last configration line for that server, and then entering the details for the second server (and so on)</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><strong>How to make this useful</strong></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">When a server connection is established, there's a AMI::RegisterAllEvents() call after authentication. &nbsp;Add in your own events, and manipulate the structures or log output</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><em>Example:</em></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">AMI::RegisterEventCB("Dial", &amp;AMI::MyDialCallback)</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">void AMI::MyDialCallback(MSG *msg)</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">{</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">&nbsp;&nbsp; &nbsp;if (msg-&gt;Attr("SubEvent").value=="Begin")</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cout &lt;&lt; msg-&gt;Attr("Channel").value + " is dialing " +msg-&gt;Attr("Dialstring").value&lt;&lt;endl;</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">}</span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><br /></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><strong>Current limitations</strong></span></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">I have some well known limitations with this software - I'll be resolving them myself for internal use, but my next step is to integrate proprietary MySQL links in to the source code, so I made sure to release this first. &nbsp;Currently my task list with my employer is too long to not take some shortcuts :)</span></div>
<div>
<ol><li><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">The channel list linked list is a static member of the channel class - this means that you run AMIflex with multiple servers in the configuration file, all of the channels for all servers will be parallel. &nbsp;If you have two servers and each server has the same extension, then there will be one device entry created and two channels open on that device, when each extension is busy.</span></li><li><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span">The bridge event currently only registered the first channel's Bridge member to the second member, and vice versa - If you are monitoring channels that will be bridged to more than one other channel, this will have to be expanded to a proper many to many-style linked list.</span> </li></ol></div>
<div><span style="font-family: Times, 'Times New Roman', serif" class="Apple-style-span"><a href="/Files/byc/amiflex.0.1.tar.bz2.rar">/Files/byc/amiflex.0.1.tar.bz2.rar</a><br /></span></div></div><img src ="http://www.cppblog.com/byc/aggbug/161041.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-11-27 18:54 <a href="http://www.cppblog.com/byc/archive/2011/11/27/161041.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>dahdi</title><link>http://www.cppblog.com/byc/archive/2011/11/24/160887.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Thu, 24 Nov 2011 03:37:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/11/24/160887.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/160887.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/11/24/160887.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/160887.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/160887.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: # lspci &#8211;vvvv Network controller# yum install kernel-develreboot# cd /usr/src/dahdi-linux-complete-XX # cd linux# make # make install # cd tools# ./configure# make# make install# make config...&nbsp;&nbsp;<a href='http://www.cppblog.com/byc/archive/2011/11/24/160887.html'>阅读全文</a><img src ="http://www.cppblog.com/byc/aggbug/160887.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-11-24 11:37 <a href="http://www.cppblog.com/byc/archive/2011/11/24/160887.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Asterisk + Vtiger CRM 5.1 电击拨号 实现来电弹屏</title><link>http://www.cppblog.com/byc/archive/2011/11/05/159672.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Sat, 05 Nov 2011 06:57:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/11/05/159672.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/159672.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/11/05/159672.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/159672.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/159672.html</trackback:ping><description><![CDATA[<a href="http://www.ztmaker.com/read.php?tid-325.html"><br /><br />http://www.ztmaker.com/read.php?tid-325.html</a><br /><br />一、Asterisk 端配置<br /><br />修改配置文件"/etc/asterisk/manager_custom.conf"，在其中添加一个管理帐号"vtigercrm"：<br /><br />[vtigercrm]<br />secret = vtigercrm<br />deny=0.0.0.0/0.0.0.0<br />permit=192.168.1.3/255.255.255.0<br />read = system,call,log,verbose,command,agent,user<br />write = system,call,log,verbose,command,agent,user<br />然后重启 Asterisk：<br /><br />二、CRM 端配置<br /><br />1、设置模块<br /><br />使用管理员登录"VtigerCRM"，在菜单中选择"Settings-&gt;Module Manager"进入模块列表页面。<br /><br />在此页面中找到"PBX Manager"模块，将其启用后，点击配置图标对此模块进行配置。各配置项内容如下：<br /><br />Asterisk server IP: 填写 Asterisk 服务器地址<br />Asterisk server port: 填写 Asterisk 管理端口，默认为 5038<br />Asterisk username: 填写 Asterisk 帐号名称，按之前的配置就填写为"vtigercrm"<br />Asterisk password: 填写 Asterisk 帐号密码，按之前的配置就填写为"vtigercrm"<br />Asterisk Version: 选择 Asterisk 的版本<br />2、设置用户分机<br /><br />使用用户帐号登录后，点击右上方的"My Preferences"，在打开的页面中找到"Asterisk Configuration"栏，并作如下配置：<br /><br />Asterisk Extension: 填写用户的分机号<br />Receive Incoming Calls: 选中此选项<br />3、启动客户端程序<br /><br />使用 SSH 登录 CRM 服务器，进入 CRM 系统安装路径下的"cron/modules/PBXManager"目录，然后运行以下命令：<br /><br /># ./AsteriskClient.php<br />如果一切正常就会出现如下信息：<br /><br />Date: 05-03-2010<br />Connecting to asterisk server.....<br />Connected successfully<br /><br />Trying to login to asterisk<br />Logged in successfully to asterisk server<br />至此，就可以使用电话拨打刚才设置的用户分机号了，如果一切正常，就可以看到CRM页面的右下角就会出现一个来电提示框。另外在菜单中打开"Tools-&gt;PBX Manager"，在页面中也可以看到来电记录。<br /><br />注：如果 Asterisk 是 1.4 版的，请到以下位置下载修改过的"AsteriskClient.php"来替换原系统中的文件：<br /><a id="url_1" href="http://danielaliaman.com/blog///index.php/2009/07/23/vtiger_pbx_manager_issues_only_first_cal?blog=2" target="_blank"><font color="#0070af">http://danielaliaman.com/blog///index.php/2009/07/23/vtiger_pbx_manager_issues_only_first_cal?blog=2</font></a><br /><br /><br /><br /><a href="http://hi.baidu.com/ahhui/blog/item/e275b419ca6b415343a9ad83.html">http://hi.baidu.com/ahhui/blog/item/e275b419ca6b415343a9ad83.html</a><br />
<div class="tit">如何使用vtigercrm5.1实现点击拨号、来电弹屏</div>
<div class="date">&nbsp;</div>
<table style="width: 100%; table-layout: fixed">
<tbody>
<tr>
<td>
<div id="blog_text" class="cnt">
<p>环境：Elastix1.6<br />已经实现的<span>功能</span>：<span>vtiger</span>crm点击<span>客户</span>电话拨号，来电在vtigercrm弹屏。<br />未解决的问题：弹屏没有来电号码。<br /><br />一、vtigercrm点击呼出配置方法：<br />1、首先保证asterisk、vtigercrm都正常使用。<br /><br />2、修改/etc/asterisk/manager.conf<span>文件</span>，增加如下： </p>
<div>
<div>[vtigecrm]<br />secret = vtigecrm<br />deny=0.0.0.0/0.0.0.0<br />permit=0.0.0.0/0.0.0.0<br />read = system,call,log,verbose,command,agent,user<br />write = system,call,log,verbose,command,agent,user </div><em>复制<span>代码</span></em></div>
<p>以上代码中vtigercrm不是特定的，但要在vtigercrm中的pbx<span>设置</span>要一致。<br /><br />3、设置vtigercrm：<br />设定-<span>模块</span><span>管理</span>-PBX Manager </p>
<div>
<div>Asterisk server IP ：192.168.0.15 （这是astersik<span>服务器</span>的IP）<br />Asterisk server port ：5038 （默认5038）<br />Asterisk username ：vtigercrm<br />Asterisk password ：vtigercrm<br />Asterisk Version：1.4 </div><em>复制代码&#183;</em></div>
<p>&nbsp;</p>
<p>4、设置vtigercrm中的个人分机号：<br />我的设定<br />Asterisk Extension：800 （这是asterisk里已设定分机号）<br />Receive Incoming Calls： 是 <br /><br />5、修改接口文件：<br />/var/www/html/vtigercrm/modules/PBXManager/utils/AsteriskClass.<span>php</span><br />将以下代码： </p>
<div>
<div>switch($typeCalled){<br />case "SIP":<br />$context = "local-extensions";<br />break;<br />case "PSTN":<br />$context = "from-inside";//"outbound-dialing";<br />break;<br />default:<br />$context = "default";<br />} </div><em>复制代码</em></div>
<p>更改为： </p>
<div>
<div>switch($typeCalled){<br />case "SIP":<br />$context = "local-extensions";<br />break;<br />case "PSTN":<br />$context = "from-internal";//"outbound-dialing";<br />break;<br />default:<br />$context = "from-internal";<br />} </div><em>复制代码</em></div>
<p>如果顺利，到这里就能用vtigercrm点击拨号了，点击号码后，你的分机会响铃，响铃分机提机后，<span>系统</span>就自动将号码拨出。<br />参考：http://wiki.vtiger.com/index.php/vtiger510:Module_Asterisk_Howto<br />二、来电弹屏的设置方法：<br />这里需要<span>运行</span>一个文件，并且运行后，不能终止。<br />进入这个<span>目录</span>：/var/www/html/vtigercrm/cron/modules/PBXManager<br />运行这个命令： </p>
<div>
<div>php AsteriskClient.php </div><em>复制代码</em></div>
<p>运行后，不能终止，如果<span>服务</span>器重启过，还需要再次运行。<br /><br />到这里，来电弹屏的功能也实现了，不过来电显示问题没找到答案。<br />翻阅vtigercrm社区<span>论坛</span>，也未找到合适的解决<span>办法</span>，更有说此方法比较好CPU资源。<br /></p></div></td></tr></tbody></table><br /><br /><br /><br /><br />弹屏补丁<br />
<p>vtigercrm/include/js/asterisk.js<br />function _defAsteriskTimer(){<br />&nbsp;var asteriskTimer = null;<br />&nbsp;var ASTERISK_POLLTIME = 5000;&nbsp;//vtigercrm polls the asterisk server for incoming calls after every 3 seconds for now<br />&nbsp;var ASTERISK_INCOMING_DIV_TIMEOUT = 60;&nbsp;</p>
<p>&nbsp;</p>
<p>notificationPopup.js<br />&nbsp;function ResetPopup(){<br />&nbsp;&nbsp;popupDiv.innerHTML = "";<br />&nbsp;&nbsp;popupDiv.style.height = "0px"; <br />&nbsp;&nbsp;popupDiv.style.display = "none";<br /><span style="color: red">&nbsp;&nbsp;parentDiv.removeChild(popupDiv);</span><br /><span style="color: red">&nbsp;&nbsp;if(parentDiv.children.length ==0){</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;parentDiv.style.display = "none";</span><br /><span style="color: red">&nbsp;&nbsp;}</span></p>
<p>&nbsp;}</p>
<p><br />&nbsp;vtigercrm/cron/modules/PBXManager/AsteriskClient.php</p>
<p>function asterisk_handleResponse2($mainresponse, $adb, $asterisk, $state) {<br />&nbsp;$appdata = $mainresponse['AppData'];<br />&nbsp;&nbsp; &nbsp;<br />&nbsp;$uniqueid = $channel = $callerType = $extension = null;<br />&nbsp;$parseSuccess = false;<br />&nbsp;<br />&nbsp;if(<br />&nbsp;&nbsp;$mainresponse['Event'] == 'Newexten' &amp;&amp; (strstr($appdata, "__DIALED_NUMBER") || strstr($appdata, "EXTTOCALL"))<br />&nbsp;) {</p>
<p>&nbsp;&nbsp;$uniqueid = $mainresponse['Uniqueid'];</p>
<p>&nbsp;&nbsp;$channel = $mainresponse['Channel'];<br />&nbsp;&nbsp;$splits = explode('/', $channel);<br />&nbsp;&nbsp;$callerType = $splits[0];</p>
<p>&nbsp;&nbsp;$splits = explode('=', $appdata);<br />&nbsp;&nbsp;$extension = $splits[1];<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;$parseSuccess = true;<br />&nbsp;} else if($mainresponse['Event'] == 'OriginateResponse'){<br />&nbsp;&nbsp;//if the event is OriginateResponse then its an outgoing call and set the flag to 1, so that AsteriskClient does not pick up as incoming call<br />&nbsp;&nbsp;$uniqueid = $mainresponse['Uniqueid'];<br />&nbsp;&nbsp;$adb-&gt;pquery("UPDATE vtiger_asteriskincomingevents set flag = 1 WHERE uid = ?", array($uniqueid));<br /><span style="color: red">&nbsp;}else if($mainresponse['Event']=='NewCallerid'){</span></p>
<p><span style="color: red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $channel = $mainresponse['Channel'];</span></p>
<p><span style="color: red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(strncmp($channel,"DAHDI",5)==0){</span></p>
<p><span style="color: red">&nbsp;&nbsp;&nbsp;$uniqueid = $mainresponse['Uniqueid'];</span></p>
<p><span style="color: red">&nbsp;&nbsp;&nbsp;if(!empty($mainresponse['CallerID'])) {</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;&nbsp;$callerNumber = $mainresponse['CallerID'];</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;}elseif(!empty($mainresponse['CallerIDNum'])) {</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;&nbsp;$callerNumber = $mainresponse['CallerIDNum'];</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;}</span><br />&nbsp;&nbsp;&nbsp;<br /><span style="color: red">&nbsp;&nbsp;&nbsp;$sql = "UPDATE vtiger_asteriskincomingevents set from_number=? WHERE uid=?";</span><br /><span style="color: red">&nbsp;&nbsp;&nbsp;$adb-&gt;pquery($sql, array($callerNumber, $uniqueid));</span><br /><span style="color: red">&nbsp;&nbsp;}&nbsp;&nbsp;</span><br />&nbsp;}<br />&nbsp;</p><br /><br /><img src ="http://www.cppblog.com/byc/aggbug/159672.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-11-05 14:57 <a href="http://www.cppblog.com/byc/archive/2011/11/05/159672.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CentOS6.0 asterisk-1.6.2.20  freepbx-2.9.0 安装过程</title><link>http://www.cppblog.com/byc/archive/2011/09/15/155865.html</link><dc:creator>八叶草</dc:creator><author>八叶草</author><pubDate>Thu, 15 Sep 2011 10:15:00 GMT</pubDate><guid>http://www.cppblog.com/byc/archive/2011/09/15/155865.html</guid><wfw:comment>http://www.cppblog.com/byc/comments/155865.html</wfw:comment><comments>http://www.cppblog.com/byc/archive/2011/09/15/155865.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/byc/comments/commentRss/155865.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/byc/services/trackbacks/155865.html</trackback:ping><description><![CDATA[1 安装CentOS6<br />需要安装的包&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;Mysql数据库客服端，Mysql数据库服务端<br />&nbsp;&nbsp;&nbsp;PHP支持（可选包增加勾选）<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php_mysql<br />&nbsp;&nbsp;&nbsp;开发工具<br /><br />2&nbsp;安装Asterisk<br />&nbsp;&nbsp;&nbsp;yum&nbsp;install libxml2-devel<br />&nbsp;&nbsp; yum install&nbsp;ncurses-devel<br /><br />&nbsp;&nbsp;&nbsp;groupadd asterisk<br />&nbsp;&nbsp;&nbsp;useradd -c "asterisk PBX" -d /var/lib/asterisk -g asterisk&nbsp;-s /sbin/nologin&nbsp;asterisk<br /><br />&nbsp;&nbsp; 解压asterisk<br />&nbsp;&nbsp;&nbsp;./configure<br />&nbsp;&nbsp;&nbsp;make<br />&nbsp;&nbsp; make install<br />&nbsp;&nbsp; //make samples&nbsp;安装freepbx不要这行<br />&nbsp;&nbsp;&nbsp;make config<br /><br />3&nbsp;安装FreePBX<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;解压freepbx<br /><br />&nbsp;&nbsp; yum install php-db<br />&nbsp;&nbsp;&nbsp;//yum install php-pear-DB (centos 5)<br />&nbsp;&nbsp;&nbsp;pear install db<br />&nbsp;&nbsp;&nbsp;yum install php-posix<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;service mysqld start&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp; mysqladmin create asterisk<br />&nbsp;&nbsp;&nbsp;mysqladmin create asteriskcdrdb&nbsp;<br />&nbsp;&nbsp;&nbsp;mysql asterisk &lt; SQL/newinstall.sql<br />&nbsp;&nbsp;&nbsp;mysql asteriskcdrdb &lt; SQL/cdr_mysql_table.sql<br />&nbsp;&nbsp;&nbsp;mysqladmin -u root -p password 123456<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp; /etc/httpd/conf/httpd.conf&nbsp;User apache 改为 User asterisk ;Group apache 改为 Group asterisk<br />&nbsp;&nbsp; &nbsp;/etc/php.ini date.timezone = PRC<br />&nbsp;&nbsp;&nbsp;&nbsp;/etc/sysconfig/selinux&nbsp; SELINUX=disabled<br /><br />&nbsp;&nbsp;&nbsp; setenforce 0<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;service httpd start&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;service&nbsp;asterisk start <br /><br /><br />&nbsp;&nbsp;&nbsp; ./install_amp --username root --password 123456<br />&nbsp;&nbsp;&nbsp; amportal start<br />&nbsp;&nbsp;&nbsp; http://你的IP user:admin pass:admin<br /><br />&nbsp;&nbsp;&nbsp;<br /><br /><br />
<p><span style="font-family: 宋体">配置</span><span style="font-family: Times New Roman">Asterisk Recording</span><span style="font-family: 宋体">接口密码和打开网页接口用户认证</span></p>
<p><span style="font-family: 宋体"><strong><span style="color: #c20cb9; font-size: 11pt">vi</span></strong><span style="color: black; font-size: 11pt"><strong>/</strong>etc<strong>/</strong>amportal.conf<br /></span></span><span style="font-family: 宋体"><span style="color: black; font-size: 11pt">ARI_ADMIN_PASSWORD=</span><span style="color: black; font-size: 11pt">你的密码<br /><span></span></span></span><span style="color: black; font-size: 11pt"><span style="font-family: 宋体">AUTHTYPE=database<br /></span></span><span style="color: black; font-size: 11pt"><span style="font-family: 宋体">FOPRUN=false<br /></span></span><span style="color: black; font-size: 11pt"><span style="font-family: 宋体">FOPDISABLE=true</span></span> </p><br />
<p><span style="font-family: 宋体"><strong><span style="color: #7a0874; font-size: 11pt">echo</span></strong><span style="color: black; font-size: 11pt">&nbsp;</span><span style="color: red; font-size: 11pt">"/usr/local/sbin/amportal start"</span><span style="color: black; font-size: 11pt"><strong>&gt;&gt;</strong><strong>/</strong>etc<strong>/</strong>rc.local</span></span><span style="font-family: 宋体"><span style="color: black; font-size: 11pt"> <br /><br /></span></span>备注:<br />显示PHP错误信息<br />调试的时候把php.ini中的display_errors&nbsp;&nbsp; =&nbsp;&nbsp; Off改成On <br />或者&nbsp;&nbsp; error_log&nbsp;&nbsp; =&nbsp;&nbsp; D:\Web\error.log&nbsp;&nbsp; 在error.log中查看错误日志!<br />&nbsp;&nbsp;&nbsp; <br /><br /><br /><br /></p>
<div id="blog_text" class="cnt">
<p>FreePBX 2.X版本安装后,都是不使用密码就可以进入admin下去管理asterisk，而有关更改密码的说明文档<br />官方网关没提供，论坛中也问得相对较多，我就简单说一下如何去配置FreePBX密码。</p>
<p>1、找到/etc/amportal.conf配置文件，将以下这个语句</p>
<p><strong># AUTHTYPE: authentication type to use for web admin<br /># If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above<br /># valid: none, database<br />AUTHTYPE=</strong><font color="#ff0000">none</font></p>
<p>更改为：（注意红色标识）</p>
<p><strong># AUTHTYPE: authentication type to use for web admin<br /># If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above<br /># valid: none, database<br />AUTHTYPE=</strong><font color="#ff0000">database</font></p>
<p>2、执行<strong><font color="#0000ff">./usr/src/freepbx-2.5.1/apply_conf.sh</font></strong> 使更改生效。（注意蓝色语句的完整性）</p>
<p>3、这样就可以使用</p>
<p>AMPDBUSER=<br />AMPDBPASS=</p>
<p>对应的帐号密码进入管理系统，也可以使用<strong>Administrators</strong>模块建立进入系统的用户。</p></div>
<p>&nbsp;</p>
<h3>报表不能查看</h3>
<p align="left"><span style="color: black; font-size: 7.5pt">如果查看报表的时候出现如下的错误提示：</span></p>
<p align="left"><span style="color: black; font-size: 7.5pt">YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL!</span></p>
<p align="left"><span style="color: black; font-size: 7.5pt">发生这个错误的原因可能是</span><span style="color: black; font-size: 7.5pt">httpd</span><span style="color: black; font-size: 7.5pt">进程不能读写</span><span style="color: black; font-size: 7.5pt">php</span><span style="color: black; font-size: 7.5pt">会话的保存路径。</span></p>
<p align="left"><span style="color: black; font-size: 7.5pt">1.</span><span style="color: black; font-size: 7.5pt">执行以下命令查看</span><span style="color: black; font-size: 7.5pt">PHP</span><span style="color: black; font-size: 7.5pt">会话的保存路径</span><span style="color: black; font-size: 7.5pt">:</span></p>
<p align="left">grep save_path /etc/php.ini</p>
<p align="left">找到:</p>
<p align="left">session.save_path = /var/lib/php/session</p>
<p align="left">2. 修改权限</p>
<p align="left">chown asterisk /var/lib/php/session</p>
<p>chmod -R 777 /var/lib/php/session</p>
<p>&nbsp;</p>
<h3><span style="line-height: 173%; font-size: 10.5pt">Couldn't load variables.txt</span></h3>
<p><span style="color: black; font-size: 8pt">如果出现此问题可能是因为</span><span style="color: black; font-size: 8pt">op_server.pl</span><span style="color: black; font-size: 8pt">没有运行。进行目录进行即可</span></p>
<p><span style="color: black; font-size: 8pt">[root@www ~]# cd /var/www/html/panel/</span></p>
<p><span style="color: black; font-size: 8pt">[root@www panel]# ./op_server.pl</span></p>
<p><span style="color: red"><br />设置freepbx 配置device与user分开</span></p>
<p style="line-height: normal; text-indent: 2em">vi /etc/amportal.conf</p>
<p style="line-height: normal; text-indent: 2em">AMPEXTENSIONS=deviceanduser | extensions<br /></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://hi.baidu.com/kinnsei/blog/item/302c2d1e4f6952f01ad57601.html">http://hi.baidu.com/kinnsei/blog/item/302c2d1e4f6952f01ad57601.html</a>(将用户(user)与设备(device)区分开来--内线分机的高级应用)<br /><br /><br /></p><img src ="http://www.cppblog.com/byc/aggbug/155865.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/byc/" target="_blank">八叶草</a> 2011-09-15 18:15 <a href="http://www.cppblog.com/byc/archive/2011/09/15/155865.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>