本帖最後由 Qnewbie 於 2010-8-16 22:51 編輯
回復 9# 角色
A dirty solution would be achieved by modifying the callback module(http://blog.gramels.info/blog/ar ... erisk-callback.html)
Main idea is to call different number according to incoming caller ID. This call initiates the real callback at another asterisk server.
[checkNum]
exten => s,1,NoOp(Incoming call from # ${CALLERID(num)})
;landline,call ipteluser1
exten => s,2,GotoIf($["${CALLERID(num)}"!= "075512345678"]?6)
exten => s,3,system(cp /var/spool/asterisk/skelett.call /var/spool/asterisk/skelett.tmp.call)
exten => s,4,system(echo 'Channel: SIP/ipteluser1@iptel' >> /var/spool/asterisk/skelett.tmp.call)
exten => s,5, Goto(sendNote,s,1)
;mobile, call ipteluser2
exten => s,6,GotoIf($["${CALLERID(num)}"!="1380013800"]?10)
exten => s,7,system(cp /var/spool/asterisk/skelett.call /var/spool/asterisk/skelett.tmp.call)
exten => s,8,system(echo 'Channel: SIP/ipteluser2@iptel' >> /var/spool/asterisk/skelett.tmp.call)
exten => s,9, Goto(sendNote,s,1)
; could be modified after your need
exten => s,10,Dial(SIP/20000,,r) ; otherwise dial 2000
exten => s,n,Hangup()
[sendNote]
exten => s,1,NoOp(Hangup then callback)
exten => s,2,Hangup()
exten => h,1,NoOp(copy skelett.tmp.call file to /var/spool/asterisk/outgoing)
exten => h,2,system(cp /var/spool/asterisk/skelett.tmp.call /var/spool/asterisk/outgoing)
exten => h,3,Hangup() |