??xml version="1.0" encoding="utf-8" standalone="yes"?>久久亚洲欧美国产精品,9久久9久久精品,99久久无色码中文字幕http://www.shnenglu.com/byc/category/17750.html学习资料记录zh-cnWed, 17 Apr 2013 03:50:47 GMTWed, 17 Apr 2013 03:50:47 GMT60freepbc 呼出{待旉修改http://www.shnenglu.com/byc/archive/2013/04/17/199505.html八叶?/dc:creator>八叶?/author>Wed, 17 Apr 2013 03:17:00 GMThttp://www.shnenglu.com/byc/archive/2013/04/17/199505.htmlhttp://www.shnenglu.com/byc/comments/199505.htmlhttp://www.shnenglu.com/byc/archive/2013/04/17/199505.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/199505.htmlhttp://www.shnenglu.com/byc/services/trackbacks/199505.html查找 macro-dialout-trunk
然后
 $ext->add($context, $exten, '', new ext_dial('${OUT_${DIAL_TRUNK}}/${OUTNUM}', '300,${DIAL_TRUNK_OPTIONS}'));  // Regular Trunk Dial

  $ext->add($context, $exten, 'skipoutnum', new ext_dial('${pre_num:4}${the_num}${post_num}', '300,${DIAL_TRUNK_OPTIONS}'));

300 Ҏ你自p|的旉

]]>
proxmox ve 2.2 elastix2.3模板制作http://www.shnenglu.com/byc/archive/2012/11/06/194720.html八叶?/dc:creator>八叶?/author>Tue, 06 Nov 2012 08:59:00 GMThttp://www.shnenglu.com/byc/archive/2012/11/06/194720.htmlhttp://www.shnenglu.com/byc/comments/194720.htmlhttp://www.shnenglu.com/byc/archive/2012/11/06/194720.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/194720.htmlhttp://www.shnenglu.com/byc/services/trackbacks/194720.htmlssh ?proxmox ve

apt-get -y update
apt-get -y makedev
apt-get -y install build-essential make pve-headers-`uname -r`
cd /usr/src/
wget http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
tar zxfv dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install
make config
mkdir /etc/asterisk
service dahdi start
dahdi_genconf
vi /etc/dahdi/modules 全部?h?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
/etc/init.d/vz restart

//用ipv6
/boot/grub/grub.cfg ?linux   /vmlinuz-2.6.32-16-pve root=/dev/mapper/pve-root ro  quiet 替换?linux   /vmlinuz-2.6.32-16-pve root=/dev/mapper/pve-root ro  ipv6.disable=1 quiet


在elastix2.3机器?参?http://wiki.openvz.org/Creating_a_CentOS_5.0_Template

First, create a file called /tmp/exclude and add the following lines to it:

.bash_history

lost+found

