เรียนท่านผู้รู้ทั้งหลายครับ

ขณะนี้ผมสามารถต่อ asterisk ของผมเข้ากับ TOT net call ได้แล้วดังนี้ (ผมมี 2 account นะครับ เพราะต้องการโทรออกทีละ 2 สายพร้อมๆกัน)
trixbox1*CLI> sip show registry
Host Username Refresh State Reg.Time
203.113.125.82:5060 0681121526 45 Registered Sat, 13 Nov 2010 22:28:41
203.113.125.82:5060 0681121495 45 Registered Sat, 13 Nov 2010 22:28:41
2 SIP registrations.
ตอนนี้ผมกำลังให้ Asterisk โทรออกไปหาเบอนอกที่เป็นมือถือ ผ่านทาง TOT Net call แล้วให้ดึงเข้า Meetme โดยใช้ Asterisk Manager Interface (AMI) ดังนี้ (โค๊ดเป็น PHP นะครับ แต่ตัดมาเฉพาะส่วนที่เกี่ยวข้อง)
$asterisk_ip = "127.0.0.1";
$timeout = 30000;
$socket = fsockopen($asterisk_ip,"5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login
");
fputs($socket, "UserName: root
");
fputs($socket, "Secret: 123456
");
fputs($socket, "Action: Originate
" );
fputs($socket, "Channel: SIP/0868996243@totnetcall
" );
fputs($socket, "Exten: 9000
" );
fputs($socket, "Context: ext-meetme
" );
fputs($socket, "Priority: 1
" );
fputs($socket, "Timeout: 100000
" );
ตรงนี้เป็น Context ของ TOT Net call ครับ
[totnetcall]
username=0681121495
type=friend
fromuser=0681121495
realm=10.10.2.50
secret=รหัสผ่านของผม
host=203.113.125.82
outboundproxy=203.113.125.82
fromdomain=203.113.125.82
insecure=very
canreinvite=no
dtmfmode=rfc2833
call-limit=1
allow=g729
allow=alaw
allow=ulaw
nat=yes
ซึ่งเมื่อเรียกใช้งานโค๊ดนี้ ทำให้ Asterisk โทรออกไปที่เบอร์ 0868996243 ได้ แต่พอกดรับสายแล้ว มันก็ตัดสายทันที ข้างล่างนี้ เป็น log จาก CLI นะครับ
== Manager 'root' logged on from 127.0.0.1
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Using SIP VRTP TOS bits 136
== Using SIP VRTP CoS mark 6
-- Executing [9000@ext-meetme:1] Macro("SIP/totnetcall-00000010", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/totnetcall-00000010", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/totnetcall-00000010", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/totnetcall-00000010", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/totnetcall-00000010", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/totnetcall-00000010", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/totnetcall-00000010", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [s@macro-user-callerid:10] GotoIf("SIP/totnetcall-00000010", "0?continue") in new stack
-- Executing [s@macro-user-callerid:11] Set("SIP/totnetcall-00000010", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("SIP/totnetcall-00000010", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("SIP/totnetcall-00000010", "Using CallerID "" <>") in new stack
-- Executing [9000@ext-meetme:2] Set("SIP/totnetcall-00000010", "MEETME_ROOMNUM=9000") in new stack
-- Executing [9000@ext-meetme:3] GotoIf("SIP/totnetcall-00000010", "0?USER") in new stack
-- Executing [9000@ext-meetme:4] Answer("SIP/totnetcall-00000010", "") in new stack
-- Executing [9000@ext-meetme:5] Wait("SIP/totnetcall-00000010", "1") in new stack
== Manager 'root' logged off from 127.0.0.1
-- Executing [9000@ext-meetme:6] Set("SIP/totnetcall-00000010", "MEETME_OPTS=M") in new stack
-- Executing [9000@ext-meetme:7] Goto("SIP/totnetcall-00000010", "STARTMEETME,1") in new stack
-- Goto (ext-meetme,STARTMEETME,1)
-- Executing [STARTMEETME@ext-meetme:1] MeetMe("SIP/totnetcall-00000010", "9000,M,") in new stack
== Parsing '/etc/asterisk/meetme.conf': == Found
== Parsing '/etc/asterisk/meetme_additional.conf': == Found
-- Created MeetMe conference 1023 for conference '9000'
-- Hungup 'DAHDI/pseudo-1502346693'
== Spawn extension (ext-meetme, STARTMEETME, 1) exited non-zero on 'SIP/totnetcall-00000010'
-- Executing [h@ext-meetme:1] Hangup("SIP/totnetcall-00000010", "") in new stack
== Spawn extension (ext-meetme, h, 1) exited non-zero on 'SIP/totnetcall-00000010'
trixbox1*CLI>
มีใครสามารถช่วยแนะนำได้ไหมครับ ว่าทำไมสายถึงตัดไป เมื่อจะเข้าห้อง MeetMe
Post Merge: 13 November 2010, 22:43:07
เพิ่มเติมนะครับ ผมสามารถโทรออกจาก Softphone ซึ่ง register เป็น user ใน Asterisk ของผม ไปสู่เบอมือถือข้างนอกได้แล้ว โดยกดตัด 1 หรือ 2 ตามด้วยเบอมือถือ เช่น 10868996243 โดยสายไม่ตัดเมื่อมือถือรับสายครับ แต่สำหรับ Meetme ยังทำไม่ได้ครับ มันตัดสายตลอด
[mytot]
exten => _1.,1,Dial(SIP/${EXTEN:1}@totnetcall,45,r)
[mytot2]
exten => _2.,1,Dial(SIP/${EXTEN:1}@totnetcall2,45,r)