| A more detail note for callback, it gives some hints for future usage. This code just call the callback initiater's number. The spool function is extreme useful for callback. Note the h, it means deadagi, should be executed after hang up.複製代碼[custom-CallBack]
;;prepare for callback and DISA
exten => s,1,NoOp(Hangup then callback to cellphone)
exten => s,2,Hangup()
exten => h,1,NoOp(copy callback.call file to /var/spool/asterisk/outgoing)
exten => h,2,System(/etc/asterisk/callback_exe)
exten => h,3,Hangup()
 The callback.call file
 Basically, the Channel statement instructs asterisk type fo trunk, the callback number, and using which trunk. It is a shorten Dial command.複製代碼Channel: SIP/6081112222@MyVSP
Context: custom-DISA-out
Extension: s
Priority: 1
CallerID: 6085558888
The Following  three lines tell asterisk how to treat the connected callback number, i.e.,  custom-DISA-out, s, 1 should be run after connection. The last line is to set the CallerID to 6085558888.
 
 The custom-DISA-out:
 It requires password to entry the DISA for using out-pstn dialplan.複製代碼[custom-DISA-out]
exten => s,1,Wait(1)
exten => s,n,Background(agent-pass)
exten => s,n,Authenticate(87235) ;this number is the password
exten => s,n,Background(pls-wait-connect-call)
exten => s,n,DISA(no-password, out-pstn)
 The whole flow is following:
 1. Caller calls access number and gives his/her tel. number.
 2. Asterisk hangs up the call(if possible), calls the Caller'  number.
 3. The caller picks up the callback, entries the password.
 4. If the password is correct, give the right dialplan to the caller(e?).
 |