/dev/*

/mnt/*

/tmp/*

/proc/*

/sys/*

/usr/src/*

 tar --numeric-owner -czvf /tmp/centos-5.7-x86_64-elasitx_orig-image.tar.gz -X /tmp/exclude /

  1. where <ARCH> represents the system architecture (i386 or
  2. x86_64) and <DISTRO> represents the distribution (default, minimal, etc.).

scp /tmp/centos-5.7-x86_64-elasitx_orig-image.tar.gz root@ip:/var/lib/vz/template/iso

回到proxmox ve 机器 使用 web?strong>centos-5.7-x86_64-elasitx_orig-image 为模板创建vt虚拟?nbsp; 假设 vm id ?100
ssh ?proxmox ve
cd /var/lib/vz/private/100
Edit the etc/inittab file and comment out the lines that respawn /sbin/mingetty on tty1 through tty6. Just put a # at the beginning of the line.

?etc/inittab 文g最后面加入
1:2345:respawn:/sbin/agetty tty1 38400 linux

Remove the etc/mtab file and then create a symbolic link by typing ln -s /proc/mounts etc/mtab
Remove all of the lines from etc/fstab except for the line that mounts /dev/pts
Edit etc/rc.d/rc.sysinit and comment out the line that starts /sbin/start_udev by placing a # at the beginning of the line.

mknod dev/ptmx c 5 2
mkdir dev/pts

cd dev
/sbin/MAKEDEV ttyp ptyp
cd ../

mknod dev/null c 1 3

mknod -m 644 dev/random c 1 8

mknod dev/urandom c 1 9
mknod dev/tty9 c 4 9

Create the var/lock/rpm folder.

Edit etc/sysconfig/network and set NETWORKING_IPV6 to no.
Add the following lines to etc/modprobe.d/blacklist.conf:
blacklist ipv6

blacklist net-pf-10
 

Disable any physical NICs by modifying the etc/sysconfig/network-scripts/ifcfg-ethX files (where X is the interface number starting from 0) and setting ONBOOT to no.

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

 

vzctl set 100 --devnodes dahdi/pseudo:rw --save
vzctl start 100
vzctl enter 100
chkconfig haldaemon off
chkconfig dahdi off
chkconfig wanrouter off

rm -rf /etc/init.d/dahdi
rm -rf /etc/init.d/wanrouter

chkconfig acpid off
chkconfig kudzu off

chkconfig xfs off
chkconfig rpcidmapd off
chkconfig rpcgssd off
chkconfig nfslock off
chkconfig mdmonitor off
chkconfig ip6tables off

exit
cd /var/lib/vz/private/100
tar -czvf /var/lib/vz/template/cache/centos-5-x86_64-elasitx.tar.gz ./






 



]]>
?a2billinghttp://www.shnenglu.com/byc/archive/2012/10/11/193154.html八叶?/dc:creator>八叶?/author>Thu, 11 Oct 2012 02:56:00 GMThttp://www.shnenglu.com/byc/archive/2012/10/11/193154.htmlhttp://www.shnenglu.com/byc/comments/193154.htmlhttp://www.shnenglu.com/byc/archive/2012/10/11/193154.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/193154.htmlhttp://www.shnenglu.com/byc/services/trackbacks/193154.htmlhttp://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

A2Billing 理?

    前言

    A2Billing 是目前社開發最熱門的計ȝi套Ӟ因為是開攑֎始碼授權所以可以合法免M用?/p>

    本篇主要在是教導如何使用這套Ӟ若還沒完成安裝的朋友Q請先前往p A2Billing 安裝?/a>?/p>

    初始化設?/h4>

    pȝ在完成安裝後Q第一個所要做的設定有Q?/p>

    // FreePBX UI > Trunks

    新增 Outbound TrunkQ本以 Voxalot Z?/p>

    Outgoing Settings
    Trunk Name = voxalot

    host=us.voxalot.com
    username=<sip_number>
    fromuser=<sip_number>
    secret=<sip_pass>
    fromdomain=voxalot.com
    nat=yes
    insecure=port,invite
    qualify=yes
    canreinvite=yes
    dtmfmode=auto
    disallow=all
    allow=ulaw&alaw
    type=peer
    context=from-trunk

    新增 Inbound TrunkQ這個主要在展示國際電話卡及 DID 轉接的應用,本篇?iptel Z?/p>

    Outgoing Settings
    Trunk Name: iptel

    username=<sip_username>
    type=friend
    secret=<sip_pass>
    qualify=yes
    insecure=port,invite
    host=iptel.org
    fromuser=osslab
    fromdomain=iptel.org
    context=a2billing
    

    Register String: <sip_username>:<sip_pass>@iptel.org/<sip_number>

    注意Qcontext 必須?a2billing

    // A2Billing Admin UI > Trunk > Create Provider

    provider name = VOXALOT_PROVIDER
    description = Voxalot Provider

    // A2Billing Admin UI > Trunk > Add Trunk

    voip-provider = VOXALOT_PROVIDER
    label = VOXALOT_TRUNK
    add prefix = I白
    provider tech = SIP
    provider ip = voxalot
    status = Active

    TIPs:

    provider ip 必須?FreePBX ?trunk name 相同

    // A2Billing Admin UI > Ratecard > Create call plan

    name = VOXALOT_CALLPLAN
    remove inter prefix = YES

    TIPs:

    remove inter prefix = YES 若撥號有包含 00 ?011 開頭的國際冠|在套?ratecard 的規則前會被去除?/p>

    // A2Billing Admin UI > Ratecard > Create new ratecard

    tariffname = VOXALOT_RATECARD
    trunk = VOXALOT_TRUNK
    description = through voxalot trunk

    // A2Billing Admin UI > Ratecard > Add Rate

    ratecard = VOXALOT_RATECARD
    dialprefix = 1800
    destination = US-Tollfree
    buying rate = 1
    buyrate min duration = 6
    buyrate billing block = 6
    selling rate = 1.5
    sellrate min duration = 60
    sellrate billing block = 60
    trunk = VOXALOT_TRUNK

    TIPs:

    Q?dialprefix 若撥號規則符合,會以此費率計?br />Q?destination 用來敘述此費率的區?/p>

    //新增 rate 後要再回?call plan ?rate card 加入?call plan
    A2Billing Admin UI > Ratecard > List Call Plan > Edit: VOXALOT_CALLPLAN

    ratecard = 選擇 VOXALOT_RATECARD, Add Ratecard

    應用一Q國際電話卡模式

    客戶操作程Q?br />① 使用手機或一般電話機撥打pȝ號碼(Access Number)

    ② 語音提示Q入電話卡號+Q?/p>

    ③ 語音提示額Q入目的地電話號碼Q?0Q國|區|電話號碼Q#Q?/p>

    // A2Billing Admin UI > Customers > Create Customers

    card number = <隨機產生>
    card alias = <隨機產生>Qweb d希
    webui password = <隨機產生>Qweb d密碼
    balance = 50.0Q不可為Ӟ且必須以 USD a算
    call plan = VOXALOT_CALLPLAN
    activated = YES
    simultaneous access = INDIVIDUAL ACCESS
    card type = PREPAID CARD
    country = TAIWAN
    sip account = NO
    iax account = NO

    實際操作Q?/p>

    因為本篇實做是以 iptel 的號g為系ip|所以用其他 IPTel 希撥入pȝ號碼Q系i會提示語音Q請輸入 card numberQ將剛剛新增的卡號入,完成後按Q,若正,pȝ會提C餘及可用通話時間Q並提示Q請輸入目的地電p|完整電p?011 + 國碼 + 區?+ 電話號碼 輸入Q完成後按#?/p>

    TIPs:

    Q?新增電話?Customer)Q有一些主要的a定Q例?card number, card alias, passwordQ這些是由pȝ隨機產生Q且沒有M規則Qhacker 無法事先a算出這些資訊?br />Q?附加?card number ?另一i代?aliasQ這個號或 email 地址都可以用來登入用戶的E頁Q密就?webui password?
    Q?若用戶撥號時有加 00Q請注意 Call Plan ?REMOVE INTER PREFIX a為 YESQ以避免 outbound 路由錯誤?/p>

    應用二:DID 轉接業務

    A2Billing 提供 DID 接駁至經?outbound trunk 的外部號{SIP URI?/p>

    // A2Billing Admin UI > DID > Add DID Group

    name = DID TWN

    // A2Billing Admin UI > DID > Add DID

    DID = 99474
    billing = only dialout rate
    DID group = DID TWN
    country = TAIWAN
    activated = YES
    monthly rate = 0

    // A2Billing Admin UI > Customers > Create Customers

    balance = 50.0
    call plan = VOXALOT_CALLPLAN
    didgroup = DID TWN
    activated = YES
    card type = PREPAID CARD
    country = TAIWAN
    sip account = NO
    iax account = NO

    a定轉接的目的號|可以透過 Admin UI ?Customer UI 來作
    客戶自行D DID 號碼
    // A2Billing Customer UI > DID

    select country = TAIWAN
    select virtual phone number = 99474
    voip call = NO
    destination = 8864123456

    TIPs:

    Q?select country 這裡內容會與 DID ?country 相同
    Q?若沒有出?DID number 可選擇,請檢查所d?customer 希?DIDGROUP 是否正確
    Q?voip call 若是 NOQ入外部的 PSTN/SIP 號碼Q若?YESQ?SIP URI?/p>

    理員分?DID 號碼i指定的客戶
    // A2Billing Admin UI > INBOUND DID > Destination

    destination = 8864123456
    customer ID = 選擇適當?customer
    DID = 選擇適當?DID
    activated = yes
    validated = 皆可
    voip_call = no

    TIPs:

    Q?voip call 若是 NOQ入外部的 PSTN/SIP 號碼Q若?YESQ?SIP URI?/p>

    Q?若需 DID 接入內部分機號碼(不經?A2B ?trunk)Q可以這樣a?br />-- destination = Local/101@from-internal (適用 FreePBX 的分?101)
    -- destination = SIP/123456 (適用 A2Billing card number 123456)
    -- voip_call = yes

    * 如果 destination number 要走 A2B ?trunkQ不該 trunk ?SIP ?ZaptelQvoip_call 必須?no?/p>

    盔R文章連結Q?/p>

    應用三:預付制、月付制會員模式

    用戶操作程Q?br />① 用戶使用 X-Lite ?ATA a備透過E\ad為分?/p>

    ② 直接撥目的地電話號碼Q例?886+XXXXXXXXQ?86 是國{?br />過程中不會有M外的提C音Q就像一般的 SIP 分機操作相同?/p>

    // A2Billing Admin UI > Customers > Create Customers

    card number = <隨機產生>
    card alias = <隨機產生>Qweb d希
    webui password = <隨機產生>Qweb d密碼
    balance = 50.0Q不可為Ӟ且必須以 USD a算
    call plan = VOXALOT_CALLPLAN
    activated = YES
    simultaneous access = INDIVIDUAL ACCESS
    card type = PREPAID CARD
    country = TAIWAN
    sip account = YES
    iax account = YES

    TIPs:

    Q?這裡?應用一)模式a定相同Q只差在 sip/iax account ?YES?br />Q?新增 customer 後,?reload Asterisk 後,SIP 用戶端才能註冊用?/p>

    // 取消 "輸入目的地號? 及其他提C音
    // A2Billing Admin UI > System Settings > Global List
    如果這裡的所有項目沒?GROUP ?agi-conf2 ?可善?GROUP 搜尋功能)Q請先前往 Add agi-conf > CREATE AGI-CONF2?/p>

    回到 Global List 扑ֈ GROUP ?agi-conf2 ?KEY/VALUE 按以下所qC改:

    use_dnid = yes

    這個SIP希除了要撥外部的\由外Q如果還要撥內部的其?SIP 分機號,需要繼U下面的修改Q?/p>

    sip_iax_friends = yes
    sip_iax_pstn_direct_call_prefix = 555
    sip_iax_pstn_direct_call = yes

    ※是否要提C餘的語音

    say_balance_after_auth = no
    say_timetocall = no

    如果電話不通,不要提示輸入目的地號的語音

    number_try = 1

    TIPs:

    Q?參數說明Q?/p>

    - Use DNID : YES 表示使用 DNIDQ並且不會提C?輸入目的地電p的語音
    - SIP Call = yes, SIP Call Prefix, Direct Call: 這三個參數是用來?SIP ad希後,也能撥其他分號|撥法?555+SIP Extension
    - Say Balance After Auth: 認證後是否提C餘?br />- Say Duration: 是否提示剩餘通話時間

    - 另一E比較快速的a定是:play_audio = no, use_dnid=yes, number_try=1?/p>

    //為此模式新增 dialplan
    //R輯 /etc/asterisk/extensions_a2billing.confQ在底下加入Q?/p>

    [custom-a2billing-sipclient]
    exten => _X.,1,Answer
    exten => _X.,n,Wait(1)
    exten => _X.,n,deadAGI(a2billing.php|2)
    exten => _X.,n,Hangup
    

     

    // ?A2Billing 套用新增?dialplan
    // A2Billing Admin UI > Customer > VoIP Settings
    扑ֈ SIP 分機項目Q按R輯

    Context = custom-a2billing-sipclient

    // 最後,埯指o套用所有的修改

    # asterisk -rx "reload"

    TIPs:

    由於版本 1.7.x ?bug 關係Q在 UI 做完操作後,並不會同步修?asterisk 的設定檔Q所以請依照方式作手動修改:
    R輯 /etc/asterisk/additional_a2billing_sip.conf Q修?context 的內宏V?br />要避免每ơ都要作手動修改Q可以參?F.A.Q 的方法?br />

    應用四:整合 FreePBX 的應?/h4>

    用途:FreePBX 的分用Ӟ?Outbound Calling 時可以透過 A2Billing 來計費,但其他原有PBX的功能都不會有媄ѝ?/p>

    // R輯 /etc/asterisk/extensions_custom.conf

    [macro-dialout-trunk-predial-hook]
    exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
    exten => s,2,MacroExit
    
    [custom-freepbx-a2billing]
    exten => _X.,1,DeadAGI(a2billing.php,${OUT_${DIAL_TRUNK}:8})
    exten => _X.,n,Hangup()
    

     

    // FreePBX UI > Trunks > Add Custom Trunk

    Custom Dial String = A2B/2

    Tips:

    2 代表?agi-conf 2

    // FreePBX UI > Outbound Routes
    自行a定需要的參數Q並向剛剛?Trunk?/p>

    // FreePBX UI > Extensions
    在需要計ȝ分機a定,參數 accountcode 填入 A2Billing ?Card Number?/p>

    Tips:

    分機在外撥的路由規則Q除?outbound route 外,還要考慮 A2Billing 的,也就?RATES 的相關設定?/p>

    延p

    應用五:Caller ID 認證模式

    用途:a定電話卡時除了使用輸入卡號的認證方式以外,還能以來電號?Caller ID) 辨識來認證?/p>

    • 啟用 Caller ID 後,用戶不需要先輸入卡號Q就可以直接撥目的地號碼?/li>
    • 一個卡號可以設定一i或多組的來電號{?/li>
    • 使用 Admin UI 來管理來電號{?/li>
    • 一旦啟用後Q當用戶的來電號g非系i所允許時,pȝ會提C卡號的認證的方式?/li>

     

    // 啟用方式
    A2Billing Admin UI > Syetem Settings >

    ?agi-conf 的方式來a,可以很容易啟?關閉這功能,需要用到的參數(Key)如下Q?/p>

    • cid_enable = yes Qyes 啟用Qno 關閉Q預a是關閉?/li>
    • cid_askpincode_ifnot_callerid = yes ; 預設 yesQ若 CID 認證失敗Q系i會提示輸入 Card Number?/li>
    • cid_auto_assign_card_to_cid = yes ; 預設 yesQ用戶撥入系i後Q如?CID 認證失敗Q系i會提示輸入 Card NumberQ一旦用戶入資a正,pȝ會自動新?CIDQ以致於該用戶下ơ再撥入時,可以通過 CID 認證Q且不會再提C?Card Number?/li>
    • cid_auto_create_card = no

    // 新增 Caller ID

    A2Billing Admin UI > Customers > Caller-ID

    CallerID = <用戶的來電號?gt;
    Activated = yes
    ID Card = <選擇卡號>

    F.A.Q

    Q:如何大量刪除 Customers?

    Ans: A2Billing UI > Customers > Add::Search > Search Customers

    a定搜尋條g > ?Search > 再按旁邊?Delete All

    注意Q這個方法無法將 VoIP Setting 一併刪除?/p>

    Q:如何大量刪除 VoIP Settings?

    Ans: 目前沒有合適的作法?/p>

    Q:如何變更pȝ預設q別 USD

    Ans: 要改兩個地方,修改 base_currency 的參數及更新 currency list?/p>

    1. A2Billing UI > System Settings > Global List
      搜尋 GROUP = global, Key = base_currency
      base_curreny = twd
    2. 即修改了幣別,pȝ預設?currency list 仍是以美?1:1 a算Q所以必須修攚w個匯率對照表?TWD 1:1?br />A2Billing UI > BILLING > Currency List > CLICK HERE TO UPDATE NOW
    Q:匯入 ratecard 時總是出N?ERROR: file type is not allowed: application/force-download

    Ans: 副檔名 csv Ҏ txt?/p>

    發現 Bug

     

    版本 問題描述
    1.7.0/1 修改 VoIP Settings ?內容Q不會同步更?Asterisk a定
    Ans:這是因為 A2Billing 預設是啟動了 Realtime Asterisk 模式(Asterisk 以資料n型式儲存a定)Q若只是檢查 *.conf 來判?Asterisk 是否更新是不準確的,然而?bug 卻造成 A2Billing 無法?relatime 模式更新 Asterisk。暫時的解決Ҏ是 A2Billing 關閉 realtime asterisk 模式Q恢復成 *.conf 方式來更?asteriskQ步驟如下:

    A2Billing UI > System Settings > Global List
    搜尋 GROUP = global

    use_realtime = no (預設?yes)

    Notes: 畉閉了 Realtime 後,爑־若有新增/R輯 VoIP Settings 時,?CONFIRM DATA 之後Q需要在作以下步驟完?Asterisk 的更斎ͼ

    1. 點選 GENERATE ADDITIONAL_A2BILLING_SIP.CONF
    2. click here to reload your asterisk server
    1.7.0 新增 CUSTOMER 時,?balance Ƅ位E持預設?0Q仍可以存檔
    Ans: 這項不確定是否為 bugQ但?1.3.x I定版,存檔前系i會檢查 balance 不可?0?
    1.7.0 若徏立電話卡是有 SIP ad希的,刪除這個電話卡後,SIP i端仍可以註冊,但已無法正常撥出?/td>
    1.7.0 ?Customer UI ?DID 功能Q操?Release DIDQ按?Release 後,雖然 DID ?releaseQ但畫面會成I白頁?/td>
    1.7.0 ?Customer UI ?DID 功能Q從項目列表中刪?destination number 時,所有欄位的值會出現I白Q再按下 Delete 後,雖然資料仍會刪除Q但需要再做一?Release DID?/td>


    ]]>
    asterisk 调试 讄http://www.shnenglu.com/byc/archive/2012/07/14/183302.html八叶?/dc:creator>八叶?/author>Fri, 13 Jul 2012 23:39:00 GMThttp://www.shnenglu.com/byc/archive/2012/07/14/183302.htmlhttp://www.shnenglu.com/byc/comments/183302.htmlhttp://www.shnenglu.com/byc/archive/2012/07/14/183302.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/183302.htmlhttp://www.shnenglu.com/byc/services/trackbacks/183302.htmlLogging

    Sometimes, when debugging an issue, it's useful to see and log extra information and at

    other times, you want logging to be minimal. Asterisk provides a number of ways of

    logging information, to files or to a syslog server. The file /etc/asterisk/logger.conf

    contains the configuration elements for logging. Asterisk has different types of message

    that can be logged these are:

     

     

    Verbose

    General 'chatter' about what is

    happening on the system.

    Verbosity levels greater than 3

    display dialplan commands as

    they are executed. This

    generates lots of log information

    Debug

    Debug messages, normally only

    used by programmers to extract

    extended information

    Notice

    Non urgent alert messages

    Warning

    Warning alert messages,

    something happened that might

    be bad. Some tell you how bad

    the warning is

    Error

    Error messages, something bad

    happened – These should be rare.

    In logger.conf you will see the [logfiles] section, this is where you define the filename

    and content of log files. Take a look at this example entry

    [logfiles]

    debug => debug

    This tells Asterisk to log debug messages (the right side of the =>) to a file called debug

    (the left side of the =>) located in /var/log/asterisk/. This directory can be changed in

    /etc/asterisk/asterisk.conf by modifying the line astlogdir => /var/log/asterisk to point

    to the desired directory. You can log multiple information types to the same file or you

    can spread the information over a number of files. For example

    [logfiles]

    debug => debug

    messages=>warning, error

    Will log debug messages to a file called debug, and will also log warning and error

    messages to a file called messages. There is a special “file” called console which when

    used will cause the message types specified to be logged to the Asterisk console, for

    example:

    [logfiles]

    console => debug, warning, error, notice, verbose

    Would log everything to the console (not to any files). The above is not recommended

    since the amount of information that would be generated could be far to much to be of

    any real use. If you change logger.conf you need to perform a reload or do a logger

    rotate (see next section). You can also log messages to a syslog sever (remote logging

    server), useful if you have either a lot of machines or want centralized logging. To do

    this use the file syslog, with the suffix you will use in /etc/syslog.conf for example, in

    logger.conf

    [logfiles]

    syslog.local0 => debug, warning, error, notice, verbose

    And /etc/syslog.conf

     

     

    local0.* @192.168.1.22

    This would send the Asterisk logging information to the syslog server at 192.168.1.22.

    Setting up a syslog server is beyond the scope of this document and is left as an exercise

    for the reader.
    Rotate logs

    It is advisable to rotate your logs frequently, depending on the amount of logging you

    have turned on and the about of data that is actually logged. Files larger than 2Gb can

    cause some nasty effects resulting in Asterisk crashes. You can rotate logs by using the

    command

    logger rotate

    This will rename the old log and start a new one. It will also reload logger.conf and

    adopt any changes you have made to it.

    Verbosity

    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 set verbose command, for example:

    set verbose 999

    Sets the verbosity level to 999, Asterisk will tell you that the level of verbosity changed

    asterisk*CLI> set verbose 999

    Verbosity is at least 999

    asterisk*CLI>

    You should see every message when it is set to this level, whereas setting it to 1 will

    show very little information.


    Setting the verbosity level changes the level on every attached

    process (connected via asterisk -r) not just the one you issue the

    command from.

    Getting to Grips with sip.conf

    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.

    You have a number of choices,






    sip set debug on 讄昄更多的sip信息
    sip set debug off关闭昄更多的sip信息
    SIP Channels are only shown if registered
    SIP SHOW INUSE will list all SIP extensions defined in SIP.CONF
    SIP SHOW CHANNELS will list all SIP extensions registered at that time
    sip set debug - Enable SIP debugging
    sip set debug ip - Enable SIP debugging on IP
    sip set debug off - Disable SIP debugging
    sip set debug peer - Enable SIP debugging on Peername



    stop gracefully 优雅地停止asterisk
    stop now 立即停止q行asterisk
    core show codecs 昄所有支持的~解码器

    set verbose 10
    set debug 10


    core set debug channel - Enable/disable debugging on a channel
    core set debug - Set level of debug chattiness
    core set debug off - Turns off debug chattiness
    core set verbose - Set level of verboseness

    core show calls {uptime}: Display information on calls


    logger set level {DEBUG|NOTICE}: Enables/Disables a specific logging level for this console
    logger set level debug off


    ]]>
    elastix 220 自动报工?/title><link>http://www.shnenglu.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.shnenglu.com/byc/archive/2012/06/27/180485.html</guid><wfw:comment>http://www.shnenglu.com/byc/comments/180485.html</wfw:comment><comments>http://www.shnenglu.com/byc/archive/2012/06/27/180485.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/byc/comments/commentRss/180485.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/byc/services/trackbacks/180485.html</trackback:ping><description><![CDATA[<div>参?br /><a >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 >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 (H口太小可能弹不出选择界面  从新选择 make distclean  ./configure) <br />add-ons 选择 res_config_mysql app_mysql cdr_mysql<br />applications 增加选择 app_voicemail<br />channel drivers 增加选择 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] = "";;  <br />int k9i = 0;  <br />int k9j = 0;  <br />int k9_flag = 0;   <br /><br /><br /><br /> <p>bridge = ast_bridge_call(qe-&gt;chan,peer, &amp;bridge_config); 前面<br />for(;k9i < 15;k9i++){  <br />    if(member->interface[k9i]=='/'){  <br />        k9_flag=1;   <br />        continue;  <br />    }  <br />    if(member->interface[k9i]=='@'){  <br />        k9_flag=0;  <br />        break;  <br />    }  <br />    if(k9_flag){  <br />        k_exten[k9j++]=member->interface[k9i];  <br />    }  <br />}                  <br />play_file(qe->chan, "number-report-begin"); <br />ast_say_digit_str(qe->chan, k_exten, AST_DIGIT_ANY, qe->chan->language);  <br />play_file(qe->chan, "number-report-end");  <br />play_file(peer, "beep");  </p> <p> <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.shnenglu.com/byc/aggbug/180485.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/byc/" target="_blank">八叶?/a> 2012-06-27 15:46 <a href="http://www.shnenglu.com/byc/archive/2012/06/27/180485.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>星网锐捷 IDA 讑֤ 查看IP http://www.shnenglu.com/byc/archive/2012/05/23/175909.html八叶?/dc:creator>八叶?/author>Wed, 23 May 2012 08:43:00 GMThttp://www.shnenglu.com/byc/archive/2012/05/23/175909.htmlhttp://www.shnenglu.com/byc/comments/175909.htmlhttp://www.shnenglu.com/byc/archive/2012/05/23/175909.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/175909.htmlhttp://www.shnenglu.com/byc/services/trackbacks/175909.html拨打 #190# 听到Ҏ提示x?br />再拨?#120# 可以听到语x报IP ?br />默认IP 192.168.88.16

    ]]>
    elastix2.3 dashboard 无交换空间时 不显C?bug 补丁http://www.shnenglu.com/byc/archive/2012/05/22/175809.html八叶?/dc:creator>八叶?/author>Tue, 22 May 2012 14:06:00 GMThttp://www.shnenglu.com/byc/archive/2012/05/22/175809.htmlhttp://www.shnenglu.com/byc/comments/175809.htmlhttp://www.shnenglu.com/byc/archive/2012/05/22/175809.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/175809.htmlhttp://www.shnenglu.com/byc/services/trackbacks/175809.html//SWAP USAGE
     if($arrSysInfo['SwapTotal']==0){
      $swap_usage_val = number_format(0.0,1);
     }
     else{
      $swap_usage_val = number_format(100.0 * ($arrSysInfo['SwapTotal'] - $arrSysInfo['SwapFree'])/$arrSysInfo['SwapTotal'], 1);
    }
    paloSantoSysInfo.class.php 157?br />        if($this->arrSysInfo['SwapTotal']==0)
            {
                    $value = 0;
            }
            else
            {
                    $value = ($this->arrSysInfo['SwapTotal'] - $this->arrSysInfo['SwapFree'])/$this->arrSysInfo['SwapTotal'];
            }

    ]]>
    elastix2.3 中文语言?voip88发布的elastix2.3中文版中抽取出来?http://www.shnenglu.com/byc/archive/2012/05/22/175802.html八叶?/dc:creator>八叶?/author>Tue, 22 May 2012 12:36:00 GMThttp://www.shnenglu.com/byc/archive/2012/05/22/175802.htmlhttp://www.shnenglu.com/byc/comments/175802.htmlhttp://www.shnenglu.com/byc/archive/2012/05/22/175802.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/175802.htmlhttp://www.shnenglu.com/byc/services/trackbacks/175802.html下蝲链接Q?a href="/Files/byc/cn_elastix.2.3.zip">cn_elastix.2.3.zip
    原始版本Q?a >http://bbs.voip88.com/thread-27724-1-1.html


    ]]>
    elastix 2.3 升到php5.2 CDR Report 出错 patchhttp://www.shnenglu.com/byc/archive/2012/05/15/175008.html八叶?/dc:creator>八叶?/author>Tue, 15 May 2012 12:44:00 GMThttp://www.shnenglu.com/byc/archive/2012/05/15/175008.htmlhttp://www.shnenglu.com/byc/comments/175008.htmlhttp://www.shnenglu.com/byc/archive/2012/05/15/175008.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/175008.htmlhttp://www.shnenglu.com/byc/services/trackbacks/175008.htmlhtml/libs/paloSantoDB.class.php

    163 ?Q函?fetchTable 内)
    $r = $result->execute($param);
    改ؓ
    if(isset($param))
    {
            foreach($param as $key => $value)
             {

                 if(is_int($value))
                         $paramtype = PDO::PARAM_INT;
                     elseif(is_bool($value))
                         $paramtype = PDO::PARAM_BOOL;
                     elseif(is_null($value))
                         $param = PDO::PARAM_NULL;
                     elseif(is_string($value))
                         $paramtype = PDO::PARAM_STR;
                     else
                         $paramtype = FALSE;
                        
                    if($paramtype )
                         $result->bindValue($key+1,$value,$paramtype);
             }
    }
    $r = $result->execute();



    ]]>
    elastix (Monitoring -> listen )ie 听录?补丁http://www.shnenglu.com/byc/archive/2012/04/25/172745.html八叶?/dc:creator>八叶?/author>Wed, 25 Apr 2012 09:18:00 GMThttp://www.shnenglu.com/byc/archive/2012/04/25/172745.htmlhttp://www.shnenglu.com/byc/comments/172745.htmlhttp://www.shnenglu.com/byc/archive/2012/04/25/172745.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/172745.htmlhttp://www.shnenglu.com/byc/services/trackbacks/172745.html/var/www/html/modules/monitoring/index.php 423?br />
    <!--                    <embed src='index.php?menu=$module_name&action=download&id=$file&rawmode=yes' width=300, height=20 autoplay=true loop=false></embed>
    -->

    <OBJECT ID="MediaPlayer" WIDTH=300 HEIGHT=100
      CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
       TYPE="application/x-oleobject"
    CODEBASE="  <PARAM name="autoStart" value="true">
      <PARAM name="filename" value="index.php?menu=$module_name&action=download&id=$file&rawmode=yes">
      <PARAM NAME="ShowControls" VALUE="True">
      <PARAM NAME="ShowStatusBar" VALUE="True">
    <EMBED TYPE="application/wav" SRC="index.php?menu=$module_name&action=download&id=$file&rawmode=yes"
    NAME="MediaPlayer" WIDTH=300 HEIGHT=100
     autostart="true" showcontrols="true" showstatusbar="true"></EMBED>
    </OBJECT>



    ]]>
    freepbx-mysql密码修改http://www.shnenglu.com/byc/archive/2012/02/24/166442.html八叶?/dc:creator>八叶?/author>Fri, 24 Feb 2012 09:21:00 GMThttp://www.shnenglu.com/byc/archive/2012/02/24/166442.htmlhttp://www.shnenglu.com/byc/comments/166442.htmlhttp://www.shnenglu.com/byc/archive/2012/02/24/166442.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/166442.htmlhttp://www.shnenglu.com/byc/services/trackbacks/166442.htmlhttp://www.freepbx.org/support/documentation/faq/changing-the-mysql-password


    amportal.conf, cdr_mysql.conf, res_mysql.conf freepbx.conf

    Once the password works, you need to update three files:

    • /etc/amportal.conf:

    AMPDBUSER=asteriskuser

    AMPDBPASS=mypass

    • /etc/asterisk/cdr_mysql.conf:

    password=mypass

    user=asteriskuser

    • /etc/asterisk/res_mysql.conf:

    dbuser = asteriskuser

    dbpass = mypass

    ./etc/freepbx.conf
    $amp_conf['AMPDBPASS'] = 'mypass';



    ]]>
    asterisk-cpphttp://www.shnenglu.com/byc/archive/2012/01/06/163703.html八叶?/dc:creator>八叶?/author>Fri, 06 Jan 2012 03:22:00 GMThttp://www.shnenglu.com/byc/archive/2012/01/06/163703.htmlhttp://www.shnenglu.com/byc/comments/163703.htmlhttp://www.shnenglu.com/byc/archive/2012/01/06/163703.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/163703.htmlhttp://www.shnenglu.com/byc/services/trackbacks/163703.htmlhttps://github.com/augcampos/asterisk-cpp
    asterisk-cpp 功能部分q可以,但bug 实在太多Qƈ发现?设计l构不合?产生的bug,不徏议用?br />

    ]]>
    asterisk-dotnet 1.6.3.1 Asterisk 1.6.2.21 一直重复连? BUGhttp://www.shnenglu.com/byc/archive/2011/12/09/161835.html八叶?/dc:creator>八叶?/author>Fri, 09 Dec 2011 08:47:00 GMThttp://www.shnenglu.com/byc/archive/2011/12/09/161835.htmlhttp://www.shnenglu.com/byc/comments/161835.htmlhttp://www.shnenglu.com/byc/archive/2011/12/09/161835.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/161835.htmlhttp://www.shnenglu.com/byc/services/trackbacks/161835.htmlasterisk 1.6 现在的版本是  Asterisk 1.6.2.21
    问题 asterisk  1.6.0.10  ?Ping 命oq回时没有actionIdQ但Aserisk 1.6.2.21Ping 命oq回却有actionId?a >

    详细?Qhttps://issues.asterisk.org/bug_view_advanced_page.php?bug_id=13993
    补丁Q?br />ManagerConnection.cs 1982 行改?br />
                if (!string.IsNullOrEmpty(actionId))
                {
                    
    int hash = Helper.GetInternalActionId(actionId).GetHashCode();
                    responseActionId 
    = Helper.StripInternalActionId(actionId);
                    responseHandler 
    = GetRemoveResponseHandler(hash);

                    
    if (response != null)
                        response.ActionId 
    = responseActionId;
                    
    if (responseHandler != null)
                    {
                        
                    }
                    
    else if (response == null && buffer.ContainsKey("ping"&& buffer["ping"== "Pong")
                    {
                        response 
    = Helper.BuildResponse(buffer);
                        
    foreach (ResponseHandler pingHandler in pingHandlers.Values)
                            pingHandler.HandleResponse(response);
                        pingHandlers.Clear();
                    }
                }
                
    else if (response == null && buffer.ContainsKey("ping"&& buffer["ping"== "Pong")
                {
                    response 
    = Helper.BuildResponse(buffer);
                    
    foreach (ResponseHandler pingHandler in pingHandlers.Values)
                        pingHandler.HandleResponse(response);
                    pingHandlers.Clear();
                }





    ]]>
    Asterisk Manager Interface C++ Interpretor for Linux [转]http://www.shnenglu.com/byc/archive/2011/11/27/161041.html八叶?/dc:creator>八叶?/author>Sun, 27 Nov 2011 10:54:00 GMThttp://www.shnenglu.com/byc/archive/2011/11/27/161041.htmlhttp://www.shnenglu.com/byc/comments/161041.htmlhttp://www.shnenglu.com/byc/archive/2011/11/27/161041.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/161041.htmlhttp://www.shnenglu.com/byc/services/trackbacks/161041.htmlAsterisk Manager Interface C++ Interpretor for Linux Q?a href="http://advancedcodingconcepts.blogspot.com/2011/02/asterisk-manager-interface-c.html">http://advancedcodingconcepts.blogspot.com/2011/02/asterisk-manager-interface-c.htmlQ?/h3>
    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.

    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.

    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)

    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.  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.  Currently, I am calling this application AMIflex based on the flexibility it provides to manage the Asterisk AMI protocol.

    This source code and it's derivatives can not be sold, licensed or packaged with any commercial software without my explicit permission.

    Download the source code here (.tar.bz2, 6kb)

    Installation instructions:

    1. unpack the file via "tar -xvjf" command
    2. create /etc/amiflex directory, and add a "servers.conf" file in the following format
    Server: server name (for display purposes only)
    Host: ip address or host name of ami server 
    Username: AMI manager username
    Secret: AMI manager password/secret

    Optional fields:

    RetryPeriod: number of seconds to wait between connection retries - ie if asterisk is rebooted (default: 300)
    Port: port number (default 5038)

    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)

    How to make this useful
    When a server connection is established, there's a AMI::RegisterAllEvents() call after authentication.  Add in your own events, and manipulate the structures or log output

    Example:
    AMI::RegisterEventCB("Dial", &AMI::MyDialCallback)

    void AMI::MyDialCallback(MSG *msg)
    {
        if (msg->Attr("SubEvent").value=="Begin")
            cout << msg->Attr("Channel").value + " is dialing " +msg->Attr("Dialstring").value<<endl;
    }


    Current limitations
    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.  Currently my task list with my employer is too long to not take some shortcuts :)
    1. 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.  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.
    2. 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.


    ]]>
    dahdihttp://www.shnenglu.com/byc/archive/2011/11/24/160887.html八叶?/dc:creator>八叶?/author>Thu, 24 Nov 2011 03:37:00 GMThttp://www.shnenglu.com/byc/archive/2011/11/24/160887.htmlhttp://www.shnenglu.com/byc/comments/160887.htmlhttp://www.shnenglu.com/byc/archive/2011/11/24/160887.html#Feedback2http://www.shnenglu.com/byc/comments/commentRss/160887.htmlhttp://www.shnenglu.com/byc/services/trackbacks/160887.html阅读全文

    ]]>
    Asterisk + Vtiger CRM 5.1 电击拨号 实现来电弹屏http://www.shnenglu.com/byc/archive/2011/11/05/159672.html八叶?/dc:creator>八叶?/author>Sat, 05 Nov 2011 06:57:00 GMThttp://www.shnenglu.com/byc/archive/2011/11/05/159672.htmlhttp://www.shnenglu.com/byc/comments/159672.htmlhttp://www.shnenglu.com/byc/archive/2011/11/05/159672.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/159672.htmlhttp://www.shnenglu.com/byc/services/trackbacks/159672.html

    http://www.ztmaker.com/read.php?tid-325.html

    一、Asterisk 端配|?br />
    修改配置文g"/etc/asterisk/manager_custom.conf"Q在其中d一个管理帐?vtigercrm"Q?br />
    [vtigercrm]
    secret = vtigercrm
    deny=0.0.0.0/0.0.0.0
    permit=192.168.1.3/255.255.255.0
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user
    然后重启 AsteriskQ?br />
    二、CRM 端配|?br />
    1、设|模?br />
    使用理员登?VtigerCRM"Q在菜单中选择"Settings->Module Manager"q入模块列表面?br />
    在此面中找?PBX Manager"模块Q将其启用后Q点击配|图标对此模块进行配|。各配置内容如下:

    Asterisk server IP: 填写 Asterisk 服务器地址
    Asterisk server port: 填写 Asterisk 理端口Q默认ؓ 5038
    Asterisk username: 填写 Asterisk 帐号名称Q按之前的配|就填写?vtigercrm"
    Asterisk password: 填写 Asterisk 帐号密码Q按之前的配|就填写?vtigercrm"
    Asterisk Version: 选择 Asterisk 的版?br />2、设|用户分?br />
    使用用户帐号d后,点击右上方的"My Preferences"Q在打开的页面中扑ֈ"Asterisk Configuration"栏,q作如下配置Q?br />
    Asterisk Extension: 填写用户的分机号
    Receive Incoming Calls: 选中此选项
    3、启动客LE序

    使用 SSH d CRM 服务器,q入 CRM pȝ安装路径下的"cron/modules/PBXManager"目录Q然后运行以下命令:

    # ./AsteriskClient.php
    如果一切正常就会出现如下信息:

    Date: 05-03-2010
    Connecting to asterisk server.....
    Connected successfully

    Trying to login to asterisk
    Logged in successfully to asterisk server
    xQ就可以使用电话拨打刚才讄的用户分机号了,如果一切正常,可以看到CRM面的右下角׃出现一个来甉|C框。另外在菜单中打开"Tools->PBX Manager"Q在面中也可以看到来电记录?br />
    注:如果 Asterisk ?1.4 版的Q请C下位|下载修改过?AsteriskClient.php"来替换原pȝ中的文gQ?br />http://danielaliaman.com/blog///index.php/2009/07/23/vtiger_pbx_manager_issues_only_first_cal?blog=2



    http://hi.baidu.com/ahhui/blog/item/e275b419ca6b415343a9ad83.html
    如何使用vtigercrm5.1实现点击拨号、来电弹?/div>
     

    环境QElastix1.6
    已经实现?span>功能Q?span>vtigercrm点击客户电话拨号Q来电在vtigercrm弹屏?br />未解决的问题Q弹屏没有来电号码?br />
    一、vtigercrm点击呼出配置ҎQ?br />1、首先保证asterisk、vtigercrm都正怋用?br />
    2、修?etc/asterisk/manager.conf文gQ增加如下:

    [vtigecrm]
    secret = vtigecrm
    deny=0.0.0.0/0.0.0.0
    permit=0.0.0.0/0.0.0.0
    read = system,call,log,verbose,command,agent,user
    write = system,call,log,verbose,command,agent,user
    复制代码

    以上代码中vtigercrm不是特定的,但要在vtigercrm中的pbx要一致?br />
    3、设|vtigercrmQ?br />讑֮-模块-PBX Manager

    Asterisk server IP Q?92.168.0.15 Q这是astersik服务?/span>的IPQ?br />Asterisk server port Q?038 Q默?038Q?br />Asterisk username Qvtigercrm
    Asterisk password Qvtigercrm
    Asterisk VersionQ?.4
    复制代码·

     

    4、设|vtigercrm中的个h分机P
    我的讑֮
    Asterisk ExtensionQ?00 Q这是asterisk里已讑֮分机P
    Receive Incoming CallsQ??

    5、修Ҏ口文Ӟ
    /var/www/html/vtigercrm/modules/PBXManager/utils/AsteriskClass.php
    以下代码:

    switch($typeCalled){
    case "SIP":
    $context = "local-extensions";
    break;
    case "PSTN":
    $context = "from-inside";//"outbound-dialing";
    break;
    default:
    $context = "default";
    }
    复制代码

    更改为:

    switch($typeCalled){
    case "SIP":
    $context = "local-extensions";
    break;
    case "PSTN":
    $context = "from-internal";//"outbound-dialing";
    break;
    default:
    $context = "from-internal";
    }
    复制代码

    如果利Q到q里p用vtigercrm点击拨号了,点击L后,你的分机会响铃,响铃分机提机后,p动将L拨出?br />参考:http://wiki.vtiger.com/index.php/vtiger510:Module_Asterisk_Howto
    二、来电弹屏的讄ҎQ?br />q里需?span>q行一个文Ӟq且q行后,不能l止?br />q入q个目录Q?var/www/html/vtigercrm/cron/modules/PBXManager
    q行q个命oQ?

    php AsteriskClient.php
    复制代码

    q行后,不能l止Q如?span>服务器重启过Q还需要再ơ运行?br />
    到这里,来电弹屏的功能也实现了,不过来电昄问题没找到答案?br />阅vtigercrmC֌论坛Q也未找到合适的解决办法Q更有说此方法比较好CPU资源?br />






    弹屏补丁

    vtigercrm/include/js/asterisk.js
    function _defAsteriskTimer(){
     var asteriskTimer = null;
     var ASTERISK_POLLTIME = 5000; //vtigercrm polls the asterisk server for incoming calls after every 3 seconds for now
     var ASTERISK_INCOMING_DIV_TIMEOUT = 60; 

     

    notificationPopup.js
     function ResetPopup(){
      popupDiv.innerHTML = "";
      popupDiv.style.height = "0px";
      popupDiv.style.display = "none";
      parentDiv.removeChild(popupDiv);
      if(parentDiv.children.length ==0){
       parentDiv.style.display = "none";
      }

     }


     vtigercrm/cron/modules/PBXManager/AsteriskClient.php

    function asterisk_handleResponse2($mainresponse, $adb, $asterisk, $state) {
     $appdata = $mainresponse['AppData'];
        
     $uniqueid = $channel = $callerType = $extension = null;
     $parseSuccess = false;
     
     if(
      $mainresponse['Event'] == 'Newexten' && (strstr($appdata, "__DIALED_NUMBER") || strstr($appdata, "EXTTOCALL"))
     ) {

      $uniqueid = $mainresponse['Uniqueid'];

      $channel = $mainresponse['Channel'];
      $splits = explode('/', $channel);
      $callerType = $splits[0];

      $splits = explode('=', $appdata);
      $extension = $splits[1];
      
      $parseSuccess = true;
     } else if($mainresponse['Event'] == 'OriginateResponse'){
      //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
      $uniqueid = $mainresponse['Uniqueid'];
      $adb->pquery("UPDATE vtiger_asteriskincomingevents set flag = 1 WHERE uid = ?", array($uniqueid));
     }else if($mainresponse['Event']=='NewCallerid'){

                    $channel = $mainresponse['Channel'];

                    if(strncmp($channel,"DAHDI",5)==0){

       $uniqueid = $mainresponse['Uniqueid'];

       if(!empty($mainresponse['CallerID'])) {
        $callerNumber = $mainresponse['CallerID'];
       }elseif(!empty($mainresponse['CallerIDNum'])) {
        $callerNumber = $mainresponse['CallerIDNum'];
       }
       
       $sql = "UPDATE vtiger_asteriskincomingevents set from_number=? WHERE uid=?";
       $adb->pquery($sql, array($callerNumber, $uniqueid));
      }  
     }
     





    ]]>CentOS6.0 asterisk-1.6.2.20 freepbx-2.9.0 安装q程http://www.shnenglu.com/byc/archive/2011/09/15/155865.html八叶?/dc:creator>八叶?/author>Thu, 15 Sep 2011 10:15:00 GMThttp://www.shnenglu.com/byc/archive/2011/09/15/155865.htmlhttp://www.shnenglu.com/byc/comments/155865.htmlhttp://www.shnenglu.com/byc/archive/2011/09/15/155865.html#Feedback0http://www.shnenglu.com/byc/comments/commentRss/155865.htmlhttp://www.shnenglu.com/byc/services/trackbacks/155865.html需要安装的?nbsp;  
       Mysql数据库客服端QMysql数据库服务端
       PHP支持Q可选包增加N)
          php_mysql
       开发工?br />
    2 安装Asterisk
       yum install libxml2-devel
       yum install ncurses-devel

       groupadd asterisk
       useradd -c "asterisk PBX" -d /var/lib/asterisk -g asterisk -s /sbin/nologin asterisk

       解压asterisk
       ./configure
       make
       make install
       //make samples 安装freepbx不要q行
       make config

    3 安装FreePBX
       
       解压freepbx

       yum install php-db
       //yum install php-pear-DB (centos 5)
       pear install db
       yum install php-posix
       
       service mysqld start   

       mysqladmin create asterisk
       mysqladmin create asteriskcdrdb 
       mysql asterisk < SQL/newinstall.sql
       mysql asteriskcdrdb < SQL/cdr_mysql_table.sql
       mysqladmin -u root -p password 123456
       
        /etc/httpd/conf/httpd.conf User apache 改ؓ User asterisk ;Group apache 改ؓ Group asterisk
        /etc/php.ini date.timezone = PRC
        /etc/sysconfig/selinux  SELINUX=disabled

        setenforce 0

        service httpd start 
        service asterisk start


        ./install_amp --username root --password 123456
        amportal start
        http://你的IP user:admin pass:admin

       


    配置Asterisk Recording接口密码和打开|页接口用户认证

    vi/etc/amportal.conf
    ARI_ADMIN_PASSWORD=你的密码
    AUTHTYPE=database
    FOPRUN=false
    FOPDISABLE=true


    echo "/usr/local/sbin/amportal start">>/etc/rc.local

    备注:
    昄PHP错误信息
    调试的时候把php.ini中的display_errors   =   OffҎOn
    或?nbsp;  error_log   =   D:\Web\error.log   在error.log中查看错误日?
       



    FreePBX 2.X版本安装?都是不用密码就可以q入admin下去理asteriskQ而有x改密码的说明文
    官方|关没提供,论坛中也问得相对较多Q我q单说一下如何去配置FreePBX密码?/p>

    1、找?etc/amportal.conf配置文gQ将以下q个语句

    # AUTHTYPE: authentication type to use for web admin
    # If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above
    # valid: none, database
    AUTHTYPE=
    none

    更改为:Q注意红色标识)

    # AUTHTYPE: authentication type to use for web admin
    # If type set to 'database', the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above
    # valid: none, database
    AUTHTYPE=
    database

    2、执?strong>./usr/src/freepbx-2.5.1/apply_conf.sh 使更改生效。(注意蓝色语句的完整性)

    3、这样就可以使用

    AMPDBUSER=
    AMPDBPASS=

    对应的帐号密码进入管理系l,也可以?strong>Administrators模块建立q入pȝ的用戗?/p>

     

    报表不能查看

    如果查看报表的时候出现如下的错误提示Q?/span>

    YOU MUST ACCESS THE CDR THROUGH THE ASTERISK MANAGEMENT PORTAL!

    发生q个错误的原因可能是httpdq程不能dphp会话的保存\径?/span>

    1.执行以下命o查看PHP会话的保存\?/span>:

    grep save_path /etc/php.ini

    扑ֈ:

    session.save_path = /var/lib/php/session

    2. 修改权限

    chown asterisk /var/lib/php/session

    chmod -R 777 /var/lib/php/session

     

    Couldn't load variables.txt

    如果出现此问题可能是因ؓop_server.pl没有q行。进行目录进行即?/span>

    [root@www ~]# cd /var/www/html/panel/

    [root@www panel]# ./op_server.pl


    讄freepbx 配置device与user分开

    vi /etc/amportal.conf

    AMPEXTENSIONS=deviceanduser | extensions

          http://hi.baidu.com/kinnsei/blog/item/302c2d1e4f6952f01ad57601.html(用?user)与设?device)区分开?-内线分机的高U应?




    ]]>
    ۺϾþĻ| þþƷŷպƷ| Ʒþþþþþ| ڸþþþþ| 88þþƷһëƬ | ëƬþþþþùëƬ| AVպƷþþþþ| һõþۺϺݺݰ| ޹Ʒ˾þ| 97þþþ| þˬˬƬAV鶹 | ޾Ʒþþþþ| ˾ҹվھƷþþþþþþ | ѾƷþ| ݺۺϾþۺ88| ˾þô߽AVһ| þˬˬˬav| ĻþӰԺ| ˾þô߽ۺӰԺҳ| ޾Ʒþǧն| þùƷӰԺ| 99þۺϾƷ | ޾Ʒרþþ| ˮϵþþƷ| þþƷվ| þþƷĻ| AVþþƷ| ѾƷ99þùۺϾƷ| þþþһƷ| ŷvaþþþ| 99þþƷѿһ| þӰԺһ| 91Ʒ91þþþø| þþ99Ʒһ| ޡvþþ뾫Ʒ| ĻۺϾþ2| ҹƵþþþһ | Ļþ| 99þþƷѾƷ| ɫ͵͵þһ| þҹۺϾþ|