หน้า 2 จากทั้งหมด 2

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 09:22
โดย nungkmitl
sip ครับ ผมงงตรง Offline อยู่ ผลก็เปิด X-lite แล้วครับ
sip show peers
Name/username Host Dyn Nat ACL Port Status
1002 (Unspecified) D N A 0 UNKNOWN
1001 (Unspecified) D N A 0 UNKNOWN
2 sip peers [Monitored: 0 online, 2 offline Unmonitored: 0 online, 0 offline]

อันนี้ กดจาก1002 ไปหา 1001 ครับ
-- Executing [1001@from-internal:1] Macro("SIP/1002-00000007", "exten-vm|1001|1001") in new stack
-- Executing [s@macro-exten-vm:1] Macro("SIP/1002-00000007", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/1002-00000007", "AMPUSER=1002") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/1002-00000007", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/1002-00000007", "1|Set|REALCALLERIDNUM=1002") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/1002-00000007", "AMPUSER=1002") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/1002-00000007", "AMPUSERCIDNAME=1002") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/1002-00000007", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/1002-00000007", "AMPUSERCID=1002") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/1002-00000007", "CALLERID(all)="1002" <1002>") in new stack
-- Executing [s@macro-user-callerid:9] ExecIf("SIP/1002-00000007", "0|Set|CHANNEL(language)=") in new stack
-- Executing [s@macro-user-callerid:10] GotoIf("SIP/1002-00000007", "0?continue") in new stack
-- Executing [s@macro-user-callerid:11] Set("SIP/1002-00000007", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("SIP/1002-00000007", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("SIP/1002-00000007", "Using CallerID "1002" <1002>") in new stack
-- Executing [s@macro-exten-vm:2] Set("SIP/1002-00000007", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("SIP/1002-00000007", "VMBOX=1001") in new stack
-- Executing [s@macro-exten-vm:4] Set("SIP/1002-00000007", "EXTTOCALL=1001") in new stack
-- Executing [s@macro-exten-vm:5] Set("SIP/1002-00000007", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("SIP/1002-00000007", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("SIP/1002-00000007", "RT=15") in new stack
-- Executing [s@macro-exten-vm:8] Macro("SIP/1002-00000007", "record-enable|1001|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("SIP/1002-00000007", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("SIP/1002-00000007", "recordingcheck|20110325-091839|1301019519.7") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20110325-091839|1301019519.7: Inbound recording not enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] MacroExit("SIP/1002-00000007", "") in new stack
-- Executing [s@macro-exten-vm:9] Macro("SIP/1002-00000007", "dial|15|tT|1001") in new stack
-- Executing [s@macro-dial:1] GotoIf("SIP/1002-00000007", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("SIP/1002-00000007", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is '1002' number is '1002'
dialparties.agi: Methodology of ring is 'none'
-- dialparties.agi: Added extension 1001 to extension map
-- dialparties.agi: Extension 1001 cf is disabled
-- dialparties.agi: Extension 1001 do not disturb is disabled
dialparties.agi: ExtensionState: 4
dialparties.agi: Extension 1001 has ExtensionState: 4
-- dialparties.agi: Checking CW and CFB status for extension 1001
-- dialparties.agi: dbset CALLTRACE/1001 to 1002
-- dialparties.agi: Filtered ARG3: 1001
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("SIP/1002-00000007", "SIP/1001|15|tT") in new stack
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-dial:8] Set("SIP/1002-00000007", "DIALSTATUS=CHANUNAVAIL") in new stack
-- Executing [s@macro-dial:9] GosubIf("SIP/1002-00000007", "0?CHANUNAVAIL|1") in new stack
-- Executing [s@macro-exten-vm:10] GotoIf("SIP/1002-00000007", "0?exit|return") in new stack
-- Executing [s@macro-exten-vm:11] Set("SIP/1002-00000007", "SV_DIALSTATUS=CHANUNAVAIL") in new stack
-- Executing [s@macro-exten-vm:12] GosubIf("SIP/1002-00000007", "0?docfu|1") in new stack
-- Executing [s@macro-exten-vm:13] GosubIf("SIP/1002-00000007", "0?docfb|1") in new stack
-- Executing [s@macro-exten-vm:14] Set("SIP/1002-00000007", "DIALSTATUS=CHANUNAVAIL") in new stack
-- Executing [s@macro-exten-vm:15] NoOp("SIP/1002-00000007", "Voicemail is 1001") in new stack
-- Executing [s@macro-exten-vm:16] GotoIf("SIP/1002-00000007", "0?s-CHANUNAVAIL|1") in new stack
-- Executing [s@macro-exten-vm:17] NoOp("SIP/1002-00000007", "Sending to Voicemail box 1001") in new stack
-- Executing [s@macro-exten-vm:18] Macro("SIP/1002-00000007", "vm|1001|CHANUNAVAIL|") in new stack
-- Executing [s@macro-vm:1] Macro("SIP/1002-00000007", "user-callerid|SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/1002-00000007", "AMPUSER=1002") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/1002-00000007", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/1002-00000007", "0|Set|REALCALLERIDNUM=1002") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/1002-00000007", "AMPUSER=1002") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/1002-00000007", "AMPUSERCIDNAME=1002") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/1002-00000007", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/1002-00000007", "AMPUSERCID=1002") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/1002-00000007", "CALLERID(all)="1002" <1002>") in new stack
-- Executing [s@macro-user-callerid:9] ExecIf("SIP/1002-00000007", "0|Set|CHANNEL(language)=") in new stack
-- Executing [s@macro-user-callerid:10] GotoIf("SIP/1002-00000007", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("SIP/1002-00000007", "Using CallerID "1002" <1002>") in new stack
-- Executing [s@macro-vm:2] Set("SIP/1002-00000007", "VMGAIN=""") in new stack
-- Executing [s@macro-vm:3] GotoIf("SIP/1002-00000007", "1?vmx|1") in new stack
-- Goto (macro-vm,vmx,1)
-- Executing [vmx@macro-vm:1] GotoIf("SIP/1002-00000007", "0?s-CHANUNAVAIL|1") in new stack
-- Executing [vmx@macro-vm:2] Set("SIP/1002-00000007", "MODE=unavail") in new stack
-- Executing [vmx@macro-vm:3] GotoIf("SIP/1002-00000007", "1?notdirect") in new stack
-- Goto (macro-vm,vmx,5)
-- Executing [vmx@macro-vm:5] NoOp("SIP/1002-00000007", "Checking if ext 1001 is enabled: ") in new stack
-- Executing [vmx@macro-vm:6] GotoIf("SIP/1002-00000007", "1?s-CHANUNAVAIL|1") in new stack
-- Goto (macro-vm,s-CHANUNAVAIL,1)
-- Executing [s-CHANUNAVAIL@macro-vm:1] Macro("SIP/1002-00000007", "get-vmcontext|1001") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("SIP/1002-00000007", "VMCONTEXT=default") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("SIP/1002-00000007", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("SIP/1002-00000007", "") in new stack
-- Executing [s-CHANUNAVAIL@macro-vm:2] VoiceMail("SIP/1002-00000007", "1001@default|u") in new stack
-- <SIP/1002-00000007> Playing 'vm-theperson' (language 'en')
-- <SIP/1002-00000007> Playing 'digits/1' (language 'en')
-- <SIP/1002-00000007> Playing 'digits/0' (language 'en')
-- <SIP/1002-00000007> Playing 'digits/0' (language 'en')
-- <SIP/1002-00000007> Playing 'digits/1' (language 'en')
-- <SIP/1002-00000007> Playing 'vm-isunavail' (language 'en')
-- <SIP/1002-00000007> Playing 'vm-intro' (language 'en')
-- <SIP/1002-00000007> Playing 'beep' (language 'en')
-- Recording the message
-- x=0, open writing: /var/spool/asterisk/voicemail/default/1001/tmp/Kwc6jZ format: wav49, 0x9906900
-- x=1, open writing: /var/spool/asterisk/voicemail/default/1001/tmp/Kwc6jZ format: wav, 0x9906420
elastix*CLI>


อันนี้กด 1234 ครับ
-- Executing [1234@from-internal:1] Playback("SIP/1002-00000008", "demo-congrats") in new stack
-- <SIP/1002-00000008> Playing 'demo-congrats' (language 'en')

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 09:33
โดย nuiz
พอจะรู้สาเหตุแล้วครับ ทำไมโทรไปไม่ได้
sip show peers
มันโชว์ว่าทั้งเบอร์ 1001 และ 1002 ไม่มีเบอร์ไหนที่ Register กับ SIP Server เลย ซึ่งถ้า Register ได้มันก็จะเห็นเป็น IP Address ในคอลัมน์ Host และ (อาจจะ) เห็น OK (x ms) ในคอลัมน์ Status

และที่ว่าทำไมกด 1234 แล้วมีเสียง มันเป็นคนละกรณีครับ กรณีกด 1234 เป็นการส่งจาก x-lite ไปหา Elastix (เรียกว่า inbound call) ซึ่งปกติมันก็จะรับเพราะเป็นเบอร์ที่มีคอนฟิกไว้แล้ว แต่กรณีการโทรไปหาเบอร์อื่น มันเป็นการส่งออกไปจาก Elastix (เรียกว่า outbound call) ซึ่ง Elastix ต้องรู้ข้อมูลอย่างน้อยๆก็ IP Address ของเบอร์ปลายทาง ไม่งั้นมันก็จะไม่รู้ว่ามันต้องส่ง call ไปที่ไหน ซึ่งตอนนี้มันยังไม่รู้ครับ

ปัญหาอย่างเดียวที่มีตอนนี้คือ ทำยังไงให้เบอร์ Extension ทั้งสองเบอร์รีจิสเตอร์กับ Server ให้ได้

เอางี้ครับ ผมอยากเห็นว่าเกิดอะไรขึ้นตอนที่ x-lite ส่ง message มารีจิสเตอร์กับ Elastix ทำไมบน x-lite ถึงโชว์ว่ารีจิสเตอร์ได้แล้ว แต่บน Elastix กลับมองไม่เห็น

- เข้า Asterisk Console
- ยังไม่ต้องโทรหากันนะครับ
- พิมพ์คำสั่ง sip set debug on และ sip set debug peer 1001 และ sip set debug peer 1002 แล้วก๊อบ message โพสต์มาเช่นเดิม
- พิมพ์คำสั่ง sip set debug off เพื่อปิดการ debug

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 10:58
โดย nungkmitl
ตามนี้ครับ
1001 ครับ
elastix*CLI> sip set debug peers 1001
Usage: sip set debug
Enables dumping of SIP packets for debugging purposes

sip set debug ip <host[:PORT]>
Enables dumping of SIP packets to and from host.

sip set debug peer <peername>
Enables dumping of SIP packets to and from host.
Require peer to be registered.

1002 ครับ
elastix*CLI> sip set debug peers 1002
Usage: sip set debug
Enables dumping of SIP packets for debugging purposes

sip set debug ip <host[:PORT]>
Enables dumping of SIP packets to and from host.

sip set debug peer <peername>
Enables dumping of SIP packets to and from host.
Require peer to be registered.
ขอบคุณครับ

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 11:20
โดย nuiz
พิมพ์คำสั่งผิดหน่ะครับ
sip set debug peer 1001
คำว่า peer มันไม่มีตัว s นะครับ แต่คุณ nungkmitl พิมพ์มีตัว s


sip set debug on
sip set debug peer 1001
sip set debug peer 1002

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 11:29
โดย nungkmitl
ขอโทษทีครับ
1001 ครับ
elastix*CLI> sip set debug peer 1001
Unable to get IP address of peer '1001'
1002 ครับ
elastix*CLI> sip set debug peer 1002
Unable to get IP address of peer '1002'

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 13:06
โดย nuiz
อืม ไม่ได้แฮะ เพราะไม่มีไอพีของ 1001, 1002

เครื่องเป็น Asterisk 1.4 ใช้คำสั่งนี้แทนครับ

sip set debug

แล้วเอาเบอร์ 1001, 1002 ลองรีจิสเตอร์เข้ามา (ปิดโปรแกรม x-lite ก่อน แล้วเปิดขึ้นมาใหม่ มันจะรีจิสเตอร์เข้ามาใหม่ ลองปิด-เปิดสักสองสามครั้ง) รอจนมี message ขึ้น อาจต้องทิ้งไว้ประมาณ 5 นาที

พอได้ message แล้ว ใช้คำสั่ง sip set debug off

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 13:33
โดย nungkmitl
ขอบคุณครับ ตอนนี้โทรได้แล้วครับลองเช็คip ดูครับ
asterisk 1.4 สามารถฟิกip ให้ไม่เปลี่ยนได้มั้ยครับ พอดีของผมมี dhcp สองวงครับ

Re: ช่ยด้วยครับมือใหม่ครับ

โพสต์โพสต์แล้ว: 25 มี.ค. 2011 15:15
โดย nuiz
ฟิกซ์ ip ของเครื่อง server ครับ แล้ว Asterisk มันจะออโต้เอง

วิธีฟิกซ์ ip ของ server ถ้าใช้ Elastix ก็คอนฟิกทางหน้าเว็บเลย เมนู System->Network (อ้างถึง Elastix 1.3 ส่วนเวอร์ชั่นอื่นๆเมนูก็ประมาณนี้แหล่ะครับ) แล้วคลิ๊กที่ Device ที่ต้องการ