** ถ้าเครื่องของท่านกำลังใช้งานอยู่ และมีปัญหาไม่ได้ด้วยอีกต่างหาก ถ้าหาแล้วไม่มีเมนูอย่างที่ผมเอามาให้ดู ก็อย่าอัพเกรดเลยครับ ปล่อยมันไว้อย่างนั้นแหล่ะ แล้วหาทางอื่นเอาถ้ายังอยากใช้ฟีเจอร์นี้อยู่ **
** ถ้าไม่เห็นเมนูอย่างที่ผมเอามาเป็นตัวอย่าง ดูข้อมูลในไฟล์ /etc/asterisk/extensions_additional.conf ด้านล่างนะครับ เผื่อจะช่วยอะไรได้บ้าง **
1. เมนู Time Groups ตั้งเวลาที่จะให้โทรออกได้
สังเกตุมุมบนด้านขวามือด้วยนะครับ นั่นคือเวลาบนเซอร์เวอร์ ถ้าไม่ตรงก็ต้องปรับให้มันตรง ดูวิธีการปรับเวลาในเซอร์เวอร์จากบทความเก่าในหัวข้อ CentOS นะครับ
2. เมนู Outbound Route ตั้งค่า Time Group ที่่ต้องการใช้งาน
3. เทสโทรออก
โทรนอกช่วงเวลา จะโทรไม่ได้ ซึ่ง Messages จะเป็นแบบนี้
-- Executing [96629009000@from-internal:1] ResetCDR("SIP/100-00000003", "") in new stack
-- Executing [96629009000@from-internal:2] NoCDR("SIP/100-00000003", "") in new stack
-- Executing [96629009000@from-internal:3] Progress("SIP/100-00000003", "") in new stack
-- Executing [96629009000@from-internal:4] Wait("SIP/100-00000003", "1") in new stack
-- Executing [96629009000@from-internal:5] Progress("SIP/100-00000003", "") in new stack
-- Executing [96629009000@from-internal:6] Playback("SIP/100-00000003", "silence/1&cannot-complete-as-dialed&check-number-dial-again|noanswer") in new stack
-- <SIP/100-00000003> Playing 'silence/1' (language 'en')
-- <SIP/100-00000003> Playing 'cannot-complete-as-dialed' (language 'en')
-- <SIP/100-00000003> Playing 'check-number-dial-again' (language 'en')
-- Executing [96629009000@from-internal:7] Wait("SIP/100-00000003", "1") in new stack
-- Executing [96629009000@from-internal:8] Congestion("SIP/100-00000003", "20") in new stack
== Spawn extension (from-internal, 96629009000, 8) exited non-zero on 'SIP/100-00000003'
-- Executing [h@from-internal:1] Hangup("SIP/100-00000003", "") in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/100-00000003'
โทรออกในเวลาจะโทรออกได้ ซึ่ง Messages จะเป็นแบบนี้
-- Executing [96629009000@from-internal:1] Macro("SIP/100-00000004", "user-callerid|LIMIT|") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/100-00000004", "AMPUSER=100") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/100-00000004", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/100-00000004", "1|Set|REALCALLERIDNUM=100") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/100-00000004", "AMPUSER=100") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/100-00000004", "AMPUSERCIDNAME=Khun Nui") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/100-00000004", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/100-00000004", "AMPUSERCID=100") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/100-00000004", "CALLERID(all)="Khun Nui" <100>") in new stack
-- Executing [s@macro-user-callerid:9] GotoIf("SIP/100-00000004", "0?limit") in new stack
-- Executing [s@macro-user-callerid:10] ExecIf("SIP/100-00000004", "1|Set|GROUP(concurrency_limit)=100") in new stack
-- Executing [s@macro-user-callerid:11] GotoIf("SIP/100-00000004", "1?continue") in new stack
-- Goto (macro-user-callerid,s,24)
-- Executing [s@macro-user-callerid:24] Set("SIP/100-00000004", "CALLERID(number)=100") in new stack
-- Executing [s@macro-user-callerid:25] Set("SIP/100-00000004", "CALLERID(name)=Khun Nui") in new stack
-- Executing [96629009000@from-internal:2] Set("SIP/100-00000004", "MOHCLASS=default") in new stack
-- Executing [96629009000@from-internal:3] Set("SIP/100-00000004", "_NODEST=") in new stack
-- Executing [96629009000@from-internal:4] Macro("SIP/100-00000004", "record-enable|100|OUT|") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("SIP/100-00000004", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("SIP/100-00000004", "recordingcheck|20110518-113821|1305693501.4") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20110518-113821|1305693501.4: Outbound recording enabled.
recordingcheck|20110518-113821|1305693501.4: CALLFILENAME=OUT100-20110518-113821-1305693501.4
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:20] MixMonitor("SIP/100-00000004", "OUT100-20110518-113821-1305693501.4.wav||") in new stack
-- Executing [s@macro-record-enable:21] MacroExit("SIP/100-00000004", "") in new stack
-- Executing [96629009000@from-internal:5] Macro("SIP/100-00000004", "dialout-trunk|2|6629009000|") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("SIP/100-00000004", "DIAL_TRUNK=2") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/100-00000004", "0?sub-pincheck|s|1") in new stack
-- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/100-00000004", "0?disabletrunk|1") in new stack
-- Executing [s@macro-dialout-trunk:4] Set("SIP/100-00000004", "DIAL_NUMBER=6629009000") in new stack
-- Executing [s@macro-dialout-trunk:5] Set("SIP/100-00000004", "DIAL_TRUNK_OPTIONS=tT") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("SIP/100-00000004", "OUTBOUND_GROUP=OUT_2") in new stack
-- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/100-00000004", "0?nomax") in new stack
-- Executing [s@macro-dialout-trunk:8] GotoIf("SIP/100-00000004", "0?chanfull") in new stack
-- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/100-00000004", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:10] Set("SIP/100-00000004", "DIAL_TRUNK_OPTIONS=") in new stack
-- Executing [s@macro-dialout-trunk:11] Macro("SIP/100-00000004", "outbound-callerid|2") in new stack
-- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/100-00000004", "0|SetCallerPres|") in new stack
-- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/100-00000004", "0|Set|REALCALLERIDNUM=100") in new stack
-- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/100-00000004", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,6)
-- Executing [s@macro-outbound-callerid:6] Set("SIP/100-00000004", "USEROUTCID="Khun Nui" <100>") in new stack
-- Executing [s@macro-outbound-callerid:7] Set("SIP/100-00000004", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:8] Set("SIP/100-00000004", "TRUNKOUTCID="CC" <023456789>") in new stack
-- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/100-00000004", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/100-00000004", "1|Set|CALLERID(all)=CC <023456789>") in new stack
-- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/100-00000004", "1|Set|CALLERID(all)=Khun Nui <100>") in new stack
-- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/100-00000004", "0|Set|CALLERID(all)=") in new stack
-- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/100-00000004", "0|SetCallerPres|prohib_passed_screen") in new stack
-- Executing [s@macro-dialout-trunk:12] GosubIf("SIP/100-00000004", "1?sub-flp-2|s|1") in new stack
-- Executing [s@sub-flp-2:1] ExecIf("SIP/100-00000004", "1|Return|") in new stack
-- Executing [s@macro-dialout-trunk:13] Set("SIP/100-00000004", "OUTNUM=6629009000") in new stack
-- Executing [s@macro-dialout-trunk:14] Set("SIP/100-00000004", "custom=SIP/trunk-202-5") in new stack
-- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/100-00000004", "0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^default)") in new stack
-- Executing [s@macro-dialout-trunk:16] ExecIf("SIP/100-00000004", "0|Set|DIAL_TRUNK_OPTIONS=M(confirm)") in new stack
-- Executing [s@macro-dialout-trunk:17] Macro("SIP/100-00000004", "dialout-trunk-predial-hook|") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/100-00000004", "") in new stack
-- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/100-00000004", "0?bypass|1") in new stack
-- Executing [s@macro-dialout-trunk:19] GotoIf("SIP/100-00000004", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:20] Dial("SIP/100-00000004", "SIP/trunk-202-5/6629009000|300|") in new stack
-- Called trunk-202-5/6629009000
== Begin MixMonitor Recording SIP/100-00000004
-- SIP/trunk-202-5-00000005 is making progress passing it to SIP/100-00000004
-- SIP/trunk-202-5-00000005 answered SIP/100-00000004
มาดูสิ่งที่เปลี่ยนแปลงในไฟล์ /etc/asterisk/extensions_additional.conf กันครับ ผมว่าเราเอาคอนเซ็ปต์นี้ไปดัดแปลง Asterisk, Elastix, FreePBX ให้โทรออกตามช่วงเวลาได้นะครับ ถ้าคอนฟิกจากหน้าเว็บไม่ได้
- โค้ด: เลือกทั้งหมด
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-1|08:00-17:59|mon-fri|*|* ; 9_outside
include => outrt-2 ; 0_outside
include => outrt-3 ; 80_outside
include => outrt-4 ; 82_outside
include => outrt-5|08:00-17:59|mon-fri|1-31|jan-dec ; 83_outside
include => outrt-6 ; 84_outside
include => outrt-7 ; Skype-Out
include => outrt-8 ; Skype
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
[outrt-1] ; 9_outside
include => outrt-1-custom
exten => _9.,1,Macro(user-callerid,LIMIT,)
exten => _9.,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _9.,n,Set(_NODEST=)
exten => _9.,n,Macro(record-enable,${AMPUSER},OUT,)
exten => _9.,n,Macro(dialout-trunk,2,${EXTEN:1},)
exten => _9.,n,Macro(outisbusy,)
บทความที่เกี่ยวข้อง
เทคนิคการจำกัดช่วงเวลาการโทรออกผ่าน Trunk ใน Elastix, FreePBX โดยวิธีแก้ไขไฟล์คอนฟิก